aboutsummaryrefslogtreecommitdiff
path: root/scene/resources/texture.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2017-06-28 17:00:18 -0300
committerJuan Linietsky2017-06-28 17:01:35 -0300
commitdb3b05d2893dcaddeb3bcb10b845ff150eb50895 (patch)
treee19d761357300ba03360593e3cbdda01e87f215e /scene/resources/texture.cpp
parent9e54e1f34f7ee0b100b45fa2388f25096eb90670 (diff)
downloadgodot-db3b05d2893dcaddeb3bcb10b845ff150eb50895.tar.gz
godot-db3b05d2893dcaddeb3bcb10b845ff150eb50895.tar.zst
godot-db3b05d2893dcaddeb3bcb10b845ff150eb50895.zip
Reworked translation system
-Label and Button reload translation on the fly -Resources are loaded and reload depending on locale
Diffstat (limited to 'scene/resources/texture.cpp')
-rw-r--r--scene/resources/texture.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 6c7ae2445..171826cb2 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -91,7 +91,7 @@ Texture::Texture() {
void ImageTexture::reload_from_file() {
- String path = get_path();
+ String path = ResourceLoader::path_remap(get_path());
if (!path.is_resource_file())
return;
@@ -710,13 +710,16 @@ void StreamTexture::set_flags(uint32_t p_flags) {
void StreamTexture::reload_from_file() {
-#ifdef TOOLS_ENABLED
- String ipath = get_import_path();
- if (ipath.is_resource_file() && ipath != path_to_file) {
- path_to_file = ipath;
- }
-#endif
- load(path_to_file);
+ String path = get_path();
+ if (!path.is_resource_file())
+ return;
+
+ path = ResourceLoader::path_remap(path); //remap for translation
+ path = ResourceLoader::import_remap(path); //remap for import
+ if (!path.is_resource_file())
+ return;
+
+ load(path);
}
void StreamTexture::_bind_methods() {