Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kinsi55 committed May 8, 2023
1 parent a290195 commit 0581c7c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion UI/Views/FilterView.bsml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</vertical>
<vertical child-control-height='false' bg='panel-top' pad='2' pad-bottom='1' pad-top='1' preferred-width='64'>
<text text='&lt;color=#DDD>Ranked' align='Center' underlined='true' bold='true' font-size='3.5' color='#69B' size-delta-y='5'/>
<list-setting text='Ranked Status' value="rankedState" choices='rankedFilterOptions' bind-value="true" apply-on-change="true" on-change="UpdateData"/>
<dropdown-list-setting text='Ranked Status' value="rankedState" choices='rankedFilterOptions' bind-value="true" apply-on-change="true" on-change="UpdateData"/>
<slider-setting text='Stars' value="minimumStars" bind-value="true" apply-on-change="true" max='13' increment='0.2' formatter='FormatShortFloat' on-change="UpdateData"/>
<slider-setting text='MERGE_TO_PREV' value="maximumStars" bind-value="true" apply-on-change="true" max='~STAR_FILTER_MAX' increment='0.2' formatter='FormatMaxStarsFloat' on-change="UpdateData"/>
</vertical>
Expand Down
3 changes: 2 additions & 1 deletion UI/Views/SplitViews/Settings.bsml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<bg xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='- https://raw.githubusercontent.com/monkeymanboy/BSML-Docs/gh-pages/BSMLSchema.xsd'>
<modal clickerino-offerino-closerino='true' hide-event='CloseSettingsModal' show-event='ShowModal' size-delta-x='80' size-delta-y='45'>
<modal clickerino-offerino-closerino='true' hide-event='CloseSettingsModal' show-event='ShowModal' size-delta-x='80' size-delta-y='55'>
<vertical horizontal-fit='Unconstrained' pad='4' pad-top='9'>
<horizontal bg='panel-top-gradient' ignore-layout='true' anchor-max-x='.97' anchor-min-x='.03' anchor-min-y='1' anchor-pos-y='-5'>
<text text='BetterSongSearch - Settings' align='Center'/>
Expand All @@ -9,6 +9,7 @@
<toggle-setting text='Download Song previews' value="loadSongPreviews" bind-value="true" apply-on-change="true" hover-hint="Load and play a short preview of songs not downloaded yet"/>
<toggle-setting text='Smaller Font size' value="smallerFontSize" bind-value="true" apply-on-change="true" hover-hint="Makes the Font size of the Song List smaller"/>
</macro.as-host>
<list-setting text='Preferred Leaderboard' value="preferredLeaderboard" choices="preferredLeaderboardChoices" bind-value="true" apply-on-change="true" hover-hint="If a song is ranked on multiple leaderboards this decides which leaderboards Star value to display and use when filtering"/>
<toggle-setting id="chinaToggle" text='Use Chinese BeatSaver Mirror' on-change="ChinaToggled"/>
<horizontal pad-top="2">
<button text='Close' click-event='CloseSettingsModal'/>
Expand Down
11 changes: 11 additions & 0 deletions UI/Views/SplitViews/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ class Settings {
public static readonly Settings instance = new Settings();
Settings() { }

static readonly IReadOnlyList<object> preferredLeaderboardChoices = new List<object>() { "ScoreSaber", "BeatLeader" };

string preferredLeaderboard {
get => PluginConfig.Instance.preferredLeaderboard;
set {
PluginConfig.Instance.preferredLeaderboard = value;

FilterView.limitedUpdateData.CallNextFrame();
}
}


[UIParams] readonly BSMLParserParams parserParams = null;

Expand Down
2 changes: 1 addition & 1 deletion Util/SongAndDiffWrappers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public RankedStates GetTargetedRankLeaderboardService() {
if(rStates.HasFlag(RankedStates.ScoresaberRanked) &&
// Filtering by BeatLeader ranked
FilterView.currentFilter.rankedState != (string)FilterOptions.rankedFilterOptions[2] &&
PluginConfig.Instance.preferredLeaderboard != "BeatLeader"
(PluginConfig.Instance.preferredLeaderboard != "BeatLeader" || !rStates.HasFlag(RankedStates.BeatleaderRanked))
)
return RankedStates.ScoresaberRanked;

Expand Down

0 comments on commit 0581c7c

Please sign in to comment.