diff options
author | hop311 <hop3114@gmail.com> | 2024-03-05 01:19:27 +0100 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-03-05 10:36:47 +0100 |
commit | 444134a93bd5c704f5201ff30371dc81d0669e46 (patch) | |
tree | 851a3ad589bab71364d4c6adcb1ee30235abc2c7 /extension/src/openvic-extension/singletons/MenuSingleton.hpp | |
parent | eaae420cd2aca224d15f6276624c2fab882c978a (diff) |
Move GDExtension menu-related functions to MenuSingletonmenu-singleton
Diffstat (limited to 'extension/src/openvic-extension/singletons/MenuSingleton.hpp')
-rw-r--r-- | extension/src/openvic-extension/singletons/MenuSingleton.hpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/extension/src/openvic-extension/singletons/MenuSingleton.hpp b/extension/src/openvic-extension/singletons/MenuSingleton.hpp new file mode 100644 index 0000000..6bd90c5 --- /dev/null +++ b/extension/src/openvic-extension/singletons/MenuSingleton.hpp @@ -0,0 +1,48 @@ +#pragma once + +#include <godot_cpp/classes/image.hpp> + +#include <openvic-simulation/types/OrderedContainers.hpp> + +namespace OpenVic { + struct GameManager; + + class MenuSingleton : public godot::Object { + GDCLASS(MenuSingleton, godot::Object) + + static inline MenuSingleton* singleton = nullptr; + + GameManager* game_manager; + + protected: + static void _bind_methods(); + + public: + static MenuSingleton* get_singleton(); + + /* This should only be called AFTER GameSingleton has been initialised! */ + MenuSingleton(); + ~MenuSingleton(); + + /* PROVINCE OVERVIEW PANEL */ + /* Get info to display in Province Overview Panel, packaged in a Dictionary using StringName constants as keys. */ + godot::Dictionary get_province_info_from_index(int32_t index) const; + int32_t get_province_building_count() const; + godot::String get_province_building_identifier(int32_t building_index) const; + godot::Error expand_selected_province_building(int32_t building_index); + int32_t get_slave_pop_icon_index() const; + int32_t get_administrative_pop_icon_index() const; + int32_t get_rgo_owner_pop_icon_index() const; + + /* TIME/SPEED CONTROL PANEL */ + void set_paused(bool paused); + void toggle_paused(); + bool is_paused() const; + void increase_speed(); + void decrease_speed(); + int32_t get_speed() const; + bool can_increase_speed() const; + bool can_decrease_speed() const; + godot::String get_longform_date() const; + }; +} |