fix(uxassist): restore native tips and align auto-cruise sliders

This commit is contained in:
soarqin committed 2026-09-26 16:15:20 +08:00
1 parent 439b5053d8
commit 94a6833aae
4 files changed
+27 -47

No files matched your search

+4
View File
@@ -4,6 +4,8 @@
## Changlog
* 1.6.1
* `Settings help`: Restore the game's native tips on question-mark buttons.
* `Auto-cruise`: Align the settings sliders and reduce spacing between their tracks and values.
* `Real-time logistic stations info panel`: Fix lingering panels after dismantling stations or initializing a planet, and keep panels updating while typing.
* `Do not render factory entities (except belts and sorters)`: Fix the option not taking effect after updating to DSP 0.10.35.29057.
* 1.6.0
@@ -418,6 +420,8 @@
## 更新日志
* 1.6.1
* `设置提示`:修复问号按钮的游戏内提示不显示的问题。
* `自动巡航`:统一设置滑条的起始位置,并缩小滑条与数值之间的间距。
* `物流站实时信息面板`:修复拆除物流站或初始化本行星后面板残留的问题,输入文字时也会保持刷新。
* `不渲染工厂建筑实体(除了传送带和分拣器)`:修复更新到戴森球计划 0.10.35.29057 后该选项不生效的问题。
* 1.6.0
+2
View File
@@ -39,8 +39,10 @@ public static class LayoutHelper
var dst = UnityEngine.Object.Instantiate(src);
dst.gameObject.name = objName;
var btn = dst.GetComponent<UIButton>();
var tipSettings = btn.tips;
Util.ResetButton(btn);
Util.NormalizeRectWithTopLeft(btn, x, y, parent);
btn.tips = tipSettings;
btn.tips.topLevel = true;
btn.tips.tipTitle = label;
btn.tips.tipText = tip;
+19 -45
View File
@@ -703,63 +703,37 @@ public static class UIConfigWindow
var autoStopCheckBox = wnd.AddCheckBox(x + 20f, y, tab4, PlayerPatch.StopOnArrivalAndInput, I18NKeys.StopAutoCruiseOnManualInput, 13);
y += 27f;
var useWarpCheckBox = wnd.AddCheckBox(x + 20f, y, tab4, PlayerPatch.UseWarper, I18NKeys.UseWarp, 13);
var autoCruiseSliderLabelWidth = 0f;
y += 27f;
var warpEnergyY = y;
txt = wnd.AddText2(x + 20f, y, tab4, I18NKeys.UseWarpMinimalEnergy, 13, "use-warp-minimal-energy");
var warpEnergySlider = wnd.AddSideSlider(
x + 20f + UI.Util.GetPreferredWidth(txt) + 5f,
y,
tab4,
PlayerPatch.UseWarperMinimalEnergy,
new EnergyMapper( ),
"0",
200f,
- 100f).WithFontSize(13);
autoCruiseSliderLabelWidth = Mathf.Max(autoCruiseSliderLabelWidth, UI.Util.GetPreferredWidth(txt));
y += 27f;
var newNavDistanceY = y;
txt = wnd.AddText2(x + 20f, y, tab4, I18NKeys.DistanceToUseWarp, 13, "text-new-navigation-distance-to-warp");
var newNavDistanceSlider = wnd.AddSideSlider(
x + 20f + UI.Util.GetPreferredWidth(txt) + 5f,
y,
tab4,
PlayerPatch.UseWarperDistance,
new DistanceMapper( ),
"0.0",
200f,
-100f).WithFontSize(13);
autoCruiseSliderLabelWidth = Mathf.Max(autoCruiseSliderLabelWidth, UI.Util.GetPreferredWidth(txt));
y += 27f;
var speedUpCheckBox = wnd.AddCheckBox(x + 20f, y, tab4, PlayerPatch.UseSpeedUp, I18NKeys.AutoBoost, 13);
y += 27f;
var speedUpEnergyY = y;
txt = wnd.AddText2(x + 20f, y, tab4, I18NKeys.AutoBoostMinimalEnergy, 13, "auto-boost-minimal-energy");
var speedUpEnergySlider = wnd.AddSideSlider(
x + 20f + UI.Util.GetPreferredWidth(txt) + 5f,
y,
tab4,
PlayerPatch.UseSpeedUpMinimalEnergy,
new EnergyMapper( ),
"0",
200f,
- 100f).WithFontSize(13);
autoCruiseSliderLabelWidth = Mathf.Max(autoCruiseSliderLabelWidth, UI.Util.GetPreferredWidth(txt));
y += 27f;
var dfHiveY = y;
txt = wnd.AddText2(x + 20f, y, tab4, I18NKeys.DarkFogHiveFollowDistance, 13, "dark-fog-hive-follow-distance");
var dfHiveSlider = wnd.AddSideSlider(
x + 20f + UI.Util.GetPreferredWidth(txt) + 5f,
y,
tab4,
PlayerPatch.DFHiveFollowDistance,
new DistanceMapperHive( ),
"0.0",
200f,
- 100f).WithFontSize(13);
autoCruiseSliderLabelWidth = Mathf.Max(autoCruiseSliderLabelWidth, UI.Util.GetPreferredWidth(txt));
y += 27f;
var dfCarrierY = y;
txt = wnd.AddText2(x + 20f, y, tab4, I18NKeys.DarkFogCarrierFollowDistance, 13, "dark-fog-carrier-follow-distance");
var dfCarrierSlider = wnd.AddSideSlider(
x + 20f + UI.Util.GetPreferredWidth(txt) + 5f,
y,
tab4,
PlayerPatch.DFCarrierFollowDistance,
new DistanceMapperCarrier( ),
"0.0",
200f,
- 100f).WithFontSize(13);
autoCruiseSliderLabelWidth = Mathf.Max(autoCruiseSliderLabelWidth, UI.Util.GetPreferredWidth(txt));
var sliderX = x + 20f + autoCruiseSliderLabelWidth + 5f;
const float sliderWidth = 160f;
var warpEnergySlider = wnd.AddSideSlider(sliderX, warpEnergyY, tab4, PlayerPatch.UseWarperMinimalEnergy, new EnergyMapper(), "0", sliderWidth, -100f).WithFontSize(13);
var newNavDistanceSlider = wnd.AddSideSlider(sliderX, newNavDistanceY, tab4, PlayerPatch.UseWarperDistance, new DistanceMapper(), "0.0", sliderWidth, -100f).WithFontSize(13);
var speedUpEnergySlider = wnd.AddSideSlider(sliderX, speedUpEnergyY, tab4, PlayerPatch.UseSpeedUpMinimalEnergy, new EnergyMapper(), "0", sliderWidth, -100f).WithFontSize(13);
var dfHiveSlider = wnd.AddSideSlider(sliderX, dfHiveY, tab4, PlayerPatch.DFHiveFollowDistance, new DistanceMapperHive(), "0.0", sliderWidth, -100f).WithFontSize(13);
var dfCarrierSlider = wnd.AddSideSlider(sliderX, dfCarrierY, tab4, PlayerPatch.DFCarrierFollowDistance, new DistanceMapperCarrier(), "0.0", sliderWidth, -100f).WithFontSize(13);
PlayerPatch.AutoCruiseEnabled.SettingChanged += NavSettingChanged;
PlayerPatch.UseWarper.SettingChanged += NavSettingChanged;