aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader/Dataloader.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-02-04 15:09:06 +0100
committer hop311 <hop3114@gmail.com>2024-02-04 15:09:06 +0100
commit87fa1c74281a651b23089079c4c1621d4fb66d73 (patch)
tree4e343f81b13f166ad4a478962348d4734ea7e11b /src/openvic-simulation/dataloader/Dataloader.cpp
parent3f6d7351816b0e089495b2f15dc1c956f3151f5a (diff)
Added support for loading all gui filesgui-loading
Diffstat (limited to 'src/openvic-simulation/dataloader/Dataloader.cpp')
-rw-r--r--src/openvic-simulation/dataloader/Dataloader.cpp19
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;