This commit is contained in:
MarcEricMartel 2023-06-11 11:59:19 -04:00
parent 166966df54
commit 788964b128
4 changed files with 153 additions and 139 deletions

BIN
audio/dot.wav Normal file

Binary file not shown.

View File

@ -12,6 +12,9 @@ public partial class start_game_menu : Control {
private LineEdit _ip;
private Label _error, _lip;
[Export]
private AudioStreamPlayer _sndBtn, _sndState;
private string Error { set { _error.Set("text", value); } }
private string IP_address {
set {
@ -24,6 +27,7 @@ public partial class start_game_menu : Control {
if (value == _currState)
return;
IP_address = "";
_sndState.Play();
switch (value) {
case _state.START:
Error = "";
@ -117,12 +121,12 @@ public partial class start_game_menu : Control {
_single.Pressed += () => startGame(_gameType.SINGLE);
//_localMulti.Pressed += () => startGame(_gameType.LOCAL);
//_LANMulti.Pressed += () => State = _state.LAN;
_host.Pressed += () => setupLANMultiGame();
_join.Pressed += () => setupLANMultiGame(false);
_quit.Pressed += () => State = _state.QUIT;
_cancel.Pressed += () => State = _state.START;
_no.Pressed += () => State = _state.START;
_yes.Pressed += () => GetTree().Quit();
_host.Pressed += () => { _sndBtn.Play(); setupLANMultiGame();};
_join.Pressed += () => { _sndBtn.Play(); setupLANMultiGame(false);};
_quit.Pressed += () => { _sndBtn.Play(); State = _state.QUIT;};
_cancel.Pressed += () => { _sndBtn.Play(); State = _state.START;};
_no.Pressed += () => { _sndBtn.Play(); State = _state.START;};
_yes.Pressed += () => { _sndBtn.Play(); GetTree().Quit();};
State = _state.START;
}

View File

@ -1,8 +1,10 @@
[gd_scene load_steps=8 format=3 uid="uid://4tym1auav4yv"]
[gd_scene load_steps=10 format=3 uid="uid://4tym1auav4yv"]
[ext_resource type="Script" path="res://menu/start_game_menu.cs" id="1_0k2xm"]
[ext_resource type="Texture2D" uid="uid://b44vs2lwgnh37" path="res://images/mushroom_cloud001.webp" id="2_aky60"]
[ext_resource type="AudioStream" uid="uid://ckg5eypyrhidg" path="res://music/I Feel Grunge (Slow).wav" id="2_yw57x"]
[ext_resource type="AudioStream" uid="uid://c8dcqkmytnyay" path="res://audio/btn.wav" id="4_fx2mk"]
[ext_resource type="AudioStream" uid="uid://dja6tipmq1m8l" path="res://audio/dot.wav" id="5_y8gc7"]
[sub_resource type="LabelSettings" id="LabelSettings_n38oc"]
font_size = 290
@ -24,7 +26,7 @@ keycode = 4194310
[sub_resource type="Shortcut" id="Shortcut_pweny"]
events = [SubResource("InputEventKey_x36ok"), SubResource("InputEventKey_hjkcu")]
[node name="StartGameMenu" type="Control"]
[node name="StartGameMenu" type="Control" node_paths=PackedStringArray("_sndBtn", "_sndState")]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
@ -32,6 +34,8 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_0k2xm")
_sndBtn = NodePath("Button")
_sndState = NodePath("State")
[node name="MushroomCloud001" type="Sprite2D" parent="."]
modulate = Color(0.317647, 0.133333, 0.137255, 1)
@ -162,3 +166,9 @@ horizontal_alignment = 1
[node name="Music" type="AudioStreamPlayer" parent="."]
stream = ExtResource("2_yw57x")
autoplay = true
[node name="Button" type="AudioStreamPlayer" parent="."]
stream = ExtResource("4_fx2mk")
[node name="State" type="AudioStreamPlayer" parent="."]
stream = ExtResource("5_y8gc7")