refactor(CheatEnabler/UniverseGen): consume more centralized constants

This commit is contained in:
2026-06-23 20:48:35 +08:00
parent 25b33144b8
commit 1939a9cf22
6 changed files with 50 additions and 46 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
using UnityEngine;
using UXAssist.UI;
using UXAssist.Common;
using UXAssist.Common.GameConstants;
namespace UniverseGenTweaks;
@@ -51,10 +52,10 @@ public static class UIConfigWindow
MyWindow.AddText(x, y, tab1, "Maximum star count", 16);
x += 20f;
y += 26f;
var sl0 = MySlider.CreateSlider(x, y, tab1, MoreSettings.MaxStarCount.Value, 64f, 1024f, "G", 240f);
var sl0 = MySlider.CreateSlider(x, y, tab1, MoreSettings.MaxStarCount.Value, UniverseGenConstants.StarCountSliderMin, UniverseGenConstants.StarCountSliderMax, "G", 240f);
sl0.OnValueChanged += () =>
{
sl0.Value = MoreSettings.MaxStarCount.Value = (Mathf.RoundToInt(sl0.Value) + 7) & ~7;
sl0.Value = MoreSettings.MaxStarCount.Value = (Mathf.RoundToInt(sl0.Value) + UniverseGenConstants.StarCountAlignmentMask) & ~UniverseGenConstants.StarCountAlignmentMask;
};
x -= 30f;
y += 36f;