MCPcopy Create free account
hub / github.com/EasyRPG/Player / Refresh

Method Refresh

src/window_interpreter.cpp:89–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void Window_Interpreter::Refresh() {
90
91 if (sub_window_flags->GetActive()) {
92#ifdef ENABLE_DYNAMIC_INTERPRETER_CONFIG
93 DrawRuntimeFlagsWindow();
94#endif
95 return;
96 }
97
98 stack_display_items.clear();
99
100 int max_cmd_count = 0, max_evt_id = 10, max_page_id = 0;
101
102 for (int i = state.stack.size() - 1; i >= 0; i--) {
103 int evt_id = state.stack[i].event_id;
104 int page_id = 0;
105 if (state.stack[i].maniac_event_id > 0) {
106 evt_id = state.stack[i].maniac_event_id;
107 page_id = state.stack[i].maniac_event_page_id;
108 }
109 if (evt_id == 0 && i == 0)
110 evt_id = display_item.owner_evt_id;
111
112 bool is_calling_ev_ce = false;
113
114 //FIXME: There are some currently unimplemented SaveEventExecFrame fields introduced via the ManiacPatch which should be used to properly get event state information
115 if (evt_id == 0 && i > 0) {
116 auto& prev_frame = state.stack[i - 1];
117 auto& com = prev_frame.commands[prev_frame.current_command - 1];
118 if (com.code == 12330) { // CallEvent
119 if (com.parameters[0] == 0) {
120 is_calling_ev_ce = true;
121 evt_id = com.parameters[1];
122 } else if (com.parameters[0] == 3 && Player::IsPatchManiac()) {
123 is_calling_ev_ce = true;
124 evt_id = Main_Data::game_variables->Get(com.parameters[1]);
125 } else if (com.parameters[0] == 4 && Player::IsPatchManiac()) {
126 is_calling_ev_ce = true;
127 evt_id = Main_Data::game_variables->GetIndirect(com.parameters[1]);
128 }
129 }
130 }
131 if (evt_id > max_evt_id)
132 max_evt_id = evt_id;
133
134 if (page_id > max_page_id)
135 max_page_id = page_id;
136
137 StackItem item = StackItem();
138 item.is_ce = is_calling_ev_ce || (i == 0 && this->display_item.is_ce);
139 item.evt_id = evt_id;
140 item.page_id = page_id;
141 item.name = "";
142 item.cmd_current = state.stack[i].current_command;
143 item.cmd_count = state.stack[i].commands.size();
144
145 if (item.is_ce) {
146 auto* ce = lcf::ReaderUtil::GetElement(lcf::Data::commonevents, item.evt_id);

Callers 1

UpdateMethod · 0.95

Calls 9

StackItemClass · 0.85
GetActiveMethod · 0.80
clearMethod · 0.45
sizeMethod · 0.45
GetMethod · 0.45
GetIndirectMethod · 0.45
GetNameMethod · 0.45
IsVisibleMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected