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

Method Update

src/window_battlestatus.cpp:267–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267void Window_BattleStatus::Update() {
268 // Window Selectable update logic skipped on purpose
269 // (breaks up/down-logic)
270 Window_Base::Update();
271
272 int old_item_max = item_max;
273 if (enemy) {
274 item_max = Main_Data::game_enemyparty->GetBattlerCount();
275 } else {
276 item_max = Main_Data::game_party->GetBattlerCount();
277 }
278
279 if (item_max != old_item_max) {
280 Refresh();
281 } else if (Feature::HasRpg2k3BattleSystem()) {
282 RefreshGauge();
283 }
284
285 if (active && index >= 0) {
286 if (Input::IsRepeated(Input::DOWN) || Input::IsRepeated(Input::RIGHT) || Input::IsTriggered(Input::SCROLL_DOWN)) {
287 Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Cursor));
288 for (int i = 1; i < item_max; i++) {
289 int new_index = (index + i) % item_max;
290 if (IsChoiceValid((*Main_Data::game_party)[new_index])) {
291 index = new_index;
292 break;
293 }
294 }
295 }
296 if (Input::IsRepeated(Input::UP) || Input::IsRepeated(Input::LEFT) || Input::IsTriggered(Input::SCROLL_UP)) {
297 Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Cursor));
298 for (int i = item_max - 1; i > 0; i--) {
299 int new_index = (index + i) % item_max;
300 if (IsChoiceValid((*Main_Data::game_party)[new_index])) {
301 index = new_index;
302 break;
303 }
304 }
305 }
306 }
307
308 UpdateCursorRect();
309}
310
311void Window_BattleStatus::UpdateCursorRect() {
312 if (lcf::Data::battlecommands.battle_type == lcf::rpg::BattleCommands::BattleType_gauge) {

Callers

nothing calls this directly

Calls 3

SePlayMethod · 0.80
UpdateFunction · 0.70
GetBattlerCountMethod · 0.45

Tested by

no test coverage detected