From 88acb31bd43f0e163522837bb1d0dd7da2977c4a Mon Sep 17 00:00:00 2001 From: hop311 Date: Wed, 28 Aug 2024 18:46:30 +0100 Subject: Switch to using custom UI nodes --- .../src/openvic-extension/classes/GUINode.hpp | 39 +++++++++++----------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'extension/src/openvic-extension/classes/GUINode.hpp') diff --git a/extension/src/openvic-extension/classes/GUINode.hpp b/extension/src/openvic-extension/classes/GUINode.hpp index 73ca92b..453263a 100644 --- a/extension/src/openvic-extension/classes/GUINode.hpp +++ b/extension/src/openvic-extension/classes/GUINode.hpp @@ -1,7 +1,6 @@ #pragma once #include -#include #include #include #include @@ -10,20 +9,21 @@ #include #include #include -#include -#include #include #include #include #include #include -#include "openvic-extension/classes/GFXMaskedFlagTexture.hpp" -#include "openvic-extension/classes/GFXPieChartTexture.hpp" -#include "openvic-extension/classes/GFXSpriteTexture.hpp" +#include "openvic-extension/classes/GUIIcon.hpp" +#include "openvic-extension/classes/GUIIconButton.hpp" #include "openvic-extension/classes/GUILabel.hpp" #include "openvic-extension/classes/GUIListBox.hpp" +#include "openvic-extension/classes/GUIMaskedFlag.hpp" +#include "openvic-extension/classes/GUIMaskedFlagButton.hpp" #include "openvic-extension/classes/GUIOverlappingElementsBox.hpp" +#include "openvic-extension/classes/GUIPieChart.hpp" +#include "openvic-extension/classes/GUIProgressBar.hpp" #include "openvic-extension/classes/GUIScrollbar.hpp" namespace OpenVic { @@ -51,36 +51,35 @@ namespace OpenVic { static godot::Vector2 get_gui_position(godot::String const& gui_scene, godot::String const& gui_position); - static godot::Button* get_button_from_node(godot::Node* node); + static GUIIconButton* get_gui_icon_button_from_node(godot::Node* node); + static GUIMaskedFlagButton* get_gui_masked_flag_button_from_node(godot::Node* node); static GUILabel* get_gui_label_from_node(godot::Node* node); static godot::Panel* get_panel_from_node(godot::Node* node); - static godot::TextureProgressBar* get_progress_bar_from_node(godot::Node* node); - static godot::TextureRect* get_texture_rect_from_node(godot::Node* node); + static GUIProgressBar* get_gui_progress_bar_from_node(godot::Node* node); + static GUIIcon* get_gui_icon_from_node(godot::Node* node); + static GUIMaskedFlag* get_gui_masked_flag_from_node(godot::Node* node); + static GUIPieChart* get_gui_pie_chart_from_node(godot::Node* node); static GUIOverlappingElementsBox* get_gui_overlapping_elements_box_from_node(godot::Node* node); static GUIScrollbar* get_gui_scrollbar_from_node(godot::Node* node); static GUIListBox* get_gui_listbox_from_node(godot::Node* node); static godot::LineEdit* get_line_edit_from_node(godot::Node* node); - godot::Button* get_button_from_nodepath(godot::NodePath const& path) const; + GUIIconButton* get_gui_icon_button_from_nodepath(godot::NodePath const& path) const; + GUIMaskedFlagButton* get_gui_masked_flag_button_from_nodepath(godot::NodePath const& path) const; GUILabel* get_gui_label_from_nodepath(godot::NodePath const& path) const; godot::Panel* get_panel_from_nodepath(godot::NodePath const& path) const; - godot::TextureProgressBar* get_progress_bar_from_nodepath(godot::NodePath const& path) const; - godot::TextureRect* get_texture_rect_from_nodepath(godot::NodePath const& path) const; + GUIProgressBar* get_gui_progress_bar_from_nodepath(godot::NodePath const& path) const; + GUIIcon* get_gui_icon_from_nodepath(godot::NodePath const& path) const; + GUIMaskedFlag* get_gui_masked_flag_from_nodepath(godot::NodePath const& path) const; + GUIPieChart* get_gui_pie_chart_from_nodepath(godot::NodePath const& path) const; GUIOverlappingElementsBox* get_gui_overlapping_elements_box_from_nodepath(godot::NodePath const& path) const; GUIScrollbar* get_gui_scrollbar_from_nodepath(godot::NodePath const& path) const; GUIListBox* get_gui_listbox_from_nodepath(godot::NodePath const& path) const; godot::LineEdit* get_line_edit_from_nodepath(godot::NodePath const& path) const; - /* Helper functions to get textures from TextureRects and Buttons. */ + /* Helper functions to get textures from TextureRects and GUIButtons. */ static godot::Ref get_texture_from_node(godot::Node* node); - static godot::Ref get_gfx_sprite_texture_from_node(godot::Node* node); - static godot::Ref get_gfx_masked_flag_texture_from_node(godot::Node* node); - static godot::Ref get_gfx_pie_chart_texture_from_node(godot::Node* node); - godot::Ref get_texture_from_nodepath(godot::NodePath const& path) const; - godot::Ref get_gfx_sprite_texture_from_nodepath(godot::NodePath const& path) const; - godot::Ref get_gfx_masked_flag_texture_from_nodepath(godot::NodePath const& path) const; - godot::Ref get_gfx_pie_chart_texture_from_nodepath(godot::NodePath const& path) const; godot::Error hide_node(godot::NodePath const& path) const; godot::Error hide_nodes(godot::TypedArray const& paths) const; -- cgit v1.2.3-56-ga3b1