checkbox fix!

This commit is contained in:
D1GQ committed 2024-08-24 09:25:28 -05:00
1 parent 23ebedcc13
commit 2fd1279995
2 files changed
+6 -13

No files matched your search

@@ -26,12 +26,6 @@ public class BetterOptionCheckboxItem : BetterOptionItem
optionBehaviour.OnValueChanged = new Action<OptionBehaviour>((option) => ValueChanged(id, option));
SpacingNum += StaticSpacingNumPlus;
// Fix Game Crash
foreach (RulesCategory rulesCategory in GameManager.Instance.GameSettingsList.AllCategories)
{
optionBehaviour.data = rulesCategory.AllGameSettings.ToArray().FirstOrDefault(item => item.Type == OptionTypes.Checkbox);
}
// Set data
optionBehaviour.CheckMark.GetComponent<SpriteRenderer>().enabled = DefaultValue;
TitleText = optionBehaviour.TitleText;
@@ -48,12 +42,11 @@ public class BetterOptionCheckboxItem : BetterOptionItem
{
if (BetterDataManager.CanLoadSetting(Id))
{
if (ThisOption != null)
{
var Bool = BetterDataManager.LoadBoolSetting(Id);
ThisOption.CheckMark.GetComponent<SpriteRenderer>().enabled = Bool;
IsChecked = Bool;
}
if (ThisOption == null) return;
var Bool = BetterDataManager.LoadBoolSetting(Id);
ThisOption.CheckMark.GetComponent<SpriteRenderer>().enabled = Bool;
IsChecked = Bool;
}
else
{
+1 -1
View File
@@ -49,7 +49,7 @@ static class GameSettingMenuPatch
}
TitleList.Add(new BetterOptionTitleItem().Create(BetterSettingsTab, $"<color=#4f92ff>Detections</color>"));
BetterGameSettings.DetectedLevelAbove = new BetterOptionIntItem().Create(600, BetterSettingsTab, "Detected player level = or >", [100, 1000, 5], 200, "Lv ", "");
BetterGameSettings.DetectedLevelAbove = new BetterOptionIntItem().Create(600, BetterSettingsTab, "Detected player level = or >", [100, 5000, 5], 200, "Lv ", "");
BetterGameSettings.DetectCheatClients = new BetterOptionCheckboxItem().Create(700, BetterSettingsTab, "Detect Cheat Clients", true);
BetterGameSettings.DetectInvalidRPCs = new BetterOptionCheckboxItem().Create(800, BetterSettingsTab, "Detect Invalid RPCs", true);