mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-02-05 04:22:21 +08:00
Add an option to auto-config logistics
This commit is contained in:
@@ -62,6 +62,7 @@ public static class UIFunctions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region ConfigWindow
|
||||||
public static void ToggleConfigWindow()
|
public static void ToggleConfigWindow()
|
||||||
{
|
{
|
||||||
if (!_configWinInitialized)
|
if (!_configWinInitialized)
|
||||||
@@ -81,34 +82,6 @@ public static class UIFunctions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly Sprite[] PlanetIcons = [
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/07.png"),
|
|
||||||
null,
|
|
||||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/09.png"),
|
|
||||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/10.png"),
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/13.png"),
|
|
||||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/14.png"),
|
|
||||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/15.png"),
|
|
||||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/16.png"),
|
|
||||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/17.png"),
|
|
||||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/18.png"),
|
|
||||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/19.png"),
|
|
||||||
null,
|
|
||||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/21.png"),
|
|
||||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/22.png"),
|
|
||||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/23.png"),
|
|
||||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/24.png"),
|
|
||||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/25.png")
|
|
||||||
];
|
|
||||||
private static readonly int[] FilterPlanetThemes = [16, 23, 10, 15, 18, 22, 25, 21, 14, 17, 19, 7, 24, 9, 13];
|
private static readonly int[] FilterPlanetThemes = [16, 23, 10, 15, 18, 22, 25, 21, 14, 17, 19, 7, 24, 9, 13];
|
||||||
public static void InitMenuButtons()
|
public static void InitMenuButtons()
|
||||||
{
|
{
|
||||||
@@ -168,310 +141,370 @@ public static class UIFunctions
|
|||||||
_buttonOnPlanetGlobe.SetActive(true);
|
_buttonOnPlanetGlobe.SetActive(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
InitStarmapButtons();
|
||||||
|
_initialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RecreateConfigWindow()
|
||||||
|
{
|
||||||
|
if (!_configWinInitialized) return;
|
||||||
|
var wasActive = _configWin.active;
|
||||||
|
if (wasActive) _configWin._Close();
|
||||||
|
MyConfigWindow.DestroyInstance(_configWin);
|
||||||
|
_configWinInitialized = false;
|
||||||
|
if (wasActive) ToggleConfigWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UpdateGlobeButtonPosition(UIPlanetGlobe planetGlobe)
|
||||||
|
{
|
||||||
|
if (_buttonOnPlanetGlobe == null) return;
|
||||||
|
var rect = (RectTransform)_buttonOnPlanetGlobe.transform;
|
||||||
|
if (planetGlobe.dysonSphereSystemUnlocked || planetGlobe.logisticsSystemUnlocked)
|
||||||
{
|
{
|
||||||
var rtrans = uiRoot.uiGame.starmap.transform as RectTransform;
|
rect.anchoredPosition3D = new Vector3(64f, -5f, 0f);
|
||||||
var cornerComboBox = UI.MyCornerComboBox.CreateComboBox(135, 5, rtrans, true).WithItems("Show original name".Translate(), "Show distance".Translate(), "Show planet count".Translate(), "Show all information".Translate());
|
}
|
||||||
cornerComboBox.SetIndex(Functions.UIFunctions.CornerComboBoxIndex);
|
else
|
||||||
cornerComboBox.OnSelChanged += (index) =>
|
{
|
||||||
{
|
rect.anchoredPosition3D = new Vector3(128f, -100f, 0f);
|
||||||
Functions.UIFunctions.CornerComboBoxIndex = index;
|
}
|
||||||
};
|
}
|
||||||
_starmapFilterToggler = UI.MyCheckButton.CreateCheckButton(5, 5, rtrans, false, ">>").WithSize(24, 24);
|
#endregion
|
||||||
MyCheckButton[] buttons = [
|
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Kimberlite
|
|
||||||
UI.MyCheckButton.CreateCheckButton(53, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Fractal Silicon
|
|
||||||
UI.MyCheckButton.CreateCheckButton(77, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Organic Crystal
|
|
||||||
UI.MyCheckButton.CreateCheckButton(101, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Grating Crystal
|
|
||||||
UI.MyCheckButton.CreateCheckButton(125, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Stalagmite Crystal
|
|
||||||
UI.MyCheckButton.CreateCheckButton(149, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Unipolar Magnet
|
|
||||||
UI.MyCheckButton.CreateCheckButton(173, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Crude Oil
|
|
||||||
UI.MyCheckButton.CreateCheckButton(197, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Fire Ice
|
|
||||||
UI.MyCheckButton.CreateCheckButton(221, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Sulfuric Acid
|
|
||||||
UI.MyCheckButton.CreateCheckButton(245, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Water
|
|
||||||
UI.MyCheckButton.CreateCheckButton(269, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Hydrogen
|
|
||||||
UI.MyCheckButton.CreateCheckButton(293, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Deuterium
|
|
||||||
|
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 29, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
#region StarMapButtons
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 53, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
private static readonly Sprite[] PlanetIcons = [
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 77, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
null,
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 101, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
null,
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 125, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
null,
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 149, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
null,
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 173, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
null,
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 197, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
null,
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 221, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
null,
|
||||||
|
Common.Util.LoadEmbeddedSprite("assets/planet_icon/07.png"),
|
||||||
|
null,
|
||||||
|
Common.Util.LoadEmbeddedSprite("assets/planet_icon/09.png"),
|
||||||
|
Common.Util.LoadEmbeddedSprite("assets/planet_icon/10.png"),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
Common.Util.LoadEmbeddedSprite("assets/planet_icon/13.png"),
|
||||||
|
Common.Util.LoadEmbeddedSprite("assets/planet_icon/14.png"),
|
||||||
|
Common.Util.LoadEmbeddedSprite("assets/planet_icon/15.png"),
|
||||||
|
Common.Util.LoadEmbeddedSprite("assets/planet_icon/16.png"),
|
||||||
|
Common.Util.LoadEmbeddedSprite("assets/planet_icon/17.png"),
|
||||||
|
Common.Util.LoadEmbeddedSprite("assets/planet_icon/18.png"),
|
||||||
|
Common.Util.LoadEmbeddedSprite("assets/planet_icon/19.png"),
|
||||||
|
null,
|
||||||
|
Common.Util.LoadEmbeddedSprite("assets/planet_icon/21.png"),
|
||||||
|
Common.Util.LoadEmbeddedSprite("assets/planet_icon/22.png"),
|
||||||
|
Common.Util.LoadEmbeddedSprite("assets/planet_icon/23.png"),
|
||||||
|
Common.Util.LoadEmbeddedSprite("assets/planet_icon/24.png"),
|
||||||
|
Common.Util.LoadEmbeddedSprite("assets/planet_icon/25.png")
|
||||||
|
];
|
||||||
|
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 263, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
public static void InitStarmapButtons()
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 287, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
{
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 311, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
var uiRoot = UIRoot.instance;
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 335, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
if (!uiRoot) return;
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 359, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
var rtrans = uiRoot.uiGame.starmap.transform as RectTransform;
|
||||||
UI.MyCheckButton.CreateCheckButton(29, 383, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
var cornerComboBox = UI.MyCornerComboBox.CreateComboBox(135, 5, rtrans, true).WithItems("Show original name".Translate(), "Show distance".Translate(), "Show planet count".Translate(), "Show all information".Translate());
|
||||||
];
|
cornerComboBox.SetIndex(Functions.UIFunctions.CornerComboBoxIndex);
|
||||||
var allOresText = MyWindow.AddText(25, 243, rtrans, "All 6 Basic Ores".Translate(), 12);
|
cornerComboBox.OnSelChanged += (index) =>
|
||||||
allOresText.gameObject.SetActive(false);
|
{
|
||||||
_starmapFilterToggler.OnChecked += UpdateButtons;
|
Functions.UIFunctions.CornerComboBoxIndex = index;
|
||||||
foreach (var button in buttons)
|
};
|
||||||
|
_starmapFilterToggler = UI.MyCheckButton.CreateCheckButton(5, 5, rtrans, false, ">>").WithSize(24, 24);
|
||||||
|
MyCheckButton[] buttons = [
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Kimberlite
|
||||||
|
UI.MyCheckButton.CreateCheckButton(53, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Fractal Silicon
|
||||||
|
UI.MyCheckButton.CreateCheckButton(77, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Organic Crystal
|
||||||
|
UI.MyCheckButton.CreateCheckButton(101, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Grating Crystal
|
||||||
|
UI.MyCheckButton.CreateCheckButton(125, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Stalagmite Crystal
|
||||||
|
UI.MyCheckButton.CreateCheckButton(149, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Unipolar Magnet
|
||||||
|
UI.MyCheckButton.CreateCheckButton(173, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Crude Oil
|
||||||
|
UI.MyCheckButton.CreateCheckButton(197, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Fire Ice
|
||||||
|
UI.MyCheckButton.CreateCheckButton(221, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Sulfuric Acid
|
||||||
|
UI.MyCheckButton.CreateCheckButton(245, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Water
|
||||||
|
UI.MyCheckButton.CreateCheckButton(269, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Hydrogen
|
||||||
|
UI.MyCheckButton.CreateCheckButton(293, 5, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Deuterium
|
||||||
|
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 29, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 53, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 77, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 101, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 125, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 149, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 173, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 197, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 221, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
||||||
|
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 263, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 287, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 311, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 335, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 359, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
||||||
|
UI.MyCheckButton.CreateCheckButton(29, 383, rtrans, false).WithIcon().WithSize(150, 24).WithIconWidth(24),
|
||||||
|
];
|
||||||
|
var allOresText = MyWindow.AddText(25, 243, rtrans, "All 6 Basic Ores".Translate(), 12);
|
||||||
|
allOresText.gameObject.SetActive(false);
|
||||||
|
_starmapFilterToggler.OnChecked += UpdateButtons;
|
||||||
|
foreach (var button in buttons)
|
||||||
|
{
|
||||||
|
button.OnChecked += () =>
|
||||||
{
|
{
|
||||||
button.OnChecked += () =>
|
if (button.Checked && !VFInput.shift && !VFInput.control)
|
||||||
{
|
{
|
||||||
if (button.Checked && !VFInput.shift && !VFInput.control)
|
foreach (var b in buttons)
|
||||||
{
|
{
|
||||||
foreach (var b in buttons)
|
if (b != button) b.Checked = false;
|
||||||
{
|
|
||||||
if (b != button) b.Checked = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
UpdateStarmapStarFilters();
|
}
|
||||||
};
|
UpdateStarmapStarFilters();
|
||||||
}
|
};
|
||||||
|
}
|
||||||
|
|
||||||
I18N.OnInitialized += UpdateI18N;
|
I18N.OnInitialized += UpdateI18N;
|
||||||
GameLogic.OnDataLoaded += () =>
|
GameLogic.OnDataLoaded += () =>
|
||||||
|
{
|
||||||
|
VeinProto veinProto;
|
||||||
|
for (int i = 0; i < 6; i++)
|
||||||
|
{
|
||||||
|
veinProto = LDB.veins.Select(i + 9);
|
||||||
|
buttons[i].SetIcon(veinProto.iconSprite);
|
||||||
|
}
|
||||||
|
var itemProto = LDB.items.Select(1007);
|
||||||
|
buttons[6].SetIcon(itemProto.iconSprite);
|
||||||
|
veinProto = LDB.veins.Select(8);
|
||||||
|
buttons[7].SetIcon(veinProto.iconSprite);
|
||||||
|
itemProto = LDB.items.Select(1116);
|
||||||
|
buttons[8].SetIcon(itemProto.iconSprite);
|
||||||
|
itemProto = LDB.items.Select(1000);
|
||||||
|
buttons[9].SetIcon(itemProto.iconSprite);
|
||||||
|
itemProto = LDB.items.Select(1120);
|
||||||
|
buttons[10].SetIcon(itemProto.iconSprite);
|
||||||
|
itemProto = LDB.items.Select(1121);
|
||||||
|
buttons[11].SetIcon(itemProto.iconSprite);
|
||||||
|
|
||||||
|
for (int i = 0; i < FilterPlanetThemes.Length; i++)
|
||||||
|
{
|
||||||
|
buttons[12 + i].SetIcon(PlanetIcons[FilterPlanetThemes[i]]);
|
||||||
|
}
|
||||||
|
UpdateI18N();
|
||||||
|
};
|
||||||
|
|
||||||
|
GameLogic.OnGameBegin += () =>
|
||||||
|
{
|
||||||
|
if (DSPGame.IsMenuDemo) return;
|
||||||
|
|
||||||
|
var galaxy = GameMain.data.galaxy;
|
||||||
|
ShowStarName = new bool[galaxy.starCount];
|
||||||
|
_starOrderNames = new string[galaxy.starCount];
|
||||||
|
_starmapStarFilterValues = new ulong[galaxy.starCount];
|
||||||
|
StarData[] stars = [.. galaxy.stars.Where(star => star != null)];
|
||||||
|
Array.Sort(stars, (a, b) =>
|
||||||
|
{
|
||||||
|
int res = a.position.sqrMagnitude.CompareTo(b.position.sqrMagnitude);
|
||||||
|
if (res != 0) return res;
|
||||||
|
return a.index.CompareTo(b.index);
|
||||||
|
});
|
||||||
|
for (int i = 0; i < stars.Length; i++)
|
||||||
|
{
|
||||||
|
var star = stars[i];
|
||||||
|
_starOrderNames[star.index] = star.displayName;
|
||||||
|
}
|
||||||
|
int[] spectrCount = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
|
for (int i = 0; i < stars.Length; i++)
|
||||||
|
{
|
||||||
|
var star = stars[i];
|
||||||
|
var index = star.index;
|
||||||
|
switch (star.type)
|
||||||
|
{
|
||||||
|
case EStarType.MainSeqStar:
|
||||||
|
switch (star.spectr)
|
||||||
|
{
|
||||||
|
case ESpectrType.M:
|
||||||
|
_starOrderNames[index] = String.Format("M{0}", ++spectrCount[0]);
|
||||||
|
break;
|
||||||
|
case ESpectrType.K:
|
||||||
|
_starOrderNames[index] = String.Format("K{0}", ++spectrCount[1]);
|
||||||
|
break;
|
||||||
|
case ESpectrType.G:
|
||||||
|
_starOrderNames[index] = String.Format("G{0}", ++spectrCount[2]);
|
||||||
|
break;
|
||||||
|
case ESpectrType.F:
|
||||||
|
_starOrderNames[index] = String.Format("F{0}", ++spectrCount[3]);
|
||||||
|
break;
|
||||||
|
case ESpectrType.A:
|
||||||
|
_starOrderNames[index] = String.Format("A{0}", ++spectrCount[4]);
|
||||||
|
break;
|
||||||
|
case ESpectrType.B:
|
||||||
|
_starOrderNames[index] = String.Format("B{0}", ++spectrCount[5]);
|
||||||
|
break;
|
||||||
|
case ESpectrType.O:
|
||||||
|
_starOrderNames[index] = String.Format("O{0}", ++spectrCount[6]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EStarType.GiantStar:
|
||||||
|
_starOrderNames[index] = String.Format("GS{0}", ++spectrCount[7]);
|
||||||
|
break;
|
||||||
|
case EStarType.WhiteDwarf:
|
||||||
|
_starOrderNames[index] = String.Format("WD{0}", ++spectrCount[8]);
|
||||||
|
break;
|
||||||
|
case EStarType.NeutronStar:
|
||||||
|
_starOrderNames[index] = String.Format("NS{0}", ++spectrCount[9]);
|
||||||
|
break;
|
||||||
|
case EStarType.BlackHole:
|
||||||
|
_starOrderNames[index] = String.Format("BH{0}", ++spectrCount[10]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_starmapFilterToggler.gameObject.SetActive(false);
|
||||||
|
_starmapFilterToggler.Checked = false;
|
||||||
|
UpdateButtons();
|
||||||
|
SetStarFilterEnabled(false);
|
||||||
|
foreach (var star in galaxy.stars)
|
||||||
|
{
|
||||||
|
if (star != null) PlanetModelingManager.RequestScanStar(star);
|
||||||
|
}
|
||||||
|
_starmapFilterInitialized = true;
|
||||||
|
};
|
||||||
|
GameLogic.OnGameEnd += () =>
|
||||||
|
{
|
||||||
|
_starOrderNames = null;
|
||||||
|
ShowStarName = null;
|
||||||
|
_starmapStarFilterValues = null;
|
||||||
|
_starmapFilterInitialized = false;
|
||||||
|
};
|
||||||
|
void UpdateI18N()
|
||||||
|
{
|
||||||
|
if (cornerComboBox != null)
|
||||||
|
{
|
||||||
|
var items = cornerComboBox.Items;
|
||||||
|
cornerComboBox.UpdateLabelText();
|
||||||
|
items[0] = "Show original name".Translate();
|
||||||
|
items[1] = "Show distance".Translate();
|
||||||
|
items[2] = "Show planet count".Translate();
|
||||||
|
items[3] = "Show all information".Translate();
|
||||||
|
}
|
||||||
|
if (buttons != null)
|
||||||
{
|
{
|
||||||
VeinProto veinProto;
|
VeinProto veinProto;
|
||||||
for (int i = 0; i < 6; i++)
|
for (int i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
veinProto = LDB.veins.Select(i + 9);
|
veinProto = LDB.veins.Select(i + 9);
|
||||||
buttons[i].SetIcon(veinProto.iconSprite);
|
buttons[i].WithTip(veinProto.Name);
|
||||||
}
|
}
|
||||||
var itemProto = LDB.items.Select(1007);
|
var itemProto = LDB.items.Select(1007);
|
||||||
buttons[6].SetIcon(itemProto.iconSprite);
|
buttons[6].WithTip(itemProto.Name);
|
||||||
veinProto = LDB.veins.Select(8);
|
veinProto = LDB.veins.Select(8);
|
||||||
buttons[7].SetIcon(veinProto.iconSprite);
|
buttons[7].WithTip(veinProto.Name);
|
||||||
itemProto = LDB.items.Select(1116);
|
itemProto = LDB.items.Select(1116);
|
||||||
buttons[8].SetIcon(itemProto.iconSprite);
|
buttons[8].WithTip(itemProto.Name);
|
||||||
itemProto = LDB.items.Select(1000);
|
itemProto = LDB.items.Select(1000);
|
||||||
buttons[9].SetIcon(itemProto.iconSprite);
|
buttons[9].WithTip(itemProto.Name);
|
||||||
itemProto = LDB.items.Select(1120);
|
itemProto = LDB.items.Select(1120);
|
||||||
buttons[10].SetIcon(itemProto.iconSprite);
|
buttons[10].WithTip(itemProto.Name);
|
||||||
itemProto = LDB.items.Select(1121);
|
itemProto = LDB.items.Select(1121);
|
||||||
buttons[11].SetIcon(itemProto.iconSprite);
|
buttons[11].WithTip(itemProto.Name);
|
||||||
|
|
||||||
for (int i = 0; i < FilterPlanetThemes.Length; i++)
|
for (int i = 0; i < FilterPlanetThemes.Length; i++)
|
||||||
{
|
{
|
||||||
buttons[12 + i].SetIcon(PlanetIcons[FilterPlanetThemes[i]]);
|
var theme = FilterPlanetThemes[i];
|
||||||
}
|
var themeProto = LDB.themes.Select(theme);
|
||||||
UpdateI18N();
|
switch (i)
|
||||||
};
|
|
||||||
|
|
||||||
GameLogic.OnGameBegin += () =>
|
|
||||||
{
|
|
||||||
if (DSPGame.IsMenuDemo) return;
|
|
||||||
|
|
||||||
var galaxy = GameMain.data.galaxy;
|
|
||||||
ShowStarName = new bool[galaxy.starCount];
|
|
||||||
_starOrderNames = new string[galaxy.starCount];
|
|
||||||
_starmapStarFilterValues = new ulong[galaxy.starCount];
|
|
||||||
StarData[] stars = [.. galaxy.stars.Where(star => star != null)];
|
|
||||||
Array.Sort(stars, (a, b) =>
|
|
||||||
{
|
|
||||||
int res = a.position.sqrMagnitude.CompareTo(b.position.sqrMagnitude);
|
|
||||||
if (res != 0) return res;
|
|
||||||
return a.index.CompareTo(b.index);
|
|
||||||
});
|
|
||||||
for (int i = 0; i < stars.Length; i++)
|
|
||||||
{
|
|
||||||
var star = stars[i];
|
|
||||||
_starOrderNames[star.index] = star.displayName;
|
|
||||||
}
|
|
||||||
int[] spectrCount = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
||||||
for (int i = 0; i < stars.Length; i++)
|
|
||||||
{
|
|
||||||
var star = stars[i];
|
|
||||||
var index = star.index;
|
|
||||||
switch (star.type)
|
|
||||||
{
|
{
|
||||||
case EStarType.MainSeqStar:
|
case 7:
|
||||||
switch (star.spectr)
|
buttons[12 + i].SetLabelText($"{themeProto.DisplayName.Translate()} ({"High yield".Translate()})");
|
||||||
{
|
|
||||||
case ESpectrType.M:
|
|
||||||
_starOrderNames[index] = String.Format("M{0}", ++spectrCount[0]);
|
|
||||||
break;
|
|
||||||
case ESpectrType.K:
|
|
||||||
_starOrderNames[index] = String.Format("K{0}", ++spectrCount[1]);
|
|
||||||
break;
|
|
||||||
case ESpectrType.G:
|
|
||||||
_starOrderNames[index] = String.Format("G{0}", ++spectrCount[2]);
|
|
||||||
break;
|
|
||||||
case ESpectrType.F:
|
|
||||||
_starOrderNames[index] = String.Format("F{0}", ++spectrCount[3]);
|
|
||||||
break;
|
|
||||||
case ESpectrType.A:
|
|
||||||
_starOrderNames[index] = String.Format("A{0}", ++spectrCount[4]);
|
|
||||||
break;
|
|
||||||
case ESpectrType.B:
|
|
||||||
_starOrderNames[index] = String.Format("B{0}", ++spectrCount[5]);
|
|
||||||
break;
|
|
||||||
case ESpectrType.O:
|
|
||||||
_starOrderNames[index] = String.Format("O{0}", ++spectrCount[6]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case EStarType.GiantStar:
|
case 8:
|
||||||
_starOrderNames[index] = String.Format("GS{0}", ++spectrCount[7]);
|
buttons[12 + i].SetLabelText($"{themeProto.DisplayName.Translate()} ({"Perfect".Translate()})");
|
||||||
break;
|
break;
|
||||||
case EStarType.WhiteDwarf:
|
default:
|
||||||
_starOrderNames[index] = String.Format("WD{0}", ++spectrCount[8]);
|
buttons[12 + i].SetLabelText(themeProto.DisplayName.Translate());
|
||||||
break;
|
|
||||||
case EStarType.NeutronStar:
|
|
||||||
_starOrderNames[index] = String.Format("NS{0}", ++spectrCount[9]);
|
|
||||||
break;
|
|
||||||
case EStarType.BlackHole:
|
|
||||||
_starOrderNames[index] = String.Format("BH{0}", ++spectrCount[10]);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_starmapFilterToggler.gameObject.SetActive(false);
|
|
||||||
_starmapFilterToggler.Checked = false;
|
|
||||||
UpdateButtons();
|
|
||||||
SetStarFilterEnabled(false);
|
|
||||||
foreach (var star in galaxy.stars)
|
|
||||||
{
|
|
||||||
if (star != null) PlanetModelingManager.RequestScanStar(star);
|
|
||||||
}
|
|
||||||
_starmapFilterInitialized = true;
|
|
||||||
};
|
|
||||||
GameLogic.OnGameEnd += () =>
|
|
||||||
{
|
|
||||||
_starOrderNames = null;
|
|
||||||
ShowStarName = null;
|
|
||||||
_starmapStarFilterValues = null;
|
|
||||||
_starmapFilterInitialized = false;
|
|
||||||
};
|
|
||||||
void UpdateI18N()
|
|
||||||
{
|
|
||||||
if (cornerComboBox != null)
|
|
||||||
{
|
|
||||||
var items = cornerComboBox.Items;
|
|
||||||
cornerComboBox.UpdateLabelText();
|
|
||||||
items[0] = "Show original name".Translate();
|
|
||||||
items[1] = "Show distance".Translate();
|
|
||||||
items[2] = "Show planet count".Translate();
|
|
||||||
items[3] = "Show all information".Translate();
|
|
||||||
}
|
|
||||||
if (buttons != null)
|
|
||||||
{
|
|
||||||
VeinProto veinProto;
|
|
||||||
for (int i = 0; i < 6; i++)
|
|
||||||
{
|
|
||||||
veinProto = LDB.veins.Select(i + 9);
|
|
||||||
buttons[i].WithTip(veinProto.Name);
|
|
||||||
}
|
|
||||||
var itemProto = LDB.items.Select(1007);
|
|
||||||
buttons[6].WithTip(itemProto.Name);
|
|
||||||
veinProto = LDB.veins.Select(8);
|
|
||||||
buttons[7].WithTip(veinProto.Name);
|
|
||||||
itemProto = LDB.items.Select(1116);
|
|
||||||
buttons[8].WithTip(itemProto.Name);
|
|
||||||
itemProto = LDB.items.Select(1000);
|
|
||||||
buttons[9].WithTip(itemProto.Name);
|
|
||||||
itemProto = LDB.items.Select(1120);
|
|
||||||
buttons[10].WithTip(itemProto.Name);
|
|
||||||
itemProto = LDB.items.Select(1121);
|
|
||||||
buttons[11].WithTip(itemProto.Name);
|
|
||||||
|
|
||||||
for (int i = 0; i < FilterPlanetThemes.Length; i++)
|
|
||||||
{
|
|
||||||
var theme = FilterPlanetThemes[i];
|
|
||||||
var themeProto = LDB.themes.Select(theme);
|
|
||||||
switch (i)
|
|
||||||
{
|
|
||||||
case 7:
|
|
||||||
buttons[12 + i].SetLabelText($"{themeProto.DisplayName.Translate()} ({"High yield".Translate()})");
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
buttons[12 + i].SetLabelText($"{themeProto.DisplayName.Translate()} ({"Perfect".Translate()})");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
buttons[12 + i].SetLabelText(themeProto.DisplayName.Translate());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (allOresText != null) allOresText.text = "All 6 Basic Ores".Translate();
|
|
||||||
}
|
|
||||||
void UpdateButtons()
|
|
||||||
{
|
|
||||||
var chk = _starmapFilterToggler.Checked;
|
|
||||||
foreach (var button in buttons)
|
|
||||||
{
|
|
||||||
if (chk)
|
|
||||||
button.gameObject.SetActive(true);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
button.gameObject.SetActive(false);
|
|
||||||
button.Checked = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
allOresText.gameObject.SetActive(chk);
|
|
||||||
_starmapFilterToggler.SetLabelText(chk ? "X" : ">>");
|
|
||||||
if (!chk)
|
|
||||||
{
|
|
||||||
UpdateStarmapStarFilters();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
void UpdateStarmapStarFilters()
|
if (allOresText != null) allOresText.text = "All 6 Basic Ores".Translate();
|
||||||
|
}
|
||||||
|
void UpdateButtons()
|
||||||
|
{
|
||||||
|
var chk = _starmapFilterToggler.Checked;
|
||||||
|
foreach (var button in buttons)
|
||||||
{
|
{
|
||||||
var filterValue = 0UL;
|
if (chk)
|
||||||
if (_starmapFilterToggler.Checked)
|
button.gameObject.SetActive(true);
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 6; i++)
|
button.gameObject.SetActive(false);
|
||||||
{
|
button.Checked = false;
|
||||||
if (buttons[i].Checked)
|
|
||||||
{
|
|
||||||
filterValue |= 1UL << (i + 9);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (buttons[6].Checked)
|
|
||||||
{
|
|
||||||
filterValue |= 1UL << 7;
|
|
||||||
}
|
|
||||||
if (buttons[7].Checked)
|
|
||||||
{
|
|
||||||
filterValue |= 1UL << 8;
|
|
||||||
}
|
|
||||||
if (buttons[8].Checked)
|
|
||||||
{
|
|
||||||
filterValue |= 1UL << 22;
|
|
||||||
}
|
|
||||||
if (buttons[9].Checked)
|
|
||||||
{
|
|
||||||
filterValue |= 1UL << 23;
|
|
||||||
}
|
|
||||||
if (buttons[10].Checked)
|
|
||||||
{
|
|
||||||
filterValue |= 1UL << 20;
|
|
||||||
}
|
|
||||||
if (buttons[11].Checked)
|
|
||||||
{
|
|
||||||
filterValue |= 1UL << 21;
|
|
||||||
}
|
|
||||||
for (int i = 0; i < FilterPlanetThemes.Length; i++)
|
|
||||||
{
|
|
||||||
if (buttons[12 + i].Checked)
|
|
||||||
{
|
|
||||||
filterValue |= 1UL << (30 + FilterPlanetThemes[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (filterValue == 0UL)
|
}
|
||||||
{
|
allOresText.gameObject.SetActive(chk);
|
||||||
for (int i = 0; i < ShowStarName.Length; i++)
|
_starmapFilterToggler.SetLabelText(chk ? "X" : ">>");
|
||||||
{
|
if (!chk)
|
||||||
ShowStarName[i] = false;
|
{
|
||||||
}
|
UpdateStarmapStarFilters();
|
||||||
SetStarFilterEnabled(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (int i = _starmapStarFilterValues.Length - 1; i >= 0; i--)
|
|
||||||
{
|
|
||||||
ShowStarName[i] = (_starmapStarFilterValues[i] & filterValue) == filterValue;
|
|
||||||
}
|
|
||||||
SetStarFilterEnabled(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_initialized = true;
|
void UpdateStarmapStarFilters()
|
||||||
|
{
|
||||||
|
var filterValue = 0UL;
|
||||||
|
if (_starmapFilterToggler.Checked)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 6; i++)
|
||||||
|
{
|
||||||
|
if (buttons[i].Checked)
|
||||||
|
{
|
||||||
|
filterValue |= 1UL << (i + 9);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (buttons[6].Checked)
|
||||||
|
{
|
||||||
|
filterValue |= 1UL << 7;
|
||||||
|
}
|
||||||
|
if (buttons[7].Checked)
|
||||||
|
{
|
||||||
|
filterValue |= 1UL << 8;
|
||||||
|
}
|
||||||
|
if (buttons[8].Checked)
|
||||||
|
{
|
||||||
|
filterValue |= 1UL << 22;
|
||||||
|
}
|
||||||
|
if (buttons[9].Checked)
|
||||||
|
{
|
||||||
|
filterValue |= 1UL << 23;
|
||||||
|
}
|
||||||
|
if (buttons[10].Checked)
|
||||||
|
{
|
||||||
|
filterValue |= 1UL << 20;
|
||||||
|
}
|
||||||
|
if (buttons[11].Checked)
|
||||||
|
{
|
||||||
|
filterValue |= 1UL << 21;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < FilterPlanetThemes.Length; i++)
|
||||||
|
{
|
||||||
|
if (buttons[12 + i].Checked)
|
||||||
|
{
|
||||||
|
filterValue |= 1UL << (30 + FilterPlanetThemes[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (filterValue == 0UL)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < ShowStarName.Length; i++)
|
||||||
|
{
|
||||||
|
ShowStarName[i] = false;
|
||||||
|
}
|
||||||
|
SetStarFilterEnabled(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (int i = _starmapStarFilterValues.Length - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
ShowStarName[i] = (_starmapStarFilterValues[i] & filterValue) == filterValue;
|
||||||
|
}
|
||||||
|
SetStarFilterEnabled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void StarmapUpdateFilterValues()
|
private static void StarmapUpdateFilterValues()
|
||||||
@@ -573,30 +606,6 @@ public static class UIFunctions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RecreateConfigWindow()
|
|
||||||
{
|
|
||||||
if (!_configWinInitialized) return;
|
|
||||||
var wasActive = _configWin.active;
|
|
||||||
if (wasActive) _configWin._Close();
|
|
||||||
MyConfigWindow.DestroyInstance(_configWin);
|
|
||||||
_configWinInitialized = false;
|
|
||||||
if (wasActive) ToggleConfigWindow();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void UpdateGlobeButtonPosition(UIPlanetGlobe planetGlobe)
|
|
||||||
{
|
|
||||||
if (_buttonOnPlanetGlobe == null) return;
|
|
||||||
var rect = (RectTransform)_buttonOnPlanetGlobe.transform;
|
|
||||||
if (planetGlobe.dysonSphereSystemUnlocked || planetGlobe.logisticsSystemUnlocked)
|
|
||||||
{
|
|
||||||
rect.anchoredPosition3D = new Vector3(64f, -5f, 0f);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rect.anchoredPosition3D = new Vector3(128f, -100f, 0f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int CornerComboBoxIndex
|
public static int CornerComboBoxIndex
|
||||||
{
|
{
|
||||||
get => _cornerComboBoxIndex;
|
get => _cornerComboBoxIndex;
|
||||||
@@ -665,4 +674,5 @@ public static class UIFunctions
|
|||||||
return (nongas, total);
|
return (nongas, total);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ namespace UXAssist.Patches;
|
|||||||
public static class LogisticsPatch
|
public static class LogisticsPatch
|
||||||
{
|
{
|
||||||
public static ConfigEntry<bool> AutoConfigLogisticsEnabled;
|
public static ConfigEntry<bool> AutoConfigLogisticsEnabled;
|
||||||
|
public static ConfigEntry<bool> AutoConfigLimitAutoReplenishCount;
|
||||||
// Dispenser config
|
// Dispenser config
|
||||||
public static ConfigEntry<int> AutoConfigDispenserChargePower; // 3~30, display as 300000.0 * value
|
public static ConfigEntry<int> AutoConfigDispenserChargePower; // 3~30, display as 300000.0 * value
|
||||||
public static ConfigEntry<int> AutoConfigDispenserCourierCount; // 0~10
|
public static ConfigEntry<int> AutoConfigDispenserCourierCount; // 0~10
|
||||||
@@ -50,6 +51,7 @@ public static class LogisticsPatch
|
|||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
AutoConfigLogisticsEnabled.SettingChanged += (_, _) => AutoConfigLogistics.Enable(AutoConfigLogisticsEnabled.Value);
|
AutoConfigLogisticsEnabled.SettingChanged += (_, _) => AutoConfigLogistics.Enable(AutoConfigLogisticsEnabled.Value);
|
||||||
|
AutoConfigLimitAutoReplenishCount.SettingChanged += (_, _) => AutoConfigLogistics.ToggleLimitAutoReplenishCount();
|
||||||
LogisticsCapacityTweaksEnabled.SettingChanged += (_, _) => LogisticsCapacityTweaks.Enable(LogisticsCapacityTweaksEnabled.Value);
|
LogisticsCapacityTweaksEnabled.SettingChanged += (_, _) => LogisticsCapacityTweaks.Enable(LogisticsCapacityTweaksEnabled.Value);
|
||||||
AllowOverflowInLogisticsEnabled.SettingChanged += (_, _) => AllowOverflowInLogistics.Enable(AllowOverflowInLogisticsEnabled.Value);
|
AllowOverflowInLogisticsEnabled.SettingChanged += (_, _) => AllowOverflowInLogistics.Enable(AllowOverflowInLogisticsEnabled.Value);
|
||||||
LogisticsConstrolPanelImprovementEnabled.SettingChanged += (_, _) => LogisticsConstrolPanelImprovement.Enable(LogisticsConstrolPanelImprovementEnabled.Value);
|
LogisticsConstrolPanelImprovementEnabled.SettingChanged += (_, _) => LogisticsConstrolPanelImprovement.Enable(LogisticsConstrolPanelImprovementEnabled.Value);
|
||||||
@@ -99,9 +101,9 @@ public static class LogisticsPatch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class AutoConfigLogistics: PatchImpl<AutoConfigLogistics>
|
private class AutoConfigLogistics : PatchImpl<AutoConfigLogistics>
|
||||||
{
|
{
|
||||||
enum KnownItemId: int
|
enum KnownItemId : int
|
||||||
{
|
{
|
||||||
Drone = 5001,
|
Drone = 5001,
|
||||||
Ship = 5002,
|
Ship = 5002,
|
||||||
@@ -109,6 +111,76 @@ public static class LogisticsPatch
|
|||||||
Warper = 1210,
|
Warper = 1210,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnEnable()
|
||||||
|
{
|
||||||
|
ToggleLimitAutoReplenishCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnDisable()
|
||||||
|
{
|
||||||
|
ToggleLimitAutoReplenishCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ToggleLimitAutoReplenishCount()
|
||||||
|
{
|
||||||
|
LimitAutoReplenishCount.Enable(AutoConfigLogisticsEnabled.Value && AutoConfigLimitAutoReplenishCount.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private class LimitAutoReplenishCount : PatchImpl<LimitAutoReplenishCount>
|
||||||
|
{
|
||||||
|
[HarmonyTranspiler]
|
||||||
|
[HarmonyPatch(typeof(PlanetFactory), nameof(PlanetFactory.EntityAutoReplenishIfNeeded))]
|
||||||
|
[HarmonyPatch(typeof(PlanetFactory), nameof(PlanetFactory.StationAutoReplenishIfNeeded))]
|
||||||
|
private static IEnumerable<CodeInstruction> PlanetFactory_StationAutoReplenishIfNeeded_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
|
||||||
|
{
|
||||||
|
var matcher = new CodeMatcher(instructions, generator);
|
||||||
|
// Patch dispenser courier count
|
||||||
|
matcher.Start().MatchForward(false,
|
||||||
|
new CodeMatch(ci => ci.IsLdloc()),
|
||||||
|
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(DispenserComponent), nameof(DispenserComponent.workCourierDatas))),
|
||||||
|
new CodeMatch(OpCodes.Ldlen),
|
||||||
|
new CodeMatch(OpCodes.Conv_I4)
|
||||||
|
);
|
||||||
|
matcher.Repeat(m => m.Advance(4).InsertAndAdvance(
|
||||||
|
new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(LogisticsPatch), nameof(AutoConfigDispenserCourierCount))),
|
||||||
|
new CodeInstruction(OpCodes.Call, AccessTools.PropertyGetter(typeof(ConfigEntry<int>), nameof(ConfigEntry<int>.Value))),
|
||||||
|
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(Math), nameof(Math.Min), [typeof(int), typeof(int)]))
|
||||||
|
));
|
||||||
|
|
||||||
|
// Patch PLS/ILS drone count
|
||||||
|
matcher.Start().MatchForward(false,
|
||||||
|
new CodeMatch(ci => ci.IsLdloc()),
|
||||||
|
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(StationComponent), nameof(StationComponent.workDroneDatas))),
|
||||||
|
new CodeMatch(OpCodes.Ldlen),
|
||||||
|
new CodeMatch(OpCodes.Conv_I4)
|
||||||
|
);
|
||||||
|
matcher.Repeat(m =>
|
||||||
|
{
|
||||||
|
var instr = m.Instruction;
|
||||||
|
m.Advance(4).InsertAndAdvance(
|
||||||
|
instr,
|
||||||
|
Transpilers.EmitDelegate((int x, StationComponent station)
|
||||||
|
=> Math.Min(x, station.isStellar ? AutoConfigILSDroneCount.Value : AutoConfigPLSDroneCount.Value))
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Patch ILS ship count
|
||||||
|
matcher.Start().MatchForward(false,
|
||||||
|
new CodeMatch(ci => ci.IsLdloc()),
|
||||||
|
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(StationComponent), nameof(StationComponent.workShipDatas))),
|
||||||
|
new CodeMatch(OpCodes.Ldlen),
|
||||||
|
new CodeMatch(OpCodes.Conv_I4)
|
||||||
|
);
|
||||||
|
UXAssist.Logger.LogDebug($"Patch ILS ship count: {matcher.Pos}");
|
||||||
|
matcher.Repeat(m => m.Advance(4).InsertAndAdvance(
|
||||||
|
new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(LogisticsPatch), nameof(AutoConfigILSShipCount))),
|
||||||
|
new CodeInstruction(OpCodes.Call, AccessTools.PropertyGetter(typeof(ConfigEntry<int>), nameof(ConfigEntry<int>.Value))),
|
||||||
|
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(Math), nameof(Math.Min), [typeof(int), typeof(int)]))
|
||||||
|
));
|
||||||
|
return matcher.InstructionEnumeration();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void DoConfigStation(PlanetFactory factory, StationComponent station)
|
private static void DoConfigStation(PlanetFactory factory, StationComponent station)
|
||||||
{
|
{
|
||||||
if (station.isCollector) return;
|
if (station.isCollector) return;
|
||||||
@@ -119,7 +191,8 @@ public static class LogisticsPatch
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int toFill;
|
int toFill;
|
||||||
if (!station.isStellar) {
|
if (!station.isStellar)
|
||||||
|
{
|
||||||
factory.powerSystem.consumerPool[station.pcId].workEnergyPerTick = (long)(50000.0 * (double)AutoConfigPLSChargePower.Value + 0.5);
|
factory.powerSystem.consumerPool[station.pcId].workEnergyPerTick = (long)(50000.0 * (double)AutoConfigPLSChargePower.Value + 0.5);
|
||||||
station.tripRangeDrones = Math.Cos(AutoConfigPLSMaxTripDrone.Value / 180.0 * Math.PI);
|
station.tripRangeDrones = Math.Cos(AutoConfigPLSMaxTripDrone.Value / 180.0 * Math.PI);
|
||||||
station.deliveryDrones = AutoConfigPLSDroneMinDeliver.Value switch { 0 => 1, _ => AutoConfigPLSDroneMinDeliver.Value * 10 };
|
station.deliveryDrones = AutoConfigPLSDroneMinDeliver.Value switch { 0 => 1, _ => AutoConfigPLSDroneMinDeliver.Value * 10 };
|
||||||
@@ -130,12 +203,14 @@ public static class LogisticsPatch
|
|||||||
}
|
}
|
||||||
factory.powerSystem.consumerPool[station.pcId].workEnergyPerTick = (long)(250000.0 * (double)AutoConfigILSChargePower.Value + 0.5);
|
factory.powerSystem.consumerPool[station.pcId].workEnergyPerTick = (long)(250000.0 * (double)AutoConfigILSChargePower.Value + 0.5);
|
||||||
station.tripRangeDrones = Math.Cos(AutoConfigILSMaxTripDrone.Value / 180.0 * Math.PI);
|
station.tripRangeDrones = Math.Cos(AutoConfigILSMaxTripDrone.Value / 180.0 * Math.PI);
|
||||||
station.tripRangeShips = AutoConfigILSMaxTripShip.Value switch {
|
station.tripRangeShips = AutoConfigILSMaxTripShip.Value switch
|
||||||
|
{
|
||||||
<= 20 => AutoConfigILSMaxTripShip.Value,
|
<= 20 => AutoConfigILSMaxTripShip.Value,
|
||||||
<= 40 => AutoConfigILSMaxTripShip.Value * 2 - 20,
|
<= 40 => AutoConfigILSMaxTripShip.Value * 2 - 20,
|
||||||
_ => 10000,
|
_ => 10000,
|
||||||
} * 2400000.0;
|
} * 2400000.0;
|
||||||
station.warpEnableDist = AutoConfigILSWarperDistance.Value switch {
|
station.warpEnableDist = AutoConfigILSWarperDistance.Value switch
|
||||||
|
{
|
||||||
<= 7 => AutoConfigILSWarperDistance.Value * 0.5 - 0.5,
|
<= 7 => AutoConfigILSWarperDistance.Value * 0.5 - 0.5,
|
||||||
<= 16 => AutoConfigILSWarperDistance.Value - 4.0,
|
<= 16 => AutoConfigILSWarperDistance.Value - 4.0,
|
||||||
<= 20 => AutoConfigILSWarperDistance.Value * 2 - 20.0,
|
<= 20 => AutoConfigILSWarperDistance.Value * 2 - 20.0,
|
||||||
@@ -175,7 +250,7 @@ public static class LogisticsPatch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LogisticsCapacityTweaks: PatchImpl<LogisticsCapacityTweaks>
|
public class LogisticsCapacityTweaks : PatchImpl<LogisticsCapacityTweaks>
|
||||||
{
|
{
|
||||||
private static KeyCode _lastKey = KeyCode.None;
|
private static KeyCode _lastKey = KeyCode.None;
|
||||||
private static long _nextKeyTick;
|
private static long _nextKeyTick;
|
||||||
@@ -309,58 +384,58 @@ public static class LogisticsPatch
|
|||||||
switch (_funcId)
|
switch (_funcId)
|
||||||
{
|
{
|
||||||
case 30:
|
case 30:
|
||||||
{
|
|
||||||
var stationPool = __instance.stationPool;
|
|
||||||
var factory = __instance.factory;
|
|
||||||
var history = GameMain.history;
|
|
||||||
for (var i = __instance.stationCursor - 1; i > 0; i--)
|
|
||||||
{
|
{
|
||||||
if (stationPool[i] == null || stationPool[i].id != i || (stationPool[i].isStellar && !stationPool[i].isCollector && !stationPool[i].isVeinCollector)) continue;
|
var stationPool = __instance.stationPool;
|
||||||
var modelIndex = factory.entityPool[stationPool[i].entityId].modelIndex;
|
var factory = __instance.factory;
|
||||||
var maxCount = LDB.models.Select(modelIndex).prefabDesc.stationMaxItemCount;
|
var history = GameMain.history;
|
||||||
var oldMaxCount = maxCount + history.localStationExtraStorage - _valuelf;
|
for (var i = __instance.stationCursor - 1; i > 0; i--)
|
||||||
var intOldMaxCount = (int)Math.Round(oldMaxCount);
|
|
||||||
var ratio = (maxCount + history.localStationExtraStorage) / oldMaxCount;
|
|
||||||
var storage = stationPool[i].storage;
|
|
||||||
for (var j = storage.Length - 1; j >= 0; j--)
|
|
||||||
{
|
{
|
||||||
if (storage[j].max + 10 < intOldMaxCount) continue;
|
if (stationPool[i] == null || stationPool[i].id != i || (stationPool[i].isStellar && !stationPool[i].isCollector && !stationPool[i].isVeinCollector)) continue;
|
||||||
storage[j].max = Mathf.RoundToInt((float)(storage[j].max * ratio / 50.0)) * 50;
|
var modelIndex = factory.entityPool[stationPool[i].entityId].modelIndex;
|
||||||
|
var maxCount = LDB.models.Select(modelIndex).prefabDesc.stationMaxItemCount;
|
||||||
|
var oldMaxCount = maxCount + history.localStationExtraStorage - _valuelf;
|
||||||
|
var intOldMaxCount = (int)Math.Round(oldMaxCount);
|
||||||
|
var ratio = (maxCount + history.localStationExtraStorage) / oldMaxCount;
|
||||||
|
var storage = stationPool[i].storage;
|
||||||
|
for (var j = storage.Length - 1; j >= 0; j--)
|
||||||
|
{
|
||||||
|
if (storage[j].max + 10 < intOldMaxCount) continue;
|
||||||
|
storage[j].max = Mathf.RoundToInt((float)(storage[j].max * ratio / 50.0)) * 50;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 31:
|
case 31:
|
||||||
{
|
|
||||||
var stationPool = __instance.stationPool;
|
|
||||||
var factory = __instance.factory;
|
|
||||||
var history = GameMain.history;
|
|
||||||
for (var i = __instance.stationCursor - 1; i > 0; i--)
|
|
||||||
{
|
{
|
||||||
if (stationPool[i] == null || stationPool[i].id != i || !stationPool[i].isStellar || stationPool[i].isCollector || stationPool[i].isVeinCollector) continue;
|
var stationPool = __instance.stationPool;
|
||||||
var modelIndex = factory.entityPool[stationPool[i].entityId].modelIndex;
|
var factory = __instance.factory;
|
||||||
var maxCount = LDB.models.Select(modelIndex).prefabDesc.stationMaxItemCount;
|
var history = GameMain.history;
|
||||||
var oldMaxCount = maxCount + history.remoteStationExtraStorage - _valuelf;
|
for (var i = __instance.stationCursor - 1; i > 0; i--)
|
||||||
var intOldMaxCount = (int)Math.Round(oldMaxCount);
|
|
||||||
var ratio = (maxCount + history.remoteStationExtraStorage) / oldMaxCount;
|
|
||||||
var storage = stationPool[i].storage;
|
|
||||||
for (var j = storage.Length - 1; j >= 0; j--)
|
|
||||||
{
|
{
|
||||||
if (storage[j].max + 10 < intOldMaxCount) continue;
|
if (stationPool[i] == null || stationPool[i].id != i || !stationPool[i].isStellar || stationPool[i].isCollector || stationPool[i].isVeinCollector) continue;
|
||||||
storage[j].max = Mathf.RoundToInt((float)(storage[j].max * ratio / 100.0)) * 100;
|
var modelIndex = factory.entityPool[stationPool[i].entityId].modelIndex;
|
||||||
|
var maxCount = LDB.models.Select(modelIndex).prefabDesc.stationMaxItemCount;
|
||||||
|
var oldMaxCount = maxCount + history.remoteStationExtraStorage - _valuelf;
|
||||||
|
var intOldMaxCount = (int)Math.Round(oldMaxCount);
|
||||||
|
var ratio = (maxCount + history.remoteStationExtraStorage) / oldMaxCount;
|
||||||
|
var storage = stationPool[i].storage;
|
||||||
|
for (var j = storage.Length - 1; j >= 0; j--)
|
||||||
|
{
|
||||||
|
if (storage[j].max + 10 < intOldMaxCount) continue;
|
||||||
|
storage[j].max = Mathf.RoundToInt((float)(storage[j].max * ratio / 100.0)) * 100;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class AllowOverflowInLogistics: PatchImpl<AllowOverflowInLogistics>
|
private class AllowOverflowInLogistics : PatchImpl<AllowOverflowInLogistics>
|
||||||
{
|
{
|
||||||
// Do not check for overflow when try to send hand items into storages
|
// Do not check for overflow when try to send hand items into storages
|
||||||
[HarmonyTranspiler]
|
[HarmonyTranspiler]
|
||||||
@@ -412,7 +487,7 @@ public static class LogisticsPatch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class LogisticsConstrolPanelImprovement: PatchImpl<LogisticsConstrolPanelImprovement>
|
private class LogisticsConstrolPanelImprovement : PatchImpl<LogisticsConstrolPanelImprovement>
|
||||||
{
|
{
|
||||||
private static int ItemIdHintUnderMouse()
|
private static int ItemIdHintUnderMouse()
|
||||||
{
|
{
|
||||||
@@ -1073,8 +1148,12 @@ public static class LogisticsPatch
|
|||||||
_iconRemotes[i].gameObject.SetActive(false);
|
_iconRemotes[i].gameObject.SetActive(false);
|
||||||
_storageItems[i] = new StorageItemData
|
_storageItems[i] = new StorageItemData
|
||||||
{
|
{
|
||||||
ItemId = -1, ItemCount = -1, ItemOrdered = -1, ItemMax = -1,
|
ItemId = -1,
|
||||||
LocalState = ELogisticStorage.None, RemoteState = ELogisticStorage.None
|
ItemCount = -1,
|
||||||
|
ItemOrdered = -1,
|
||||||
|
ItemMax = -1,
|
||||||
|
LocalState = ELogisticStorage.None,
|
||||||
|
RemoteState = ELogisticStorage.None
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1163,16 +1242,16 @@ public static class LogisticsPatch
|
|||||||
switch (_layout)
|
switch (_layout)
|
||||||
{
|
{
|
||||||
case EStationTipLayout.InterstellarLogistics:
|
case EStationTipLayout.InterstellarLogistics:
|
||||||
{
|
{
|
||||||
countUIText.color = _iconRemotesImage[i].color = StateColor[(int)storageState.RemoteState];
|
countUIText.color = _iconRemotesImage[i].color = StateColor[(int)storageState.RemoteState];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EStationTipLayout.VeinCollector:
|
case EStationTipLayout.VeinCollector:
|
||||||
case EStationTipLayout.PlanetaryLogistics:
|
case EStationTipLayout.PlanetaryLogistics:
|
||||||
{
|
{
|
||||||
countUIText.color = _iconLocalsImage[i].color = StateColor[(int)storageState.LocalState];
|
countUIText.color = _iconLocalsImage[i].color = StateColor[(int)storageState.LocalState];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EStationTipLayout.None:
|
case EStationTipLayout.None:
|
||||||
case EStationTipLayout.Collector:
|
case EStationTipLayout.Collector:
|
||||||
default:
|
default:
|
||||||
@@ -1260,39 +1339,39 @@ public static class LogisticsPatch
|
|||||||
switch (_layout)
|
switch (_layout)
|
||||||
{
|
{
|
||||||
case EStationTipLayout.InterstellarLogistics:
|
case EStationTipLayout.InterstellarLogistics:
|
||||||
{
|
|
||||||
var localLogic = storage.localLogic;
|
|
||||||
if (storageState.LocalState != localLogic)
|
|
||||||
{
|
{
|
||||||
storageState.LocalState = localLogic;
|
var localLogic = storage.localLogic;
|
||||||
var iconLocalImage = _iconLocalsImage[i];
|
if (storageState.LocalState != localLogic)
|
||||||
iconLocalImage.sprite = StateSprite[(int)localLogic];
|
{
|
||||||
iconLocalImage.color = StateColor[(int)localLogic];
|
storageState.LocalState = localLogic;
|
||||||
}
|
var iconLocalImage = _iconLocalsImage[i];
|
||||||
var remoteLogic = storage.remoteLogic;
|
iconLocalImage.sprite = StateSprite[(int)localLogic];
|
||||||
if (storageState.RemoteState != remoteLogic)
|
iconLocalImage.color = StateColor[(int)localLogic];
|
||||||
{
|
}
|
||||||
storageState.RemoteState = remoteLogic;
|
var remoteLogic = storage.remoteLogic;
|
||||||
var iconRemoteImage = _iconRemotesImage[i];
|
if (storageState.RemoteState != remoteLogic)
|
||||||
iconRemoteImage.sprite = StateSprite[(int)remoteLogic];
|
{
|
||||||
countUIText.color = iconRemoteImage.color = StateColor[(int)remoteLogic];
|
storageState.RemoteState = remoteLogic;
|
||||||
}
|
var iconRemoteImage = _iconRemotesImage[i];
|
||||||
|
iconRemoteImage.sprite = StateSprite[(int)remoteLogic];
|
||||||
|
countUIText.color = iconRemoteImage.color = StateColor[(int)remoteLogic];
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EStationTipLayout.VeinCollector:
|
case EStationTipLayout.VeinCollector:
|
||||||
case EStationTipLayout.PlanetaryLogistics:
|
case EStationTipLayout.PlanetaryLogistics:
|
||||||
{
|
|
||||||
var localLogic = storage.localLogic;
|
|
||||||
if (storageState.LocalState != localLogic)
|
|
||||||
{
|
{
|
||||||
storageState.LocalState = localLogic;
|
var localLogic = storage.localLogic;
|
||||||
var iconLocalImage = _iconLocalsImage[i];
|
if (storageState.LocalState != localLogic)
|
||||||
iconLocalImage.sprite = StateSprite[(int)localLogic];
|
{
|
||||||
countUIText.color = iconLocalImage.color = StateColor[(int)localLogic];
|
storageState.LocalState = localLogic;
|
||||||
|
var iconLocalImage = _iconLocalsImage[i];
|
||||||
|
iconLocalImage.sprite = StateSprite[(int)localLogic];
|
||||||
|
countUIText.color = iconLocalImage.color = StateColor[(int)localLogic];
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
case EStationTipLayout.None:
|
case EStationTipLayout.None:
|
||||||
case EStationTipLayout.Collector:
|
case EStationTipLayout.Collector:
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -82,17 +82,18 @@ public static class UIConfigWindow
|
|||||||
I18N.Add("Build Tesla Tower and Wireless Power Tower alternately", "Build Tesla Tower and Wireless Power Tower alternately", "交替建造电力感应塔和无线输电塔");
|
I18N.Add("Build Tesla Tower and Wireless Power Tower alternately", "Build Tesla Tower and Wireless Power Tower alternately", "交替建造电力感应塔和无线输电塔");
|
||||||
I18N.Add("Belt signals for buy out dark fog items automatically", "Belt signals for buy out dark fog items automatically", "用于自动购买黑雾物品的传送带信号");
|
I18N.Add("Belt signals for buy out dark fog items automatically", "Belt signals for buy out dark fog items automatically", "用于自动购买黑雾物品的传送带信号");
|
||||||
I18N.Add("Auto-config logistic stations", "Auto-config logistic stations", "自动配置物流设施");
|
I18N.Add("Auto-config logistic stations", "Auto-config logistic stations", "自动配置物流设施");
|
||||||
|
I18N.Add("Limit auto-replenish count to values below", "Limit auto-replenish count to values below", "限制自动补给数量为下面配置的值");
|
||||||
I18N.Add("Dispenser", "Logistics Distributor", "物流配送器");
|
I18N.Add("Dispenser", "Logistics Distributor", "物流配送器");
|
||||||
I18N.Add("PLS", "PLS", "行星物流站");
|
I18N.Add("PLS", "PLS", "行星物流站");
|
||||||
I18N.Add("ILS", "ILS", "星际物流站");
|
I18N.Add("ILS", "ILS", "星际物流站");
|
||||||
I18N.Add("Advanced Mining Machine", "Advanced Mining Machine", "大型采矿机");
|
I18N.Add("Advanced Mining Machine", "Advanced Mining Machine", "大型采矿机");
|
||||||
I18N.Add("Max. Charging Power", "Max. Charging Power", "最大充能功率");
|
I18N.Add("Max. Charging Power", "Max. Charging Power", "最大充能功率");
|
||||||
I18N.Add("Count of Bots auto-filled", "Count of Bots auto-filled", "自动填充的配送机数量");
|
I18N.Add("Count of Bots filled", "Count of Bots filled", "填充的配送机数量");
|
||||||
I18N.Add("Max. Charging Power", "Max. Charging Power", "最大充能功率");
|
I18N.Add("Max. Charging Power", "Max. Charging Power", "最大充能功率");
|
||||||
I18N.Add("Drone transport range", "Drone transport range", "运输机最远路程");
|
I18N.Add("Drone transport range", "Drone transport range", "运输机最远路程");
|
||||||
I18N.Add("Min. Load of Drones", "Min. Load of Drones", "运输机起送量");
|
I18N.Add("Min. Load of Drones", "Min. Load of Drones", "运输机起送量");
|
||||||
I18N.Add("Outgoing integration count", "Outgoing integration count", "输出货物集装数量");
|
I18N.Add("Outgoing integration count", "Outgoing integration count", "输出货物集装数量");
|
||||||
I18N.Add("Count of Drones auto-filled", "Count of Drones auto-filled", "自动填充的运输机数量");
|
I18N.Add("Count of Drones filled", "Count of Drones filled", "填充的运输机数量");
|
||||||
I18N.Add("Max. Charging Power", "Max. Charging Power", "最大充能功率");
|
I18N.Add("Max. Charging Power", "Max. Charging Power", "最大充能功率");
|
||||||
I18N.Add("Drone transport range", "Drone transport range", "运输机最远路程");
|
I18N.Add("Drone transport range", "Drone transport range", "运输机最远路程");
|
||||||
I18N.Add("Vessel transport range", "Vessel transport range", "运输船最远路程");
|
I18N.Add("Vessel transport range", "Vessel transport range", "运输船最远路程");
|
||||||
@@ -102,8 +103,8 @@ public static class UIConfigWindow
|
|||||||
I18N.Add("Outgoing integration count", "Outgoing integration count", "输出货物集装数量");
|
I18N.Add("Outgoing integration count", "Outgoing integration count", "输出货物集装数量");
|
||||||
I18N.Add("Include Orbital Collector", "Include Orbital Collector", "包含轨道采集器");
|
I18N.Add("Include Orbital Collector", "Include Orbital Collector", "包含轨道采集器");
|
||||||
I18N.Add("Warpers required", "Warpers required", "翘曲器必备");
|
I18N.Add("Warpers required", "Warpers required", "翘曲器必备");
|
||||||
I18N.Add("Count of Drones auto-filled", "Count of Drones auto-filled", "自动填充的运输机数量");
|
I18N.Add("Count of Drones filled", "Count of Drones filled", "填充的运输机数量");
|
||||||
I18N.Add("Count of Vessels auto-filled", "Count of Vessels auto-filled", "自动填充的运输船数量");
|
I18N.Add("Count of Vessels filled", "Count of Vessels filled", "填充的运输船数量");
|
||||||
I18N.Add("Collecting Speed", "Collecting Speed", "开采速度");
|
I18N.Add("Collecting Speed", "Collecting Speed", "开采速度");
|
||||||
I18N.Add("Min. Piler Value", "Outgoing integration count", "输出货物集装数量");
|
I18N.Add("Min. Piler Value", "Outgoing integration count", "输出货物集装数量");
|
||||||
|
|
||||||
@@ -532,6 +533,8 @@ public static class UIConfigWindow
|
|||||||
y += 36f;
|
y += 36f;
|
||||||
wnd.AddCheckBox(x, y, tab3, LogisticsPatch.AutoConfigLogisticsEnabled, "Auto-config logistic stations");
|
wnd.AddCheckBox(x, y, tab3, LogisticsPatch.AutoConfigLogisticsEnabled, "Auto-config logistic stations");
|
||||||
y += 24f;
|
y += 24f;
|
||||||
|
wnd.AddCheckBox(10f, y, tab3, LogisticsPatch.AutoConfigLimitAutoReplenishCount, "Limit auto-replenish count to values below", 13).WithSmallerBox();
|
||||||
|
y += 18f;
|
||||||
var maxWidth = 0f;
|
var maxWidth = 0f;
|
||||||
wnd.AddText2(10f, y, tab3, "Dispenser", 14, "text-dispenser");
|
wnd.AddText2(10f, y, tab3, "Dispenser", 14, "text-dispenser");
|
||||||
y += 18f;
|
y += 18f;
|
||||||
@@ -540,7 +543,7 @@ public static class UIConfigWindow
|
|||||||
var textForMeasureTextWidth = wnd.AddText2(x, y, tab3, "Max. Charging Power", 13, "text-dispenser-max-charging-power");
|
var textForMeasureTextWidth = wnd.AddText2(x, y, tab3, "Max. Charging Power", 13, "text-dispenser-max-charging-power");
|
||||||
maxWidth = Mathf.Max(maxWidth, textForMeasureTextWidth.preferredWidth);
|
maxWidth = Mathf.Max(maxWidth, textForMeasureTextWidth.preferredWidth);
|
||||||
y += 18f;
|
y += 18f;
|
||||||
textForMeasureTextWidth = wnd.AddText2(x, y, tab3, "Count of Bots auto-filled", 13, "text-dispenser-count-of-bots-auto-filled");
|
textForMeasureTextWidth = wnd.AddText2(x, y, tab3, "Count of Bots filled", 13, "text-dispenser-count-of-bots-filled");
|
||||||
maxWidth = Mathf.Max(maxWidth, textForMeasureTextWidth.preferredWidth);
|
maxWidth = Mathf.Max(maxWidth, textForMeasureTextWidth.preferredWidth);
|
||||||
y += 18f;
|
y += 18f;
|
||||||
wnd.AddText2(10f, y, tab3, "PLS", 14, "text-pls");
|
wnd.AddText2(10f, y, tab3, "PLS", 14, "text-pls");
|
||||||
@@ -557,7 +560,7 @@ public static class UIConfigWindow
|
|||||||
textForMeasureTextWidth = wnd.AddText2(x, y, tab3, "Outgoing integration count", 13, "text-pls-outgoing-integration-count");
|
textForMeasureTextWidth = wnd.AddText2(x, y, tab3, "Outgoing integration count", 13, "text-pls-outgoing-integration-count");
|
||||||
maxWidth = Mathf.Max(maxWidth, textForMeasureTextWidth.preferredWidth);
|
maxWidth = Mathf.Max(maxWidth, textForMeasureTextWidth.preferredWidth);
|
||||||
y += 18f;
|
y += 18f;
|
||||||
textForMeasureTextWidth = wnd.AddText2(x, y, tab3, "Count of Drones auto-filled", 13, "text-pls-count-of-drones-auto-filled");
|
textForMeasureTextWidth = wnd.AddText2(x, y, tab3, "Count of Drones filled", 13, "text-pls-count-of-drones-filled");
|
||||||
maxWidth = Mathf.Max(maxWidth, textForMeasureTextWidth.preferredWidth);
|
maxWidth = Mathf.Max(maxWidth, textForMeasureTextWidth.preferredWidth);
|
||||||
y += 18f;
|
y += 18f;
|
||||||
wnd.AddText2(10f, y, tab3, "ILS", 14, "text-ils");
|
wnd.AddText2(10f, y, tab3, "ILS", 14, "text-ils");
|
||||||
@@ -585,10 +588,10 @@ public static class UIConfigWindow
|
|||||||
textForMeasureTextWidth = wnd.AddText2(x, y, tab3, "Outgoing integration count", 13, "text-ils-outgoing-integration-count");
|
textForMeasureTextWidth = wnd.AddText2(x, y, tab3, "Outgoing integration count", 13, "text-ils-outgoing-integration-count");
|
||||||
maxWidth = Mathf.Max(maxWidth, textForMeasureTextWidth.preferredWidth);
|
maxWidth = Mathf.Max(maxWidth, textForMeasureTextWidth.preferredWidth);
|
||||||
y += 18f;
|
y += 18f;
|
||||||
textForMeasureTextWidth = wnd.AddText2(x, y, tab3, "Count of Drones auto-filled", 13, "text-ils-count-of-drones-auto-filled");
|
textForMeasureTextWidth = wnd.AddText2(x, y, tab3, "Count of Drones filled", 13, "text-ils-count-of-drones-filled");
|
||||||
maxWidth = Mathf.Max(maxWidth, textForMeasureTextWidth.preferredWidth);
|
maxWidth = Mathf.Max(maxWidth, textForMeasureTextWidth.preferredWidth);
|
||||||
y += 18f;
|
y += 18f;
|
||||||
textForMeasureTextWidth = wnd.AddText2(x, y, tab3, "Count of Vessels auto-filled", 13, "text-ils-count-of-vessels-auto-filled");
|
textForMeasureTextWidth = wnd.AddText2(x, y, tab3, "Count of Vessels filled", 13, "text-ils-count-of-vessels-filled");
|
||||||
maxWidth = Mathf.Max(maxWidth, textForMeasureTextWidth.preferredWidth);
|
maxWidth = Mathf.Max(maxWidth, textForMeasureTextWidth.preferredWidth);
|
||||||
y += 18f;
|
y += 18f;
|
||||||
wnd.AddText2(10f, y, tab3, "Advanced Mining Machine", 14, "text-amm");
|
wnd.AddText2(10f, y, tab3, "Advanced Mining Machine", 14, "text-amm");
|
||||||
|
|||||||
@@ -138,13 +138,15 @@ public class UXAssist : BaseUnityPlugin, IModCanSave
|
|||||||
"Dismantle blueprint selected buildings");
|
"Dismantle blueprint selected buildings");
|
||||||
LogisticsPatch.AutoConfigLogisticsEnabled = Config.Bind("Factory", "AutoConfigLogistics", false,
|
LogisticsPatch.AutoConfigLogisticsEnabled = Config.Bind("Factory", "AutoConfigLogistics", false,
|
||||||
"Auto-config logistic stations");
|
"Auto-config logistic stations");
|
||||||
|
LogisticsPatch.AutoConfigLimitAutoReplenishCount = Config.Bind("Factory", "AutoConfigLimitAutoReplenishCount", false,
|
||||||
|
"Limit auto-replenish count to config values");
|
||||||
LogisticsPatch.AutoConfigDispenserChargePower = Config.Bind("Factory", "AutoConfigDispenserChargePower", 30, new ConfigDescription("LD: Max. Charging Power", new AcceptableValueRange<int>(3, 30)));
|
LogisticsPatch.AutoConfigDispenserChargePower = Config.Bind("Factory", "AutoConfigDispenserChargePower", 30, new ConfigDescription("LD: Max. Charging Power", new AcceptableValueRange<int>(3, 30)));
|
||||||
LogisticsPatch.AutoConfigDispenserCourierCount = Config.Bind("Factory", "AutoConfigDispenserCourierCount", 10, new ConfigDescription("LD: Count of Bots auto-filled", new AcceptableValueRange<int>(0, 10)));
|
LogisticsPatch.AutoConfigDispenserCourierCount = Config.Bind("Factory", "AutoConfigDispenserCourierCount", 10, new ConfigDescription("LD: Count of Bots filled", new AcceptableValueRange<int>(0, 10)));
|
||||||
LogisticsPatch.AutoConfigPLSChargePower = Config.Bind("Factory", "AutoConfigPLSChargePower", 4, new ConfigDescription("PLS: Max. Charging Power", new AcceptableValueRange<int>(2, 20)));
|
LogisticsPatch.AutoConfigPLSChargePower = Config.Bind("Factory", "AutoConfigPLSChargePower", 4, new ConfigDescription("PLS: Max. Charging Power", new AcceptableValueRange<int>(2, 20)));
|
||||||
LogisticsPatch.AutoConfigPLSMaxTripDrone = Config.Bind("Factory", "AutoConfigPLSMaxTripDrone", 180, new ConfigDescription("PLS: Drone transport range", new AcceptableValueRange<int>(1, 180)));
|
LogisticsPatch.AutoConfigPLSMaxTripDrone = Config.Bind("Factory", "AutoConfigPLSMaxTripDrone", 180, new ConfigDescription("PLS: Drone transport range", new AcceptableValueRange<int>(1, 180)));
|
||||||
LogisticsPatch.AutoConfigPLSDroneMinDeliver = Config.Bind("Factory", "AutoConfigPLSDroneMinDeliver", 10, new ConfigDescription("PLS: Min. Load of Drones", new AcceptableValueRange<int>(0, 10)));
|
LogisticsPatch.AutoConfigPLSDroneMinDeliver = Config.Bind("Factory", "AutoConfigPLSDroneMinDeliver", 10, new ConfigDescription("PLS: Min. Load of Drones", new AcceptableValueRange<int>(0, 10)));
|
||||||
LogisticsPatch.AutoConfigPLSMinPilerValue = Config.Bind("Factory", "AutoConfigPLSMinPilerValue", 0, new ConfigDescription("PLS: Outgoing integration count", new AcceptableValueRange<int>(0, 4)));
|
LogisticsPatch.AutoConfigPLSMinPilerValue = Config.Bind("Factory", "AutoConfigPLSMinPilerValue", 0, new ConfigDescription("PLS: Outgoing integration count", new AcceptableValueRange<int>(0, 4)));
|
||||||
LogisticsPatch.AutoConfigPLSDroneCount = Config.Bind("Factory", "AutoConfigPLSDroneCount", 10, new ConfigDescription("PLS: Count of Drones auto-filled", new AcceptableValueRange<int>(0, 50)));
|
LogisticsPatch.AutoConfigPLSDroneCount = Config.Bind("Factory", "AutoConfigPLSDroneCount", 10, new ConfigDescription("PLS: Count of Drones filled", new AcceptableValueRange<int>(0, 50)));
|
||||||
LogisticsPatch.AutoConfigILSChargePower = Config.Bind("Factory", "AutoConfigILSChargePower", 4, new ConfigDescription("ILS: Max. Charging Power", new AcceptableValueRange<int>(2, 20)));
|
LogisticsPatch.AutoConfigILSChargePower = Config.Bind("Factory", "AutoConfigILSChargePower", 4, new ConfigDescription("ILS: Max. Charging Power", new AcceptableValueRange<int>(2, 20)));
|
||||||
LogisticsPatch.AutoConfigILSMaxTripDrone = Config.Bind("Factory", "AutoConfigILSMaxTripDrone", 180, new ConfigDescription("ILS: Drone transport range", new AcceptableValueRange<int>(1, 180)));
|
LogisticsPatch.AutoConfigILSMaxTripDrone = Config.Bind("Factory", "AutoConfigILSMaxTripDrone", 180, new ConfigDescription("ILS: Drone transport range", new AcceptableValueRange<int>(1, 180)));
|
||||||
LogisticsPatch.AutoConfigILSMaxTripShip = Config.Bind("Factory", "AutoConfigILSMaxTripShip", 41, new ConfigDescription("ILS: Vessel transport range", new AcceptableValueRange<int>(1, 41)));
|
LogisticsPatch.AutoConfigILSMaxTripShip = Config.Bind("Factory", "AutoConfigILSMaxTripShip", 41, new ConfigDescription("ILS: Vessel transport range", new AcceptableValueRange<int>(1, 41)));
|
||||||
@@ -156,8 +158,8 @@ public class UXAssist : BaseUnityPlugin, IModCanSave
|
|||||||
"ILS: Include Orbital Collector");
|
"ILS: Include Orbital Collector");
|
||||||
LogisticsPatch.AutoConfigILSWarperNecessary = Config.Bind("Factory", "AutoConfigILSWarperNecessary", true,
|
LogisticsPatch.AutoConfigILSWarperNecessary = Config.Bind("Factory", "AutoConfigILSWarperNecessary", true,
|
||||||
"ILS: Warpers required");
|
"ILS: Warpers required");
|
||||||
LogisticsPatch.AutoConfigILSDroneCount = Config.Bind("Factory", "AutoConfigILSDroneCount", 20, new ConfigDescription("ILS: Count of Drones auto-filled", new AcceptableValueRange<int>(0, 100)));
|
LogisticsPatch.AutoConfigILSDroneCount = Config.Bind("Factory", "AutoConfigILSDroneCount", 20, new ConfigDescription("ILS: Count of Drones filled", new AcceptableValueRange<int>(0, 100)));
|
||||||
LogisticsPatch.AutoConfigILSShipCount = Config.Bind("Factory", "AutoConfigILSShipCount", 10, new ConfigDescription("ILS: Count of Vessels auto-filled", new AcceptableValueRange<int>(0, 10)));
|
LogisticsPatch.AutoConfigILSShipCount = Config.Bind("Factory", "AutoConfigILSShipCount", 10, new ConfigDescription("ILS: Count of Vessels filled", new AcceptableValueRange<int>(0, 10)));
|
||||||
LogisticsPatch.AutoConfigVeinCollectorHarvestSpeed = Config.Bind("Factory", "AutoConfigVeinCollectorHarvestSpeed", 20, new ConfigDescription("AMM: Collecting Speed", new AcceptableValueRange<int>(0, 20)));
|
LogisticsPatch.AutoConfigVeinCollectorHarvestSpeed = Config.Bind("Factory", "AutoConfigVeinCollectorHarvestSpeed", 20, new ConfigDescription("AMM: Collecting Speed", new AcceptableValueRange<int>(0, 20)));
|
||||||
LogisticsPatch.AutoConfigVeinCollectorMinPilerValue = Config.Bind("Factory", "AutoConfigVeinCollectorMinPilerValue", 0, new ConfigDescription("AMM: Outgoing integration count", new AcceptableValueRange<int>(0, 4)));
|
LogisticsPatch.AutoConfigVeinCollectorMinPilerValue = Config.Bind("Factory", "AutoConfigVeinCollectorMinPilerValue", 0, new ConfigDescription("AMM: Outgoing integration count", new AcceptableValueRange<int>(0, 4)));
|
||||||
LogisticsPatch.LogisticsCapacityTweaksEnabled = Config.Bind("Factory", "LogisticsCapacityTweaks", true,
|
LogisticsPatch.LogisticsCapacityTweaksEnabled = Config.Bind("Factory", "LogisticsCapacityTweaks", true,
|
||||||
|
|||||||
Reference in New Issue
Block a user