From c0cc6e202c33fb3889d0025b1b04148ae66545f2 Mon Sep 17 00:00:00 2001 From: hop311 Date: Sat, 30 Dec 2023 14:59:20 +0000 Subject: Added button state textures + block colour progress bars --- .../src/openvic-extension/classes/GFXMaskedFlagTexture.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp') diff --git a/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp b/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp index f71a1d7..294b842 100644 --- a/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp +++ b/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp @@ -5,6 +5,8 @@ #include #include +#include "openvic-extension/classes/GFXButtonStateTexture.hpp" + namespace OpenVic { class GFXMaskedFlagTexture : public godot::ImageTexture { GDCLASS(GFXMaskedFlagTexture, godot::ImageTexture) @@ -15,6 +17,8 @@ namespace OpenVic { godot::Ref overlay_image, mask_image, flag_image, combined_image; + static godot::StringName const& _signal_image_updated(); + godot::Error _generate_combined_image(); protected: @@ -23,9 +27,12 @@ namespace OpenVic { public: GFXMaskedFlagTexture(); - /* Create a GFXMaskedFlagTexture using the specific GFX::MaskedFlag. - * Returns nullptr if setting gfx_masked_flag fails. */ - static godot::Ref make_gfx_masked_flag_texture(GFX::MaskedFlag const* gfx_masked_flag); + /* Create a GFXMaskedFlagTexture using the specified GFX::MaskedFlag. Returns nullptr if gfx_masked_flag fails. + * Connects the provided GFXButtonStateTextures (if any) to the GFXMaskedFlagTexture's image_updated signal. */ + static godot::Ref make_gfx_masked_flag_texture( + GFX::MaskedFlag const* gfx_masked_flag, + std::vector> const& button_state_textures = {} + ); /* Reset gfx_masked_flag, flag_country and flag_type to nullptr/an empty string, and unreference all images. * This does not affect the godot::ImageTexture, which cannot be reset to a null or empty image. */ -- cgit v1.2.3-56-ga3b1