From 65fe0e5c5dd49616c8052a780b67080d547bb86a Mon Sep 17 00:00:00 2001 From: Rendo Date: Fri, 25 Jul 2025 18:15:20 +0500 Subject: [PATCH] Refactor --- project.godot | 2 +- scenes/gui/choose_your_seeds.tscn | 2 +- scenes/templates/level_template.tscn | 2 +- scripts/Newlon.cs | 9 +++++++++ scripts/Newlon.cs.uid | 1 + scripts/PlayerProgress.cs | 17 ----------------- scripts/ScalableAudioPlayer.cs | 12 ------------ scripts/ScalableAudioPlayer.cs.uid | 1 - scripts/{ => audio}/ChooseYourSeedsMusic.cs | 0 scripts/{ => audio}/ChooseYourSeedsMusic.cs.uid | 0 scripts/{ => audio}/MusicTransitioner.cs | 0 scripts/{ => audio}/MusicTransitioner.cs.uid | 0 scripts/systems/static-data/PlayerProgress.cs | 17 +++++++++++++++++ .../static-data}/PlayerProgress.cs.uid | 0 14 files changed, 30 insertions(+), 33 deletions(-) create mode 100644 scripts/Newlon.cs create mode 100644 scripts/Newlon.cs.uid delete mode 100644 scripts/PlayerProgress.cs delete mode 100644 scripts/ScalableAudioPlayer.cs delete mode 100644 scripts/ScalableAudioPlayer.cs.uid rename scripts/{ => audio}/ChooseYourSeedsMusic.cs (100%) rename scripts/{ => audio}/ChooseYourSeedsMusic.cs.uid (100%) rename scripts/{ => audio}/MusicTransitioner.cs (100%) rename scripts/{ => audio}/MusicTransitioner.cs.uid (100%) create mode 100644 scripts/systems/static-data/PlayerProgress.cs rename scripts/{ => systems/static-data}/PlayerProgress.cs.uid (100%) diff --git a/project.godot b/project.godot index cecd960..3aaf06e 100644 --- a/project.godot +++ b/project.godot @@ -30,7 +30,7 @@ GameRegistry="*res://scripts/systems/GameRegistry.cs" Cheats="*res://scripts/debug/Cheats.cs" AudioSequencer="*res://scenes/audio_sequencer.tscn" SaveSerializer="*res://scripts/SaveSerializer.cs" -PlayerProgress="*res://scripts/PlayerProgress.cs" +PlayerProgress="*res://scripts/systems/static-data/PlayerProgress.cs" [display] diff --git a/scenes/gui/choose_your_seeds.tscn b/scenes/gui/choose_your_seeds.tscn index d95699e..7f22eba 100644 --- a/scenes/gui/choose_your_seeds.tscn +++ b/scenes/gui/choose_your_seeds.tscn @@ -13,7 +13,7 @@ [ext_resource type="Script" uid="uid://c1x4n4nqyq72f" path="res://scripts/audio/ChannelSettings.cs" id="10_nlh6x"] [ext_resource type="PackedScene" uid="uid://bvpt0q4j6nx18" path="res://scenes/gui/almanach.tscn" id="11_nlh6x"] [ext_resource type="AudioStream" uid="uid://mu86q1r1dvgo" path="res://assets/audio/music/03. Choose Your Seeds.mp3" id="13_y65t1"] -[ext_resource type="Script" uid="uid://b4ysi1iutmju3" path="res://scripts/ChooseYourSeedsMusic.cs" id="14_rptyw"] +[ext_resource type="Script" uid="uid://b4ysi1iutmju3" path="res://scripts/audio/ChooseYourSeedsMusic.cs" id="14_rptyw"] [sub_resource type="ViewportTexture" id="ViewportTexture_rmoaa"] viewport_path = NodePath("Panel/MarginContainer/VBoxContainer/HBoxContainer/Frame/Previewport") diff --git a/scenes/templates/level_template.tscn b/scenes/templates/level_template.tscn index 5826b6a..f6e4449 100644 --- a/scenes/templates/level_template.tscn +++ b/scenes/templates/level_template.tscn @@ -36,7 +36,7 @@ [ext_resource type="AudioStream" uid="uid://bwnmx7t3hcw6h" path="res://assets/audio/sfx/level/awooga.mp3" id="32_xsaqy"] [ext_resource type="AudioStream" uid="uid://cfybn7wn04frs" path="res://assets/audio/music/Grasswalk_Standard.mp3" id="34_tqd4v"] [ext_resource type="AudioStream" uid="uid://get7nh1goi1c" path="res://assets/audio/music/Grasswalk_cool.mp3" id="35_4gg2g"] -[ext_resource type="Script" uid="uid://bnj5tlcpmep2o" path="res://scripts/MusicTransitioner.cs" id="36_wwgye"] +[ext_resource type="Script" uid="uid://bnj5tlcpmep2o" path="res://scripts/audio/MusicTransitioner.cs" id="36_wwgye"] [sub_resource type="Animation" id="Animation_vbgdr"] resource_name = "CYS_Sequence" diff --git a/scripts/Newlon.cs b/scripts/Newlon.cs new file mode 100644 index 0000000..9a4d5ea --- /dev/null +++ b/scripts/Newlon.cs @@ -0,0 +1,9 @@ +namespace Newlon; + +public static class LON +{ + public static float Pr(string path) + { + return 0; + } +} \ No newline at end of file diff --git a/scripts/Newlon.cs.uid b/scripts/Newlon.cs.uid new file mode 100644 index 0000000..968f5e7 --- /dev/null +++ b/scripts/Newlon.cs.uid @@ -0,0 +1 @@ +uid://bkr8vxejk4n2u diff --git a/scripts/PlayerProgress.cs b/scripts/PlayerProgress.cs deleted file mode 100644 index ef4c36b..0000000 --- a/scripts/PlayerProgress.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Generic; -using Godot; -using Newlon; - -public partial class PlayerProgress : Node -{ - public static PlayerProgress Instance { get; private set; } - - public override void _EnterTree() - { - Instance = this; - } - - public List PlayerPlants { get; set; } = new(); - public int MaxSeedpackets = 9; - public int Money { get; set; } -} diff --git a/scripts/ScalableAudioPlayer.cs b/scripts/ScalableAudioPlayer.cs deleted file mode 100644 index b53b823..0000000 --- a/scripts/ScalableAudioPlayer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Godot; -using System; - -public partial class ScalableAudioPlayer : AudioStreamPlayer -{ - // Called every frame. 'delta' is the elapsed time since the previous frame. - public override void _Process(double delta) - { - if(PitchScale != (float)Engine.TimeScale) - PitchScale = (float)Engine.TimeScale * (float)Engine.TimeScale; - } -} diff --git a/scripts/ScalableAudioPlayer.cs.uid b/scripts/ScalableAudioPlayer.cs.uid deleted file mode 100644 index 08e8092..0000000 --- a/scripts/ScalableAudioPlayer.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://wfjsgbg3fekl diff --git a/scripts/ChooseYourSeedsMusic.cs b/scripts/audio/ChooseYourSeedsMusic.cs similarity index 100% rename from scripts/ChooseYourSeedsMusic.cs rename to scripts/audio/ChooseYourSeedsMusic.cs diff --git a/scripts/ChooseYourSeedsMusic.cs.uid b/scripts/audio/ChooseYourSeedsMusic.cs.uid similarity index 100% rename from scripts/ChooseYourSeedsMusic.cs.uid rename to scripts/audio/ChooseYourSeedsMusic.cs.uid diff --git a/scripts/MusicTransitioner.cs b/scripts/audio/MusicTransitioner.cs similarity index 100% rename from scripts/MusicTransitioner.cs rename to scripts/audio/MusicTransitioner.cs diff --git a/scripts/MusicTransitioner.cs.uid b/scripts/audio/MusicTransitioner.cs.uid similarity index 100% rename from scripts/MusicTransitioner.cs.uid rename to scripts/audio/MusicTransitioner.cs.uid diff --git a/scripts/systems/static-data/PlayerProgress.cs b/scripts/systems/static-data/PlayerProgress.cs new file mode 100644 index 0000000..a6306b8 --- /dev/null +++ b/scripts/systems/static-data/PlayerProgress.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using Godot; +using Newlon; + +public partial class PlayerProgress : Node +{ + public static PlayerProgress Instance { get; private set; } + + public override void _EnterTree() + { + Instance = this; + } + + public List PlayerPlants { get; set; } = new(); + public int MaxSeedpackets = 9; + public int Money { get; set; } +} diff --git a/scripts/PlayerProgress.cs.uid b/scripts/systems/static-data/PlayerProgress.cs.uid similarity index 100% rename from scripts/PlayerProgress.cs.uid rename to scripts/systems/static-data/PlayerProgress.cs.uid