Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions prefabs/map_info_container.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
[ext_resource type="Texture2D" uid="uid://csk7favaty7k2" path="res://user/skins/default/ui/buttons/speed_plus_plus.png" id="14_hri10"]
[ext_resource type="Texture2D" uid="uid://ddhu70ryjua54" path="res://user/skins/default/ui/buttons/speed_middle.png" id="18_1m5pv"]
[ext_resource type="Texture2D" uid="uid://4o5eelsayk4d" path="res://user/skins/default/ui/buttons/play.png" id="20_ir45w"]
[ext_resource type="Texture2D" path="res://user/skins/default/modifiers/hardrock_v2.png" id="21_hardrock"]

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_svokg"]

Expand Down Expand Up @@ -615,6 +616,17 @@ layout_mode = 2
icon = ExtResource("9_abwk8")
Modifier = "Ghost"

[node name="Hard" type="AspectRatioContainer" parent="Actions/ScrollContainer/Holder/Modifiers/ScrollContainer/HBoxContainer" unique_id=1417833015]
layout_mode = 2
size_flags_horizontal = 0

[node name="ModifierButton" parent="Actions/ScrollContainer/Holder/Modifiers/ScrollContainer/HBoxContainer/Hard" unique_id=1417833016 instance=ExtResource("7_dccrs")]
custom_minimum_size = Vector2(58, 54)
layout_mode = 2
icon = ExtResource("21_hardrock")
Modifier = "HardRock"
Description = "Hard Mode: Reducing note size and hit window"

[node name="Speed" type="Panel" parent="Actions/ScrollContainer/Holder" unique_id=1748400541]
custom_minimum_size = Vector2(0, 32)
layout_mode = 1
Expand Down
15 changes: 15 additions & 0 deletions prefabs/score_panel.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,21 @@ label_settings = SubResource("LabelSettings_i1p2f")
horizontal_alignment = 2
vertical_alignment = 1

[node name="Rank" type="Label" parent="." unique_id=1111993920]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.6
anchor_top = 0.4
anchor_right = 1.0
anchor_bottom = 0.4
offset_left = 4.0
offset_top = 4.0
offset_right = -110.0
text = "SS"
label_settings = SubResource("LabelSettings_exmec")
horizontal_alignment = 2
vertical_alignment = 1

[node name="Accuracy" type="Label" parent="." unique_id=696162467]
layout_mode = 1
anchors_preset = -1
Expand Down
13 changes: 13 additions & 0 deletions scenes/game.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,19 @@ grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("12_whe6p")

[node name="Rank" type="Label" parent="PanelRight/PanelRightViewport"]
anchors_preset = -1
anchor_left = 0.5
anchor_top = 0.15
anchor_right = 0.5
anchor_bottom = 0.15
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("4_rvp5o")
text = "SS"
label_settings = SubResource("LabelSettings_usmyc")
horizontal_alignment = 1

[node name="Accuracy" type="Label" parent="PanelRight/PanelRightViewport" unique_id=1669266042]
anchors_preset = -1
anchor_left = 0.5
Expand Down
19 changes: 19 additions & 0 deletions scenes/results.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ font_size = 32
shader = ExtResource("5_eo0oh")
shader_parameter/brightness = 1.25

[sub_resource type="LabelSettings" id="LabelSettings_huge_rank"]
font = ExtResource("2_f4qdi")
font_size = 550
font_color = Color(1, 1, 1, 0.5)

[node name="SceneResults" type="Node" unique_id=11944572]
script = ExtResource("1_llpx6")

Expand Down Expand Up @@ -230,6 +235,20 @@ offset_top = 300.0
offset_right = -32.0
offset_bottom = 302.0

[node name="Rank" type="Label" parent="Holder"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 32.0
grow_horizontal = 2
grow_vertical = 2
text = "SS"
label_settings = SubResource("LabelSettings_huge_rank")
horizontal_alignment = 0
vertical_alignment = 1
text_overrun_behavior = 3

[node name="Accuracy" type="Label" parent="Holder" unique_id=678663131]
layout_mode = 1
anchors_preset = -1
Expand Down
200 changes: 100 additions & 100 deletions scripts/SceneManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,133 +3,133 @@

public partial class SceneManager : Node
{
private static SubViewportContainer backgroundContainer;
private static SubViewportContainer backgroundContainer;

private static SubViewport backgroundViewport;
private static SubViewport backgroundViewport;

private static string activeScenePath;
private static string activeScenePath;

public static SceneManager Instance { get; private set; }
public static SceneManager Instance { get; private set; }

public static Window Root;
public static Window Root;

public static Dictionary<string, BaseScene> Scenes = [];
public static Dictionary<string, BaseScene> Scenes = [];

public static BaseScene Scene;
public static BaseScene Scene;

public static BaseSpace Space;
public static BaseSpace Space;

public static Panel VolumePanel;
public static Panel VolumePanel;

public override void _EnterTree()
{
Instance = this;
Root = GetTree().Root;
VolumePanel = GetNode<Panel>("Volume");
}
public override void _EnterTree()
{
Instance = this;
Root = GetTree().Root;
VolumePanel = GetNode<Panel>("Volume");
}

public override void _Ready()
{
backgroundContainer = GetNode<SubViewportContainer>("Background");
backgroundViewport = backgroundContainer.GetNode<SubViewport>("SubViewport");
public override void _Ready()
{
backgroundContainer = GetNode<SubViewportContainer>("Background");
backgroundViewport = backgroundContainer.GetNode<SubViewport>("SubViewport");

Load("res://scenes/loading.tscn");
}
Load("res://scenes/loading.tscn");
}

public static void ReloadCurrentScene()
{
Load(activeScenePath, true);
}
public static void ReloadCurrentScene()
{
Load(activeScenePath, true);
}

public static void Load(string path, bool skipTransition = false)
{
bool isSceneLoaded = Scenes.TryGetValue(path, out BaseScene loadedScene);
BaseScene newScene = isSceneLoaded ? loadedScene : (BaseScene)ResourceLoader.Load<PackedScene>(path).Instantiate();
public static void Load(string path, bool skipTransition = false)
{
bool isSceneLoaded = Scenes.TryGetValue(path, out BaseScene loadedScene);
BaseScene newScene = isSceneLoaded ? loadedScene : (BaseScene)ResourceLoader.Load<PackedScene>(path).Instantiate();

// temp solution until these scenes are non-static
if (!isSceneLoaded && newScene.Name != "SceneGame" && newScene.Name != "SceneResults")
{
Scenes[path] = newScene;
}
// temp solution until these scenes are non-static
if (!isSceneLoaded && newScene.Name != "SceneGame" && newScene.Name != "SceneResults")
{
Scenes[path] = newScene;
}

Tween outTween = Instance.CreateTween().SetTrans(Tween.TransitionType.Quad);
Tween outTween = Instance.CreateTween().SetTrans(Tween.TransitionType.Quad);

if (Scene != null)
{
outTween.TweenProperty(Scene.Transition, "self_modulate", Color.FromHtml("ffffffff"), skipTransition ? 0 : 0.25);
}
if (Scene != null)
{
outTween.TweenProperty(Scene.Transition, "self_modulate", Color.FromHtml("ffffffff"), skipTransition ? 0 : 0.25);
}

outTween.TweenCallback(Callable.From(() =>
{
removeScene(Scene);
outTween.TweenCallback(Callable.From(() =>
{
removeScene(Scene);

activeScenePath = path;
Scene = newScene;
activeScenePath = path;
Scene = newScene;

addScene(newScene);
addScene(newScene);

newScene.Transition.SelfModulate = Color.FromHtml("ffffffff");
Instance.CreateTween().SetTrans(Tween.TransitionType.Quad).TweenProperty(newScene.Transition, "self_modulate", Color.FromHtml("ffffff00"), skipTransition ? 0 : 0.25);
}));
}
newScene.Transition.SelfModulate = Color.FromHtml("ffffffff");
Instance.CreateTween().SetTrans(Tween.TransitionType.Quad).TweenProperty(newScene.Transition, "self_modulate", Color.FromHtml("ffffff00"), skipTransition ? 0 : 0.25);
}));
}

private static void addScene(BaseScene scene, bool updateSpace = true)
{
if (scene == null || scene.GetParent() == Instance) { return; }
private static void addScene(BaseScene scene, bool updateSpace = true)
{
if (scene == null || scene.GetParent() == Instance) { return; }

if (updateSpace)
{
addSpace(scene.GetSpace(), scene.AddSpaceAsChild);
}
if (updateSpace)
{
addSpace(scene.GetSpace(), scene.AddSpaceAsChild);
}

Instance.AddChild(scene);
scene.Load();
}
Instance.AddChild(scene);
scene.Load();
}

private static void removeScene(BaseScene scene, bool updateSpace = true)
{
if (scene == null || scene.GetParent() != Instance) { return; }
private static void removeScene(BaseScene scene, bool updateSpace = true)
{
if (scene == null || scene.GetParent() != Instance) { return; }

scene.Unload();
Instance.RemoveChild(scene);
scene.Unload();
Instance.RemoveChild(scene);

// also temp
if (scene.Name == "SceneGame" || scene.Name == "SceneResults")
{
scene.QueueFree();
}
// also temp
if (scene.Name == "SceneGame" || scene.Name == "SceneResults")
{
scene.QueueFree();
}

if (updateSpace)
{
removeSpace();
}
}
if (updateSpace)
{
removeSpace();
}
}

private static void addSpace(BaseSpace space, bool addToScene = false)
{
if (space == null || space.GetParent() == backgroundViewport) { return; }
private static void addSpace(BaseSpace space, bool addToScene = false)
{
if (space == null || space.GetParent() == backgroundViewport) { return; }

if (addToScene)
{
Scene.AddChild(space);
Scene.MoveChild(space, 0);
}
else
{
backgroundViewport.AddChild(space);
}

backgroundContainer.Visible = !addToScene;

Space = space;
}

private static void removeSpace()
{
if (Space == null) { return; }

Space.GetParent().RemoveChild(Space);

Space = null;
}
if (addToScene)
{
Scene.AddChild(space);
Scene.MoveChild(space, 0);
}
else
{
backgroundViewport.AddChild(space);
}

backgroundContainer.Visible = !addToScene;

Space = space;
}

private static void removeSpace()
{
if (Space == null) { return; }

Space.GetParent().RemoveChild(Space);

Space = null;
}
}
Loading