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

Fix compatibility with Godot 3.1

This closes #35.
This commit is contained in:
Hugo Locurcio 2019-12-14 23:19:58 +01:00
parent a4b7fe2205
commit c4ca26c013
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C

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