-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.cs
75 lines (62 loc) · 1.73 KB
/
menu.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
namespace Skull;
using Godot;
using System;
public partial class menu : Control
{
public override void _Ready()
{
}
public override void _Process(double delta)
{
}
private void _on_options_pressed()
{
GD.Print("Option button");
GetTree().ChangeSceneToFile("res://options.tscn");
}
private void _on_exit_pressed()
{
GD.Print("Exit button");
GetTree().Quit();
}
private void _on_play_pressed()
{
GD.Print("Play button");
GetTree().ChangeSceneToFile("res://Scenes/Start/Start.tscn");
}
private void _on_multiplayer_pressed()
{
GD.Print("Multiplayer button");
GetTree().ChangeSceneToFile("res://Scenes/Multiplayer/MultiplayerScene.tscn");
}
private void _on_texture_button_pressed()
{
GD.Print("Chat scene");
GetTree().ChangeSceneToFile("res://chat.tscn");
}
private void _on_back_pressed()
{
GD.Print("Back button");
GetTree().ChangeSceneToFile("res://menu.tscn");
}
private void _on_check_button_toggled(bool button_pressed)
{
var streamPlayer = GetNode<AudioStreamPlayer2D>("AudioStreamPlayer2D");
streamPlayer.Stream = GD.Load<AudioStream>("res://ship-radar.wav");
if(button_pressed)
{
GD.Print("CheckButton sound : ", button_pressed);
streamPlayer.Play();
}
else
{
GD.Print("CheckButton sound : ", button_pressed);
streamPlayer.Stop();
}
}
private void _on_tutorial_pressed()
{
GD.Print("Tutorial button");
GetTree().ChangeSceneToFile("res://UI/Tutorial/tutorial.tscn");
}
}