aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.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/GFXMaskedFlagTexture.hpp
parent8fc620484ac406c7a86b92553d77a0bd20e4143b (diff)
parentc0cc6e202c33fb3889d0025b1b04148ae66545f2 (diff)
Merge pull request #181 from OpenVicProject/ui-state-style
UI polish
Diffstat (limited to 'extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp')
-rw-r--r--extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp13
1 files changed, 10 insertions, 3 deletions
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 <openvic-simulation/country/Country.hpp>
#include <openvic-simulation/interface/GFX.hpp>
+#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<godot::Image> 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<GFXMaskedFlagTexture> 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<GFXMaskedFlagTexture> make_gfx_masked_flag_texture(
+ GFX::MaskedFlag const* gfx_masked_flag,
+ std::vector<godot::Ref<GFXButtonStateTexture>> 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. */