mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-08 22:53:33 +08:00
work in progress
This commit is contained in:
@@ -7,7 +7,7 @@ using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
|
||||
public static class UIFunctions
|
||||
{
|
||||
@@ -19,6 +19,7 @@ public static class UIFunctions
|
||||
private static int _cornerComboBoxIndex;
|
||||
private static string[] _starOrderNames;
|
||||
private static bool _starmapFilterInitialized;
|
||||
private static ulong[] _starmapStarFilterValues;
|
||||
private static bool _starFilterEnabled;
|
||||
private static UI.MyCheckButton _starmapFilterToggler;
|
||||
public static bool[] ShowStarName;
|
||||
@@ -34,82 +35,16 @@ public static class UIFunctions
|
||||
});
|
||||
I18N.Add("KEYOpenUXAssistConfigWindow", "[UXA] Open UXAssist Config Window", "[UXA] 打开UX助手设置面板");
|
||||
I18N.OnInitialized += RecreateConfigWindow;
|
||||
GameLogic.OnGameBegin += () =>
|
||||
{
|
||||
var galaxy = GameMain.data.galaxy;
|
||||
ShowStarName = new bool[galaxy.starCount];
|
||||
_starOrderNames = new string[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;
|
||||
}
|
||||
}
|
||||
};
|
||||
GameLogic.OnGameEnd += () =>
|
||||
{
|
||||
_starOrderNames = null;
|
||||
ShowStarName = null;
|
||||
};
|
||||
}
|
||||
|
||||
public static void OnUpdate()
|
||||
{
|
||||
if (!_starmapFilterInitialized || _starmapFilterToggler == null || _starmapFilterToggler.gameObject.activeSelf) return;
|
||||
if (PlanetModelingManager.scnPlanetReqList.Count == 0) _starmapFilterToggler.gameObject.SetActive(true);
|
||||
if (PlanetModelingManager.scnPlanetReqList.Count == 0)
|
||||
{
|
||||
StarmapUpdateFilterValues();
|
||||
_starmapFilterToggler.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnInputUpdate()
|
||||
@@ -139,6 +74,23 @@ public static class UIFunctions
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly Sprite[] PlanetIcons = [
|
||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/07.png"),
|
||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/09.png"),
|
||||
Common.Util.LoadEmbeddedSprite("assets/planet_icon/10.png"),
|
||||
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"),
|
||||
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")
|
||||
];
|
||||
public static void InitMenuButtons()
|
||||
{
|
||||
if (_initialized) return;
|
||||
@@ -205,20 +157,28 @@ public static class UIFunctions
|
||||
{
|
||||
Functions.UIFunctions.CornerComboBoxIndex = index;
|
||||
};
|
||||
_starmapFilterToggler = UI.MyCheckButton.CreateCheckButton(20, 0, rtrans, false, ">>").WithSize(20, 20);
|
||||
_starmapFilterToggler = UI.MyCheckButton.CreateCheckButton(10, 0, rtrans, false, ">>").WithSize(24, 24);
|
||||
MyCheckButton[] buttons = [
|
||||
UI.MyCheckButton.CreateCheckButton(40, 0, rtrans, false).WithIcon().WithSize(20, 20), // Kimberlite
|
||||
UI.MyCheckButton.CreateCheckButton(60, 0, rtrans, false).WithIcon().WithSize(20, 20), // Fractal Silicon
|
||||
UI.MyCheckButton.CreateCheckButton(80, 0, rtrans, false).WithIcon().WithSize(20, 20), // Organic Crystal
|
||||
UI.MyCheckButton.CreateCheckButton(100, 0, rtrans, false).WithIcon().WithSize(20, 20), // Grating Crystal
|
||||
UI.MyCheckButton.CreateCheckButton(120, 0, rtrans, false).WithIcon().WithSize(20, 20), // Stalagmite Crystal
|
||||
UI.MyCheckButton.CreateCheckButton(140, 0, rtrans, false).WithIcon().WithSize(20, 20), // Unipolar Magnet
|
||||
UI.MyCheckButton.CreateCheckButton(160, 0, rtrans, false).WithIcon().WithSize(20, 20), // Crude Oil
|
||||
UI.MyCheckButton.CreateCheckButton(180, 0, rtrans, false).WithIcon().WithSize(20, 20), // Fire Ice
|
||||
UI.MyCheckButton.CreateCheckButton(200, 0, rtrans, false).WithIcon().WithSize(20, 20), // Sulfuric Acid
|
||||
UI.MyCheckButton.CreateCheckButton(220, 0, rtrans, false).WithIcon().WithSize(20, 20), // Water
|
||||
UI.MyCheckButton.CreateCheckButton(240, 0, rtrans, false).WithIcon().WithSize(20, 20), // Hydrogen
|
||||
UI.MyCheckButton.CreateCheckButton(260, 0, rtrans, false).WithIcon().WithSize(20, 20), // Deuterium
|
||||
UI.MyCheckButton.CreateCheckButton(34, 0, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Kimberlite
|
||||
UI.MyCheckButton.CreateCheckButton(58, 0, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Fractal Silicon
|
||||
UI.MyCheckButton.CreateCheckButton(82, 0, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Organic Crystal
|
||||
UI.MyCheckButton.CreateCheckButton(106, 0, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Grating Crystal
|
||||
UI.MyCheckButton.CreateCheckButton(130, 0, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Stalagmite Crystal
|
||||
UI.MyCheckButton.CreateCheckButton(154, 0, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Unipolar Magnet
|
||||
UI.MyCheckButton.CreateCheckButton(178, 0, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Crude Oil
|
||||
UI.MyCheckButton.CreateCheckButton(202, 0, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Fire Ice
|
||||
UI.MyCheckButton.CreateCheckButton(226, 0, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Sulfuric Acid
|
||||
UI.MyCheckButton.CreateCheckButton(250, 0, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Water
|
||||
UI.MyCheckButton.CreateCheckButton(274, 0, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Hydrogen
|
||||
UI.MyCheckButton.CreateCheckButton(298, 0, rtrans, false).WithIcon().WithSize(24, 24).WithIconWidth(24), // Deuterium
|
||||
|
||||
UI.MyCheckButton.CreateCheckButton(34, 24, rtrans, false).WithIcon().WithSize(120, 24).WithIconWidth(24),
|
||||
UI.MyCheckButton.CreateCheckButton(34, 48, rtrans, false).WithIcon().WithSize(120, 24).WithIconWidth(24),
|
||||
UI.MyCheckButton.CreateCheckButton(34, 72, rtrans, false).WithIcon().WithSize(120, 24).WithIconWidth(24),
|
||||
UI.MyCheckButton.CreateCheckButton(34, 96, rtrans, false).WithIcon().WithSize(120, 24).WithIconWidth(24),
|
||||
UI.MyCheckButton.CreateCheckButton(34, 120, rtrans, false).WithIcon().WithSize(120, 24).WithIconWidth(24),
|
||||
UI.MyCheckButton.CreateCheckButton(34, 144, rtrans, false).WithIcon().WithSize(120, 24).WithIconWidth(24),
|
||||
UI.MyCheckButton.CreateCheckButton(34, 168, rtrans, false).WithIcon().WithSize(120, 24).WithIconWidth(24),
|
||||
];
|
||||
_starmapFilterToggler.OnChecked += UpdateButtons;
|
||||
foreach (var button in buttons)
|
||||
@@ -246,15 +206,118 @@ public static class UIFunctions
|
||||
buttons[10].WithTip(itemProto.Name).SetIcon(itemProto.iconSprite);
|
||||
itemProto = LDB.items.Select(1121);
|
||||
buttons[11].WithTip(itemProto.Name).SetIcon(itemProto.iconSprite);
|
||||
|
||||
// [ 0] = 07.png
|
||||
// [ 1] = 09.png
|
||||
// [ 2] = 10.png
|
||||
// [ 3] = 13.png
|
||||
// [ 4] = 14.png
|
||||
// [ 5] = 15.png
|
||||
// [ 6] = 16.png
|
||||
// [ 7] = 17.png
|
||||
// [ 8] = 18.png
|
||||
// [ 9] = 19.png
|
||||
// [10] = 21.png
|
||||
// [11] = 22.png
|
||||
// [12] = 23.png
|
||||
// [13] = 24.png
|
||||
// [14] = 25.png
|
||||
|
||||
var themeProto = LDB.themes.Select(16);
|
||||
buttons[12].SetLabelText(themeProto.DisplayName);
|
||||
buttons[12].SetIcon(PlanetIcons[6]);
|
||||
themeProto = LDB.themes.Select(23);
|
||||
buttons[13].SetLabelText(themeProto.DisplayName);
|
||||
buttons[13].SetIcon(PlanetIcons[12]);
|
||||
themeProto = LDB.themes.Select(10);
|
||||
buttons[14].SetLabelText(themeProto.DisplayName);
|
||||
buttons[14].SetIcon(PlanetIcons[2]);
|
||||
themeProto = LDB.themes.Select(15);
|
||||
buttons[15].SetLabelText(themeProto.DisplayName);
|
||||
buttons[15].SetIcon(PlanetIcons[5]);
|
||||
themeProto = LDB.themes.Select(18);
|
||||
buttons[16].SetLabelText(themeProto.DisplayName);
|
||||
buttons[16].SetIcon(PlanetIcons[8]);
|
||||
themeProto = LDB.themes.Select(22);
|
||||
buttons[17].SetLabelText(themeProto.DisplayName);
|
||||
buttons[17].SetIcon(PlanetIcons[11]);
|
||||
themeProto = LDB.themes.Select(25);
|
||||
buttons[18].SetLabelText(themeProto.DisplayName);
|
||||
buttons[18].SetIcon(PlanetIcons[14]);
|
||||
};
|
||||
|
||||
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 GameMain.data.galaxy.stars)
|
||||
foreach (var star in galaxy.stars)
|
||||
{
|
||||
if (star != null) PlanetModelingManager.RequestScanStar(star);
|
||||
}
|
||||
@@ -262,6 +325,9 @@ public static class UIFunctions
|
||||
};
|
||||
GameLogic.OnGameEnd += () =>
|
||||
{
|
||||
_starOrderNames = null;
|
||||
ShowStarName = null;
|
||||
_starmapStarFilterValues = null;
|
||||
_starmapFilterInitialized = false;
|
||||
};
|
||||
void UpdateButtons()
|
||||
@@ -285,50 +351,70 @@ public static class UIFunctions
|
||||
}
|
||||
void UpdateStarmapStarFilters()
|
||||
{
|
||||
List<(int, int)> filters = [];
|
||||
bool showAny = false;
|
||||
var filterValue = 0UL;
|
||||
if (_starmapFilterToggler.Checked)
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
if (buttons[i].Checked)
|
||||
{
|
||||
filters.Add((i + 9, 0));
|
||||
showAny = true;
|
||||
filterValue |= 1UL << (i + 9);
|
||||
}
|
||||
}
|
||||
if (buttons[6].Checked)
|
||||
{
|
||||
filters.Add((7, 0));
|
||||
showAny = true;
|
||||
filterValue |= 1UL << 7;
|
||||
}
|
||||
if (buttons[7].Checked)
|
||||
{
|
||||
filters.Add((8, 1011));
|
||||
showAny = true;
|
||||
filterValue |= 1UL << 8;
|
||||
}
|
||||
if (buttons[8].Checked)
|
||||
{
|
||||
filters.Add((0, 1116));
|
||||
showAny = true;
|
||||
filterValue |= 1UL << 22;
|
||||
}
|
||||
if (buttons[9].Checked)
|
||||
{
|
||||
filters.Add((0, 1000));
|
||||
showAny = true;
|
||||
filterValue |= 1UL << 23;
|
||||
}
|
||||
if (buttons[10].Checked)
|
||||
{
|
||||
filters.Add((0, 1120));
|
||||
showAny = true;
|
||||
filterValue |= 1UL << 20;
|
||||
}
|
||||
if (buttons[11].Checked)
|
||||
{
|
||||
filters.Add((0, 1121));
|
||||
showAny = true;
|
||||
filterValue |= 1UL << 21;
|
||||
}
|
||||
if (buttons[12].Checked)
|
||||
{
|
||||
filterValue |= 1UL << (30 + 16);
|
||||
}
|
||||
if (buttons[13].Checked)
|
||||
{
|
||||
filterValue |= 1UL << (30 + 23);
|
||||
}
|
||||
if (buttons[14].Checked)
|
||||
{
|
||||
filterValue |= 1UL << (30 + 10);
|
||||
}
|
||||
if (buttons[15].Checked)
|
||||
{
|
||||
filterValue |= 1UL << (30 + 15);
|
||||
}
|
||||
if (buttons[16].Checked)
|
||||
{
|
||||
filterValue |= 1UL << (30 + 18);
|
||||
}
|
||||
if (buttons[17].Checked)
|
||||
{
|
||||
filterValue |= 1UL << (30 + 22);
|
||||
}
|
||||
if (buttons[18].Checked)
|
||||
{
|
||||
filterValue |= 1UL << (30 + 25);
|
||||
}
|
||||
}
|
||||
if (!showAny)
|
||||
if (filterValue == 0UL)
|
||||
{
|
||||
for (int i = 0; i < ShowStarName.Length; i++)
|
||||
{
|
||||
@@ -337,69 +423,9 @@ public static class UIFunctions
|
||||
SetStarFilterEnabled(false);
|
||||
return;
|
||||
}
|
||||
var galaxy = GameMain.data.galaxy;
|
||||
var stars = galaxy.stars;
|
||||
for (int i = 0; i < galaxy.starCount; i++)
|
||||
for (int i = _starmapStarFilterValues.Length - 1; i >= 0; i--)
|
||||
{
|
||||
var star = stars[i];
|
||||
if (star == null) continue;
|
||||
ShowStarName[i] = false;
|
||||
var allMatch = true;
|
||||
foreach (var filter in filters)
|
||||
{
|
||||
var match = false;
|
||||
foreach (var planet in star.planets)
|
||||
{
|
||||
if (planet == null) continue;
|
||||
if (planet.type == EPlanetType.Gas)
|
||||
{
|
||||
if (filter.Item2 != 0)
|
||||
{
|
||||
foreach (var n in planet.gasItems)
|
||||
{
|
||||
if (n == filter.Item2)
|
||||
{
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (match) break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (filter.Item2 != 0)
|
||||
{
|
||||
if (planet.waterItemId == filter.Item2)
|
||||
{
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (filter.Item1 != 0)
|
||||
{
|
||||
foreach (var group in planet.veinGroups)
|
||||
{
|
||||
if (group.amount > 0 && (int)group.type == filter.Item1)
|
||||
{
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (match) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!match)
|
||||
{
|
||||
allMatch = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (allMatch)
|
||||
{
|
||||
ShowStarName[i] = true;
|
||||
}
|
||||
ShowStarName[i] = (_starmapStarFilterValues[i] & filterValue) == filterValue;
|
||||
}
|
||||
SetStarFilterEnabled(true);
|
||||
}
|
||||
@@ -407,6 +433,93 @@ public static class UIFunctions
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
private static void StarmapUpdateFilterValues()
|
||||
{
|
||||
var galaxy = GameMain.data.galaxy;
|
||||
var stars = galaxy.stars;
|
||||
for (int i = 0; i < galaxy.starCount; i++)
|
||||
{
|
||||
var star = stars[i];
|
||||
if (star == null) continue;
|
||||
var value = 0UL;
|
||||
foreach (var planet in star.planets)
|
||||
{
|
||||
if (planet == null) continue;
|
||||
while (planet.scanning)
|
||||
{
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
var planetValue = 0UL;
|
||||
if (planet.type == EPlanetType.Gas)
|
||||
{
|
||||
foreach (var n in planet.gasItems)
|
||||
{
|
||||
switch (n)
|
||||
{
|
||||
case 1011:
|
||||
planetValue |= 1UL << 8;
|
||||
break;
|
||||
case 1120:
|
||||
planetValue |= 1UL << 20;
|
||||
break;
|
||||
case 1121:
|
||||
planetValue |= 1UL << 21;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var group in planet.veinGroups)
|
||||
{
|
||||
if (group.amount > 0)
|
||||
{
|
||||
planetValue |= 1UL << (int)group.type;
|
||||
}
|
||||
}
|
||||
switch (planet.waterItemId)
|
||||
{
|
||||
case 1116:
|
||||
planetValue |= 1UL << 22;
|
||||
break;
|
||||
case 1000:
|
||||
planetValue |= 1UL << 23;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((value & (1UL << (30 + planet.theme))) == 0)
|
||||
{
|
||||
switch (planet.theme)
|
||||
{
|
||||
case 7: case 9: case 13: case 17: case 19: case 24:
|
||||
{
|
||||
const ulong needed = 0x7EUL;
|
||||
if ((planetValue & needed) == needed)
|
||||
{
|
||||
value |= 1UL << (30 + planet.theme);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 14:
|
||||
{
|
||||
const ulong needed = 0x2200UL;
|
||||
if ((planetValue & needed) == needed)
|
||||
{
|
||||
value |= 1UL << (30 + planet.theme);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 10: case 15: case 16: case 18: case 21: case 22: case 23: case 25:
|
||||
value |= 1UL << (30 + planet.theme);
|
||||
break;
|
||||
}
|
||||
}
|
||||
value |= planetValue;
|
||||
}
|
||||
_starmapStarFilterValues[i] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static void RecreateConfigWindow()
|
||||
{
|
||||
if (!_configWinInitialized) return;
|
||||
|
||||
Reference in New Issue
Block a user