-
Notifications
You must be signed in to change notification settings - Fork 1
/
Init.cs
41 lines (39 loc) · 1.06 KB
/
Init.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Godot;
using System;
using GodotTask;
public partial class Init : Node2D
{
public override void _Ready()
{
if (OS.GetLocale() == "zh_TW" || OS.GetLocale() == "zh_HK" || OS.GetLocale() == "zh_MO")
{
TranslationServer.SetLocale("zh_TW");
}
else if (OS.GetLocaleLanguage() == "zh" || OS.GetLocale() == "zh_CN" || OS.GetLocale() == "zh_SG")
{
TranslationServer.SetLocale("zh_CN");
}
else
{
TranslationServer.SetLocale(OS.GetLocale());
}
if (FileAccess.FileExists("user://LocalChat.ini"))
{
var save=new ConfigFile();
save.Load("user://LocalChat.ini");
TranslationServer.SetLocale((string)save.GetValue("Settings","Language","en"));
GetNode<AutoLoad>("/root/AutoLoad").notification=(bool)save.GetValue("Settings","Notification",true);
}
else
{
var save=new ConfigFile();
save.SetValue("Settings","Language",TranslationServer.GetLocale());
save.Save("user://LocalChat.ini");
}
GDTask.Delay(200);//todo fix
GetTree().ChangeSceneToFile("res://Menu.tscn");
}
public override void _Process(double delta)
{
}
}