-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat/ActivableModifiers: Final version for activable modifiers
- Loading branch information
Showing
8 changed files
with
87 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 53 additions & 1 deletion
54
FightSabers/FightSabers/UI/Controllers/FightSabersGameplaySetup.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,63 @@ | ||
using BeatSaberMarkupLanguage.Attributes; | ||
using BeatSaberMarkupLanguage.Components; | ||
using FightSabers.Models.Modifiers; | ||
|
||
namespace FightSabers.UI.Controllers | ||
{ | ||
class FightSabersGameplaySetup : PersistentSingleton<FightSabersGameplaySetup> | ||
internal class FightSabersGameplaySetup : NotifiableSingleton<FightSabersGameplaySetup> | ||
{ | ||
[UIValue("warning-hint-text")] private string _warningHintText = "<color=#e74c3c>You will not encounter any monsters if you enable one of these modifiers, and will also disable the score submission.</color>"; | ||
[UIValue("note-shrinker")] public bool NoteShrinkerEnabled; | ||
[UIValue("note-shrinker-strength")] public float NoteShrinkerStrength = 1f; | ||
private string _noteShrinkerHint = "If enabled, notes will be scaled at <color=#FFA500>x0.65</color> of their size."; | ||
[UIValue("note-shrinker-hint")] | ||
public string NoteShrinkerHint { | ||
get { return _noteShrinkerHint; } | ||
private set { | ||
_noteShrinkerHint = value; | ||
NotifyPropertyChanged(); | ||
} | ||
} | ||
[UIValue("color-sucker")] public bool ColorSuckerEnabled; | ||
[UIValue("color-sucker-strength")] public float ColorSuckerStrength = 1f; | ||
private string _colorSuckerHint = "If enabled, notes will restore <color=#FFA500>2.56%</color> of their color when cut."; | ||
[UIValue("color-sucker-hint")] | ||
public string ColorSuckerHint { | ||
get { return _colorSuckerHint; } | ||
private set { | ||
_colorSuckerHint = value; | ||
NotifyPropertyChanged(); | ||
} | ||
} | ||
[UIValue("time-warper")] public bool TimeWarperEnabled; | ||
[UIValue("time-warper-strength")] public float TimeWarperStrength = 1f; | ||
private string _timeWarperHint = "If enabled, the song will be speed up by <color=#FFA500>x1.2</color>."; | ||
[UIValue("time-warper-hint")] public string TimeWarperHint | ||
{ | ||
get { return _timeWarperHint; } | ||
private set | ||
{ | ||
_timeWarperHint = value; | ||
NotifyPropertyChanged(); | ||
} | ||
} | ||
|
||
[UIAction("update-ns-hint-act")] | ||
public void UpdateNoteShrinkerHint(float value) | ||
{ | ||
NoteShrinkerHint = $"If enabled, notes will be scaled at <color=#FFA500>x{NoteShrinker.BaseScaleApplied.x * (1 / NoteShrinkerStrength):F}</color> of their size."; | ||
} | ||
|
||
[UIAction("update-cs-hint-act")] | ||
public void UpdateColorSuckerHint(float value) | ||
{ | ||
ColorSuckerHint = $"If enabled, notes will restore <color=#FFA500>{(float)(0.8 / (35 * ColorSuckerStrength * 0.85) * 100):F}%</color> of their color when cut."; | ||
} | ||
|
||
[UIAction("update-tw-hint-act")] | ||
public void UpdateTimeWarperHint(float value) | ||
{ | ||
TimeWarperHint = $"If enabled, the song will be speed up by <color=#FFA500>x{1 + 0.2 * TimeWarperStrength:F}</color>."; | ||
} | ||
} | ||
} |
18 changes: 13 additions & 5 deletions
18
FightSabers/FightSabers/UI/Views/FightSabersGameplaySetupView.bsml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
<bg xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='https://monkeymanboy.github.io/BSML-Docs/ https://raw.githubusercontent.com/monkeymanboy/BSML-Docs/gh-pages/BSMLSchema.xsd'> | ||
<modifier-container> | ||
<modifier source='#BatteryIcon' text='Note Shrinker' value='note-shrinker' apply-on-change='true'></modifier> | ||
<modifier source='#NoBombsIcon' text='Color Sucker' value='color-sucker' apply-on-change='true'></modifier> | ||
<modifier source='#FasterSongIcon' text='Time Warper' value='time-warper' apply-on-change='true'></modifier> | ||
</modifier-container> | ||
<horizontal horizontal-fit='PreferredSize'> | ||
<modifier-container pref-width='65'> | ||
<modifier source='#GameNoteIcon' text='Note Shrinker' value='note-shrinker' apply-on-change='true' hover-hint='~warning-hint-text'/> | ||
<increment-setting text='Strength' font-size='4' value='note-shrinker-strength' min='0.7' max='130' increment='0.05' apply-on-change='true' | ||
hover-hint='~note-shrinker-hint' on-change='update-ns-hint-act'/> | ||
<modifier source='#LightIcon' text='Color Sucker' value='color-sucker' apply-on-change='true' hover-hint='~warning-hint-text'/> | ||
<increment-setting text='Strength' font-size='4' value='color-sucker-strength' min='0.05' increment='0.05' apply-on-change='true' | ||
hover-hint='~color-sucker-hint' on-change='update-cs-hint-act'/> | ||
<modifier source='#FasterSongIcon' text='Time Warper' value='time-warper' apply-on-change='true' hover-hint='~warning-hint-text'/> | ||
<increment-setting text='Strength' font-size='4' value='time-warper-strength' min='0.05' increment='0.05' apply-on-change='true' | ||
hover-hint='~time-warper-hint' on-change='update-tw-hint-act'/> | ||
</modifier-container> | ||
</horizontal> | ||
</bg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters