From b493547fb8c77918306fe56b74b704284cf54931 Mon Sep 17 00:00:00 2001 From: Hop311 Date: Thu, 25 May 2023 00:17:53 +0100 Subject: Import fix + ProvinceOverviewPanel close fix --- extension/src/Utilities.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 extension/src/Utilities.cpp (limited to 'extension/src/Utilities.cpp') diff --git a/extension/src/Utilities.cpp b/extension/src/Utilities.cpp new file mode 100644 index 0000000..a912490 --- /dev/null +++ b/extension/src/Utilities.cpp @@ -0,0 +1,16 @@ +#include "Utilities.hpp" + +#include +#include + +using namespace godot; +using namespace OpenVic; + +Ref OpenVic::load_godot_image(String const& path) { + if (path.begins_with("res://")) { + ResourceLoader* loader = ResourceLoader::get_singleton(); + return loader ? loader->load(path) : nullptr; + } else { + return Image::load_from_file(path); + } +} -- cgit v1.2.3-56-ga3b1