1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Merge pull request #39 from Calinou/fix-3.1-compatibility

Fix compatibility with Godot 3.1
This commit is contained in:
Overloaded 2019-12-15 00:44:23 +02:00 committed by GitHub
commit 14df6ced91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,8 +24,15 @@ func _ready() -> void:
# This property is only available in 3.2alpha or later, so use `set()` to fail gracefully if it doesn't exist.
OS.set("min_window_size", Vector2(1152, 648))
# `TranslationServer.get_loaded_locales()` was added in 3.2beta and isn't available in 3.1.2.
# The `has_method()` check and the `else` branch can be removed once 3.2 is released.
if TranslationServer.has_method("get_loaded_locales"):
loaded_locales = TranslationServer.get_loaded_locales()
else:
# Hardcoded list of locales
loaded_locales = ["el", "en"]
# Make sure locales are always sorted, in the same order
loaded_locales = TranslationServer.get_loaded_locales()
loaded_locales.sort()
# Load settings from the config file