update: 更新到godot4.4.1,并大量重构代码
This commit is contained in:
16
Main.cs
16
Main.cs
@ -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() {
|
||||
|
Reference in New Issue
Block a user