From f81dfd8be7a9fe9dd0b55afa36d86a756b3af65b Mon Sep 17 00:00:00 2001 From: hop311 Date: Sun, 28 Jul 2024 23:48:34 +0100 Subject: GUI::ListBox offsets + load search panel gui file --- src/openvic-simulation/dataloader/Dataloader.cpp | 2 +- src/openvic-simulation/interface/GUI.cpp | 6 +++--- src/openvic-simulation/interface/GUI.hpp | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/openvic-simulation/dataloader/Dataloader.cpp b/src/openvic-simulation/dataloader/Dataloader.cpp index 77d0baa..f4e1927 100644 --- a/src/openvic-simulation/dataloader/Dataloader.cpp +++ b/src/openvic-simulation/dataloader/Dataloader.cpp @@ -288,7 +288,7 @@ bool Dataloader::_load_interface_files(UIManager& ui_manager) const { "core", /* Over-map menus */ - "province_interface", "topbar", "menubar", "outliner", + "province_interface", "topbar", "menubar", "outliner", "goto", /* Nation management screens */ "country_production", "country_budget", "country_technology", "country_politics", "country_pops", "country_trade", diff --git a/src/openvic-simulation/interface/GUI.cpp b/src/openvic-simulation/interface/GUI.cpp index 9acb72c..87e3624 100644 --- a/src/openvic-simulation/interface/GUI.cpp +++ b/src/openvic-simulation/interface/GUI.cpp @@ -205,18 +205,18 @@ bool OverlappingElementsBox::_fill_key_map(NodeTools::case_insensitive_key_map_t return ret; } -ListBox::ListBox() : size {}, offset {}, spacing {}, scrollbar_name {} {} +ListBox::ListBox() : size {}, scrollbar_offset {}, items_offset {}, spacing {}, scrollbar_name {} {} bool ListBox::_fill_key_map(NodeTools::case_insensitive_key_map_t& key_map, UIManager const& ui_manager) { bool ret = Element::_fill_key_map(key_map, ui_manager); ret &= add_key_map_entries(key_map, "size", ONE_EXACTLY, expect_fvec2(assign_variable_callback(size)), - "offset", ZERO_OR_ONE, expect_fvec2(assign_variable_callback(offset)), + "offset", ZERO_OR_ONE, expect_fvec2(assign_variable_callback(scrollbar_offset)), + "borderSize", ZERO_OR_ONE, expect_fvec2(assign_variable_callback(items_offset)), "spacing", ZERO_OR_ONE, expect_fixed_point(assign_variable_callback(spacing)), "scrollbartype", ZERO_OR_ONE, expect_string(assign_variable_callback_string(scrollbar_name)), "backGround", ZERO_OR_ONE, success_callback, - "borderSize", ZERO_OR_ONE, success_callback, "horizontal", ZERO_OR_ONE, success_callback, "priority", ZERO_OR_ONE, success_callback, "allwaystransparent", ZERO_OR_ONE, success_callback diff --git a/src/openvic-simulation/interface/GUI.hpp b/src/openvic-simulation/interface/GUI.hpp index 74afbd1..4e1b062 100644 --- a/src/openvic-simulation/interface/GUI.hpp +++ b/src/openvic-simulation/interface/GUI.hpp @@ -240,11 +240,12 @@ namespace OpenVic::GUI { friend std::unique_ptr std::make_unique(); fvec2_t PROPERTY(size); - fvec2_t PROPERTY(offset); + fvec2_t PROPERTY(scrollbar_offset); + fvec2_t PROPERTY(items_offset); fixed_point_t PROPERTY(spacing); std::string PROPERTY(scrollbar_name); /* In vanilla this is always core's standardlistbox_slider */ - // TODO - backGround, borderSize + // TODO - backGround protected: ListBox(); -- cgit v1.2.3-56-ga3b1