Skip to content

Commit

Permalink
Undo version bump for a beta build, plus other misc. fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Caeden117 committed May 22, 2019
1 parent a0ffb8b commit 77a869b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 41 deletions.
38 changes: 7 additions & 31 deletions Counters+/UI/AdvancedCounterSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class AdvancedCounterSettings
};
static List<Tuple<ICounterMode, string>> scoreSettings = new List<Tuple<ICounterMode, string>>
{
{ICounterMode.Both, "Original" }, //Counters+ Counter w/ Points
{ICounterMode.Original, "Original" }, //Counters+ Counter w/ Points
{ICounterMode.BaseGame, "Base Game" }, //Base Game w/ Points
//{ICounterMode.BaseWithOutPoints, "Base No Points" }, //Base Game w/ Points Under Combo
{ICounterMode.LeavePoints, "No Points" }, //Counters+ Counter w/ Points Under Combo
Expand All @@ -46,8 +46,6 @@ public class AdvancedCounterSettings
private static HoverHint scoreHover;
private static HoverHint spinometerHover;

private static ListViewController IncludeRingSetting;

internal static Dictionary<IConfigModel, Action<SubMenu, IConfigModel>> counterUIItems = new Dictionary<IConfigModel, Action<SubMenu, IConfigModel>>()
{
{ CC.settings.missedConfig, (sub, config) => {
Expand Down Expand Up @@ -83,6 +81,7 @@ public class AdvancedCounterSettings
};
scoreMode.GetValue = () => {
if (scoreHover == null) scoreHover = BeatSaberUI.AddHintText(scoreMode.transform as RectTransform, DetermineModeText(CC.settings.scoreConfig.Mode, true));
if (CC.settings.scoreConfig.Mode == ICounterMode.Both) CC.settings.scoreConfig.Mode = ICounterMode.Original;
return scoreSettings.ToList().IndexOf(scoreSettings.Where((Tuple<ICounterMode, string> x) => (x.Item1 == CC.settings.scoreConfig.Mode)).First());
};
scoreMode.SetValue += (v) => {
Expand Down Expand Up @@ -122,16 +121,13 @@ public class AdvancedCounterSettings
};
progressRank.SetValue += (v) => {
CC.settings.progressConfig.ProgressTimeLeft = v != 0f;
if (CC.settings.progressConfig.ProgressTimeLeft && CC.settings.progressConfig.Mode == ICounterMode.Original && IncludeRingSetting == null)
CreateIncludeRingSetting(ref sub);
else if (IncludeRingSetting != null){
CPEVC.loadedElements.Remove(IncludeRingSetting.gameObject);
UnityEngine.Object.Destroy(IncludeRingSetting.gameObject);
IncludeRingSetting = null;
CPEVC.settingsCount--;
}
};
var includeRing = CPEVC.AddList(ref sub, CC.settings.progressConfig, "Include Progress Ring", "Whether or not the Progress Ring will also be effected by the \"Progress From End\" setting.\nOnly active in \"Original\" mode.", 2);
includeRing.GetTextForValue = (v) => (v != 0f) ? "ON" : "OFF";
includeRing.GetValue = () => CC.settings.progressConfig.IncludeRing ? 1f : 0f;
includeRing.SetValue += (v) => CC.settings.progressConfig.IncludeRing = v != 0f;
var progressMode = CPEVC.AddList(ref sub, config, "Mode", "", progressSettings.Count());
progressMode.GetTextForValue = (v) => {
return progressSettings[Mathf.RoundToInt(v)].Item2;
Expand All @@ -144,17 +140,7 @@ public class AdvancedCounterSettings
if (progressHover == null) progressHover = BeatSaberUI.AddHintText(progressMode.transform as RectTransform, DetermineModeText(CC.settings.progressConfig.Mode));
CC.settings.progressConfig.Mode = progressSettings[Mathf.RoundToInt(v)].Item1;
progressHover.text = DetermineModeText(CC.settings.progressConfig.Mode);
if (CC.settings.progressConfig.ProgressTimeLeft && CC.settings.progressConfig.Mode == ICounterMode.Original && IncludeRingSetting == null)
CreateIncludeRingSetting(ref sub);
else if (IncludeRingSetting != null){
CPEVC.loadedElements.Remove(IncludeRingSetting.gameObject);
UnityEngine.Object.Destroy(IncludeRingSetting.gameObject);
IncludeRingSetting = null;
CPEVC.settingsCount--;
}
};
if (CC.settings.progressConfig.ProgressTimeLeft && CC.settings.progressConfig.Mode == ICounterMode.Original)
CreateIncludeRingSetting(ref sub);
} },
{ CC.settings.speedConfig, (sub, config) => {
var speedPrecision = CPEVC.AddList(ref sub, config, "Percentage Precision", "How precise should the precentage be?", 6);
Expand Down Expand Up @@ -194,16 +180,6 @@ public class AdvancedCounterSettings
} },
};

private static void CreateIncludeRingSetting(ref SubMenu sub)
{
var includeRing = CPEVC.AddList(ref sub, CC.settings.progressConfig, "Include Progress Ring", "Whether or not the Progress Ring will also be effected by the \"Progress From End\" setting.", 2);
includeRing.GetTextForValue = (v) => (v != 0f) ? "ON" : "OFF";
includeRing.GetValue = () => CC.settings.progressConfig.IncludeRing ? 1f : 0f;
includeRing.SetValue += (v) => CC.settings.progressConfig.IncludeRing = v != 0f;
IncludeRingSetting = includeRing;
includeRing.Init();
}

private static string DetermineModeText(ICounterMode Mode, bool alternateText = false)
{
string mode = "Invalid mode!";
Expand Down
10 changes: 1 addition & 9 deletions Counters+/UI/ViewControllers/CountersPlusEditViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,15 +339,7 @@ private static void PositionElement(GameObject element)

private static void InitSettings()
{
try
{
foreach (ListViewController list in loadedSettings)
{
list.InvokePrivateMethod("OnDisable", new object[] { });
list.InvokePrivateMethod("OnEnable", new object[] { });
}
}
catch { } //No, well fine, fuck you too, mr. list was modified - enumeration cannot continue.
foreach (ListViewController list in loadedSettings) list.Init();
}
}
}
2 changes: 1 addition & 1 deletion Counters+/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"icon": "CountersPlus.UI.Images.Logo.png",
"id": "Counters+",
"name": "Counters+",
"version": "1.5.7",
"version": "1.5.6",
"dependsOn": {
"BS Utils": "^1.3.3",
"CustomUI": "^1.5.8"
Expand Down

0 comments on commit 77a869b

Please sign in to comment.