Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f7e5335
export button
fogsaturate Jun 22, 2026
417556e
redundant
fogsaturate Jun 22, 2026
83beff5
dddssdfdffdffdffdffdfdf
fogsaturate Jun 22, 2026
6a82546
bye collection
fogsaturate Jun 23, 2026
fa3c268
selects file now
fogsaturate Jun 23, 2026
37b4c3e
easy
fogsaturate Jun 23, 2026
0fada81
useless
fogsaturate Jun 23, 2026
ce21167
deprecated
fogsaturate Jun 23, 2026
068693c
adjust to map.cs change
fogsaturate Jun 23, 2026
9de2b08
map folder cache
fogsaturate Jun 23, 2026
f00c7f0
fix .phxm extract
fogsaturate Jun 24, 2026
c85a6da
more debug YAY!!!!
fogsaturate Jun 24, 2026
bfd7020
fix
fogsaturate Jun 25, 2026
a79487a
yeah!
fogsaturate Jun 26, 2026
775379e
small optimization
fogsaturate Jun 26, 2026
f88717b
cleanup + fix
fogsaturate Jun 26, 2026
e60c1aa
cleanupppppp
fogsaturate Jun 26, 2026
f036bdc
its as shrimple as that
fogsaturate Jun 28, 2026
16d8de8
djfodsjfoisdfjhiosfjhoisdf
fogsaturate Jun 28, 2026
3a1df8b
cleanup + fix loading
fogsaturate Jun 28, 2026
c9f4b6b
more cleanup
fogsaturate Jun 28, 2026
db39546
fix replace map bug
fogsaturate Jun 28, 2026
8688ebf
fix replays
fogsaturate Jun 28, 2026
7be1ba7
i lied
fogsaturate Aug 4, 2026
2d8e114
fix map deletion
fogsaturate Aug 4, 2026
9e124b8
fix legacy replays
fogsaturate Aug 4, 2026
7b56478
Just in case
fogsaturate Aug 4, 2026
3f2de5c
Big cleanup :)
fogsaturate Aug 12, 2026
16e50d6
delete if not in maps folder
fogsaturate Aug 18, 2026
f13e678
:)
fogsaturate Aug 18, 2026
e936e48
HI !!!!!!!!! :)
fogsaturate Aug 18, 2026
71030a4
clean up
fogsaturate Aug 18, 2026
3ab1e83
favorite conversion
fogsaturate Aug 18, 2026
3baf294
fix annoying default map bug !!!
fogsaturate Aug 19, 2026
9af55c5
fix extracted files not getting deleted in maps folder
fogsaturate Aug 19, 2026
d3390cc
lets keep corrupted stuff for the future
fogsaturate Aug 19, 2026
fb0cc22
resident evil 5
fogsaturate Aug 21, 2026
09f8460
Merge branch 'indev' into indev
nyuwaea Aug 21, 2026
588c09d
dotnet format
fogsaturate Aug 21, 2026
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
16 changes: 15 additions & 1 deletion prefabs/map_info_container.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[ext_resource type="Theme" uid="uid://dhuhu3mmaew1a" path="res://themes/theme.tres" id="4_4d08m"]
[ext_resource type="Script" uid="uid://c1235cyjfh4rl" path="res://scripts/ui/LinkPopupButton.cs" id="4_dccrs"]
[ext_resource type="Texture2D" uid="uid://7px5v8ikildx" path="res://user/skins/default/ui/buttons/favorite.png" id="5_1m5pv"]
[ext_resource type="Texture2D" uid="uid://dkpbociv8fgfd" path="res://user/skins/default/ui/buttons/export.png" id="5_g02bu"]
[ext_resource type="Script" uid="uid://dy45uerqy0yd7" path="res://scripts/ui/FlatPreview.cs" id="5_svokg"]
[ext_resource type="Texture2D" uid="uid://degvlg4p0if70" path="res://user/skins/default/ui/buttons/add_video.png" id="6_g02bu"]
[ext_resource type="Texture2D" uid="uid://cgxbwx4f28lt2" path="res://user/skins/default/ui/buttons/copy.png" id="7_oibm8"]
Expand Down Expand Up @@ -175,7 +176,7 @@ outline_color = Color(0, 0, 0, 1)
shadow_size = 4
shadow_color = Color(0, 0, 0, 1)

[node name="MapInfoContainer" type="Panel" unique_id=150923669 node_paths=PackedStringArray("info", "dim", "coverBackground", "cover", "infoSubholder", "mainLabel", "extraLabel", "artistLink", "favoriteButton", "videoButton", "videoDialog", "copyButton", "copyDialog", "deleteButton", "actions", "preview", "speedHolder", "speedPresets", "playHolder", "startButton", "leaderboard", "lbScrollContainer", "lbContainer", "lbExpand", "lbHide")]
[node name="MapInfoContainer" type="Panel" unique_id=150923669 node_paths=PackedStringArray("info", "dim", "coverBackground", "cover", "infoSubholder", "mainLabel", "extraLabel", "artistLink", "exportButton", "favoriteButton", "videoButton", "videoDialog", "copyButton", "copyDialog", "deleteButton", "actions", "preview", "speedHolder", "speedPresets", "playHolder", "startButton", "leaderboard", "lbScrollContainer", "lbContainer", "lbExpand", "lbHide")]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
Expand All @@ -193,6 +194,7 @@ infoSubholder = NodePath("Info/ScrollContainer/HBoxContainer")
mainLabel = NodePath("Info/ScrollContainer/HBoxContainer/Subholder/Main")
extraLabel = NodePath("Info/ScrollContainer/HBoxContainer/Subholder/Extra")
artistLink = NodePath("Info/ScrollContainer/HBoxContainer/Background/ArtistLink")
exportButton = NodePath("Info/ScrollContainer/HBoxContainer/Subholder/Buttons/Export")
favoriteButton = NodePath("Info/ScrollContainer/HBoxContainer/Subholder/Buttons/Favorite")
videoButton = NodePath("Info/ScrollContainer/HBoxContainer/Subholder/Buttons/Video")
videoDialog = NodePath("Info/ScrollContainer/HBoxContainer/Subholder/Buttons/Video/VideoDialog")
Expand Down Expand Up @@ -357,6 +359,17 @@ grow_horizontal = 0
grow_vertical = 0
alignment = 2

[node name="Export" type="Button" parent="Info/ScrollContainer/HBoxContainer/Subholder/Buttons" unique_id=2033571562]
layout_mode = 2
tooltip_text = "Exports map into a .phxm file to share easily"
focus_mode = 0
mouse_default_cursor_shape = 2
theme = ExtResource("4_4d08m")
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_constants/icon_max_width = 24
icon = ExtResource("5_g02bu")
icon_alignment = 1

[node name="Favorite" type="Button" parent="Info/ScrollContainer/HBoxContainer/Subholder/Buttons" unique_id=1022164792]
layout_mode = 2
tooltip_text = "Favorite"
Expand Down Expand Up @@ -390,6 +403,7 @@ filters = PackedStringArray("*.mp4")
use_native_dialog = true

[node name="Copy" type="Button" parent="Info/ScrollContainer/HBoxContainer/Subholder/Buttons" unique_id=2053076461]
visible = false
layout_mode = 2
tooltip_text = "Copy"
focus_mode = 0
Expand Down
6 changes: 2 additions & 4 deletions scripts/SoundManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Godot;

Expand Down Expand Up @@ -221,7 +219,7 @@ public static void PlayJukebox(Map map, bool setRichPresence = true)

JukeboxIndex = MapManager.Maps.FindIndex(x => x.Id == map.Id);

Song.Stream = Util.Audio.LoadFromFile($"{MapUtil.MapsCacheFolder}/{map.Name}/audio.{map.AudioExt}");
Song.Stream = Util.Audio.LoadFromFile($"{MapUtil.MapsFolder}/{map.Name}/audio.{map.AudioExt}");
Song.Play();

Instance.JukeboxPlayed?.Invoke(map);
Expand Down Expand Up @@ -280,7 +278,7 @@ public static void StartMapSelectionPlayback(Map map, bool setRichPresence = tru
}
}

Song.Stream = Util.Audio.LoadFromFile($"{MapUtil.MapsCacheFolder}/{map.Name}/audio.{map.AudioExt}");
Song.Stream = Util.Audio.LoadFromFile($"{MapUtil.MapsFolder}/{map.Name}/audio.{map.AudioExt}");
Song.Play(0);

Instance.JukeboxPlayed?.Invoke(map);
Expand Down
9 changes: 5 additions & 4 deletions scripts/game/managers/ReplayManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using Godot;
Expand Down Expand Up @@ -28,7 +29,7 @@ public enum Mode
public string ReplayPath;
public Vector2 CursorPosition { get; private set; }

private FileAccess file;
private Godot.FileAccess file;
private ulong statusOffset, frameCountOffset;

public void NewReplay(Attempt attempt)
Expand All @@ -39,7 +40,7 @@ public void NewReplay(Attempt attempt)

ReplayPath = $"{Constants.USER_FOLDER}/replays/{attempt.ID}.phxr";

file = FileAccess.Open(ReplayPath, FileAccess.ModeFlags.Write);
file = Godot.FileAccess.Open(ReplayPath, Godot.FileAccess.ModeFlags.Write);

file.StoreString("phxr"); // sig
file.Store8(1); // replay file version
Expand Down Expand Up @@ -69,7 +70,7 @@ public void NewReplay(Attempt attempt)
}

string serializedMods = string.Join("_", mods);
string mapName = attempt.Map.FilePath.GetFile().GetBaseName();
string mapName = Path.GetFileName(attempt.Map.FolderPath);
string player = "You";

void storeSizedString(string data)
Expand Down Expand Up @@ -126,7 +127,7 @@ public void SaveReplay(Attempt attempt)
file.Close();

// open replay to store hash
file = FileAccess.Open($"{Constants.USER_FOLDER}/replays/{attempt.ID}.phxr", FileAccess.ModeFlags.ReadWrite);
file = Godot.FileAccess.Open($"{Constants.USER_FOLDER}/replays/{attempt.ID}.phxr", Godot.FileAccess.ModeFlags.ReadWrite);
ulong length = file.GetLength();
byte[] hash = SHA256.HashData(file.GetBuffer((long)length));
file.StoreBuffer(hash);
Expand Down
2 changes: 1 addition & 1 deletion scripts/game/ui/PlaytestOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void UpdatePlaytestOverlay(bool show)
speedValue = speedDouble;
}

var map = MapParser.Decode(oldAttempt.Map.FilePath, Rhythia.AudioFilePath);
var map = MapParser.Decode(oldAttempt.Map.FolderPath, Rhythia.AudioFilePath);

Game.Attempt = new(map, speedValue, GetStartFrom(startFromEdit) * 1000, Rhythia.TempCam, Rhythia.TempMods);
SceneManager.ReloadCurrentScene();
Expand Down
31 changes: 21 additions & 10 deletions scripts/map/Map.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
Expand All @@ -17,15 +16,21 @@ public partial class Map : RefCounted
public int Id { get; set; }

public string Name { get; set; } = string.Empty;
public int? CacheVersion { get; set; }
public string LastModifiedMetadata { get; set; }
public string LastModifiedNotes { get; set; }

public string Hash { get; set; }
/// <summary>
/// The hash of the metadata.json, then the objects.phxmo in order
/// </summary>
public string MetadataObjectHash { get; set; }

public string Collection { get; set; } = string.Empty;

[Ignore]
public MapSet MapSet { get; set; }

public string FilePath { get; set; } = string.Empty;
public string FolderPath { get; set; } = string.Empty;

public bool Favorite { get; set; }

Expand Down Expand Up @@ -86,7 +91,7 @@ public Note[] TryParseNotes()
{
try
{
notes = MapParser.DecodePHXMO($"{MapUtil.MapsCacheFolder}/{Name}/objects.phxmo");
notes = MapParser.DecodePHXMO($"{MapUtil.MapsFolder}/{Name}/objects.phxmo");
return notes;
}
catch
Expand All @@ -97,7 +102,7 @@ public Note[] TryParseNotes()

private Texture2D getCover()
{
string path = $"{MapUtil.MapsCacheFolder}/{Name}";
string path = $"{MapUtil.MapsFolder}/{Name}";

if (cover == DefaultCover && File.Exists($"{path}/cover.png"))
{
Expand All @@ -115,10 +120,15 @@ private Texture2D getCover()

public Map() { }

public Map(string filePath, Note[] data = null, string id = null, string artist = "", string title = "", float rating = 0, string[] mappers = null, int difficulty = 0, string difficultyName = null, int? length = null, byte[] audioBuffer = null, byte[] coverBuffer = null, byte[] videoBuffer = null, bool ephemeral = false, string artistLink = "", string artistPlatform = "")
public Map(string folderPath, Note[] data = null, string id = null, string artist = "", string title = "", float rating = 0, string[] mappers = null, int difficulty = 0, string difficultyName = null, int? length = null, byte[] audioBuffer = null, byte[] coverBuffer = null, byte[] videoBuffer = null, bool ephemeral = false, string artistLink = "", string artistPlatform = "")
{
FilePath = filePath;
CacheVersion = 2;

FolderPath = folderPath;
Ephemeral = ephemeral;
MetadataObjectHash = "";
LastModifiedMetadata = "";
LastModifiedNotes = "";
Artist = (artist ?? "").StripEscapes();
ArtistLink = artistLink;
ArtistPlatform = artistPlatform;
Expand All @@ -145,6 +155,7 @@ public Map(string filePath, Note[] data = null, string id = null, string artist

public string EncodeMeta()
{
string path = $"{MapUtil.MapsFolder}/{Name}";
return Json.Stringify(new Godot.Collections.Dictionary()
{
["ID"] = Name,
Expand All @@ -157,9 +168,9 @@ public string EncodeMeta()
["Difficulty"] = Difficulty,
["DifficultyName"] = DifficultyName,
["Length"] = Length,
["HasAudio"] = AudioBuffer != null,
["HasCover"] = CoverBuffer != null,
["HasVideo"] = VideoBuffer != null,
["HasAudio"] = AudioBuffer != null && File.Exists($"{path}/audio.{AudioExt}"),
["HasCover"] = CoverBuffer != null && File.Exists($"{path}/cover.png"),
["HasVideo"] = VideoBuffer != null && File.Exists($"{path}/video.mp4"),
["AudioExt"] = AudioExt
}, "\t");
}
Expand Down
Loading
Loading