aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.hpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-12-19 00:38:54 +0100
committer hop311 <hop3114@gmail.com>2023-12-25 19:06:13 +0100
commit4e9764ee29fb7b453862835d5aa3a081b0f9a269 (patch)
treea59c5b960a706a383b8ebd1dbcfb704067a5b51b /extension/src/openvic-extension/classes/GUIOverlappingElementsBox.hpp
parentd26c990d9a5596a3ef3b32ba1cb0f99950cd6d34 (diff)
Back to UI Work
- UIAdapter -> UITools with cleaner API - GUIOverlappingElementsBox (for core and modifier icons) - Improved GUINode API - Province building slots - TypeHints for files in the GameSession folder - Incorporate SIM strong colour types
Diffstat (limited to 'extension/src/openvic-extension/classes/GUIOverlappingElementsBox.hpp')
-rw-r--r--extension/src/openvic-extension/classes/GUIOverlappingElementsBox.hpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.hpp b/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.hpp
new file mode 100644
index 0000000..5a420f2
--- /dev/null
+++ b/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.hpp
@@ -0,0 +1,51 @@
+#pragma once
+
+#include <godot_cpp/classes/container.hpp>
+
+#include <openvic-simulation/interface/GUI.hpp>
+
+namespace OpenVic {
+ class GUIOverlappingElementsBox : public godot::Container {
+ GDCLASS(GUIOverlappingElementsBox, godot::Container)
+
+ GUI::OverlappingElementsBox const* PROPERTY(gui_overlapping_elements_box);
+ GUI::Element const* PROPERTY(gui_child_element);
+
+ godot::Error _update_child_positions();
+
+ protected:
+ static void _bind_methods();
+
+ void _notification(int what);
+
+ public:
+ GUIOverlappingElementsBox();
+
+ /* Reset gui_overlapping_elements_box and gui_child_element to nullptr, and remove all child elements. */
+ void clear();
+
+ /* Remove all child elements. */
+ void clear_children();
+
+ /* Add or remove child elements to reach the specified count. */
+ godot::Error set_child_count(int32_t new_count);
+
+ /* Set the GUI::OverlappingElementsBox. This does not affect any existing child elements. */
+ godot::Error set_gui_overlapping_elements_box(GUI::OverlappingElementsBox const* new_gui_overlapping_elements_box);
+
+ /* Return the name of the GUI::OverlappingElementsBox, or an empty String if it's null. */
+ godot::String get_gui_overlapping_elements_box_name() const;
+
+ /* Set the child GUI::Element, removing all previous child elements (even if the child GUI::Element doesn't change). */
+ godot::Error set_gui_child_element(GUI::Element const* new_gui_child_element);
+
+ /* Search for a GUI::Element with the specfied name and, if successful,
+ * set the child element to it using set_gui_child_element. */
+ godot::Error set_gui_child_element_name(
+ godot::String const& gui_child_element_file, godot::String const& gui_child_element_name
+ );
+
+ /* Return the name of the child GUI::Element, or an empty String if it's null. */
+ godot::String get_gui_child_element_name() const;
+ };
+}