update: 更新到godot4.4.1,并大量重构代码

This commit is contained in:
ZZY
2025-06-09 18:17:06 +08:00
parent b27abb55a2
commit 3fa39fc71e
39 changed files with 801 additions and 790 deletions

16
Main.cs
View File

@ -29,7 +29,7 @@ public partial class Main : Node2D
// }
// Called when the node enters the scene tree for the first time.
Global global = null;
GlobalManager global = null!;
public override void _Ready() {
// GetTree().Connect("screen_resized", ResizeChessboardToFitScreen);
// Button undo = GetNode<Button>("Undo");
@ -40,9 +40,9 @@ public partial class Main : Node2D
// ChessBoard board1 = GetChild<ChessBoard>(0);
// board.Visible = false;
// board.Can
global = GetNode<Global>("/root/Global");
global = GlobalManager.Instance;
global.GlobalTheme = GetChild<Control>(GetChildCount() - 1).Theme;
global.ConfigFlush();
global.GlobalThemeConfigFlush();
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
@ -51,16 +51,20 @@ public partial class Main : Node2D
private void GoToSignlePlayer() {
// global.GotoScene("res://Scenes/SinglePlayer.tscn");
global.GotoScene("res://Scenes/ChessGame.tscn");
global?.GotoScene("res://Scenes/ChessGame.tscn");
}
private void GoToMultiPlayer() {
// global.GotoScene("res://Scenes/MultiPlayer.tscn");
global.GotoScene("res://Scenes/GameLobby.tscn");
global?.GotoScene("res://Scenes/GameLobby.tscn");
}
private void GoToSetting() {
global.GotoScene("res://Scenes/Setting.tscn");
global?.GotoScene("res://Scenes/Setting.tscn");
}
private void GotoMods() {
global?.GotoScene("res://Scenes/Mods.tscn");
}
// private void goToMenu() {