aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-07-25 00:21:27 +0200
committer hop311 <hop3114@gmail.com>2024-07-25 00:21:27 +0200
commit35ccace5c13b547025a6b823442f7abed676a19f (patch)
tree72262f7d0d16ce06ad3deef026f3506ab6d8add7 /extension/src/openvic-extension/classes
parentd4b223b491ec2d9b32393c4c58ad85f18bd9566e (diff)
Fix checkbox theme and positioningfix-checkbox
Diffstat (limited to 'extension/src/openvic-extension/classes')
-rw-r--r--extension/src/openvic-extension/classes/GFXSpriteTexture.cpp5
-rw-r--r--extension/src/openvic-extension/classes/GFXSpriteTexture.hpp2
-rw-r--r--extension/src/openvic-extension/classes/GUINode.cpp1
-rw-r--r--extension/src/openvic-extension/classes/GUINode.hpp3
4 files changed, 7 insertions, 4 deletions
diff --git a/extension/src/openvic-extension/classes/GFXSpriteTexture.cpp b/extension/src/openvic-extension/classes/GFXSpriteTexture.cpp
index 41bea4b..b81f32e 100644
--- a/extension/src/openvic-extension/classes/GFXSpriteTexture.cpp
+++ b/extension/src/openvic-extension/classes/GFXSpriteTexture.cpp
@@ -21,6 +21,7 @@ void GFXSpriteTexture::_bind_methods() {
OV_BIND_METHOD(GFXSpriteTexture::get_gfx_texture_sprite_name);
OV_BIND_METHOD(GFXSpriteTexture::set_icon_index, { "new_icon_index" });
+ OV_BIND_METHOD(GFXSpriteTexture::set_toggled_icon, { "toggle" });
OV_BIND_METHOD(GFXSpriteTexture::get_icon_index);
OV_BIND_METHOD(GFXSpriteTexture::get_icon_count);
@@ -133,3 +134,7 @@ Error GFXSpriteTexture::set_icon_index(int32_t new_icon_index) {
_update_button_states();
return OK;
}
+
+Error GFXSpriteTexture::set_toggled_icon(bool toggled) {
+ return set_icon_index(toggled ? 2 : 1);
+}
diff --git a/extension/src/openvic-extension/classes/GFXSpriteTexture.hpp b/extension/src/openvic-extension/classes/GFXSpriteTexture.hpp
index 4e93e62..7b6b433 100644
--- a/extension/src/openvic-extension/classes/GFXSpriteTexture.hpp
+++ b/extension/src/openvic-extension/classes/GFXSpriteTexture.hpp
@@ -53,5 +53,7 @@ namespace OpenVic {
* If zero is used but icon_count is non-zero, icon_index defaults to icon_count (the last frame,
* not the first frame because it is often empty). */
godot::Error set_icon_index(GFX::frame_t new_icon_index);
+
+ godot::Error set_toggled_icon(bool toggled);
};
}
diff --git a/extension/src/openvic-extension/classes/GUINode.cpp b/extension/src/openvic-extension/classes/GUINode.cpp
index 452efc8..674f162 100644
--- a/extension/src/openvic-extension/classes/GUINode.cpp
+++ b/extension/src/openvic-extension/classes/GUINode.cpp
@@ -40,7 +40,6 @@ using namespace OpenVic;
#define APPLY_TO_CHILD_TYPES(F) \
F(Button, button) \
- F(CheckBox, check_box) \
F(Label, label) \
F(Panel, panel) \
F(TextureProgressBar, progress_bar) \
diff --git a/extension/src/openvic-extension/classes/GUINode.hpp b/extension/src/openvic-extension/classes/GUINode.hpp
index 60c0050..af1562e 100644
--- a/extension/src/openvic-extension/classes/GUINode.hpp
+++ b/extension/src/openvic-extension/classes/GUINode.hpp
@@ -2,7 +2,6 @@
#include <godot_cpp/classes/bit_map.hpp>
#include <godot_cpp/classes/button.hpp>
-#include <godot_cpp/classes/check_box.hpp>
#include <godot_cpp/classes/control.hpp>
#include <godot_cpp/classes/image.hpp>
#include <godot_cpp/classes/input_event.hpp>
@@ -52,7 +51,6 @@ 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 godot::CheckBox* get_check_box_from_node(godot::Node* node);
static godot::Label* get_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);
@@ -62,7 +60,6 @@ namespace OpenVic {
static GUIListBox* get_gui_listbox_from_node(godot::Node* node);
godot::Button* get_button_from_nodepath(godot::NodePath const& path) const;
- godot::CheckBox* get_check_box_from_nodepath(godot::NodePath const& path) const;
godot::Label* get_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;