diff options
author | hop311 <hop3114@gmail.com> | 2023-12-30 15:59:20 +0100 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2023-12-30 15:59:20 +0100 |
commit | c0cc6e202c33fb3889d0025b1b04148ae66545f2 (patch) | |
tree | 65ef49b0d12cf307269defeb0960f25ea442f777 /extension/src/openvic-extension/classes/GFXIconTexture.hpp | |
parent | f2f42d1b65605876a6ec12626be55183b4681b88 (diff) |
Added button state textures + block colour progress bars
Diffstat (limited to 'extension/src/openvic-extension/classes/GFXIconTexture.hpp')
-rw-r--r-- | extension/src/openvic-extension/classes/GFXIconTexture.hpp | 12 |
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. */ |