aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp
diff options
context:
space:
mode:
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. */