aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-02-19 22:05:16 +0100
committer hop311 <hop3114@gmail.com>2024-02-19 22:26:52 +0100
commitc48d14ca66d47ea7c25bb9a36c3d51f76d8351fc (patch)
tree1912fb231991b53dd638a295bb8d8f84b587885b /extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp
parent275cfbb62fe69828aeb9968110ad822447322a4e (diff)
Added multipurpose GFXSpriteTexture + reworked GFXButtonStateTexturesprite-texture
Diffstat (limited to 'extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp')
-rw-r--r--extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp b/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp
index 294b842..1e85dd8 100644
--- a/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp
+++ b/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.hpp
@@ -1,23 +1,20 @@
#pragma once
-#include <godot_cpp/classes/image_texture.hpp>
-
#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)
+ class GFXMaskedFlagTexture : public GFXButtonStateHavingTexture {
+ GDCLASS(GFXMaskedFlagTexture, GFXButtonStateHavingTexture)
GFX::MaskedFlag const* PROPERTY(gfx_masked_flag);
Country const* PROPERTY(flag_country);
godot::StringName PROPERTY(flag_type);
- godot::Ref<godot::Image> overlay_image, mask_image, flag_image, combined_image;
-
- static godot::StringName const& _signal_image_updated();
+ godot::Ref<godot::Image> overlay_image, mask_image, flag_image;
+ godot::Ref<godot::ImageTexture> combined_texture;
godot::Error _generate_combined_image();
@@ -27,12 +24,8 @@ namespace OpenVic {
public:
GFXMaskedFlagTexture();
- /* 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 = {}
- );
+ /* Create a GFXMaskedFlagTexture using the specified GFX::MaskedFlag. Returns nullptr if gfx_masked_flag fails. */
+ static godot::Ref<GFXMaskedFlagTexture> make_gfx_masked_flag_texture(GFX::MaskedFlag const* gfx_masked_flag);
/* 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. */