Skip to content

Commit d44896d

Browse files
authored
Merge fixes & galaxy space (#46)
* post merge fixes * accurate unpause mask * old debug prints * start selected song on startfrom seek * pausing fixes * useless gitkeep * redundant * galaxy space (thx noobour)
1 parent 0116a85 commit d44896d

18 files changed

Lines changed: 422 additions & 189 deletions

File tree

prefabs/spaces/galaxy.tscn

Lines changed: 187 additions & 0 deletions
Large diffs are not rendered by default.

scenes/game.tscn

Lines changed: 55 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
[ext_resource type="Texture2D" uid="uid://lfj8i1bi6kfs" path="res://textures/ui/pause.png" id="23_7silw"]
2424
[ext_resource type="FontFile" uid="uid://dotb3skhwouha" path="res://fonts/Roboto-Bold.ttf" id="23_wf21h"]
2525
[ext_resource type="FontFile" uid="uid://rs2mb33nd3b1" path="res://fonts/Roboto-Italic.ttf" id="24_j6p10"]
26-
[ext_resource type="Script" path="res://scripts/scenes/PauseHud.cs" id="25_pausehud"]
26+
[ext_resource type="Script" uid="uid://qjqjxykl30bm" path="res://scripts/scenes/PauseHud.cs" id="25_pausehud"]
2727

2828
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_sijr0"]
2929
bg_color = Color(0.1072, 0.0896, 0.16, 0.25098)
@@ -62,6 +62,27 @@ Button/styles/hover = SubResource("StyleBoxFlat_6kbgk")
6262
Button/styles/normal = SubResource("StyleBoxEmpty_jlnvv")
6363
Button/styles/pressed = SubResource("StyleBoxFlat_y08lf")
6464

65+
[sub_resource type="ViewportTexture" id="ViewportTexture_pausehud"]
66+
viewport_path = NodePath("PauseHud/PauseVP")
67+
68+
[sub_resource type="LabelSettings" id="LabelSettings_pause_base"]
69+
font = ExtResource("23_wf21h")
70+
font_size = 84
71+
font_color = Color(0.5, 0.5, 0.5, 1)
72+
73+
[sub_resource type="LabelSettings" id="LabelSettings_pause_fill"]
74+
font = ExtResource("23_wf21h")
75+
font_size = 84
76+
77+
[sub_resource type="LabelSettings" id="LabelSettings_pause_hint"]
78+
font = ExtResource("12_axsek")
79+
font_size = 24
80+
81+
[sub_resource type="LabelSettings" id="LabelSettings_r7xjp"]
82+
font = ExtResource("12_axsek")
83+
font_size = 18
84+
font_color = Color(1, 1, 1, 0.8)
85+
6586
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_73q55"]
6687
transparency = 1
6788
cull_mode = 2
@@ -198,12 +219,17 @@ bg_color = Color(0, 0, 0, 0)
198219
font = ExtResource("12_axsek")
199220
font_size = 50
200221

222+
[sub_resource type="LabelSettings" id="LabelSettings_pause_counter_title"]
223+
font = ExtResource("12_axsek")
224+
font_size = 20
225+
226+
[sub_resource type="LabelSettings" id="LabelSettings_pause_counter_value"]
227+
font = ExtResource("12_axsek")
228+
font_size = 42
229+
201230
[sub_resource type="ViewportTexture" id="ViewportTexture_suyxu"]
202231
viewport_path = NodePath("PanelRight/PanelRightViewport")
203232

204-
[sub_resource type="ViewportTexture" id="ViewportTexture_pausehud"]
205-
viewport_path = NodePath("PauseHud/PauseVP")
206-
207233
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ro5ir"]
208234
resource_local_to_scene = true
209235
transparency = 1
@@ -231,36 +257,6 @@ font_color = Color(1, 1, 1, 0.768627)
231257
font = ExtResource("12_axsek")
232258
font_size = 50
233259

234-
[sub_resource type="LabelSettings" id="LabelSettings_r7xjp"]
235-
font = ExtResource("12_axsek")
236-
font_size = 18
237-
font_color = Color(1, 1, 1, 0.8)
238-
239-
[sub_resource type="LabelSettings" id="LabelSettings_pause_base"]
240-
font = ExtResource("23_wf21h")
241-
font_size = 84
242-
font_color = Color(0.50, 0.50, 0.50, 1)
243-
244-
[sub_resource type="LabelSettings" id="LabelSettings_pause_fill"]
245-
font = ExtResource("23_wf21h")
246-
font_size = 84
247-
font_color = Color(1, 1, 1, 1)
248-
249-
[sub_resource type="LabelSettings" id="LabelSettings_pause_hint"]
250-
font = ExtResource("12_axsek")
251-
font_size = 24
252-
font_color = Color(1, 1, 1, 1)
253-
254-
[sub_resource type="LabelSettings" id="LabelSettings_pause_counter_title"]
255-
font = ExtResource("12_axsek")
256-
font_size = 20
257-
font_color = Color(1, 1, 1, 1)
258-
259-
[sub_resource type="LabelSettings" id="LabelSettings_pause_counter_value"]
260-
font = ExtResource("12_axsek")
261-
font_size = 42
262-
font_color = Color(1, 1, 1, 1)
263-
264260
[sub_resource type="ShaderMaterial" id="ShaderMaterial_gc8yu"]
265261
shader = ExtResource("14_3xchs")
266262

@@ -482,27 +478,28 @@ theme = SubResource("Theme_e1j6l")
482478
theme_override_font_sizes/font_size = 28
483479
text = "GIVE UP"
484480

485-
[node name="PauseHud" type="Sprite3D" parent="."]
481+
[node name="PauseHud" type="Sprite3D" parent="." unique_id=1594331476]
486482
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.2, -6)
487-
visible = false
488483
pixel_size = 0.012
489484
no_depth_test = true
490485
render_priority = 104
491486
texture = SubResource("ViewportTexture_pausehud")
492487

493-
[node name="PauseVP" type="SubViewport" parent="PauseHud"]
488+
[node name="PauseVP" type="SubViewport" parent="PauseHud" unique_id=1841571202]
494489
disable_3d = true
495490
transparent_bg = true
496491
canvas_item_default_texture_filter = 2
497492
size = Vector2i(600, 600)
498493
render_target_update_mode = 4
499494

500-
[node name="Control" type="Control" parent="PauseHud/PauseVP"]
495+
[node name="Control" type="Control" parent="PauseHud/PauseVP" unique_id=1700063552]
496+
layout_mode = 3
497+
anchors_preset = 0
501498
offset_right = 600.0
502499
offset_bottom = 600.0
503500
script = ExtResource("25_pausehud")
504501

505-
[node name="Paused" type="Label" parent="PauseHud/PauseVP/Control"]
502+
[node name="Paused" type="Label" parent="PauseHud/PauseVP/Control" unique_id=1511102743]
506503
layout_mode = 1
507504
anchors_preset = 8
508505
anchor_left = 0.5
@@ -520,13 +517,19 @@ label_settings = SubResource("LabelSettings_pause_base")
520517
horizontal_alignment = 1
521518
vertical_alignment = 1
522519

523-
[node name="ProgressMask" type="Control" parent="PauseHud/PauseVP/Control"]
524-
layout_mode = 1
525-
offset_right = 0.0
526-
offset_bottom = 600.0
520+
[node name="ProgressMask" type="Control" parent="PauseHud/PauseVP/Control" unique_id=1572831027]
527521
clip_contents = true
522+
layout_mode = 1
523+
anchor_left = 0.5
524+
anchor_top = 0.5
525+
anchor_right = 0.5
526+
anchor_bottom = 0.5
527+
offset_top = -300.0
528+
offset_bottom = 300.0
529+
grow_horizontal = 2
530+
grow_vertical = 2
528531

529-
[node name="FillPaused" type="Label" parent="PauseHud/PauseVP/Control/ProgressMask"]
532+
[node name="FillPaused" type="Label" parent="PauseHud/PauseVP/Control/ProgressMask" unique_id=2138730588]
530533
layout_mode = 1
531534
anchors_preset = 8
532535
anchor_left = 0.5
@@ -544,7 +547,7 @@ label_settings = SubResource("LabelSettings_pause_fill")
544547
horizontal_alignment = 1
545548
vertical_alignment = 1
546549

547-
[node name="HoldR" type="Label" parent="PauseHud/PauseVP/Control"]
550+
[node name="HoldR" type="Label" parent="PauseHud/PauseVP/Control" unique_id=1786763793]
548551
layout_mode = 1
549552
anchors_preset = 8
550553
anchor_left = 0.5
@@ -561,7 +564,7 @@ text = "HOLD R TO EXIT"
561564
label_settings = SubResource("LabelSettings_pause_hint")
562565
horizontal_alignment = 1
563566

564-
[node name="QuitOverlay" type="Panel" parent="."]
567+
[node name="QuitOverlay" type="Panel" parent="." unique_id=316579954]
565568
visible = false
566569
modulate = Color(1, 1, 1, 0)
567570
z_index = 2
@@ -573,7 +576,7 @@ grow_vertical = 2
573576
mouse_filter = 2
574577
theme_override_styles/panel = SubResource("StyleBoxEmpty_d5aou")
575578

576-
[node name="Holder" type="VBoxContainer" parent="QuitOverlay"]
579+
[node name="Holder" type="VBoxContainer" parent="QuitOverlay" unique_id=289008022]
577580
layout_mode = 1
578581
anchors_preset = 8
579582
anchor_left = 0.5
@@ -588,20 +591,19 @@ grow_horizontal = 2
588591
grow_vertical = 2
589592
alignment = 1
590593

591-
[node name="Label" type="Label" parent="QuitOverlay/Holder"]
594+
[node name="Label" type="Label" parent="QuitOverlay/Holder" unique_id=1425722822]
592595
layout_mode = 2
593596
text = "Hold R to Quit"
594597
label_settings = SubResource("LabelSettings_r7xjp")
595598
horizontal_alignment = 1
596599

597-
[node name="ProgressBackground" type="ColorRect" parent="QuitOverlay/Holder"]
600+
[node name="ProgressBackground" type="ColorRect" parent="QuitOverlay/Holder" unique_id=372914467]
598601
custom_minimum_size = Vector2(300, 8)
599602
layout_mode = 2
600603
color = Color(0.28, 0.28, 0.28, 0.75)
601604

602-
[node name="ProgressBar" type="ColorRect" parent="QuitOverlay/Holder/ProgressBackground"]
605+
[node name="ProgressBar" type="ColorRect" parent="QuitOverlay/Holder/ProgressBackground" unique_id=541280931]
603606
layout_mode = 0
604-
offset_right = 0.0
605607
offset_bottom = 8.0
606608
color = Color(0.54, 0.54, 0.54, 0.82)
607609

@@ -783,7 +785,7 @@ text = "1x"
783785
label_settings = SubResource("LabelSettings_usmyc")
784786
horizontal_alignment = 1
785787

786-
[node name="PauseTitle" type="Label" parent="PanelLeft/PanelLeftViewport" groups=["pause_text"]]
788+
[node name="PauseTitle" type="Label" parent="PanelLeft/PanelLeftViewport" unique_id=531787894 groups=["pause_text"]]
787789
anchors_preset = -1
788790
anchor_left = 0.5
789791
anchor_top = 0.86
@@ -799,7 +801,7 @@ text = "PAUSES"
799801
label_settings = SubResource("LabelSettings_pause_counter_title")
800802
horizontal_alignment = 1
801803

802-
[node name="PauseCount" type="Label" parent="PanelLeft/PanelLeftViewport" groups=["pause_text"]]
804+
[node name="PauseCount" type="Label" parent="PanelLeft/PanelLeftViewport" unique_id=1695472366 groups=["pause_text"]]
803805
anchors_preset = -1
804806
anchor_left = 0.5
805807
anchor_top = 0.93

scripts/SoundManager.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -370,19 +370,19 @@ private static bool isScopedPlayback()
370370

371371
public static float ComputeVolumeDb(float volume, float master, float range)
372372
{
373-
if (volume <= 0 || master <= 0) return double.NegativeInfinity;
374-
return -80 + range * Math.Pow(volume / 100, 0.1) * Math.Pow(master / 100, 0.1);
373+
if (volume <= 0 || master <= 0) return float.NegativeInfinity;
374+
return (float)(-80 + range * Math.Pow(volume / 100, 0.1) * Math.Pow(master / 100, 0.1));
375375
}
376376

377377
public static void UpdateVolume()
378378
{
379379
var settings = SettingsManager.Instance.Settings;
380380

381-
Song.VolumeDb = ComputeVolumeDb(settings.VolumeMusic.Value, settings.VolumeMaster.Value, 70);
382-
MenuMusic.VolumeDb = ComputeVolumeDb(settings.VolumeMenuMusic.Value, settings.VolumeMaster.Value, 70);
383-
HitSound.VolumeDb = ComputeVolumeDb(settings.VolumeHitSound.Value, settings.VolumeMaster.Value, 80);
384-
MissSound.VolumeDb = ComputeVolumeDb(settings.VolumeMissSound.Value, settings.VolumeMaster.Value, 80);
385-
FailSound.VolumeDb = ComputeVolumeDb(settings.VolumeSFX.Value, settings.VolumeMaster.Value, 80);
381+
Song.VolumeDb = ComputeVolumeDb((float)settings.VolumeMusic.Value, (float)settings.VolumeMaster.Value, 70);
382+
MenuMusic.VolumeDb = ComputeVolumeDb((float)settings.VolumeMenuMusic.Value, (float)settings.VolumeMaster.Value, 70);
383+
HitSound.VolumeDb = ComputeVolumeDb((float)settings.VolumeHitSound.Value, (float)settings.VolumeMaster.Value, 80);
384+
MissSound.VolumeDb = ComputeVolumeDb((float)settings.VolumeMissSound.Value, (float)settings.VolumeMaster.Value, 80);
385+
FailSound.VolumeDb = ComputeVolumeDb((float)settings.VolumeSFX.Value, (float)settings.VolumeMaster.Value, 80);
386386
}
387387

388388
public static void PlayHitSound()

scripts/database/settings/SettingsProfile.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,19 +263,19 @@ public partial class SettingsProfile
263263
/// Audio control for hit sound
264264
/// </summary>
265265
[Order]
266-
public SettingsItem<float> VolumeHitSound { get; private set; }
266+
public SettingsItem<double> VolumeHitSound { get; private set; }
267267

268268
/// <summary>
269269
/// Audio control for miss sound
270270
/// </summary>
271271
[Order]
272-
public SettingsItem<float> VolumeMissSound { get; private set; }
272+
public SettingsItem<double> VolumeMissSound { get; private set; }
273273

274274
/// <summary>
275275
/// Audio control for menu music
276276
/// </summary>
277277
[Order]
278-
public SettingsItem<float> VolumeMenuMusic { get; private set; }
278+
public SettingsItem<double> VolumeMenuMusic { get; private set; }
279279

280280
/// <summary>
281281
/// Toggles hit sound to always play
@@ -311,7 +311,7 @@ public partial class SettingsProfile
311311
/// Adjusts the local audio offset in milliseconds
312312
/// </summary>
313313
[Order]
314-
public SettingsItem<float> LocalOffset { get; private set; }
314+
public SettingsItem<double> LocalOffset { get; private set; }
315315

316316
#endregion
317317

@@ -537,7 +537,7 @@ public SettingsProfile()
537537
UpdateAction = (_, init) => { if (!init) { SkinManager.Load(); } },
538538
List = new("skin")
539539
{
540-
Values = ["skin", "void", "grid", "squircles", "waves"]
540+
Values = ["skin", "void", "grid", "squircles", "waves", "galaxy"]
541541
}
542542
};
543543

@@ -550,7 +550,7 @@ public SettingsProfile()
550550
UpdateAction = (_, init) => { if (!init) { SkinManager.Load(); } },
551551
List = new("skin")
552552
{
553-
Values = ["skin", "void", "grid", "squircles", "waves"]
553+
Values = ["skin", "void", "grid", "squircles", "waves", "galaxy"]
554554
}
555555
};
556556

@@ -775,7 +775,8 @@ public SettingsProfile()
775775
UpdateAction = (value, _) => DisplayServer.WindowSetMode(
776776
value
777777
? DisplayServer.WindowMode.ExclusiveFullscreen
778-
: DisplayServer.WindowMode.Windowed)
778+
: DisplayServer.WindowMode.Windowed
779+
)
779780
};
780781

781782
LockFPS = new(true)

scripts/map/Leaderboard.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ public Score(byte[] buffer)
156156
FileParser FileBuffer = new(buffer);
157157

158158
int attemptIdLength = (int)FileBuffer.GetUInt32();
159-
Logger.Log($"[Leaderboard] attemptId length={attemptIdLength}, remaining={FileBuffer.Length - FileBuffer.Pointer}");
159+
// Logger.Log($"[Leaderboard] attemptId length={attemptIdLength}, remaining={FileBuffer.Length - FileBuffer.Pointer}");
160160
AttemptID = FileBuffer.GetString(attemptIdLength);
161161

162162
int playerLength = (int)FileBuffer.GetUInt32();
163-
Logger.Log($"[Leaderboard] player length={playerLength}, remaining={FileBuffer.Length - FileBuffer.Pointer}");
163+
// Logger.Log($"[Leaderboard] player length={playerLength}, remaining={FileBuffer.Length - FileBuffer.Pointer}");
164164
Player = FileBuffer.GetString(playerLength);
165165

166166
Qualifies = FileBuffer.GetBool();
@@ -173,7 +173,7 @@ public Score(byte[] buffer)
173173
Modifiers = [];
174174

175175
int modifiersLength = (int)FileBuffer.GetUInt32();
176-
Logger.Log($"[Leaderboard] modifiers length={modifiersLength}, remaining={FileBuffer.Length - FileBuffer.Pointer}");
176+
// Logger.Log($"[Leaderboard] modifiers length={modifiersLength}, remaining={FileBuffer.Length - FileBuffer.Pointer}");
177177

178178
foreach (KeyValuePair<string, bool> entry in (Godot.Collections.Dictionary<string, bool>)Json.ParseString(FileBuffer.GetString(modifiersLength)))
179179
{

0 commit comments

Comments
 (0)