Skip to content

Commit

Permalink
Merge pull request #95 from Freeze7x/main
Browse files Browse the repository at this point in the history
Editor invert scrolling toggle
  • Loading branch information
flustix authored Oct 24, 2024
2 parents a8a2db3 + af63ddb commit 28470f1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions fluXis.Game/Configuration/FluXisConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ protected override void InitialiseDefaults()
SetDefault(FluXisSetting.EditorDim, 0.4f, 0f, .8f, 0.2f);
SetDefault(FluXisSetting.EditorBlur, 0f, 0f, 1f, 0.2f);
SetDefault(FluXisSetting.EditorShowSamples, false);
SetDefault(FluXisSetting.InvertScroll, false);

// Audio
SetDefault(FluXisSetting.InactiveVolume, 0.5d, 0d, 1d, 0.01d);
Expand Down Expand Up @@ -155,6 +156,7 @@ public enum FluXisSetting
EditorDim,
EditorBlur,
EditorShowSamples,
InvertScroll,

// Audio
InactiveVolume,
Expand Down
8 changes: 6 additions & 2 deletions fluXis.Game/Screens/Edit/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ private void load(AudioManager audioManager, Storage storage, FluXisConfig confi
dependencies.CacheAs(actionStack = new EditorActionStack(editorMap) { NotificationManager = notifications });
dependencies.CacheAs(settings = new EditorSettings
{
ShowSamples = config.GetBindable<bool>(FluXisSetting.EditorShowSamples)
ShowSamples = config.GetBindable<bool>(FluXisSetting.EditorShowSamples),
InvertedScroll = config.GetBindable<bool>(FluXisSetting.InvertScroll)
});

updateStateHash();
Expand Down Expand Up @@ -358,7 +359,10 @@ private void load(AudioManager audioManager, Storage storage, FluXisConfig confi
},
new FluXisMenuSpacer(),
new("Show sample on notes", FontAwesome6.Solid.LayerGroup, () => settings.ShowSamples.Value = !settings.ShowSamples.Value)
{ IsActive = () => settings.ShowSamples.Value }
{ IsActive = () => settings.ShowSamples.Value },
new FluXisMenuSpacer(),
new("Invert scroll direction", FontAwesome6.Solid.UpDown, () => settings.InvertedScroll.Value = !settings.InvertedScroll.Value)
{ IsActive = () => settings.InvertedScroll.Value }
}
},
new("Timing", FontAwesome6.Solid.Clock)
Expand Down
1 change: 1 addition & 0 deletions fluXis.Game/Screens/Edit/EditorSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public int SnapDivisor
public BindableBool FlashUnderlay { get; } = new();
public BindableColour4 FlashUnderlayColor { get; } = new(FluXisColors.Background1);
public Bindable<bool> ShowSamples { get; init; }
public Bindable<bool> InvertedScroll { get; init; }

public BindableFloat ZoomBindable { get; } = new(2f)
{
Expand Down
1 change: 1 addition & 0 deletions fluXis.Game/Screens/Edit/Tabs/Shared/EditorTabContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ protected override bool OnScroll(ScrollEvent e)
scrollAccumulation = delta * (1 - Math.Abs(scrollAccumulation));

scrollAccumulation += e.ScrollDelta.Y;
scrollAccumulation *= Settings.InvertedScroll.Value ? -1 : 1;

while (Math.Abs(scrollAccumulation) >= 1)
{
Expand Down

0 comments on commit 28470f1

Please sign in to comment.