From 4a899c1a9e83ab9476b85522751081be434caa35 Mon Sep 17 00:00:00 2001 From: hop311 Date: Sat, 2 Dec 2023 15:48:08 +0000 Subject: Crime+event modifier loading + misc UI backend --- src/openvic-simulation/interface/GFX.cpp | 13 +++++-------- src/openvic-simulation/interface/GFX.hpp | 3 +-- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'src/openvic-simulation/interface') diff --git a/src/openvic-simulation/interface/GFX.cpp b/src/openvic-simulation/interface/GFX.cpp index f4e2074..927b832 100644 --- a/src/openvic-simulation/interface/GFX.cpp +++ b/src/openvic-simulation/interface/GFX.cpp @@ -42,18 +42,15 @@ bool TextureSprite::_fill_key_map(key_map_t& key_map) { return ret; } -ProgressBar::ProgressBar() -: back_colour {}, back_texture_file {}, - progress_colour {}, progress_texture_file {}, - size {} {} +ProgressBar::ProgressBar() : back_colour {}, progress_colour {} {} bool ProgressBar::_fill_key_map(key_map_t& key_map) { bool ret = Sprite::_fill_key_map(key_map); ret &= add_key_map_entries(key_map, "color", ONE_EXACTLY, expect_colour(assign_variable_callback(back_colour)), "colortwo", ONE_EXACTLY, expect_colour(assign_variable_callback(progress_colour)), - "textureFile1", ZERO_OR_ONE, expect_string(assign_variable_callback_string(back_texture_file)), - "textureFile2", ZERO_OR_ONE, expect_string(assign_variable_callback_string(progress_texture_file)), + "textureFile1", ZERO_OR_ONE, expect_string(assign_variable_callback_string(progress_texture_file)), + "textureFile2", ZERO_OR_ONE, expect_string(assign_variable_callback_string(back_texture_file)), "size", ONE_EXACTLY, expect_ivec2(assign_variable_callback(size)), "effectFile", ONE_EXACTLY, success_callback, @@ -84,12 +81,12 @@ bool LineChart::_fill_key_map(key_map_t& key_map) { return ret; } -MaskedFlag::MaskedFlag() : texture_file {}, mask_file {} {} +MaskedFlag::MaskedFlag() : overlay_file {}, mask_file {} {} bool MaskedFlag::_fill_key_map(key_map_t& key_map) { bool ret = Sprite::_fill_key_map(key_map); ret &= add_key_map_entries(key_map, - "textureFile1", ONE_EXACTLY, expect_string(assign_variable_callback_string(texture_file)), + "textureFile1", ONE_EXACTLY, expect_string(assign_variable_callback_string(overlay_file)), "textureFile2", ONE_EXACTLY, expect_string(assign_variable_callback_string(mask_file)), "effectFile", ONE_EXACTLY, success_callback, "allwaystransparent", ZERO_OR_ONE, success_callback, diff --git a/src/openvic-simulation/interface/GFX.hpp b/src/openvic-simulation/interface/GFX.hpp index 2422e24..ff27613 100644 --- a/src/openvic-simulation/interface/GFX.hpp +++ b/src/openvic-simulation/interface/GFX.hpp @@ -117,11 +117,10 @@ namespace OpenVic::GFX { OV_DETAIL_GET_TYPE }; - class MaskedFlag final : public Sprite { friend std::unique_ptr std::make_unique(); - std::string PROPERTY(texture_file) + std::string PROPERTY(overlay_file) std::string PROPERTY(mask_file); protected: -- cgit v1.2.3-56-ga3b1