ROM load options and ZSCustomOverworld upgrade dialog. More...
#include <rom_load_options_dialog.h>

Classes | |
| struct | LoadOptions |
Public Member Functions | |
| RomLoadOptionsDialog () | |
| ~RomLoadOptionsDialog ()=default | |
| void | Open (Rom *rom, const std::string &rom_filename) |
| Open the dialog after ROM detection. | |
| void | Open (Rom *rom) |
| Open the dialog with just ROM pointer (filename from ROM) | |
| bool | Show (bool *p_open) |
| Show the dialog. | |
| void | Draw (bool *p_open) |
| Draw the dialog (wrapper around Show) | |
| const LoadOptions & | GetOptions () const |
| Get the selected load options. | |
| bool | WasConfirmed () const |
| Check if dialog resulted in confirmation. | |
| void | ResetConfirmation () |
| Reset confirmation state. | |
| void | SetConfirmCallback (std::function< void(const LoadOptions &)> callback) |
| Set callback for when options are confirmed. | |
| void | SetUpgradeCallback (std::function< absl::Status(int version)> callback) |
| Set callback for ZSO upgrade. | |
| bool | ShouldPromptUpgrade () const |
| Check if ROM needs upgrade prompt. | |
| zelda3::OverworldVersion | GetDetectedVersion () const |
| Get detected ROM version. | |
Private Member Functions | |
| void | DrawVersionInfo () |
| void | DrawUpgradeOptions () |
| void | DrawFeatureFlagPresets () |
| void | DrawFeatureFlagDetails () |
| void | DrawProjectOptions () |
| void | DrawActionButtons () |
| void | ApplyPreset (const std::string &preset_name) |
| void | ApplyOptionsToFeatureFlags () |
Private Attributes | |
| Rom * | rom_ = nullptr |
| std::string | rom_filename_ |
| zelda3::OverworldVersion | detected_version_ = zelda3::OverworldVersion::kVanilla |
| bool | is_open_ = false |
| bool | confirmed_ = false |
| bool | show_advanced_ = false |
| LoadOptions | options_ |
| int | selected_preset_index_ = 0 |
| std::function< void(const LoadOptions &) | confirm_callback_ ) |
| std::function< absl::Status(int version)> | upgrade_callback_ |
| char | project_name_buffer_ [256] = {} |
| char | project_path_buffer_ [512] = {} |
Static Private Attributes | |
| static constexpr int | kNumPresets = 4 |
| static const char * | kPresetNames [kNumPresets] |
| static const char * | kPresetDescriptions [kNumPresets] |
ROM load options and ZSCustomOverworld upgrade dialog.
Shown after ROM detection to offer:
Flow:
Definition at line 32 of file rom_load_options_dialog.h.
| yaze::editor::RomLoadOptionsDialog::RomLoadOptionsDialog | ( | ) |
Definition at line 28 of file rom_load_options_dialog.cc.
References options_, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_entrances, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_exits, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_items, and yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_maps.
|
default |
| void yaze::editor::RomLoadOptionsDialog::Open | ( | Rom * | rom, |
| const std::string & | rom_filename ) |
Open the dialog after ROM detection.
| rom | Pointer to loaded ROM for version detection |
| rom_filename | Filename for display and project naming |
Definition at line 46 of file rom_load_options_dialog.cc.
References ApplyPreset(), confirmed_, detected_version_, yaze::zelda3::OverworldVersionHelper::GetVersion(), yaze::Rom::is_loaded(), is_open_, kPresetNames, yaze::zelda3::kVanilla, yaze::zelda3::kZSCustomV1, yaze::zelda3::kZSCustomV2, yaze::zelda3::kZSCustomV3, options_, project_name_buffer_, rom_, rom_filename_, selected_preset_index_, yaze::editor::RomLoadOptionsDialog::LoadOptions::target_zso_version, and yaze::editor::RomLoadOptionsDialog::LoadOptions::upgrade_to_zscustom.
Referenced by yaze::editor::EditorManager::LoadRom(), and Open().

| void yaze::editor::RomLoadOptionsDialog::Open | ( | Rom * | rom | ) |
Open the dialog with just ROM pointer (filename from ROM)
| rom | Pointer to loaded ROM |
Definition at line 36 of file rom_load_options_dialog.cc.
References yaze::Rom::filename(), and Open().

| bool yaze::editor::RomLoadOptionsDialog::Show | ( | bool * | p_open | ) |
Show the dialog.
| p_open | Pointer to open state |
Definition at line 94 of file rom_load_options_dialog.cc.
References confirmed_, DrawActionButtons(), DrawFeatureFlagDetails(), DrawFeatureFlagPresets(), DrawProjectOptions(), DrawUpgradeOptions(), DrawVersionInfo(), ICON_MD_SETTINGS, is_open_, and show_advanced_.
Referenced by Draw().
| void yaze::editor::RomLoadOptionsDialog::Draw | ( | bool * | p_open | ) |
Draw the dialog (wrapper around Show)
| p_open | Pointer to open state |
Definition at line 42 of file rom_load_options_dialog.cc.
References Show().
Referenced by yaze::editor::EditorManager::Update().

|
inline |
Get the selected load options.
Definition at line 91 of file rom_load_options_dialog.h.
References options_.
|
inline |
Check if dialog resulted in confirmation.
Definition at line 96 of file rom_load_options_dialog.h.
References confirmed_.
|
inline |
Reset confirmation state.
Definition at line 101 of file rom_load_options_dialog.h.
References confirmed_.
|
inline |
Set callback for when options are confirmed.
Definition at line 106 of file rom_load_options_dialog.h.
References confirm_callback_.
Referenced by yaze::editor::EditorManager::Initialize().
|
inline |
Set callback for ZSO upgrade.
Definition at line 113 of file rom_load_options_dialog.h.
References upgrade_callback_.
| bool yaze::editor::RomLoadOptionsDialog::ShouldPromptUpgrade | ( | ) | const |
Check if ROM needs upgrade prompt.
Definition at line 443 of file rom_load_options_dialog.cc.
References detected_version_, and yaze::zelda3::kVanilla.
|
inline |
Get detected ROM version.
Definition at line 125 of file rom_load_options_dialog.h.
References detected_version_.
|
private |
Definition at line 137 of file rom_load_options_dialog.cc.
References yaze::gui::ConvertColorToImVec4(), detected_version_, yaze::gui::ThemeManager::Get(), yaze::gui::ThemeManager::GetCurrentTheme(), yaze::zelda3::OverworldVersionHelper::GetVersionName(), ICON_MD_INFO, ICON_MD_UPGRADE, ICON_MD_VERIFIED, yaze::zelda3::kVanilla, yaze::zelda3::kZSCustomV1, yaze::zelda3::kZSCustomV2, yaze::zelda3::kZSCustomV3, and rom_filename_.
Referenced by Show().

|
private |
Definition at line 178 of file rom_load_options_dialog.cc.
References detected_version_, yaze::editor::RomLoadOptionsDialog::LoadOptions::enable_custom_overworld, yaze::editor::RomLoadOptionsDialog::LoadOptions::enable_tail_expansion, yaze::zelda3::OverworldVersionHelper::GetVersionName(), ICON_MD_AUTO_FIX_HIGH, ICON_MD_CHECK_CIRCLE, yaze::zelda3::kVanilla, options_, yaze::editor::RomLoadOptionsDialog::LoadOptions::target_zso_version, and yaze::editor::RomLoadOptionsDialog::LoadOptions::upgrade_to_zscustom.
Referenced by Show().

|
private |
Definition at line 244 of file rom_load_options_dialog.cc.
References ApplyPreset(), ICON_MD_TUNE, kNumPresets, kPresetDescriptions, kPresetNames, selected_preset_index_, and show_advanced_.
Referenced by Show().

|
private |
Definition at line 280 of file rom_load_options_dialog.cc.
References ICON_MD_FLAG, options_, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_all_palettes, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_dungeon_maps, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_gfx_groups, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_entrances, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_exits, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_items, and yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_maps.
Referenced by Show().
|
private |
Definition at line 307 of file rom_load_options_dialog.cc.
References yaze::editor::RomLoadOptionsDialog::LoadOptions::create_project, ICON_MD_FOLDER, options_, yaze::editor::RomLoadOptionsDialog::LoadOptions::project_name, and project_name_buffer_.
Referenced by Show().
|
private |
Definition at line 329 of file rom_load_options_dialog.cc.
References ApplyOptionsToFeatureFlags(), confirm_callback_, confirmed_, yaze::gui::ConvertColorToImVec4(), yaze::gui::ThemeManager::Get(), yaze::gui::ThemeManager::GetCurrentTheme(), ICON_MD_CHECK, is_open_, kPresetNames, options_, yaze::editor::RomLoadOptionsDialog::LoadOptions::selected_preset, selected_preset_index_, yaze::editor::RomLoadOptionsDialog::LoadOptions::target_zso_version, upgrade_callback_, and yaze::editor::RomLoadOptionsDialog::LoadOptions::upgrade_to_zscustom.
Referenced by Show().

|
private |
Definition at line 381 of file rom_load_options_dialog.cc.
References detected_version_, yaze::editor::RomLoadOptionsDialog::LoadOptions::enable_custom_overworld, yaze::zelda3::kVanilla, options_, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_all_palettes, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_dungeon_maps, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_gfx_groups, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_entrances, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_exits, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_items, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_maps, yaze::editor::RomLoadOptionsDialog::LoadOptions::target_zso_version, and yaze::editor::RomLoadOptionsDialog::LoadOptions::upgrade_to_zscustom.
Referenced by DrawFeatureFlagPresets(), and Open().
|
private |
Definition at line 429 of file rom_load_options_dialog.cc.
References yaze::editor::RomLoadOptionsDialog::LoadOptions::enable_custom_overworld, yaze::editor::RomLoadOptionsDialog::LoadOptions::enable_tail_expansion, yaze::core::FeatureFlags::get(), options_, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_all_palettes, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_dungeon_maps, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_gfx_groups, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_entrances, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_exits, yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_items, and yaze::editor::RomLoadOptionsDialog::LoadOptions::save_overworld_maps.
Referenced by DrawActionButtons().

|
private |
Definition at line 139 of file rom_load_options_dialog.h.
Referenced by Open().
|
private |
Definition at line 140 of file rom_load_options_dialog.h.
Referenced by DrawVersionInfo(), and Open().
|
private |
Definition at line 141 of file rom_load_options_dialog.h.
Referenced by ApplyPreset(), DrawUpgradeOptions(), DrawVersionInfo(), GetDetectedVersion(), Open(), and ShouldPromptUpgrade().
|
private |
Definition at line 142 of file rom_load_options_dialog.h.
Referenced by DrawActionButtons(), Open(), and Show().
|
private |
Definition at line 143 of file rom_load_options_dialog.h.
Referenced by DrawActionButtons(), Open(), ResetConfirmation(), Show(), and WasConfirmed().
|
private |
Definition at line 144 of file rom_load_options_dialog.h.
Referenced by DrawFeatureFlagPresets(), and Show().
|
private |
Definition at line 147 of file rom_load_options_dialog.h.
Referenced by ApplyOptionsToFeatureFlags(), ApplyPreset(), DrawActionButtons(), DrawFeatureFlagDetails(), DrawProjectOptions(), DrawUpgradeOptions(), GetOptions(), Open(), and RomLoadOptionsDialog().
|
staticconstexprprivate |
Definition at line 150 of file rom_load_options_dialog.h.
Referenced by DrawFeatureFlagPresets().
|
staticprivate |
Definition at line 151 of file rom_load_options_dialog.h.
Referenced by DrawActionButtons(), DrawFeatureFlagPresets(), and Open().
|
staticprivate |
Definition at line 152 of file rom_load_options_dialog.h.
Referenced by DrawFeatureFlagPresets().
|
private |
Definition at line 153 of file rom_load_options_dialog.h.
Referenced by DrawActionButtons(), DrawFeatureFlagPresets(), and Open().
|
private |
Definition at line 156 of file rom_load_options_dialog.h.
Referenced by DrawActionButtons(), and SetConfirmCallback().
|
private |
Definition at line 157 of file rom_load_options_dialog.h.
Referenced by DrawActionButtons(), and SetUpgradeCallback().
|
private |
Definition at line 160 of file rom_load_options_dialog.h.
Referenced by DrawProjectOptions(), and Open().
|
private |
Definition at line 161 of file rom_load_options_dialog.h.