aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-07-29 21:35:15 +0200
committer GitHub <noreply@github.com>2024-07-29 21:35:15 +0200
commitde190028555cb1b70ca9fbbd10af3de4440b8b89 (patch)
tree5540d5334370414b51a45e8c184ad3d0b9974c0e
parent861acff78bd238232ed9e369ea046c2ed4a31198 (diff)
parentf81dfd8be7a9fe9dd0b55afa36d86a756b3af65b (diff)
Merge pull request #180 from OpenVicProject/listbox-offsets
GUI::ListBox offsets + load search panel gui file
-rw-r--r--src/openvic-simulation/dataloader/Dataloader.cpp2
-rw-r--r--src/openvic-simulation/interface/GUI.cpp6
-rw-r--r--src/openvic-simulation/interface/GUI.hpp5
3 files changed, 7 insertions, 6 deletions
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<ListBox> std::make_unique<ListBox>();
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();