aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/utility/UITools.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-07-26 22:59:12 +0200
committer hop311 <hop3114@gmail.com>2024-07-26 22:59:12 +0200
commit164db4eb8f24e87755e02bae0e539f4f266e15b9 (patch)
tree9ab24e79d47c2c56dfd68ebf89e419d30324c92c /extension/src/openvic-extension/utility/UITools.cpp
parent46c3009075be36577ab7dbea263655e428833b20 (diff)
Free removed child nodes + `godot::` cleanupfree-on-remove
Diffstat (limited to 'extension/src/openvic-extension/utility/UITools.cpp')
-rw-r--r--extension/src/openvic-extension/utility/UITools.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/extension/src/openvic-extension/utility/UITools.cpp b/extension/src/openvic-extension/utility/UITools.cpp
index 5d2ef1f..3c7e04f 100644
--- a/extension/src/openvic-extension/utility/UITools.cpp
+++ b/extension/src/openvic-extension/utility/UITools.cpp
@@ -28,7 +28,7 @@ using OpenVic::Utilities::godot_to_std_string;
using OpenVic::Utilities::std_view_to_godot_string;
using OpenVic::Utilities::std_view_to_godot_string_name;
-GFX::Sprite const* UITools::get_gfx_sprite(godot::String const& gfx_sprite) {
+GFX::Sprite const* UITools::get_gfx_sprite(String const& gfx_sprite) {
GameSingleton* game_singleton = GameSingleton::get_singleton();
ERR_FAIL_NULL_V(game_singleton, nullptr);
GFX::Sprite const* sprite = game_singleton->get_definition_manager().get_ui_manager().get_sprite_by_identifier(
@@ -38,7 +38,7 @@ GFX::Sprite const* UITools::get_gfx_sprite(godot::String const& gfx_sprite) {
return sprite;
}
-GUI::Element const* UITools::get_gui_element(godot::String const& gui_scene, godot::String const& gui_element) {
+GUI::Element const* UITools::get_gui_element(String const& gui_scene, String const& gui_element) {
GameSingleton const* game_singleton = GameSingleton::get_singleton();
ERR_FAIL_NULL_V(game_singleton, nullptr);
GUI::Scene const* scene =
@@ -65,13 +65,12 @@ GUI::Position const* UITools::get_gui_position(String const& gui_scene, String c
namespace OpenVic {
struct generate_gui_args_t {
GUI::Element const& element;
- godot::String const& name;
+ String const& name;
AssetManager& asset_manager;
- godot::Control*& result;
+ Control*& result;
constexpr generate_gui_args_t(
- GUI::Element const& new_element, godot::String const& new_name, AssetManager& new_asset_manager,
- godot::Control*& new_result
+ GUI::Element const& new_element, String const& new_name, AssetManager& new_asset_manager, Control*& new_result
) : element { new_element }, name { new_name }, asset_manager { new_asset_manager }, result { new_result } {}
};
}
@@ -690,7 +689,7 @@ bool UITools::generate_gui_element(
}
bool UITools::generate_gui_element(
- godot::String const& gui_scene, godot::String const& gui_element, godot::String const& name, godot::Control*& result
+ String const& gui_scene, String const& gui_element, String const& name, Control*& result
) {
return generate_gui_element(get_gui_element(gui_scene, gui_element), name, result);
}