|
| 1 | +/* |
| 2 | + * This file is part of EasyRPG Player. |
| 3 | + * |
| 4 | + * EasyRPG Player is free software: you can redistribute it and/or modify |
| 5 | + * it under the terms of the GNU General Public License as published by |
| 6 | + * the Free Software Foundation, either version 3 of the License, or |
| 7 | + * (at your option) any later version. |
| 8 | + * |
| 9 | + * EasyRPG Player is distributed in the hope that it will be useful, |
| 10 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | + * GNU General Public License for more details. |
| 13 | + * |
| 14 | + * You should have received a copy of the GNU General Public License |
| 15 | + * along with EasyRPG Player. If not, see <http://www.gnu.org/licenses/>. |
| 16 | + */ |
| 17 | + |
| 18 | +#include "scene_debug_picture.h" |
| 19 | +#include "input.h" |
| 20 | +#include "player.h" |
| 21 | +#include "game_system.h" |
| 22 | +#include "main_data.h" |
| 23 | + |
| 24 | +Scene_DebugPicture::Scene_DebugPicture() { |
| 25 | + type = Scene::DebugPicture; |
| 26 | +} |
| 27 | + |
| 28 | +void Scene_DebugPicture::Start() { |
| 29 | + // Make list window narrow (just IDs) to maximize info space |
| 30 | + int list_w = 64; |
| 31 | + |
| 32 | + list_window = std::make_unique<Window_DebugPictureList>( |
| 33 | + Player::menu_offset_x, |
| 34 | + Player::menu_offset_y, |
| 35 | + list_w, |
| 36 | + MENU_HEIGHT |
| 37 | + ); |
| 38 | + |
| 39 | + info_window = std::make_unique<Window_DebugPictureInfo>( |
| 40 | + Player::menu_offset_x + list_w, |
| 41 | + Player::menu_offset_y, |
| 42 | + MENU_WIDTH - list_w, |
| 43 | + MENU_HEIGHT |
| 44 | + ); |
| 45 | + |
| 46 | + list_window->SetActive(true); |
| 47 | + list_window->SetIndex(0); |
| 48 | + |
| 49 | + // Initialize info window with first item |
| 50 | + info_window->SetPictureId(list_window->GetPictureId()); |
| 51 | +} |
| 52 | + |
| 53 | +void Scene_DebugPicture::vUpdate() { |
| 54 | + list_window->Update(); |
| 55 | + info_window->Update(); |
| 56 | + |
| 57 | + // Update info window based on selection |
| 58 | + if (list_window->GetActive()) { |
| 59 | + // Always refresh info window to see real-time coordinate updates |
| 60 | + info_window->SetPictureId(list_window->GetPictureId()); |
| 61 | + info_window->Refresh(); |
| 62 | + } |
| 63 | + |
| 64 | + if (Input::IsTriggered(Input::CANCEL)) { |
| 65 | + Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Cancel)); |
| 66 | + Scene::Pop(); |
| 67 | + } |
| 68 | +} |
0 commit comments