dev: 更新代码,并准备LuaMod
This commit is contained in:
@ -4,24 +4,21 @@ using System.IO;
|
||||
|
||||
public partial class Setting : Control {
|
||||
private GlobalManager global = GlobalManager.Instance;
|
||||
private IConfigManager config = GlobalManager.Instance.ConfigManager;
|
||||
int font_size;
|
||||
private readonly IConfigManager config = GlobalManager.Instance.ConfigManager;
|
||||
private int font_size;
|
||||
private LineEdit fontOut = null!;
|
||||
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready() {
|
||||
fontOut = GetNode<LineEdit>("BoxContainer/MarginContainer5/HBoxContainer/FontSize");
|
||||
fontOut = GetNode<LineEdit>("%FontSize");
|
||||
font_size = config.GetValue<int>("font_size");
|
||||
GetNode<HSlider>("BoxContainer/MarginContainer6/FontSizeBar")
|
||||
GetNode<HSlider>("%FontSizeBar")
|
||||
.Value = font_size;
|
||||
fontOut.Text = font_size.ToString();
|
||||
|
||||
FillingData();
|
||||
}
|
||||
private void FillingData() {
|
||||
GetNode<LineEdit>("BoxContainer/MarginContainer2/Server/LineEdit")
|
||||
.Text = config.GetValue<string>("server_url");
|
||||
GetNode<LineEdit>("BoxContainer/MarginContainer3/Name/LineEdit")
|
||||
GetNode<LineEdit>("%LineEdit_ServerIP")
|
||||
.Text = config.GetValue<string>("server_addr");
|
||||
GetNode<LineEdit>("%LineEdit_UserName")
|
||||
.Text = config.GetValue<string>("user_name");
|
||||
}
|
||||
|
||||
@ -35,17 +32,14 @@ public partial class Setting : Control {
|
||||
|
||||
private void OnSave() {
|
||||
global.SaveConfig();
|
||||
// OS.Alert("Saved", "Setting");
|
||||
}
|
||||
|
||||
void OnNameChanged(string Value) {
|
||||
config.SetValue("user_name", Value);
|
||||
// config.GetValue<>Flush();
|
||||
}
|
||||
|
||||
private void OnServerUrlChanged(string Value) {
|
||||
config.SetValue("server_url", Value);
|
||||
// config.GetValue<>Flush();
|
||||
}
|
||||
|
||||
private void OnFontSizeChanged(float Value) {
|
||||
|
Reference in New Issue
Block a user