mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-09 00:13:36 +08:00
some fixes
This commit is contained in:
@@ -342,10 +342,11 @@ public static class FactoryPatch
|
||||
ref var signal = ref entitySignPool[belt.entityId];
|
||||
if (signal.iconId0 < 1000) continue;
|
||||
var signalBelt = pair.Value;
|
||||
var inc = signalBelt.Inc / signalBelt.Stack;
|
||||
if (altFormat)
|
||||
signal.count0 = signalBelt.SpeedLimit + signalBelt.Stack * 10000 + signalBelt.Inc / signalBelt.Stack * 100000;
|
||||
signal.count0 = signalBelt.SpeedLimit + signalBelt.Stack * 10000 + inc * 100000;
|
||||
else
|
||||
signal.count0 = signalBelt.SpeedLimit * 100 + signalBelt.Stack + signalBelt.Inc / signalBelt.Stack * 10;
|
||||
signal.count0 = signalBelt.SpeedLimit * 100 + signalBelt.Stack + inc * 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -526,7 +527,7 @@ public static class FactoryPatch
|
||||
GetSignalBelts(factory)?.Remove(beltId);
|
||||
}
|
||||
|
||||
public static void RemovePlanetSignalBelts(int factory)
|
||||
private static void RemovePlanetSignalBelts(int factory)
|
||||
{
|
||||
GetSignalBelts(factory)?.Clear();
|
||||
}
|
||||
|
||||
@@ -96,8 +96,7 @@ public static class PlanetPatch
|
||||
);
|
||||
matcher.Repeat(codeMatcher =>
|
||||
{
|
||||
matcher.Advance(1);
|
||||
matcher.InsertAndAdvance(
|
||||
codeMatcher.Advance(1).InsertAndAdvance(
|
||||
new CodeInstruction(OpCodes.Ldloc, local1),
|
||||
new CodeInstruction(OpCodes.Or)
|
||||
);
|
||||
|
||||
@@ -8,7 +8,7 @@ public static class UIConfigWindow
|
||||
{
|
||||
private static RectTransform _windowTrans;
|
||||
private static RectTransform _tab;
|
||||
private static readonly UIButton[] _dysonLayerBtn = new UIButton[10];
|
||||
private static readonly UIButton[] DysonLayerBtn = new UIButton[10];
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
@@ -30,6 +30,7 @@ public static class UIConfigWindow
|
||||
I18N.Add("Click to dismantle selected layer", "Click to dismantle selected layer", "点击拆除对应的戴森壳");
|
||||
I18N.Apply();
|
||||
MyConfigWindow.OnUICreated += CreateUI;
|
||||
MyConfigWindow.OnUpdateUI += UpdateUI;
|
||||
}
|
||||
|
||||
private static void CreateUI(MyConfigWindow wnd, RectTransform trans)
|
||||
@@ -77,7 +78,7 @@ public static class UIConfigWindow
|
||||
var id = i + 1;
|
||||
var btn = wnd.AddFlatButton(x, y, tab1, id.ToString(), 12, "dismantle-layer-" + id, () => { DysonSpherePatch.InitCurrentDysonSphere(id); });
|
||||
((RectTransform)btn.transform).sizeDelta = new Vector2(40f, 20f);
|
||||
_dysonLayerBtn[i] = btn;
|
||||
DysonLayerBtn[i] = btn;
|
||||
if (i == 4)
|
||||
{
|
||||
x -= 160f;
|
||||
@@ -113,7 +114,7 @@ public static class UIConfigWindow
|
||||
for (var i = 1; i <= 10; i++)
|
||||
{
|
||||
var layer = ds.layersIdBased[i];
|
||||
_dysonLayerBtn[i - 1].button.interactable = layer != null && layer.id == i;
|
||||
DysonLayerBtn[i - 1].button.interactable = layer != null && layer.id == i;
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -122,7 +123,7 @@ public static class UIConfigWindow
|
||||
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
_dysonLayerBtn[i].button.interactable = false;
|
||||
DysonLayerBtn[i].button.interactable = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public static class UIConfigWindow
|
||||
MyWindow.AddText(x, y, tab, "Maximum star count", 16);
|
||||
x += 20f;
|
||||
y += 26f;
|
||||
var sl0 = MySlider.CreateSlider(x, y, tab, (float)MoreSettings.MaxStarCount.Value, 64f, 1024f, "G", 240f);
|
||||
var sl0 = MySlider.CreateSlider(x, y, tab, MoreSettings.MaxStarCount.Value, 64f, 1024f, "G", 240f);
|
||||
sl0.OnValueChanged += () =>
|
||||
{
|
||||
sl0.Value = MoreSettings.MaxStarCount.Value = (Mathf.RoundToInt(sl0.Value) + 7) & ~7;
|
||||
|
||||
Reference in New Issue
Block a user