Skip to content

Commit

Permalink
Fix Merge Conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
KamiQuasi committed Jan 18, 2023
2 parents 5961ae5 + da7b527 commit 7ad38dd
Show file tree
Hide file tree
Showing 5 changed files with 609 additions and 497 deletions.
49 changes: 49 additions & 0 deletions Scenes/GameOverScreen.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using Godot;
using System;

public class GameOverScreen : CanvasLayer
{
// Declare member variables here. Examples:
// private int a = 2;
// private string b = "text";

Game MyGame;
CanvasLayer ourGui;
Serilog.Core.Logger _serilogger;

// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
MyGame = GetNode<Game>("/root/Game");
_serilogger = MyGame._serilogger;

ourGui = MyGame.GetNode<CanvasLayer>("GUI");
}

// // Called every frame. 'delta' is the elapsed time since the previous frame.
// public override void _Process(float delta)
// {
//
// }

public void _on_TryAgainButton_button_up()
{
// send the join message
bool success = MyGame.JoinGameAsPlayer(MyGame.myUuid);
if (!success)
{
_serilogger.Information($"GameOverScreen.cs: join failed TODO tell player why");
// TODO: alert errors or something
}
else
{
// since we successfully joined the game, we can remove this node
// which is the game over screen. removing the screen "displays"
// the main game window
QueueFree();

// re-show the GUI
MyGame.initializeGameUI();
}
}
}
32 changes: 32 additions & 0 deletions Scenes/GameOverScreen.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://Assets/UIElements/MainTheme.tres" type="Theme" id=1]
[ext_resource path="res://Scenes/GameOverScreen.cs" type="Script" id=2]

[node name="GameOverScreen" type="CanvasLayer"]
script = ExtResource( 2 )

[node name="CenterContainer" type="CenterContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0

[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
margin_left = 882.0
margin_top = 494.0
margin_right = 1038.0
margin_bottom = 586.0

[node name="GameOverLabel" type="Label" parent="CenterContainer/VBoxContainer"]
margin_right = 156.0
margin_bottom = 41.0
theme = ExtResource( 1 )
text = "Game Over"

[node name="TryAgainButton" type="Button" parent="CenterContainer/VBoxContainer"]
margin_top = 45.0
margin_right = 156.0
margin_bottom = 92.0
theme = ExtResource( 1 )
text = "Try Again?"

[connection signal="button_up" from="CenterContainer/VBoxContainer/TryAgainButton" to="." method="_on_TryAgainButton_button_up"]
7 changes: 3 additions & 4 deletions Scenes/LoginScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public class LoginScreen : Control
{
Game MyGame;

public Serilog.Core.Logger _serilogger;
Serilog.Core.Logger _serilogger;

LineEdit textField;

Expand All @@ -14,9 +14,8 @@ public override void _Ready()
MyGame = GetNode<Game>("/root/Game");
_serilogger = MyGame._serilogger;


textField = this.GetNode<LineEdit>("VBoxContainer/HBoxContainer/NameLineEdit");
textField.GrabFocus();
textField = this.GetNode<LineEdit>("VBoxContainer/HBoxContainer/NameLineEdit");
textField.GrabFocus();

// TODO: need to interrogate server for the initial defaults for things like
// missile speed
Expand Down
Loading

0 comments on commit 7ad38dd

Please sign in to comment.