Skip to content

Commit e70fba9

Browse files
committed
added how to play
1 parent 63668f2 commit e70fba9

7 files changed

Lines changed: 260 additions & 2 deletions

File tree

Globals/translations.csv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,7 @@ INVENTORY_TAB_NOTES,Notes,乐谱
5454
INVENTORY_TAB_RELICS,Relics,遗物
5555
OPTIONS_VOLUME_LABEL,Master Volume,最终音量设置
5656
OPTIONS_CONTRAST_LABEL,High Contrast,高对比度模式
57+
HOW_TO_PLAY,How to Play,如何游玩
58+
HOW_TO_PLAY_BLOCK1,"Hit notes to\nbuild combo","点击音符\n以建立连击"
59+
HOW_TO_PLAY_BLOCK2,"Place notes when\ncombo is full","当连击满\n时放置音符"
60+
HOW_TO_PLAY_BLOCK3,"Only placed notes\nhave effects","只有已放置\n的音符才有效"

scenes/Options/OptionsMenu.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ public partial class OptionsMenu : CanvasLayer
2121
[Export]
2222
private CheckBox _highContrastToggle;
2323

24+
[Export]
25+
private Button _howToPlayButton;
26+
2427
private const float MinVolumeVal = 50f;
2528

2629
public override void _Ready()
@@ -36,6 +39,7 @@ public override void _Ready()
3639
_closeButton.Pressed += CloseMenu;
3740
_controlsButton.Pressed += OpenControls;
3841
_highContrastToggle.Toggled += HighContrastChanged;
42+
_howToPlayButton.Pressed += OpenHowToPlay;
3943
}
4044

4145
public override void _Process(double delta) //TODO: Better method for returning focus
@@ -98,4 +102,12 @@ private void HighContrastChanged(bool toggled)
98102
StageProducer.ContrastFilter.Visible = toggled;
99103
SaveSystem.UpdateConfig(SaveSystem.ConfigSettings.HighContrast, toggled);
100104
}
105+
106+
private void OpenHowToPlay()
107+
{
108+
HowToPlay howtoPlay = GD.Load<PackedScene>("res://scenes/UI/HowToPlay.tscn")
109+
.Instantiate<HowToPlay>();
110+
AddChild(howtoPlay);
111+
howtoPlay.OpenMenu(this);
112+
}
101113
}

scenes/Options/OptionsMenu.tscn

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
[ext_resource type="Script" path="res://scenes/Options/scripts/LanguageSelection.cs" id="1_qyvkw"]
44
[ext_resource type="Script" path="res://scenes/Options/OptionsMenu.cs" id="1_yjq7i"]
55

6-
[node name="OptionsMenu" type="CanvasLayer" node_paths=PackedStringArray("_focused", "_volumeSlider", "_closeButton", "_controlsButton", "_highContrastToggle")]
6+
[node name="OptionsMenu" type="CanvasLayer" node_paths=PackedStringArray("_focused", "_volumeSlider", "_closeButton", "_controlsButton", "_highContrastToggle", "_howToPlayButton")]
77
process_mode = 3
88
script = ExtResource("1_yjq7i")
99
_focused = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/LanguageSelection")
1010
_volumeSlider = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/Container/Volume")
1111
_closeButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/TitleButton")
1212
_controlsButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/ControlsButton")
1313
_highContrastToggle = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HBoxContainer/CheckBox")
14+
_howToPlayButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HowToPlayButton")
1415

1516
[node name="Control" type="Control" parent="."]
1617
layout_mode = 3
@@ -59,7 +60,7 @@ theme_override_constants/margin_bottom = 10
5960
custom_minimum_size = Vector2(240, 0)
6061
layout_mode = 2
6162
size_flags_horizontal = 0
62-
theme_override_constants/separation = 25
63+
theme_override_constants/separation = 18
6364
alignment = 1
6465

6566
[node name="Title" type="Label" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
@@ -112,6 +113,10 @@ script = ExtResource("1_qyvkw")
112113
layout_mode = 2
113114
text = "TITLE_CONTROLS"
114115

116+
[node name="HowToPlayButton" type="Button" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
117+
layout_mode = 2
118+
text = "HOW_TO_PLAY"
119+
115120
[node name="TitleButton" type="Button" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
116121
layout_mode = 2
117122
text = "CONTROLS_RETURN_BUTTON"

scenes/UI/HowToPlay.cs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
using System;
2+
using Godot;
3+
4+
public partial class HowToPlay : Node2D
5+
{
6+
[Export]
7+
private Button _returnButton;
8+
9+
private Node _previousScene;
10+
private ProcessModeEnum _previousProcessMode;
11+
12+
// Called when the node enters the scene tree for the first time.
13+
public override void _Ready()
14+
{
15+
_returnButton.Pressed += CloseMenu;
16+
}
17+
18+
// Called every frame. 'delta' is the elapsed time since the previous frame.
19+
public override void _Process(double delta) { }
20+
21+
public void OpenMenu(Node prevScene)
22+
{
23+
_previousScene = prevScene;
24+
_previousProcessMode = _previousScene.GetProcessMode();
25+
prevScene.ProcessMode = ProcessModeEnum.Disabled;
26+
}
27+
28+
private void CloseMenu()
29+
{
30+
_previousScene.ProcessMode = _previousProcessMode;
31+
QueueFree();
32+
}
33+
34+
public override void _Input(InputEvent @event)
35+
{
36+
if (@event.IsActionPressed("ui_cancel"))
37+
{
38+
CloseMenu();
39+
GetViewport().SetInputAsHandled();
40+
}
41+
}
42+
}

scenes/UI/HowToPlay.tscn

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
[gd_scene load_steps=8 format=3 uid="uid://cavxn51vwbew3"]
2+
3+
[ext_resource type="Script" path="res://scenes/UI/HowToPlay.cs" id="1_kqayr"]
4+
[ext_resource type="Texture2D" uid="uid://xtygvpk7s8e4" path="res://scenes/NoteManager/assets/outline_white.png" id="2_4i384"]
5+
[ext_resource type="Texture2D" uid="uid://dp3vkn65j4o3s" path="res://scenes/UI/assets/combobar.png" id="3_7006y"]
6+
[ext_resource type="Texture2D" uid="uid://caw70lr5e1yiq" path="res://Classes/Notes/assets/double_note.png" id="4_m6low"]
7+
[ext_resource type="Texture2D" uid="uid://cdf3g3174du4r" path="res://Classes/Notes/assets/heal_note.png" id="5_8kiq2"]
8+
[ext_resource type="Texture2D" uid="uid://c3chrsxrulapd" path="res://Classes/Notes/assets/single_note.png" id="6_uonw3"]
9+
[ext_resource type="Texture2D" uid="uid://dg0lmu0pip4lr" path="res://Classes/Notes/assets/vampire_note.png" id="7_rbdrm"]
10+
11+
[node name="CanvasLayer" type="Node2D" node_paths=PackedStringArray("_returnButton")]
12+
process_mode = 3
13+
script = ExtResource("1_kqayr")
14+
_returnButton = NodePath("Control/ReturnButton")
15+
16+
[node name="Control" type="Control" parent="."]
17+
layout_mode = 3
18+
anchors_preset = 0
19+
offset_right = 40.0
20+
offset_bottom = 40.0
21+
22+
[node name="ColorRect" type="ColorRect" parent="Control"]
23+
offset_right = 640.0
24+
offset_bottom = 360.0
25+
color = Color(0.133333, 0.133333, 0.133333, 1)
26+
27+
[node name="Label" type="Label" parent="Control"]
28+
offset_top = 16.0
29+
offset_right = 642.0
30+
offset_bottom = 39.0
31+
text = "HOW_TO_PLAY"
32+
horizontal_alignment = 1
33+
34+
[node name="ReturnButton" type="Button" parent="Control"]
35+
offset_left = 202.5
36+
offset_top = 314.0
37+
offset_right = 437.5
38+
offset_bottom = 345.0
39+
text = "CONTROLS_RETURN_BUTTON"
40+
41+
[node name="MarginContainer" type="Control" parent="Control"]
42+
anchors_preset = 0
43+
offset_left = 10.0
44+
offset_top = 60.0
45+
offset_right = 210.0
46+
offset_bottom = 310.0
47+
48+
[node name="ColorRect" type="ColorRect" parent="Control/MarginContainer"]
49+
layout_mode = 2
50+
offset_right = 200.0
51+
offset_bottom = 250.0
52+
color = Color(0.239216, 0.239216, 0.239216, 0.854902)
53+
54+
[node name="Left" type="Sprite2D" parent="Control/MarginContainer"]
55+
position = Vector2(27.0001, 62)
56+
rotation = -3.14159
57+
texture = ExtResource("2_4i384")
58+
59+
[node name="Up" type="Sprite2D" parent="Control/MarginContainer"]
60+
position = Vector2(27.0001, 102)
61+
rotation = -1.5708
62+
texture = ExtResource("2_4i384")
63+
64+
[node name="Down" type="Sprite2D" parent="Control/MarginContainer"]
65+
position = Vector2(27.0001, 145)
66+
rotation = 1.5708
67+
texture = ExtResource("2_4i384")
68+
69+
[node name="Right" type="Sprite2D" parent="Control/MarginContainer"]
70+
position = Vector2(27.0001, 186)
71+
texture = ExtResource("2_4i384")
72+
73+
[node name="Label" type="Label" parent="Control/MarginContainer"]
74+
layout_mode = 2
75+
offset_left = 54.0
76+
offset_top = 114.0
77+
offset_right = 254.0
78+
offset_bottom = 137.0
79+
text = "HOW_TO_PLAY_BLOCK1"
80+
81+
[node name="MarginContainer2" type="Control" parent="Control"]
82+
anchors_preset = 0
83+
offset_left = 220.0
84+
offset_top = 60.0
85+
offset_right = 420.0
86+
offset_bottom = 310.0
87+
88+
[node name="ColorRect" type="ColorRect" parent="Control/MarginContainer2"]
89+
layout_mode = 2
90+
offset_right = 200.0
91+
offset_bottom = 250.0
92+
color = Color(0.239216, 0.239216, 0.239216, 0.854902)
93+
94+
[node name="Label" type="Label" parent="Control/MarginContainer2"]
95+
layout_mode = 2
96+
offset_left = 54.0
97+
offset_top = 114.0
98+
offset_right = 254.0
99+
offset_bottom = 137.0
100+
text = "HOW_TO_PLAY_BLOCK2"
101+
102+
[node name="Combobar" type="Sprite2D" parent="Control/MarginContainer2"]
103+
position = Vector2(28, 125)
104+
scale = Vector2(1, 1.59184)
105+
texture = ExtResource("3_7006y")
106+
107+
[node name="MarginContainer3" type="Control" parent="Control"]
108+
anchors_preset = 0
109+
offset_left = 430.0
110+
offset_top = 60.0
111+
offset_right = 630.0
112+
offset_bottom = 310.0
113+
114+
[node name="ColorRect" type="ColorRect" parent="Control/MarginContainer3"]
115+
layout_mode = 2
116+
offset_right = 200.0
117+
offset_bottom = 250.0
118+
color = Color(0.239216, 0.239216, 0.239216, 0.854902)
119+
120+
[node name="Label" type="Label" parent="Control/MarginContainer3"]
121+
layout_mode = 2
122+
offset_left = 54.0
123+
offset_top = 114.0
124+
offset_right = 254.0
125+
offset_bottom = 137.0
126+
text = "HOW_TO_PLAY_BLOCK3"
127+
128+
[node name="Left" type="Sprite2D" parent="Control/MarginContainer3"]
129+
position = Vector2(27.0001, 62)
130+
rotation = -3.14159
131+
texture = ExtResource("2_4i384")
132+
133+
[node name="Up" type="Sprite2D" parent="Control/MarginContainer3"]
134+
position = Vector2(27.0001, 102)
135+
rotation = -1.5708
136+
texture = ExtResource("2_4i384")
137+
138+
[node name="Down" type="Sprite2D" parent="Control/MarginContainer3"]
139+
position = Vector2(27.0001, 145)
140+
rotation = 1.5708
141+
texture = ExtResource("2_4i384")
142+
143+
[node name="Right" type="Sprite2D" parent="Control/MarginContainer3"]
144+
position = Vector2(27.0001, 186)
145+
texture = ExtResource("2_4i384")
146+
147+
[node name="DoubleNote" type="Sprite2D" parent="Control/MarginContainer3"]
148+
position = Vector2(27, 60)
149+
texture = ExtResource("4_m6low")
150+
151+
[node name="HealNote" type="Sprite2D" parent="Control/MarginContainer3"]
152+
position = Vector2(29, 100)
153+
texture = ExtResource("5_8kiq2")
154+
155+
[node name="SingleNote" type="Sprite2D" parent="Control/MarginContainer3"]
156+
position = Vector2(29, 146)
157+
texture = ExtResource("6_uonw3")
158+
159+
[node name="VampireNote" type="Sprite2D" parent="Control/MarginContainer3"]
160+
position = Vector2(28, 187)
161+
texture = ExtResource("7_rbdrm")

scenes/UI/assets/combobar.png

650 Bytes
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://dp3vkn65j4o3s"
6+
path="res://.godot/imported/combobar.png-c835d811fb05e4fd220a08e5b5cab683.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://scenes/UI/assets/combobar.png"
14+
dest_files=["res://.godot/imported/combobar.png-c835d811fb05e4fd220a08e5b5cab683.ctex"]
15+
16+
[params]
17+
18+
compress/mode=0
19+
compress/high_quality=false
20+
compress/lossy_quality=0.7
21+
compress/hdr_compression=1
22+
compress/normal_map=0
23+
compress/channel_pack=0
24+
mipmaps/generate=false
25+
mipmaps/limit=-1
26+
roughness/mode=0
27+
roughness/src_normal=""
28+
process/fix_alpha_border=true
29+
process/premult_alpha=false
30+
process/normal_map_invert_y=false
31+
process/hdr_as_srgb=false
32+
process/hdr_clamp_exposure=false
33+
process/size_limit=0
34+
detect_3d/compress_to=1

0 commit comments

Comments
 (0)