Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ csharp_style_prefer_index_operator = false:silent
csharp_style_prefer_range_operator = false:silent
csharp_style_prefer_switch_expression = false:none

csharp_style_namespace_declarations = block_scoped:warning
csharp_style_namespace_declarations = file_scoped:warning

#Style - C# 12 features
csharp_style_prefer_primary_constructors = false
Expand Down
1 change: 1 addition & 0 deletions .github/godot_version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.6.1
59 changes: 55 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,68 @@ name: CI

on:
pull_request:
types: [opened, reopened]
types:
- opened
workflow_dispatch:

jobs:
dotnet-format:
godot-project-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Verify xllint
shell: bash
run: |
command -v xmllint >/dev/null 2>&1 || {
sudo apt-get update
sudo apt-get install -y --no-install-recommends libxml2-utils
}

- name: Verify project
shell: bash
env:
CSPROJ_PATH: "Rhythia.csproj"
VERSION_FILE: ".github/godot_version.txt"
run: |
if compgen -G "${CSPROJ_PATH}.old*" > /dev/null; then
echo "::error file=${CSPROJ_PATH}.old::${CSPROJ_PATH}.old migration exists"
exit 1
fi

if [ ! -f "$CSPROJ_PATH" ]; then
echo "::error::$CSPROJ_PATH not found"
exit 1
fi

if [ ! -f "$VERSION_FILE" ]; then
echo "::error::$VERSION_FILE not found"
exit 1
fi

EXPECTED_VERSION=$(tr -d '[:space:]' < "$VERSION_FILE")
EXPECTED_SDK="Godot.NET.Sdk/${EXPECTED_VERSION}"

ACTUAL_SDK=$(xmllint --xpath 'string(/Project/@Sdk)' "$CSPROJ_PATH")

if [ -z "$ACTUAL_SDK" ]; then
echo "::error file=$CSPROJ_PATH::no <Project Sdk=\"...\"> attribute found"
exit 1
fi

if [ "$ACTUAL_SDK" != "$EXPECTED_SDK" ]; then
echo "::error file=$CSPROJ_PATH::expected Sdk=\"$EXPECTED_SDK\" but found Sdk=\"$ACTUAL_SDK\""
exit 1
fi

echo "Godot SDK OK: $ACTUAL_SDK"

dotnet-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # Checkout v4
- name: Setup
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # Dotnet 4.0.2
with:
dotnet-version: 10.0.x

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export_presets.cfg
*.translation

# Mono-specific ignores
*.csproj.user
.mono/
data_*/
mono_crash.*.json
Expand Down
18 changes: 0 additions & 18 deletions Rhythia.csproj.old

This file was deleted.

18 changes: 0 additions & 18 deletions Rhythia.csproj.old.1

This file was deleted.

9 changes: 0 additions & 9 deletions Rhythia.csproj.user

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/game/LegacyRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public override void _Process(double delta)
}

noteOpacity = Math.Clamp(noteOpacity, 0, 1);

float noteSize = (float)(LegacyRunner.CurrentAttempt.IsReplay ? LegacyRunner.CurrentAttempt.Replays[0].NoteSize : settings.NoteSize.Value) / 4;
Transform3D transform = new(Vector3.Right * noteSize, Vector3.Up * noteSize, Vector3.Back * noteSize, Vector3.Zero);

Expand Down
8 changes: 4 additions & 4 deletions scripts/map/MapManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ public static void Delete(Map map)
Maps.RemoveAll(x => x.Id == map.Id);


Callable.From(() =>
{
_ = ToastNotification.Notify($"Deleted {map.PrettyTitle}!");
}).CallDeferred();
Callable.From(() =>
{
_ = ToastNotification.Notify($"Deleted {map.PrettyTitle}!");
}).CallDeferred();
Callable.From(() => MapDeleted?.Invoke(map)).CallDeferred();
}
catch (Exception e)
Expand Down
6 changes: 3 additions & 3 deletions scripts/scenes/LegacyRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ public override void _Process(double delta)
else
{
double audioDelay = CurrentAttempt.Progress - 1000 * (SoundManager.Song.GetPlaybackPosition() + AudioServer.GetTimeSinceLastMix());

if (Math.Abs(audioDelay) > 25 && CurrentAttempt.Progress > 0)
{
SoundManager.Song.PitchScale = Math.Max(Mathf.Epsilon, (float)CurrentAttempt.Speed + (float)audioDelay / 1000);
Expand Down Expand Up @@ -1041,7 +1041,7 @@ public override void _Process(double delta)
CurrentAttempt.Skippable = false;

startGameplayMediaAtExpected(isPauseRampActive() ? SoundManager.Song.VolumeDb : getTargetMusicVolumeDb());

int nextNoteMillisecond = CurrentAttempt.PassedNotes >= CurrentAttempt.Map.Notes.Length ? (int)MapLength + 5000 : CurrentAttempt.Map.Notes[CurrentAttempt.PassedNotes].Millisecond;
int lastNoteMillisecond = CurrentAttempt.PassedNotes > 0 ? CurrentAttempt.Map.Notes[CurrentAttempt.PassedNotes - 1].Millisecond : 0;

Expand Down Expand Up @@ -1638,7 +1638,7 @@ private static void updatePauseStateEachFrame(double delta)
pauseHoldTime += (float)delta;
pauseState = Math.Max(0, pauseState - (float)(delta / pauseHoldDuration));
pauseHudControl.SetProgress(Math.Clamp(1f - pauseState, 0f, 1f));

if (CurrentAttempt.Map.AudioBuffer != null && musicStarted && SoundManager.Song.Playing)
{
SoundManager.Song.VolumeDb = Mathf.Lerp(getTargetMusicVolumeDb() - 60, getTargetMusicVolumeDb(), 1 - pauseState);
Expand Down
36 changes: 18 additions & 18 deletions scripts/scenes/PauseHud.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@

public partial class PauseHud : Control
{
private Control progressMask;
private Control progressMask;

public override void _Ready()
{
progressMask = GetNode<Control>("ProgressMask");
SetProgress(0);
}
public override void _Ready()
{
progressMask = GetNode<Control>("ProgressMask");
SetProgress(0);
}

public void SetProgress(float percent)
{
if (progressMask == null)
{
return;
}
public void SetProgress(float percent)
{
if (progressMask == null)
{
return;
}

float clamped = Mathf.Clamp(percent, 0f, 1f);
float width = 320f * clamped;
progressMask.OffsetRight = width / 2;
progressMask.OffsetLeft = -width / 2;
}
}
float clamped = Mathf.Clamp(percent, 0f, 1f);
float width = 320f * clamped;
progressMask.OffsetRight = width / 2;
progressMask.OffsetLeft = -width / 2;
}
}
70 changes: 35 additions & 35 deletions scripts/spaces/Galaxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ namespace Spaces;

public partial class Galaxy : BaseSpace
{
private SettingsProfile settings;
private Environment environment;
// private Node3D planet;
// private Vector3 planetStartPos;
private StandardMaterial3D tileMaterial;
private Color fogReset = new(0, 0, 0);

public override void _Ready()
{
base._Ready();
settings = SettingsManager.Instance.Settings;
environment = WorldEnvironment.Environment;
tileMaterial = (GetNode<MeshInstance3D>("Road").Mesh as PlaneMesh).Material as StandardMaterial3D;
// planet = GetNode<Node3D>("Planet");
// planetStartPos = planet.Position;
}

public override void _Process(double delta)
{
base._Process(delta);
// sky rotation
environment.SkyRotation += (Vector3.Down + Vector3.Right) * (float)delta / 100;
// tile movement
tileMaterial.Uv1Offset += Vector3.Up * (float)delta / 2;
// planet floating
//planet.Position = planetStartPos + Vector3.Up * (float)Math.Sin(Time.GetTicksMsec() / 1000f );
// fog
environment.FogLightColor = settings.SpaceHitEffects ? NoteHitColor : fogReset;
}
private SettingsProfile settings;
private Environment environment;
// private Node3D planet;
// private Vector3 planetStartPos;
private StandardMaterial3D tileMaterial;
private Color fogReset = new(0, 0, 0);

public override void _Ready()
{
base._Ready();

settings = SettingsManager.Instance.Settings;
environment = WorldEnvironment.Environment;
tileMaterial = (GetNode<MeshInstance3D>("Road").Mesh as PlaneMesh).Material as StandardMaterial3D;

// planet = GetNode<Node3D>("Planet");
// planetStartPos = planet.Position;
}

public override void _Process(double delta)
{
base._Process(delta);

// sky rotation
environment.SkyRotation += (Vector3.Down + Vector3.Right) * (float)delta / 100;

// tile movement
tileMaterial.Uv1Offset += Vector3.Up * (float)delta / 2;

// planet floating
//planet.Position = planetStartPos + Vector3.Up * (float)Math.Sin(Time.GetTicksMsec() / 1000f );

// fog
environment.FogLightColor = settings.SpaceHitEffects ? NoteHitColor : fogReset;
}
}
2 changes: 1 addition & 1 deletion scripts/spaces/Grid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ public override void _Process(double delta)
tileMaterial.AlbedoColor = NoteHitColor;
tileMaterial.Uv1Offset += Vector3.Up * (float)delta * 3;
}
}
}
2 changes: 1 addition & 1 deletion scripts/spaces/Squircles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ private void updateColor(Color color)
particlesNear.Color = color.Lightened(0.1f);
particlesFar.Color = particlesNear.Color;
}
}
}
2 changes: 1 addition & 1 deletion scripts/spaces/Waves.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ public override void UpdateState(bool playing)
skyMaterial.SetShaderParameter("image_lerp", 0.0);
}
}
}
}
6 changes: 3 additions & 3 deletions scripts/ui/SettingsMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@ private void updateProfileSelection()

string current = SettingsManager.GetCurrentProfile();
string[] profiles = Directory.GetFiles($"{Constants.USER_FOLDER}/profiles");

// add custom profiles to item list
for (int i = 0; i < profiles.Length; i++)
{
string name = profiles[i].GetFile().GetBaseName();

if (name != "default")
{
profilesButton.AddItem(name);
Expand Down Expand Up @@ -338,7 +338,7 @@ private void updateSlider(HSlider slider, LineEdit lineEdit, double value)
{
lineEdit.ReleaseFocus();
}

slider.SetValueNoSignal(value);
}

Expand Down
Loading