Skip to content

Commit d3b23f6

Browse files
cornerloanLifeHckr
andauthored
Note icon + vertical scrolling options (#237)
* Very hardcoded, but mostly works Doesn't "live" update. all the changes are on load, so changing the icons in the middle of a battle won't apply any changes. changing outside of battle works perfectly though. * Simplify Swap Arrow/Note Sprite Logic * Note symbol selection is now checkbox * Vertical Scroll Putting this here for safe keeping * Integrate Vertical Scroll Toggle Add new config setting Attempt to swap between normal CM and DW.CM based on setting Split Lane Lines into separate sprite Attempt to adjust sprites and combo text based on setting --------- Co-authored-by: LifeHckr <jarodthereal@gmail.com>
1 parent 75610ea commit d3b23f6

26 files changed

Lines changed: 464 additions & 14 deletions

Globals/SaveSystem.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public static class SaveSystem
2828
private const int DefaultInputControllerSecondary = 10; //right bumper
2929
private const int DefaultInputControllerInventory = 4; //back button
3030
private const string DefaultLanguage = "en";
31+
private const bool DefaultTypeIsArrow = false;
32+
private const bool DefaultVerticalScroll = false;
3133
private const bool DefaultHighCon = false;
3234
private const bool DefaultFirstTime = true;
3335
private const bool DefaultHasWon = false;
@@ -49,9 +51,11 @@ public enum ConfigSettings
4951
InputControllerSecondary,
5052
InputControllerInventory,
5153
LanguageKey,
54+
TypeIsArrow,
5255
HighContrast,
5356
FirstTime,
5457
HasWon,
58+
VerticalScroll,
5559
}
5660

5761
/**
@@ -75,9 +79,11 @@ private static void InitConfig()
7579
UpdateConfig(ConfigSettings.InputControllerSecondary, DefaultInputControllerSecondary);
7680
UpdateConfig(ConfigSettings.InputControllerInventory, DefaultInputControllerInventory);
7781
UpdateConfig(ConfigSettings.LanguageKey, DefaultLanguage);
82+
UpdateConfig(ConfigSettings.TypeIsArrow, DefaultTypeIsArrow);
7883
UpdateConfig(ConfigSettings.HighContrast, DefaultHighCon);
7984
UpdateConfig(ConfigSettings.FirstTime, DefaultFirstTime);
8085
UpdateConfig(ConfigSettings.HasWon, DefaultHasWon);
86+
UpdateConfig(ConfigSettings.VerticalScroll, DefaultVerticalScroll);
8187
}
8288

8389
private static void SaveConfig()
@@ -136,6 +142,12 @@ public static void UpdateConfig(ConfigSettings setting, Variant value)
136142
case ConfigSettings.LanguageKey:
137143
_curConfigData.SetValue("Options", "LanguageKey", value);
138144
break;
145+
case ConfigSettings.TypeIsArrow:
146+
_curConfigData.SetValue("Options", "TypeIsArrow", value);
147+
break;
148+
case ConfigSettings.VerticalScroll:
149+
_curConfigData.SetValue("Options", "VerticalScroll", value);
150+
break;
139151
case ConfigSettings.HighContrast:
140152
_curConfigData.SetValue("Options", "HighContrast", value);
141153
break;
@@ -280,6 +292,10 @@ public static Variant GetConfigValue(ConfigSettings setting)
280292
);
281293
case ConfigSettings.LanguageKey:
282294
return _curConfigData.GetValue("Options", "LanguageKey", DefaultLanguage);
295+
case ConfigSettings.TypeIsArrow:
296+
return _curConfigData.GetValue("Options", "TypeIsArrow", DefaultTypeIsArrow);
297+
case ConfigSettings.VerticalScroll:
298+
return _curConfigData.GetValue("Options", "VerticalScroll", DefaultVerticalScroll);
283299
case ConfigSettings.HighContrast:
284300
return _curConfigData.GetValue("Options", "HighContrast", DefaultHighCon);
285301
case ConfigSettings.FirstTime:

Globals/StageProducer.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ public void InitFromCfg()
5959
.GetConfigValue(SaveSystem.ConfigSettings.HighContrast)
6060
.AsBool();
6161
GetTree().Root.CallDeferred("add_child", ContrastFilter);
62+
InputHandler.UseArrows = SaveSystem
63+
.GetConfigValue(SaveSystem.ConfigSettings.TypeIsArrow)
64+
.AsBool();
65+
BattleDirector.VerticalScroll = SaveSystem
66+
.GetConfigValue(SaveSystem.ConfigSettings.VerticalScroll)
67+
.AsBool();
6268
}
6369

6470
private void GenerateMapConsistent()

Globals/Translations/Translations.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ INVENTORY_TAB_NOTES,Notes,乐谱
127127
INVENTORY_TAB_RELICS,Relics,遗物
128128
OPTIONS_VOLUME_LABEL,Master Volume,最终音量设置
129129
OPTIONS_CONTRAST_LABEL,High Contrast,高对比度模式
130+
OPTIONS_NOTE_SWAP,Use arrows?,使用箭头?
131+
OPTIONS_VERT_SCROLL,Vertical Scroll?,垂直滚动?
130132
HOW_TO_PLAY,How to Play,如何游玩
131133
HOW_TO_PLAY_BLOCK1,Hit notes to\nbuild combo,点击音符\n以建立连击
132134
HOW_TO_PLAY_BLOCK2,Place notes when\ncombo is full,当连击满\n时放置音符

Scenes/3DWizard/3DWizard.tscn

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
[gd_scene load_steps=8 format=3 uid="uid://dyd2nc2sgt0qw"]
2+
3+
[ext_resource type="Script" uid="uid://b07ivt3coc3lm" path="res://Scenes/3DWizard/DimensionalWizard.cs" id="1_7ax4h"]
4+
[ext_resource type="PackedScene" uid="uid://dfevfib11kou1" path="res://Scenes/ChartViewport/ChartViewport.tscn" id="1_7h5n6"]
5+
[ext_resource type="Shader" uid="uid://dp36iuuy414k1" path="res://SharedAssets/StarryNight.gdshader" id="2_xxbq6"]
6+
7+
[sub_resource type="ShaderMaterial" id="ShaderMaterial_xxbq6"]
8+
shader = ExtResource("2_xxbq6")
9+
shader_parameter/bg_top_color = Vector4(0.18, 0.08, 0.12, 0)
10+
shader_parameter/bg_bottom_color = Vector4(0.028, 0.008, 0.184, 0)
11+
shader_parameter/gradient_ratio = 1.0
12+
shader_parameter/time_scale = 1.0
13+
14+
[sub_resource type="ViewportTexture" id="ViewportTexture_xxbq6"]
15+
viewport_path = NodePath("SubViewport")
16+
17+
[sub_resource type="ViewportTexture" id="ViewportTexture_7ax4h"]
18+
viewport_path = NodePath("BG")
19+
20+
[sub_resource type="Environment" id="Environment_7h5n6"]
21+
ambient_light_source = 1
22+
reflected_light_source = 1
23+
24+
[node name="3DWizard" type="Node3D" node_paths=PackedStringArray("CM")]
25+
script = ExtResource("1_7ax4h")
26+
CM = NodePath("SubViewport/VPContainer")
27+
28+
[node name="BG" type="SubViewport" parent="."]
29+
size = Vector2i(1200, 500)
30+
31+
[node name="StarShader" type="ColorRect" parent="BG"]
32+
z_index = -1
33+
material = SubResource("ShaderMaterial_xxbq6")
34+
offset_right = 1200.0
35+
offset_bottom = 500.0
36+
color = Color(0, 0, 0, 1)
37+
38+
[node name="SubViewport" type="SubViewport" parent="."]
39+
transparent_bg = true
40+
size = Vector2i(680, 940)
41+
42+
[node name="VPContainer" parent="SubViewport" instance=ExtResource("1_7h5n6")]
43+
offset_top = 380.0
44+
offset_bottom = 560.0
45+
46+
[node name="Sprite3D" type="Sprite3D" parent="."]
47+
transform = Transform3D(-4.37114e-08, -1, 0, 0.617036, -2.69715e-08, 0.786935, -0.786935, 3.4398e-08, 0.617036, 0, 0, 0.138215)
48+
texture = SubResource("ViewportTexture_xxbq6")
49+
50+
[node name="BGSprite" type="Sprite3D" parent="."]
51+
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.581, -1.032)
52+
texture = SubResource("ViewportTexture_7ax4h")
53+
54+
[node name="Camera3D" type="Camera3D" parent="."]
55+
transform = Transform3D(1, 0, 0, 0, 0.999729, -0.023298, 0, 0.023298, 0.999729, 0, -1.55715, 3.51069)
56+
environment = SubResource("Environment_7h5n6")
57+
fov = 53.5
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using System;
2+
using Godot;
3+
4+
public partial class DimensionalWizard : Node3D
5+
{
6+
[Export]
7+
public ChartManager CM;
8+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uid://b07ivt3coc3lm

Scenes/BattleDirector/BattleScene.tscn

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
[gd_scene load_steps=12 format=3 uid="uid://b0mrgr7h0ty1y"]
1+
[gd_scene load_steps=13 format=3 uid="uid://b0mrgr7h0ty1y"]
22

33
[ext_resource type="Script" uid="uid://bttu0wmy2fp64" path="res://Scenes/BattleDirector/Scripts/BattleDirector.cs" id="1_jmdo1"]
44
[ext_resource type="Script" uid="uid://pl57giqyhckb" path="res://Scenes/UI/Scripts/MenuModule.cs" id="2_ka0ws"]
55
[ext_resource type="Script" uid="uid://tg14hkh1n7iv" path="res://Scenes/BattleDirector/Scripts/Conductor.cs" id="3_elcaj"]
66
[ext_resource type="PackedScene" uid="uid://duhiilcv4tat3" path="res://Scenes/BattleDirector/NotePlacementBar.tscn" id="4_qk7om"]
7-
[ext_resource type="PackedScene" uid="uid://dfevfib11kou1" path="res://Scenes/ChartViewport/ChartViewport.tscn" id="5_r2xh0"]
7+
[ext_resource type="PackedScene" uid="uid://dyd2nc2sgt0qw" path="res://Scenes/3DWizard/3DWizard.tscn" id="5_e25q1"]
88
[ext_resource type="Texture2D" uid="uid://qhwve7fik4do" path="res://SharedAssets/BackGround_Full.png" id="6_0jtpx"]
9+
[ext_resource type="PackedScene" uid="uid://dfevfib11kou1" path="res://Scenes/ChartViewport/ChartViewport.tscn" id="6_e25q1"]
910
[ext_resource type="Script" uid="uid://cp6t6haqyef7o" path="res://Scenes/AreaBasedBackground.cs" id="7_6k2qj"]
1011
[ext_resource type="Texture2D" uid="uid://dbjotl0v1ymia" path="res://SharedAssets/BattleFrame1.png" id="7_klvil"]
1112
[ext_resource type="Theme" uid="uid://d37e3tpsbxwak" path="res://Scenes/UI/Assets/GeneralTheme.tres" id="8_62qim"]
@@ -19,13 +20,14 @@ gradient = SubResource("Gradient_8uy3a")
1920
fill_from = Vector2(1, 0)
2021
fill_to = Vector2(0.738532, 1)
2122

22-
[node name="ProtoBattleDirector" type="Node2D" node_paths=PackedStringArray("PuppetMarkers", "_countdownLabel", "CD", "CM", "NPB", "Audio", "FocusedButton")]
23+
[node name="ProtoBattleDirector" type="Node2D" node_paths=PackedStringArray("PuppetMarkers", "_countdownLabel", "CD", "CM", "DW", "NPB", "Audio", "FocusedButton")]
2324
process_mode = 1
2425
script = ExtResource("1_jmdo1")
2526
PuppetMarkers = [NodePath("PlayerMarker"), NodePath("Enemy1Marker"), NodePath("Enemy2Marker"), NodePath("Enemy3Marker")]
2627
_countdownLabel = NodePath("CountInControl/Countdown")
2728
CD = NodePath("Conductor")
28-
CM = NodePath("SubViewport")
29+
CM = NodePath("VPContainer")
30+
DW = NodePath("3D/SubViewport/3DWizard")
2931
NPB = NodePath("NotePlacementBar")
3032
Audio = NodePath("AudioStreamPlayer")
3133
FocusedButton = NodePath("StartButton")
@@ -37,9 +39,8 @@ metadata/_edit_lock_ = true
3739
script = ExtResource("2_ka0ws")
3840
CurSceneNode = NodePath("..")
3941

40-
[node name="Conductor" type="Node" parent="." node_paths=PackedStringArray("CM")]
42+
[node name="Conductor" type="Node" parent="."]
4143
script = ExtResource("3_elcaj")
42-
CM = NodePath("../SubViewport")
4344

4445
[node name="PlayerMarker" type="Marker2D" parent="."]
4546
position = Vector2(158, 125)
@@ -64,7 +65,22 @@ offset_right = 81.0
6465
offset_bottom = 175.0
6566
texture = SubResource("GradientTexture2D_bajwn")
6667

67-
[node name="SubViewport" parent="." instance=ExtResource("5_r2xh0")]
68+
[node name="3D" type="SubViewportContainer" parent="."]
69+
offset_left = 80.0
70+
offset_top = 180.0
71+
offset_right = 560.0
72+
offset_bottom = 360.0
73+
74+
[node name="SubViewport" type="SubViewport" parent="3D"]
75+
handle_input_locally = false
76+
size = Vector2i(480, 180)
77+
render_target_update_mode = 4
78+
79+
[node name="3DWizard" parent="3D/SubViewport" instance=ExtResource("5_e25q1")]
80+
process_mode = 4
81+
visible = false
82+
83+
[node name="VPContainer" parent="." instance=ExtResource("6_e25q1")]
6884
offset_left = 80.0
6985
offset_top = 180.0
7086
offset_right = 560.0

Scenes/BattleDirector/Scripts/BattleDirector.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public partial class BattleDirector : Node2D
2525
[Export]
2626
private ChartManager CM;
2727

28+
[Export]
29+
private DimensionalWizard DW;
30+
2831
[Export]
2932
public NotePlacementBar NPB;
3033

@@ -40,6 +43,7 @@ public partial class BattleDirector : Node2D
4043

4144
public static bool AutoPlay = false;
4245
public static bool PlayerDisabled = false;
46+
public static bool VerticalScroll = false;
4347

4448
#endregion
4549

@@ -110,7 +114,15 @@ public override void _Ready()
110114
InitPlayer();
111115
InitEnemies();
112116
InitScoringGuide();
113-
CD.Initialize(curChart, songLen, _enemies);
117+
if (VerticalScroll)
118+
{
119+
CM.ProcessMode = ProcessModeEnum.Disabled;
120+
CM.Visible = false;
121+
CM = DW.CM;
122+
DW.Visible = true;
123+
DW.ProcessMode = ProcessModeEnum.Inherit;
124+
}
125+
CD.Initialize(CM, curChart, songLen, _enemies);
114126

115127
CD.NoteInputEvent += OnTimedInput;
116128

Scenes/BattleDirector/Scripts/Conductor.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88
public partial class Conductor : Node
99
{
10-
[Export]
1110
private ChartManager CM;
1211
private MidiMaestro MM;
1312

@@ -19,11 +18,17 @@ public partial class Conductor : Node
1918
private bool _initialized;
2019

2120
#region Initialization
22-
public void Initialize(NoteChart curSong, double songLen, EnemyPuppet[] enemies = null)
21+
public void Initialize(
22+
ChartManager cm,
23+
NoteChart curSong,
24+
double songLen,
25+
EnemyPuppet[] enemies = null
26+
)
2327
{
2428
if (_initialized)
2529
return;
2630

31+
CM = cm;
2732
MM = new MidiMaestro(curSong);
2833
CM.ArrowFromInput += ReceiveNoteInput;
2934

Scenes/BattleDirector/Tutorial/Toriel.tscn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ position = Vector2(35, 202)
115115
position = Vector2(59, 266)
116116

117117
[node name="NoteMarker" type="Marker2D" parent="."]
118-
position = Vector2(364, 294)
118+
position = Vector2(392, 246)
119119

120120
[node name="LoopMarker" type="Marker2D" parent="."]
121121
position = Vector2(129, 270)

0 commit comments

Comments
 (0)