aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/GFXIconTexture.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-01-01 20:45:57 +0100
committer GitHub <noreply@github.com>2024-01-01 20:45:57 +0100
commitcf34ce1d7459ee91fc75e89835a8e7171fac636b (patch)
tree54c19503dc6e1bfbda1e11cf5f403e5038046cbe /extension/src/openvic-extension/classes/GFXIconTexture.hpp
parent8fc620484ac406c7a86b92553d77a0bd20e4143b (diff)
parentc0cc6e202c33fb3889d0025b1b04148ae66545f2 (diff)
Merge pull request #181 from OpenVicProject/ui-state-style
UI polish
Diffstat (limited to 'extension/src/openvic-extension/classes/GFXIconTexture.hpp')
-rw-r--r--extension/src/openvic-extension/classes/GFXIconTexture.hpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/extension/src/openvic-extension/classes/GFXIconTexture.hpp b/extension/src/openvic-extension/classes/GFXIconTexture.hpp
index 176d855..06dac34 100644
--- a/extension/src/openvic-extension/classes/GFXIconTexture.hpp
+++ b/extension/src/openvic-extension/classes/GFXIconTexture.hpp
@@ -4,6 +4,8 @@
#include <openvic-simulation/interface/GFX.hpp>
+#include "openvic-extension/classes/GFXButtonStateTexture.hpp"
+
namespace OpenVic {
class GFXIconTexture : public godot::AtlasTexture {
GDCLASS(GFXIconTexture, godot::AtlasTexture)
@@ -16,14 +18,22 @@ namespace OpenVic {
GFX::frame_t PROPERTY(icon_index);
GFX::frame_t PROPERTY(icon_count);
+ godot::Ref<godot::Image> sprite_image;
+
+ static godot::StringName const& _signal_image_updated();
+
protected:
static void _bind_methods();
public:
GFXIconTexture();
+ /* Create a GFXIconTexture using the specified GFX::TextureSprite and icon index. Returns nullptr if
+ * set_gfx_texture_sprite fails. Connects the provided GFXButtonStateTextures (if any) to the
+ * GFXIconTexture's image_updated signal. */
static godot::Ref<GFXIconTexture> make_gfx_icon_texture(
- GFX::TextureSprite const* gfx_texture_sprite, GFX::frame_t icon = GFX::NO_FRAMES
+ GFX::TextureSprite const* gfx_texture_sprite, GFX::frame_t icon = GFX::NO_FRAMES,
+ std::vector<godot::Ref<GFXButtonStateTexture>> const& button_state_textures = {}
);
/* Discard the GFX::TextureSprite, atlas texture and icon index. */