aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/GUIIconButton.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-08-30 23:30:12 +0200
committer GitHub <noreply@github.com>2024-08-30 23:30:12 +0200
commit2e0bc5b556b9c6df46a8cdd48d3f109e0ac76b63 (patch)
tree2c521b99fe6cd0a7fd5d6a29e55645b3415792b3 /extension/src/openvic-extension/classes/GUIIconButton.hpp
parentf54e454afb90f8868e7c62529e2a388fdaadf20b (diff)
parentbdc2ba527bc02e7cdf977f6040f2ca85aa4f9a94 (diff)
Merge pull request #253 from OpenVicProject/tooltip
Tooltips
Diffstat (limited to 'extension/src/openvic-extension/classes/GUIIconButton.hpp')
-rw-r--r--extension/src/openvic-extension/classes/GUIIconButton.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/extension/src/openvic-extension/classes/GUIIconButton.hpp b/extension/src/openvic-extension/classes/GUIIconButton.hpp
new file mode 100644
index 0000000..10fc179
--- /dev/null
+++ b/extension/src/openvic-extension/classes/GUIIconButton.hpp
@@ -0,0 +1,36 @@
+#pragma once
+
+#include "openvic-extension/classes/GFXSpriteTexture.hpp"
+#include "openvic-extension/classes/GUIButton.hpp"
+
+namespace OpenVic {
+ class GUIIconButton : public GUIButton {
+ GDCLASS(GUIIconButton, GUIButton)
+
+ godot::Ref<GFXSpriteTexture> gfx_sprite_texture;
+
+ protected:
+ static void _bind_methods();
+
+ public:
+ godot::Error set_gfx_texture_sprite(
+ GFX::TextureSprite const* gfx_texture_sprite, GFX::frame_t icon = GFX::NO_FRAMES
+ );
+
+ godot::Ref<GFXSpriteTexture> get_gfx_sprite_texture() const;
+
+ godot::Error set_gfx_texture_sprite_name(
+ godot::String const& gfx_texture_sprite_name, GFX::frame_t icon = GFX::NO_FRAMES
+ );
+
+ godot::String get_gfx_texture_sprite_name() const;
+
+ godot::Error set_icon_index(GFX::frame_t icon_index) const;
+
+ GFX::frame_t get_icon_index() const;
+
+ godot::Error set_toggled_icon(bool toggled) const;
+
+ void _toggled(bool toggled_on) override;
+ };
+}