aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/GFXSpriteTexture.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-07-26 21:13:00 +0200
committer GitHub <noreply@github.com>2024-07-26 21:13:00 +0200
commit7dfb935447708cfdff664603eadafcbb4aa24042 (patch)
tree72262f7d0d16ce06ad3deef026f3506ab6d8add7 /extension/src/openvic-extension/classes/GFXSpriteTexture.cpp
parentd4b223b491ec2d9b32393c4c58ad85f18bd9566e (diff)
parent35ccace5c13b547025a6b823442f7abed676a19f (diff)
Merge pull request #242 from OpenVicProject/fix-checkbox
Fix checkbox theme and positioning
Diffstat (limited to 'extension/src/openvic-extension/classes/GFXSpriteTexture.cpp')
-rw-r--r--extension/src/openvic-extension/classes/GFXSpriteTexture.cpp5
1 files changed, 5 insertions, 0 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);
+}