From c48d14ca66d47ea7c25bb9a36c3d51f76d8351fc Mon Sep 17 00:00:00 2001 From: hop311 Date: Mon, 19 Feb 2024 21:05:16 +0000 Subject: Added multipurpose GFXSpriteTexture + reworked GFXButtonStateTexture --- .../openvic-extension/classes/GFXIconTexture.hpp | 62 ---------------------- 1 file changed, 62 deletions(-) delete mode 100644 extension/src/openvic-extension/classes/GFXIconTexture.hpp (limited to 'extension/src/openvic-extension/classes/GFXIconTexture.hpp') diff --git a/extension/src/openvic-extension/classes/GFXIconTexture.hpp b/extension/src/openvic-extension/classes/GFXIconTexture.hpp deleted file mode 100644 index 06dac34..0000000 --- a/extension/src/openvic-extension/classes/GFXIconTexture.hpp +++ /dev/null @@ -1,62 +0,0 @@ -#pragma once - -#include - -#include - -#include "openvic-extension/classes/GFXButtonStateTexture.hpp" - -namespace OpenVic { - class GFXIconTexture : public godot::AtlasTexture { - GDCLASS(GFXIconTexture, godot::AtlasTexture) - - /* PROPERTY automatically defines getter functions: - * - get_gfx_texture_sprite - * - get_icon_index - * - get_icon_count */ - GFX::TextureSprite const* PROPERTY(gfx_texture_sprite); - GFX::frame_t PROPERTY(icon_index); - GFX::frame_t PROPERTY(icon_count); - - godot::Ref 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 make_gfx_icon_texture( - GFX::TextureSprite const* gfx_texture_sprite, GFX::frame_t icon = GFX::NO_FRAMES, - std::vector> const& button_state_textures = {} - ); - - /* Discard the GFX::TextureSprite, atlas texture and icon index. */ - void clear(); - - /* Set the GFX::TextureSprite, load its texture as an atlas and set its displayed icon */ - godot::Error set_gfx_texture_sprite( - GFX::TextureSprite const* new_gfx_texture_sprite, GFX::frame_t icon = GFX::NO_FRAMES - ); - - /* Search for a GFX::TextureSprite with the specfied name and, - * if successful, call set_gfx_texture_sprite to set it and its icon. */ - godot::Error set_gfx_texture_sprite_name( - godot::String const& gfx_texture_sprite_name, GFX::frame_t icon = GFX::NO_FRAMES - ); - - /* Return the name of the GFX::TextureSprite, or an empty String if it's null. */ - godot::String get_gfx_texture_sprite_name() const; - - /* Set icon_index to a value between one and icon_count (inclusive), and update the AtlasTexture's region - * to display that frame. An index of zero can be used if gfx_texture_sprite has no frames (zero icon_count). - * 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); - }; -} -- cgit v1.2.3-56-ga3b1