diff options
author | Hop311 <Hop3114@gmail.com> | 2024-02-05 20:38:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-05 20:38:23 +0100 |
commit | 6489da997cddb20667db0455fa4f38319dc7c883 (patch) | |
tree | 4e343f81b13f166ad4a478962348d4734ea7e11b /src/openvic-simulation/dataloader/Dataloader.cpp | |
parent | 068c13ede817d17df599ca3481261bf17ed95604 (diff) | |
parent | 87fa1c74281a651b23089079c4c1621d4fb66d73 (diff) |
Merge pull request #145 from OpenVicProject/gui-loading
Added support for loading all gui files
Diffstat (limited to 'src/openvic-simulation/dataloader/Dataloader.cpp')
-rw-r--r-- | src/openvic-simulation/dataloader/Dataloader.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/openvic-simulation/dataloader/Dataloader.cpp b/src/openvic-simulation/dataloader/Dataloader.cpp index c6d6281..157ff04 100644 --- a/src/openvic-simulation/dataloader/Dataloader.cpp +++ b/src/openvic-simulation/dataloader/Dataloader.cpp @@ -283,21 +283,34 @@ bool Dataloader::_load_interface_files(UIManager& ui_manager) const { ui_manager.lock_sprites(); ui_manager.lock_fonts(); - // Hard-coded example until the mechanism for requesting them from GDScript is fleshed out + /* Hard-coded GUI file names, might be replaced with a dynamic system but everything should still be loaded on startup. */ static const std::vector<std::string_view> gui_files { - "province_interface.gui", "topbar.gui" + /* Contains generic listbox scrollbar */ + "core", + + /* Over-map menus */ + "province_interface", "topbar", "menubar", "outliner", + + /* Nation management screens */ + "country_production", "country_budget", "country_technology", "country_politics", "country_pops", "country_trade", + "country_diplomacy", "country_military" }; + static constexpr std::string_view gui_file_extension = ".gui"; + ui_manager.reserve_more_scenes(gui_files.size()); for (std::string_view const& gui_file : gui_files) { if (!ui_manager.load_gui_file( - gui_file, parse_defines(lookup_file(append_string_views(interface_directory, gui_file))).get_file_node() + gui_file, parse_defines(lookup_file( + append_string_views(interface_directory, gui_file, gui_file_extension) + )).get_file_node() )) { Logger::error("Failed to load interface gui file: ", gui_file); ret = false; } } + ui_manager.lock_scenes(); return ret; |