diff --git a/Globals/SaveSystem.cs b/Globals/SaveSystem.cs index 63ea5acf..274c920b 100644 --- a/Globals/SaveSystem.cs +++ b/Globals/SaveSystem.cs @@ -28,6 +28,8 @@ public static class SaveSystem private const int DefaultInputControllerSecondary = 10; //right bumper private const int DefaultInputControllerInventory = 4; //back button private const string DefaultLanguage = "en"; + private const bool DefaultTypeIsArrow = false; + private const bool DefaultVerticalScroll = false; private const bool DefaultHighCon = false; private const bool DefaultFirstTime = true; private const bool DefaultHasWon = false; @@ -49,9 +51,11 @@ public enum ConfigSettings InputControllerSecondary, InputControllerInventory, LanguageKey, + TypeIsArrow, HighContrast, FirstTime, HasWon, + VerticalScroll, } /** @@ -75,9 +79,11 @@ private static void InitConfig() UpdateConfig(ConfigSettings.InputControllerSecondary, DefaultInputControllerSecondary); UpdateConfig(ConfigSettings.InputControllerInventory, DefaultInputControllerInventory); UpdateConfig(ConfigSettings.LanguageKey, DefaultLanguage); + UpdateConfig(ConfigSettings.TypeIsArrow, DefaultTypeIsArrow); UpdateConfig(ConfigSettings.HighContrast, DefaultHighCon); UpdateConfig(ConfigSettings.FirstTime, DefaultFirstTime); UpdateConfig(ConfigSettings.HasWon, DefaultHasWon); + UpdateConfig(ConfigSettings.VerticalScroll, DefaultVerticalScroll); } private static void SaveConfig() @@ -136,6 +142,12 @@ public static void UpdateConfig(ConfigSettings setting, Variant value) case ConfigSettings.LanguageKey: _curConfigData.SetValue("Options", "LanguageKey", value); break; + case ConfigSettings.TypeIsArrow: + _curConfigData.SetValue("Options", "TypeIsArrow", value); + break; + case ConfigSettings.VerticalScroll: + _curConfigData.SetValue("Options", "VerticalScroll", value); + break; case ConfigSettings.HighContrast: _curConfigData.SetValue("Options", "HighContrast", value); break; @@ -280,6 +292,10 @@ public static Variant GetConfigValue(ConfigSettings setting) ); case ConfigSettings.LanguageKey: return _curConfigData.GetValue("Options", "LanguageKey", DefaultLanguage); + case ConfigSettings.TypeIsArrow: + return _curConfigData.GetValue("Options", "TypeIsArrow", DefaultTypeIsArrow); + case ConfigSettings.VerticalScroll: + return _curConfigData.GetValue("Options", "VerticalScroll", DefaultVerticalScroll); case ConfigSettings.HighContrast: return _curConfigData.GetValue("Options", "HighContrast", DefaultHighCon); case ConfigSettings.FirstTime: diff --git a/Globals/StageProducer.cs b/Globals/StageProducer.cs index 60bdba74..8ed9ffe4 100644 --- a/Globals/StageProducer.cs +++ b/Globals/StageProducer.cs @@ -59,6 +59,12 @@ public void InitFromCfg() .GetConfigValue(SaveSystem.ConfigSettings.HighContrast) .AsBool(); GetTree().Root.CallDeferred("add_child", ContrastFilter); + InputHandler.UseArrows = SaveSystem + .GetConfigValue(SaveSystem.ConfigSettings.TypeIsArrow) + .AsBool(); + BattleDirector.VerticalScroll = SaveSystem + .GetConfigValue(SaveSystem.ConfigSettings.VerticalScroll) + .AsBool(); } private void GenerateMapConsistent() diff --git a/Globals/Translations/Translations.csv b/Globals/Translations/Translations.csv index 6d214faa..70685c9c 100644 --- a/Globals/Translations/Translations.csv +++ b/Globals/Translations/Translations.csv @@ -127,6 +127,8 @@ INVENTORY_TAB_NOTES,Notes,乐谱 INVENTORY_TAB_RELICS,Relics,遗物 OPTIONS_VOLUME_LABEL,Master Volume,最终音量设置 OPTIONS_CONTRAST_LABEL,High Contrast,高对比度模式 +OPTIONS_NOTE_SWAP,Use arrows?,使用箭头? +OPTIONS_VERT_SCROLL,Vertical Scroll?,垂直滚动? HOW_TO_PLAY,How to Play,如何游玩 HOW_TO_PLAY_BLOCK1,Hit notes to\nbuild combo,点击音符\n以建立连击 HOW_TO_PLAY_BLOCK2,Place notes when\ncombo is full,当连击满\n时放置音符 diff --git a/Scenes/3DWizard/3DWizard.tscn b/Scenes/3DWizard/3DWizard.tscn new file mode 100644 index 00000000..60ae9079 --- /dev/null +++ b/Scenes/3DWizard/3DWizard.tscn @@ -0,0 +1,57 @@ +[gd_scene load_steps=8 format=3 uid="uid://dyd2nc2sgt0qw"] + +[ext_resource type="Script" uid="uid://b07ivt3coc3lm" path="res://Scenes/3DWizard/DimensionalWizard.cs" id="1_7ax4h"] +[ext_resource type="PackedScene" uid="uid://dfevfib11kou1" path="res://Scenes/ChartViewport/ChartViewport.tscn" id="1_7h5n6"] +[ext_resource type="Shader" uid="uid://dp36iuuy414k1" path="res://SharedAssets/StarryNight.gdshader" id="2_xxbq6"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_xxbq6"] +shader = ExtResource("2_xxbq6") +shader_parameter/bg_top_color = Vector4(0.18, 0.08, 0.12, 0) +shader_parameter/bg_bottom_color = Vector4(0.028, 0.008, 0.184, 0) +shader_parameter/gradient_ratio = 1.0 +shader_parameter/time_scale = 1.0 + +[sub_resource type="ViewportTexture" id="ViewportTexture_xxbq6"] +viewport_path = NodePath("SubViewport") + +[sub_resource type="ViewportTexture" id="ViewportTexture_7ax4h"] +viewport_path = NodePath("BG") + +[sub_resource type="Environment" id="Environment_7h5n6"] +ambient_light_source = 1 +reflected_light_source = 1 + +[node name="3DWizard" type="Node3D" node_paths=PackedStringArray("CM")] +script = ExtResource("1_7ax4h") +CM = NodePath("SubViewport/VPContainer") + +[node name="BG" type="SubViewport" parent="."] +size = Vector2i(1200, 500) + +[node name="StarShader" type="ColorRect" parent="BG"] +z_index = -1 +material = SubResource("ShaderMaterial_xxbq6") +offset_right = 1200.0 +offset_bottom = 500.0 +color = Color(0, 0, 0, 1) + +[node name="SubViewport" type="SubViewport" parent="."] +transparent_bg = true +size = Vector2i(680, 940) + +[node name="VPContainer" parent="SubViewport" instance=ExtResource("1_7h5n6")] +offset_top = 380.0 +offset_bottom = 560.0 + +[node name="Sprite3D" type="Sprite3D" parent="."] +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) +texture = SubResource("ViewportTexture_xxbq6") + +[node name="BGSprite" type="Sprite3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.581, -1.032) +texture = SubResource("ViewportTexture_7ax4h") + +[node name="Camera3D" type="Camera3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 0.999729, -0.023298, 0, 0.023298, 0.999729, 0, -1.55715, 3.51069) +environment = SubResource("Environment_7h5n6") +fov = 53.5 diff --git a/Scenes/3DWizard/DimensionalWizard.cs b/Scenes/3DWizard/DimensionalWizard.cs new file mode 100644 index 00000000..8c1de5e4 --- /dev/null +++ b/Scenes/3DWizard/DimensionalWizard.cs @@ -0,0 +1,8 @@ +using System; +using Godot; + +public partial class DimensionalWizard : Node3D +{ + [Export] + public ChartManager CM; +} diff --git a/Scenes/3DWizard/DimensionalWizard.cs.uid b/Scenes/3DWizard/DimensionalWizard.cs.uid new file mode 100644 index 00000000..090d7a10 --- /dev/null +++ b/Scenes/3DWizard/DimensionalWizard.cs.uid @@ -0,0 +1 @@ +uid://b07ivt3coc3lm diff --git a/Scenes/BattleDirector/BattleScene.tscn b/Scenes/BattleDirector/BattleScene.tscn index c135a47e..5d2b6970 100644 --- a/Scenes/BattleDirector/BattleScene.tscn +++ b/Scenes/BattleDirector/BattleScene.tscn @@ -1,11 +1,12 @@ -[gd_scene load_steps=12 format=3 uid="uid://b0mrgr7h0ty1y"] +[gd_scene load_steps=13 format=3 uid="uid://b0mrgr7h0ty1y"] [ext_resource type="Script" uid="uid://bttu0wmy2fp64" path="res://Scenes/BattleDirector/Scripts/BattleDirector.cs" id="1_jmdo1"] [ext_resource type="Script" uid="uid://pl57giqyhckb" path="res://Scenes/UI/Scripts/MenuModule.cs" id="2_ka0ws"] [ext_resource type="Script" uid="uid://tg14hkh1n7iv" path="res://Scenes/BattleDirector/Scripts/Conductor.cs" id="3_elcaj"] [ext_resource type="PackedScene" uid="uid://duhiilcv4tat3" path="res://Scenes/BattleDirector/NotePlacementBar.tscn" id="4_qk7om"] -[ext_resource type="PackedScene" uid="uid://dfevfib11kou1" path="res://Scenes/ChartViewport/ChartViewport.tscn" id="5_r2xh0"] +[ext_resource type="PackedScene" uid="uid://dyd2nc2sgt0qw" path="res://Scenes/3DWizard/3DWizard.tscn" id="5_e25q1"] [ext_resource type="Texture2D" uid="uid://qhwve7fik4do" path="res://SharedAssets/BackGround_Full.png" id="6_0jtpx"] +[ext_resource type="PackedScene" uid="uid://dfevfib11kou1" path="res://Scenes/ChartViewport/ChartViewport.tscn" id="6_e25q1"] [ext_resource type="Script" uid="uid://cp6t6haqyef7o" path="res://Scenes/AreaBasedBackground.cs" id="7_6k2qj"] [ext_resource type="Texture2D" uid="uid://dbjotl0v1ymia" path="res://SharedAssets/BattleFrame1.png" id="7_klvil"] [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") fill_from = Vector2(1, 0) fill_to = Vector2(0.738532, 1) -[node name="ProtoBattleDirector" type="Node2D" node_paths=PackedStringArray("PuppetMarkers", "_countdownLabel", "CD", "CM", "NPB", "Audio", "FocusedButton")] +[node name="ProtoBattleDirector" type="Node2D" node_paths=PackedStringArray("PuppetMarkers", "_countdownLabel", "CD", "CM", "DW", "NPB", "Audio", "FocusedButton")] process_mode = 1 script = ExtResource("1_jmdo1") PuppetMarkers = [NodePath("PlayerMarker"), NodePath("Enemy1Marker"), NodePath("Enemy2Marker"), NodePath("Enemy3Marker")] _countdownLabel = NodePath("CountInControl/Countdown") CD = NodePath("Conductor") -CM = NodePath("SubViewport") +CM = NodePath("VPContainer") +DW = NodePath("3D/SubViewport/3DWizard") NPB = NodePath("NotePlacementBar") Audio = NodePath("AudioStreamPlayer") FocusedButton = NodePath("StartButton") @@ -37,9 +39,8 @@ metadata/_edit_lock_ = true script = ExtResource("2_ka0ws") CurSceneNode = NodePath("..") -[node name="Conductor" type="Node" parent="." node_paths=PackedStringArray("CM")] +[node name="Conductor" type="Node" parent="."] script = ExtResource("3_elcaj") -CM = NodePath("../SubViewport") [node name="PlayerMarker" type="Marker2D" parent="."] position = Vector2(158, 125) @@ -64,7 +65,22 @@ offset_right = 81.0 offset_bottom = 175.0 texture = SubResource("GradientTexture2D_bajwn") -[node name="SubViewport" parent="." instance=ExtResource("5_r2xh0")] +[node name="3D" type="SubViewportContainer" parent="."] +offset_left = 80.0 +offset_top = 180.0 +offset_right = 560.0 +offset_bottom = 360.0 + +[node name="SubViewport" type="SubViewport" parent="3D"] +handle_input_locally = false +size = Vector2i(480, 180) +render_target_update_mode = 4 + +[node name="3DWizard" parent="3D/SubViewport" instance=ExtResource("5_e25q1")] +process_mode = 4 +visible = false + +[node name="VPContainer" parent="." instance=ExtResource("6_e25q1")] offset_left = 80.0 offset_top = 180.0 offset_right = 560.0 diff --git a/Scenes/BattleDirector/Scripts/BattleDirector.cs b/Scenes/BattleDirector/Scripts/BattleDirector.cs index 55c17661..aface55c 100644 --- a/Scenes/BattleDirector/Scripts/BattleDirector.cs +++ b/Scenes/BattleDirector/Scripts/BattleDirector.cs @@ -25,6 +25,9 @@ public partial class BattleDirector : Node2D [Export] private ChartManager CM; + [Export] + private DimensionalWizard DW; + [Export] public NotePlacementBar NPB; @@ -40,6 +43,7 @@ public partial class BattleDirector : Node2D public static bool AutoPlay = false; public static bool PlayerDisabled = false; + public static bool VerticalScroll = false; #endregion @@ -110,7 +114,15 @@ public override void _Ready() InitPlayer(); InitEnemies(); InitScoringGuide(); - CD.Initialize(curChart, songLen, _enemies); + if (VerticalScroll) + { + CM.ProcessMode = ProcessModeEnum.Disabled; + CM.Visible = false; + CM = DW.CM; + DW.Visible = true; + DW.ProcessMode = ProcessModeEnum.Inherit; + } + CD.Initialize(CM, curChart, songLen, _enemies); CD.NoteInputEvent += OnTimedInput; diff --git a/Scenes/BattleDirector/Scripts/Conductor.cs b/Scenes/BattleDirector/Scripts/Conductor.cs index ddbd59f0..034d7acf 100644 --- a/Scenes/BattleDirector/Scripts/Conductor.cs +++ b/Scenes/BattleDirector/Scripts/Conductor.cs @@ -7,7 +7,6 @@ */ public partial class Conductor : Node { - [Export] private ChartManager CM; private MidiMaestro MM; @@ -19,11 +18,17 @@ public partial class Conductor : Node private bool _initialized; #region Initialization - public void Initialize(NoteChart curSong, double songLen, EnemyPuppet[] enemies = null) + public void Initialize( + ChartManager cm, + NoteChart curSong, + double songLen, + EnemyPuppet[] enemies = null + ) { if (_initialized) return; + CM = cm; MM = new MidiMaestro(curSong); CM.ArrowFromInput += ReceiveNoteInput; diff --git a/Scenes/BattleDirector/Tutorial/Toriel.tscn b/Scenes/BattleDirector/Tutorial/Toriel.tscn index 12a97537..4b5ce332 100644 --- a/Scenes/BattleDirector/Tutorial/Toriel.tscn +++ b/Scenes/BattleDirector/Tutorial/Toriel.tscn @@ -115,7 +115,7 @@ position = Vector2(35, 202) position = Vector2(59, 266) [node name="NoteMarker" type="Marker2D" parent="."] -position = Vector2(364, 294) +position = Vector2(392, 246) [node name="LoopMarker" type="Marker2D" parent="."] position = Vector2(129, 270) diff --git a/Scenes/ChartViewport/ChartViewport.tscn b/Scenes/ChartViewport/ChartViewport.tscn index f65b608e..573c3212 100644 --- a/Scenes/ChartViewport/ChartViewport.tscn +++ b/Scenes/ChartViewport/ChartViewport.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=7 format=3 uid="uid://dfevfib11kou1"] +[gd_scene load_steps=8 format=3 uid="uid://dfevfib11kou1"] [ext_resource type="Script" uid="uid://btgmfxqoe2wqx" path="res://Scenes/ChartViewport/Scripts/ChartManager.cs" id="1_ruh2l"] +[ext_resource type="Texture2D" uid="uid://3kimu20ebgtu" path="res://Scenes/ChartViewport/LaneLines.png" id="2_543sd"] [ext_resource type="Texture2D" uid="uid://cp78odda2doab" path="res://Scenes/ChartViewport/LoopMarker.png" id="2_q5cjc"] [ext_resource type="Script" uid="uid://cf58ep1c2o0q2" path="res://Scenes/ChartViewport/Scripts/Loopable.cs" id="3_5u57h"] [ext_resource type="PackedScene" uid="uid://bn8txx53xlguw" path="res://Scenes/NoteManager/NoteManager.tscn" id="4_fd5fw"] @@ -29,6 +30,13 @@ render_target_update_mode = 4 position = Vector2(-50, 0) anchor_mode = 0 +[node name="LaneLines" type="TextureRect" parent="SubViewport"] +offset_left = -50.0 +offset_top = 45.0 +offset_right = 480.0 +offset_bottom = 135.0 +texture = ExtResource("2_543sd") + [node name="StarShader" type="ColorRect" parent="SubViewport"] z_index = -1 material = SubResource("ShaderMaterial_5uw0y") diff --git a/Scenes/ChartViewport/LaneLines.png b/Scenes/ChartViewport/LaneLines.png new file mode 100644 index 00000000..4d3d6bcf Binary files /dev/null and b/Scenes/ChartViewport/LaneLines.png differ diff --git a/Scenes/ChartViewport/LaneLines.png.import b/Scenes/ChartViewport/LaneLines.png.import new file mode 100644 index 00000000..e59de181 --- /dev/null +++ b/Scenes/ChartViewport/LaneLines.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://3kimu20ebgtu" +path="res://.godot/imported/LaneLines.png-fa4c66b9892f799286e4b25955ab6fae.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Scenes/ChartViewport/LaneLines.png" +dest_files=["res://.godot/imported/LaneLines.png-fa4c66b9892f799286e4b25955ab6fae.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Scenes/ChartViewport/Scripts/ChartManager.cs b/Scenes/ChartViewport/Scripts/ChartManager.cs index e4db9e61..71c96b5d 100644 --- a/Scenes/ChartViewport/Scripts/ChartManager.cs +++ b/Scenes/ChartViewport/Scripts/ChartManager.cs @@ -281,6 +281,11 @@ public void ComboText(Timing timed, ArrowType arrow, int currentCombo) TextParticle newText = new TextParticle(); AddChild(newText); newText.Position = IH.Arrows[(int)arrow].Node.Position - newText.Size / 2; + if (BattleDirector.VerticalScroll) + { + newText.RotationDegrees += 90f; + newText.Position += Vector2.Right * 70; + } IH.FeedbackEffect(arrow, timed); newText.Text = Tr("BATTLE_ROOM_" + timed.ToString().ToUpper()) + $" {currentCombo}"; } diff --git a/Scenes/Maps/Scripts/Cartographer.cs b/Scenes/Maps/Scripts/Cartographer.cs index def841d0..f54fc0fa 100644 --- a/Scenes/Maps/Scripts/Cartographer.cs +++ b/Scenes/Maps/Scripts/Cartographer.cs @@ -74,6 +74,10 @@ public override void _Process(double delta) public override void _EnterTree() { BgAudioPlayer.LiveInstance.PlayLevelMusic(); + if (!SaveSystem.GetConfigValue(SaveSystem.ConfigSettings.FirstTime).AsBool()) + return; + BattleDirector.VerticalScroll = false; + SaveSystem.UpdateConfig(SaveSystem.ConfigSettings.VerticalScroll, false); } private Vector2 GetPosition(int x, int y) diff --git a/Scenes/NoteManager/Assets/Arrow_Outline.png b/Scenes/NoteManager/Assets/Arrow_Outline.png new file mode 100644 index 00000000..d030bb58 Binary files /dev/null and b/Scenes/NoteManager/Assets/Arrow_Outline.png differ diff --git a/Scenes/NoteManager/Assets/Arrow_Outline.png.import b/Scenes/NoteManager/Assets/Arrow_Outline.png.import new file mode 100644 index 00000000..355d468a --- /dev/null +++ b/Scenes/NoteManager/Assets/Arrow_Outline.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c2j0nmuox6flp" +path="res://.godot/imported/Arrow_Outline.png-dbc89009df5f433f3228bbd1180824d6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Scenes/NoteManager/Assets/Arrow_Outline.png" +dest_files=["res://.godot/imported/Arrow_Outline.png-dbc89009df5f433f3228bbd1180824d6.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Scenes/NoteManager/Assets/New_Arrow.png b/Scenes/NoteManager/Assets/New_Arrow.png new file mode 100644 index 00000000..31a28ae2 Binary files /dev/null and b/Scenes/NoteManager/Assets/New_Arrow.png differ diff --git a/Scenes/NoteManager/Assets/New_Arrow.png.import b/Scenes/NoteManager/Assets/New_Arrow.png.import new file mode 100644 index 00000000..165cf091 --- /dev/null +++ b/Scenes/NoteManager/Assets/New_Arrow.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cvua2fv6dk2pk" +path="res://.godot/imported/New_Arrow.png-b9cc790fe65b856a0cee80c6a83cb011.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Scenes/NoteManager/Assets/New_Arrow.png" +dest_files=["res://.godot/imported/New_Arrow.png-b9cc790fe65b856a0cee80c6a83cb011.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Scenes/NoteManager/Scripts/InputHandler.cs b/Scenes/NoteManager/Scripts/InputHandler.cs index 682895b6..c61dfdb2 100644 --- a/Scenes/NoteManager/Scripts/InputHandler.cs +++ b/Scenes/NoteManager/Scripts/InputHandler.cs @@ -40,6 +40,8 @@ public partial class InputHandler : Node2D }, }; + public static bool UseArrows = false; + private void InitializeArrowCheckers() { //Set the color of the arrows @@ -53,6 +55,11 @@ private void InitializeArrowCheckers() public override void _Ready() { InitializeArrowCheckers(); + UpdateArrowSprites(); + if (!BattleDirector.VerticalScroll) + return; + foreach (CheckerData data in Arrows) + data.Node.RotationDegrees += 90f; } public override void _Process(double delta) @@ -113,4 +120,42 @@ public void FeedbackEffect(ArrowType arrow, Timing timed) particles.Emit(particleAmount); } + + private static readonly string ArrowFolderPath = "res://Scenes/NoteManager/Assets/"; + + private void UpdateArrowSprites() + { + if (!UseArrows) + return; + Arrows[(int)ArrowType.Left].Node.Texture = GD.Load( + ArrowFolderPath + "New_Arrow.png" + ); + Arrows[(int)ArrowType.Left].Node.Outline.Texture = GD.Load( + ArrowFolderPath + "Arrow_Outline.png" + ); + Arrows[(int)ArrowType.Left].Node.RotationDegrees = 180f; + + Arrows[(int)ArrowType.Up].Node.Texture = GD.Load( + ArrowFolderPath + "New_Arrow.png" + ); + Arrows[(int)ArrowType.Up].Node.Outline.Texture = GD.Load( + ArrowFolderPath + "Arrow_Outline.png" + ); + Arrows[(int)ArrowType.Up].Node.RotationDegrees = 270f; + + Arrows[(int)ArrowType.Down].Node.Texture = GD.Load( + ArrowFolderPath + "New_Arrow.png" + ); + Arrows[(int)ArrowType.Down].Node.Outline.Texture = GD.Load( + ArrowFolderPath + "Arrow_Outline.png" + ); + Arrows[(int)ArrowType.Down].Node.RotationDegrees = 90f; + + Arrows[(int)ArrowType.Right].Node.Texture = GD.Load( + ArrowFolderPath + "New_Arrow.png" + ); + Arrows[(int)ArrowType.Right].Node.Outline.Texture = GD.Load( + ArrowFolderPath + "Arrow_Outline.png" + ); + } } diff --git a/Scenes/NoteManager/Scripts/NoteArrow.cs b/Scenes/NoteManager/Scripts/NoteArrow.cs index fe3b6c7e..8c58ad58 100644 --- a/Scenes/NoteManager/Scripts/NoteArrow.cs +++ b/Scenes/NoteManager/Scripts/NoteArrow.cs @@ -35,9 +35,13 @@ public virtual void Init(CheckerData parentChecker, ArrowData arrowData, double _beatTime = beatTime; Position = new Vector2(GetNewPosX(), parentChecker.Node.GlobalPosition.Y); + RotationDegrees = parentChecker.Node.RotationDegrees; + Texture = parentChecker.Node.Texture; OutlineSprite.Texture = parentChecker.Node.Outline.Texture; IconSprite.Texture = arrowData.NoteRef.Texture; IconSprite.Rotation = -Rotation; + if (BattleDirector.VerticalScroll) + IconSprite.RotationDegrees += 90f; OutlineSprite.Modulate = parentChecker.Color; } diff --git a/Scenes/UI/Options/OptionsMenu.tscn b/Scenes/UI/Options/OptionsMenu.tscn index f883c248..48e8fd10 100644 --- a/Scenes/UI/Options/OptionsMenu.tscn +++ b/Scenes/UI/Options/OptionsMenu.tscn @@ -6,7 +6,7 @@ [ext_resource type="Texture2D" uid="uid://djd6iw2g84bba" path="res://Scenes/UI/Assets/UI_CenterFrame.png" id="3_qydxi"] [ext_resource type="Theme" uid="uid://d37e3tpsbxwak" path="res://Scenes/UI/Assets/GeneralTheme.tres" id="4_r616m"] -[node name="OptionsMenu" type="CanvasLayer" node_paths=PackedStringArray("_focused", "_volumeSlider", "_closeButton", "_controlsButton", "_highContrastToggle", "_howToPlayButton")] +[node name="OptionsMenu" type="CanvasLayer" node_paths=PackedStringArray("_focused", "_volumeSlider", "_closeButton", "_controlsButton", "_highContrastToggle", "_howToPlayButton", "_titleScreenOptions", "_noteSpriteToggle", "_verticalScrollToggle")] process_mode = 3 script = ExtResource("1_yjq7i") _focused = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HBoxContainer/CheckBox") @@ -15,6 +15,9 @@ _closeButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer _controlsButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/ControlsButton") _highContrastToggle = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HBoxContainer/CheckBox") _howToPlayButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HowToPlayButton") +_titleScreenOptions = NodePath("Control/MarginContainer2") +_noteSpriteToggle = NodePath("Control/MarginContainer2/CenterContainer/MarginContainer/VBoxContainer/NoteCheckbox") +_verticalScrollToggle = NodePath("Control/MarginContainer2/CenterContainer/MarginContainer/VBoxContainer/VerticalScroll") [node name="Control" type="Control" parent="."] layout_mode = 3 @@ -39,6 +42,77 @@ patch_margin_top = 100 patch_margin_right = 105 patch_margin_bottom = 100 +[node name="MarginContainer2" type="MarginContainer" parent="Control"] +layout_mode = 1 +offset_right = 162.0 +offset_bottom = 105.0 +size_flags_horizontal = 0 +size_flags_vertical = 0 +theme_override_constants/margin_left = 7 +theme_override_constants/margin_top = 7 + +[node name="OptionsBackground" type="NinePatchRect" parent="Control/MarginContainer2"] +layout_mode = 2 +texture = ExtResource("3_qydxi") +patch_margin_left = 5 +patch_margin_top = 5 +patch_margin_right = 5 +patch_margin_bottom = 5 + +[node name="MoreOpaque" type="NinePatchRect" parent="Control/MarginContainer2"] +layout_mode = 2 +texture = ExtResource("3_qydxi") +patch_margin_left = 5 +patch_margin_top = 5 +patch_margin_right = 5 +patch_margin_bottom = 5 + +[node name="MoreMoreOpaque" type="NinePatchRect" parent="Control/MarginContainer2"] +layout_mode = 2 +texture = ExtResource("3_qydxi") +patch_margin_left = 5 +patch_margin_top = 5 +patch_margin_right = 5 +patch_margin_bottom = 5 + +[node name="CenterContainer" type="CenterContainer" parent="Control/MarginContainer2"] +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="Control/MarginContainer2/CenterContainer"] +layout_mode = 2 +size_flags_horizontal = 0 +theme_override_constants/margin_left = 7 +theme_override_constants/margin_top = 7 +theme_override_constants/margin_right = 7 +theme_override_constants/margin_bottom = 7 + +[node name="VBoxContainer" type="VBoxContainer" parent="Control/MarginContainer2/CenterContainer/MarginContainer"] +layout_mode = 2 +size_flags_horizontal = 0 +size_flags_vertical = 0 + +[node name="NoteLabel" type="Label" parent="Control/MarginContainer2/CenterContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +text = "OPTIONS_NOTE_SWAP" +horizontal_alignment = 1 + +[node name="NoteCheckbox" type="CheckBox" parent="Control/MarginContainer2/CenterContainer/MarginContainer/VBoxContainer"] +self_modulate = Color(2, 3, 2, 1) +layout_mode = 2 +size_flags_horizontal = 4 +focus_neighbor_right = NodePath("../../../../../CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HBoxContainer/CheckBox") + +[node name="VerticalLabel" type="Label" parent="Control/MarginContainer2/CenterContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +text = "OPTIONS_VERT_SCROLL" +horizontal_alignment = 1 + +[node name="VerticalScroll" type="CheckBox" parent="Control/MarginContainer2/CenterContainer/MarginContainer/VBoxContainer"] +modulate = Color(2, 3, 2, 1) +layout_mode = 2 +size_flags_horizontal = 4 +focus_neighbor_right = NodePath("../../../../../CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HBoxContainer/CheckBox") + [node name="CenterContainer" type="CenterContainer" parent="Control"] layout_mode = 1 anchors_preset = 15 @@ -46,6 +120,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +mouse_filter = 2 [node name="MarginContainer" type="MarginContainer" parent="Control/CenterContainer"] layout_mode = 2 @@ -87,6 +162,7 @@ alignment = 1 [node name="CheckBox" type="CheckBox" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HBoxContainer"] self_modulate = Color(2, 3, 2, 1) layout_mode = 2 +focus_neighbor_left = NodePath("../../../../../../MarginContainer2/CenterContainer/MarginContainer/VBoxContainer/NoteCheckbox") [node name="Label" type="Label" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HBoxContainer"] layout_mode = 2 diff --git a/Scenes/UI/Options/Scripts/OptionsMenu.cs b/Scenes/UI/Options/Scripts/OptionsMenu.cs index b709adc5..09beea6d 100644 --- a/Scenes/UI/Options/Scripts/OptionsMenu.cs +++ b/Scenes/UI/Options/Scripts/OptionsMenu.cs @@ -26,6 +26,15 @@ public partial class OptionsMenu : CanvasLayer, IFocusableMenu [Export] private Button _howToPlayButton; + [Export] + private MarginContainer _titleScreenOptions; + + [Export] + private CheckBox _noteSpriteToggle; + + [Export] + private CheckBox _verticalScrollToggle; + private const float MinVolumeVal = 0f; public override void _Ready() @@ -46,6 +55,12 @@ public override void _Ready() _controlsButton.Pressed += OpenControls; _highContrastToggle.Toggled += HighContrastChanged; _howToPlayButton.Pressed += OpenHowToPlay; + + _titleScreenOptions.Visible = !StageProducer.IsInitialized; + _noteSpriteToggle.ButtonPressed = InputHandler.UseArrows; + _noteSpriteToggle.Toggled += ArrowSpritesToggled; + _verticalScrollToggle.ButtonPressed = BattleDirector.VerticalScroll; + _verticalScrollToggle.Toggled += VerticalScrollToggled; } public override void _Input(InputEvent @event) @@ -112,6 +127,18 @@ public static void ChangeVolume(double value) ); } + private void ArrowSpritesToggled(bool value) + { + InputHandler.UseArrows = value; + SaveSystem.UpdateConfig(SaveSystem.ConfigSettings.TypeIsArrow, value); + } + + private void VerticalScrollToggled(bool value) + { + BattleDirector.VerticalScroll = value; + SaveSystem.UpdateConfig(SaveSystem.ConfigSettings.VerticalScroll, value); + } + private void HighContrastChanged(bool toggled) { StageProducer.ContrastFilter.Visible = toggled; diff --git a/Scenes/UI/Remapping/ControlSettings.cs b/Scenes/UI/Remapping/ControlSettings.cs index b5714900..5ae9746c 100644 --- a/Scenes/UI/Remapping/ControlSettings.cs +++ b/Scenes/UI/Remapping/ControlSettings.cs @@ -39,6 +39,32 @@ public partial class ControlSettings : Node2D, IFocusableMenu private JoyButton _tempJoyButton; private string _chosenKey = ""; + [Export] + private Sprite2D _keyboardUpSprite; + + [Export] + private Sprite2D _keyboardDownSprite; + + [Export] + private Sprite2D _keyboardLeftSprite; + + [Export] + private Sprite2D _keyboardRightSprite; + + [Export] + private Sprite2D _controllerUpSprite; + + [Export] + private Sprite2D _controllerDownSprite; + + [Export] + private Sprite2D _controllerLeftSprite; + + [Export] + private Sprite2D _controllerRightSprite; + + private static readonly string NotePath = "res://Scenes/NoteManager/Assets/"; + //These just don't play well with inputs private readonly HashSet _invalidKeys = new HashSet { @@ -137,6 +163,7 @@ public override void _Ready() _closeButton.Pressed += ReturnToPrev; InitInputSprites(); + InitNoteSprites(); } private void InitInputSprites() @@ -154,6 +181,27 @@ private void InitInputSprites() UpdateKeySprites(); } + + private void InitNoteSprites() + { + if (!InputHandler.UseArrows) + return; + _keyboardUpSprite.Texture = GD.Load(NotePath + "New_Arrow.png"); + _keyboardUpSprite.RotationDegrees = 270f; + _keyboardDownSprite.Texture = GD.Load(NotePath + "New_Arrow.png"); + _keyboardDownSprite.RotationDegrees = 90f; + _keyboardLeftSprite.Texture = GD.Load(NotePath + "New_Arrow.png"); + _keyboardLeftSprite.RotationDegrees = 180f; + _keyboardRightSprite.Texture = GD.Load(NotePath + "New_Arrow.png"); + + _controllerUpSprite.Texture = GD.Load(NotePath + "New_Arrow.png"); + _controllerUpSprite.RotationDegrees = 270f; + _controllerDownSprite.Texture = GD.Load(NotePath + "New_Arrow.png"); + _controllerDownSprite.RotationDegrees = 90f; + _controllerLeftSprite.Texture = GD.Load(NotePath + "New_Arrow.png"); + _controllerLeftSprite.RotationDegrees = 180f; + _controllerRightSprite.Texture = GD.Load(NotePath + "New_Arrow.png"); + } #endregion #region Focus and Menus diff --git a/Scenes/UI/Remapping/Remap.tscn b/Scenes/UI/Remapping/Remap.tscn index ef67fa30..6dacf5de 100644 --- a/Scenes/UI/Remapping/Remap.tscn +++ b/Scenes/UI/Remapping/Remap.tscn @@ -22,7 +22,7 @@ [ext_resource type="Texture2D" uid="uid://cpxcg12lovxu5" path="res://Scenes/UI/Remapping/Assets/Joypad Button 4 (Back, Sony Select, Xbox Back, Nintendo -).png" id="16_s0mtp"] [ext_resource type="Texture2D" uid="uid://djd6iw2g84bba" path="res://Scenes/UI/Assets/UI_CenterFrame.png" id="18_8iace"] -[node name="Remap" type="Node2D" node_paths=PackedStringArray("_closeButton", "_remapPopup", "_remapLabel", "_remapDescription", "_remapTimer", "_remapTabs")] +[node name="Remap" type="Node2D" node_paths=PackedStringArray("_closeButton", "_remapPopup", "_remapLabel", "_remapDescription", "_remapTimer", "_remapTabs", "_keyboardUpSprite", "_keyboardDownSprite", "_keyboardLeftSprite", "_keyboardRightSprite", "_controllerUpSprite", "_controllerDownSprite", "_controllerLeftSprite", "_controllerRightSprite")] process_mode = 3 script = ExtResource("1_ir12b") _closeButton = NodePath("Panel/TitleButton") @@ -31,6 +31,14 @@ _remapLabel = NodePath("RemapPopup/Label2") _remapDescription = NodePath("RemapPopup/Label3") _remapTimer = NodePath("RemapPopup/Timer") _remapTabs = NodePath("Panel/TabContainer") +_keyboardUpSprite = NodePath("Panel/TabContainer/CONTROLS_KEYBOARD/Up") +_keyboardDownSprite = NodePath("Panel/TabContainer/CONTROLS_KEYBOARD/Down") +_keyboardLeftSprite = NodePath("Panel/TabContainer/CONTROLS_KEYBOARD/Left") +_keyboardRightSprite = NodePath("Panel/TabContainer/CONTROLS_KEYBOARD/Right") +_controllerUpSprite = NodePath("Panel/TabContainer/CONTROLS_CONTROLLER/Up") +_controllerDownSprite = NodePath("Panel/TabContainer/CONTROLS_CONTROLLER/Down") +_controllerLeftSprite = NodePath("Panel/TabContainer/CONTROLS_CONTROLLER/Left") +_controllerRightSprite = NodePath("Panel/TabContainer/CONTROLS_CONTROLLER/Right") [node name="Background" type="NinePatchRect" parent="."] offset_right = 640.0 diff --git a/SharedAssets/BattleFrame1.png b/SharedAssets/BattleFrame1.png index 2e512481..005729fd 100644 Binary files a/SharedAssets/BattleFrame1.png and b/SharedAssets/BattleFrame1.png differ