diff --git a/src/feature.cpp b/src/feature.cpp index 27d642c7e5..c7e5e2e576 100644 --- a/src/feature.cpp +++ b/src/feature.cpp @@ -56,6 +56,3 @@ bool Feature::HasFixedEnemyFacingDirection() { return HasRpg2k3BattleSystem() && lcf::Data::battlecommands.easyrpg_fixed_enemy_facing_direction > 0; } -bool Feature::HasHorizontalAllyEnemySelecting() { - return HasRpg2k3BattleSystem() && lcf::Data::battlecommands.easyrpg_horizontal_ally_enemy_selection; -} diff --git a/src/feature.h b/src/feature.h index 1a18cbf334..2710c0c785 100644 --- a/src/feature.h +++ b/src/feature.h @@ -51,11 +51,6 @@ namespace Feature { * @return true if fixed enemy facing direction is used */ bool HasFixedEnemyFacingDirection(); - - /** - * @return true if horizontal ally/enemy selecting during battle is used - */ - bool HasHorizontalAllyEnemySelecting(); } #endif diff --git a/src/scene_battle_rpg2k3.cpp b/src/scene_battle_rpg2k3.cpp index 42468f086c..9b4f00cb90 100644 --- a/src/scene_battle_rpg2k3.cpp +++ b/src/scene_battle_rpg2k3.cpp @@ -554,6 +554,8 @@ void Scene_Battle_Rpg2k3::CreateBattleTargetWindow() { int transp = IsTransparent() ? 160 : 255; target_window->SetBackOpacity(transp); } + + target_window->SetSingleColumnWrapping(true); } void Scene_Battle_Rpg2k3::RefreshTargetWindow() { diff --git a/src/window_battlestatus.cpp b/src/window_battlestatus.cpp index 9ddd6e22eb..f3be182ff7 100644 --- a/src/window_battlestatus.cpp +++ b/src/window_battlestatus.cpp @@ -283,7 +283,7 @@ void Window_BattleStatus::Update() { } if (active && index >= 0) { - if (Input::IsRepeated(Input::DOWN) || Input::IsTriggered(Input::SCROLL_DOWN)) { + if (Input::IsRepeated(Input::DOWN) || Input::IsRepeated(Input::RIGHT) || Input::IsTriggered(Input::SCROLL_DOWN)) { Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Cursor)); for (int i = 1; i < item_max; i++) { int new_index = (index + i) % item_max; @@ -293,7 +293,7 @@ void Window_BattleStatus::Update() { } } } - if (Input::IsRepeated(Input::UP) || Input::IsTriggered(Input::SCROLL_UP)) { + if (Input::IsRepeated(Input::UP) || Input::IsRepeated(Input::LEFT) || Input::IsTriggered(Input::SCROLL_UP)) { Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Cursor)); for (int i = item_max - 1; i > 0; i--) { int new_index = (index + i) % item_max; diff --git a/src/window_selectable.cpp b/src/window_selectable.cpp index c8ca714e10..a414a7e260 100644 --- a/src/window_selectable.cpp +++ b/src/window_selectable.cpp @@ -195,13 +195,13 @@ void Window_Selectable::Update() { } } if (Input::IsRepeated(Input::RIGHT)) { - if (column_max >= 2 && index < item_max - 1) { + if (column_max >= wrap_limit && index < item_max - 1) { Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Cursor)); index += 1; } } if (Input::IsRepeated(Input::LEFT)) { - if (column_max >= 2 && index > 0) { + if (column_max >= wrap_limit && index > 0) { Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Cursor)); index -= 1; } @@ -234,3 +234,7 @@ void Window_Selectable::SetEndlessScrolling(bool state) { void Window_Selectable::SetMenuItemHeight(int height) { menu_item_height = height; } + +void Window_Selectable::SetSingleColumnWrapping(bool wrap) { + wrap_limit = wrap ? 1 : 2; +} diff --git a/src/window_selectable.h b/src/window_selectable.h index 25caf3254f..b676f7140d 100644 --- a/src/window_selectable.h +++ b/src/window_selectable.h @@ -92,6 +92,14 @@ class Window_Selectable: public Window_Base { */ void SetMenuItemHeight(int height); + /** + * Allow left/right input to move cursor up/down when the selectable has only one column. + * By default this behaviour is only enabled for two and more columns. + * + * @param wrap enable/disable single column wrap + */ + void SetSingleColumnWrapping(bool wrap); + protected: void UpdateArrows(); @@ -107,6 +115,8 @@ class Window_Selectable: public Window_Base { int scroll_dir = 0; int scroll_progress = 0; + + int wrap_limit = 2; }; inline void Window_Selectable::SetItemMax(int value) {