Skip to content

Commit a60d1c9

Browse files
authored
cleanup and version check (#47)
relative fix
1 parent d44896d commit a60d1c9

21 files changed

Lines changed: 333 additions & 329 deletions

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ csharp_style_prefer_index_operator = false:silent
175175
csharp_style_prefer_range_operator = false:silent
176176
csharp_style_prefer_switch_expression = false:none
177177

178-
csharp_style_namespace_declarations = block_scoped:warning
178+
csharp_style_namespace_declarations = file_scoped:warning
179179

180180
#Style - C# 12 features
181181
csharp_style_prefer_primary_constructors = false

.github/godot_version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4.6.1

.github/workflows/ci.yml

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,68 @@ name: CI
22

33
on:
44
pull_request:
5-
types: [opened, reopened]
5+
types:
6+
- opened
67
workflow_dispatch:
78

89
jobs:
9-
dotnet-format:
10+
godot-project-check:
1011
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
14+
15+
- name: Verify xllint
16+
shell: bash
17+
run: |
18+
command -v xmllint >/dev/null 2>&1 || {
19+
sudo apt-get update
20+
sudo apt-get install -y --no-install-recommends libxml2-utils
21+
}
22+
23+
- name: Verify project
24+
shell: bash
25+
env:
26+
CSPROJ_PATH: "Rhythia.csproj"
27+
VERSION_FILE: ".github/godot_version.txt"
28+
run: |
29+
if compgen -G "${CSPROJ_PATH}.old*" > /dev/null; then
30+
echo "::error file=${CSPROJ_PATH}.old::${CSPROJ_PATH}.old migration exists"
31+
exit 1
32+
fi
33+
34+
if [ ! -f "$CSPROJ_PATH" ]; then
35+
echo "::error::$CSPROJ_PATH not found"
36+
exit 1
37+
fi
38+
39+
if [ ! -f "$VERSION_FILE" ]; then
40+
echo "::error::$VERSION_FILE not found"
41+
exit 1
42+
fi
43+
44+
EXPECTED_VERSION=$(tr -d '[:space:]' < "$VERSION_FILE")
45+
EXPECTED_SDK="Godot.NET.Sdk/${EXPECTED_VERSION}"
1146
47+
ACTUAL_SDK=$(xmllint --xpath 'string(/Project/@Sdk)' "$CSPROJ_PATH")
48+
49+
if [ -z "$ACTUAL_SDK" ]; then
50+
echo "::error file=$CSPROJ_PATH::no <Project Sdk=\"...\"> attribute found"
51+
exit 1
52+
fi
53+
54+
if [ "$ACTUAL_SDK" != "$EXPECTED_SDK" ]; then
55+
echo "::error file=$CSPROJ_PATH::expected Sdk=\"$EXPECTED_SDK\" but found Sdk=\"$ACTUAL_SDK\""
56+
exit 1
57+
fi
58+
59+
echo "Godot SDK OK: $ACTUAL_SDK"
60+
61+
dotnet-format:
62+
runs-on: ubuntu-latest
1263
steps:
13-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
64+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # Checkout v4
1465
- name: Setup
15-
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9
66+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # Dotnet 4.0.2
1667
with:
1768
dotnet-version: 10.0.x
1869

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export_presets.cfg
2121
*.translation
2222

2323
# Mono-specific ignores
24+
*.csproj.user
2425
.mono/
2526
data_*/
2627
mono_crash.*.json

Rhythia.csproj.old

Lines changed: 0 additions & 18 deletions
This file was deleted.

Rhythia.csproj.old.1

Lines changed: 0 additions & 18 deletions
This file was deleted.

Rhythia.csproj.user

Lines changed: 0 additions & 9 deletions
This file was deleted.

scripts/game/LegacyRenderer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public override void _Process(double delta)
3535
}
3636

3737
noteOpacity = Math.Clamp(noteOpacity, 0, 1);
38-
38+
3939
float noteSize = (float)(LegacyRunner.CurrentAttempt.IsReplay ? LegacyRunner.CurrentAttempt.Replays[0].NoteSize : settings.NoteSize.Value) / 4;
4040
Transform3D transform = new(Vector3.Right * noteSize, Vector3.Up * noteSize, Vector3.Back * noteSize, Vector3.Zero);
4141

scripts/map/MapManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ public static void Delete(Map map)
113113
Maps.RemoveAll(x => x.Id == map.Id);
114114

115115

116-
Callable.From(() =>
117-
{
118-
_ = ToastNotification.Notify($"Deleted {map.PrettyTitle}!");
119-
}).CallDeferred();
116+
Callable.From(() =>
117+
{
118+
_ = ToastNotification.Notify($"Deleted {map.PrettyTitle}!");
119+
}).CallDeferred();
120120
Callable.From(() => MapDeleted?.Invoke(map)).CallDeferred();
121121
}
122122
catch (Exception e)

scripts/scenes/LegacyRunner.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ public override void _Process(double delta)
930930
else
931931
{
932932
double audioDelay = CurrentAttempt.Progress - 1000 * (SoundManager.Song.GetPlaybackPosition() + AudioServer.GetTimeSinceLastMix());
933-
933+
934934
if (Math.Abs(audioDelay) > 25 && CurrentAttempt.Progress > 0)
935935
{
936936
SoundManager.Song.PitchScale = Math.Max(Mathf.Epsilon, (float)CurrentAttempt.Speed + (float)audioDelay / 1000);
@@ -1041,7 +1041,7 @@ public override void _Process(double delta)
10411041
CurrentAttempt.Skippable = false;
10421042

10431043
startGameplayMediaAtExpected(isPauseRampActive() ? SoundManager.Song.VolumeDb : getTargetMusicVolumeDb());
1044-
1044+
10451045
int nextNoteMillisecond = CurrentAttempt.PassedNotes >= CurrentAttempt.Map.Notes.Length ? (int)MapLength + 5000 : CurrentAttempt.Map.Notes[CurrentAttempt.PassedNotes].Millisecond;
10461046
int lastNoteMillisecond = CurrentAttempt.PassedNotes > 0 ? CurrentAttempt.Map.Notes[CurrentAttempt.PassedNotes - 1].Millisecond : 0;
10471047

@@ -1638,7 +1638,7 @@ private static void updatePauseStateEachFrame(double delta)
16381638
pauseHoldTime += (float)delta;
16391639
pauseState = Math.Max(0, pauseState - (float)(delta / pauseHoldDuration));
16401640
pauseHudControl.SetProgress(Math.Clamp(1f - pauseState, 0f, 1f));
1641-
1641+
16421642
if (CurrentAttempt.Map.AudioBuffer != null && musicStarted && SoundManager.Song.Playing)
16431643
{
16441644
SoundManager.Song.VolumeDb = Mathf.Lerp(getTargetMusicVolumeDb() - 60, getTargetMusicVolumeDb(), 1 - pauseState);

0 commit comments

Comments
 (0)