fix(locale): scope cur_lang across full setup in game_scene.gd
This commit is contained in:
@@ -172,6 +172,8 @@ func setup(m2client: Node, assets_root: String,
|
|||||||
var diag_after := int(OS.get_environment("MT_DIAG_AFTER_MS")) if OS.get_environment("MT_DIAG_AFTER_MS") != "" else DIAG_AFTER_MS
|
var diag_after := int(OS.get_environment("MT_DIAG_AFTER_MS")) if OS.get_environment("MT_DIAG_AFTER_MS") != "" else DIAG_AFTER_MS
|
||||||
_diag_at = Time.get_ticks_msec() + diag_after
|
_diag_at = Time.get_ticks_msec() + diag_after
|
||||||
_ui_mobile = UiProfile.resolve() == UiProfile.Mode.MOBILE
|
_ui_mobile = UiProfile.resolve() == UiProfile.Mode.MOBILE
|
||||||
|
var LocaleScript = load("res://locale.gd")
|
||||||
|
var cur_lang: String = LocaleScript.get_default_lang() if LocaleScript and LocaleScript.has_method("get_default_lang") else "zh"
|
||||||
# GC_MAIN_CHARACTER only carries the server-space coordinates, not the map
|
# GC_MAIN_CHARACTER only carries the server-space coordinates, not the map
|
||||||
# folder. The old fixed A1 fallback puts characters from A2/A3 outside the
|
# folder. The old fixed A1 fallback puts characters from A2/A3 outside the
|
||||||
# rendered terrain, which looks like an empty map. Resolve the map from the
|
# rendered terrain, which looks like an empty map. Resolve the map from the
|
||||||
@@ -458,8 +460,6 @@ func setup(m2client: Node, assets_root: String,
|
|||||||
if ClassDB.class_exists("Metin2Proto") and assets_root != "":
|
if ClassDB.class_exists("Metin2Proto") and assets_root != "":
|
||||||
proto = ClassDB.instantiate("Metin2Proto")
|
proto = ClassDB.instantiate("Metin2Proto")
|
||||||
add_child(proto)
|
add_child(proto)
|
||||||
var LocaleScript = load("res://locale.gd")
|
|
||||||
var cur_lang: String = LocaleScript.get_default_lang() if LocaleScript and LocaleScript.has_method("get_default_lang") else "zh"
|
|
||||||
var ip := assets_root.path_join("locale/locale/%s/item_proto" % cur_lang)
|
var ip := assets_root.path_join("locale/locale/%s/item_proto" % cur_lang)
|
||||||
if not FileAccess.file_exists(ip):
|
if not FileAccess.file_exists(ip):
|
||||||
ip = assets_root.path_join("locale/locale/en/item_proto")
|
ip = assets_root.path_join("locale/locale/en/item_proto")
|
||||||
|
|||||||
Reference in New Issue
Block a user