1
0
mirror of https://github.com/soarqin/DSP_Mods_TO.git synced 2026-02-04 22:22:22 +08:00
This commit is contained in:
2024-03-19 21:09:22 +08:00
parent 195260a3c9
commit 165fd704bb
6 changed files with 444 additions and 374 deletions

View File

@@ -12,72 +12,37 @@ internal class CruiseAssistConfigManager(ConfigFile config) : ConfigManager(conf
protected override void CheckConfigImplements(Step step) protected override void CheckConfigImplements(Step step)
{ {
var saveFlag = false; var saveFlag = false;
if (step == Step.Awake) switch (step)
{ {
var configEntry = Bind("Base", "ModVersion", "0.0.37", "Don't change."); case Step.Awake:
configEntry.Value = "0.0.37"; saveFlag = OnAwake();
Migration("State", "MainWindow0Left", 100, "State", "InfoWindowLeft"); OnAwakeOrGameMainBegin();
Migration("State", "MainWindow0Top", 100, "State", "InfoWindowTop"); OnAwakeOrGameMainBeginOrStateOrChangeSeed();
Migration("State", "MainWindow0Left", 100, "State", "MainWindowLeft"); break;
Migration("State", "MainWindow0Top", 100, "State", "MainWindowTop"); case Step.GameMainBegin:
Migration("State", "StarListWindow0Left", 100, "State", "StarListWindowLeft"); OnAwakeOrGameMainBegin();
Migration("State", "StarListWindow0Top", 100, "State", "StarListWindowTop"); OnAwakeOrGameMainBeginOrStateOrChangeSeed();
Migration("Setting", "CloseStarListWhenSetTargetPlanet", false, "Setting", "HideStarListWhenSetTargetPlanet"); break;
saveFlag = true; case Step.ChangeSeed:
OnAwakeOrGameMainBeginOrStateOrChangeSeed();
break;
case Step.State:
OnAwakeOrGameMainBeginOrStateOrChangeSeed();
saveFlag = OnState();
break;
case Step.UniverseGenCreateGalaxy:
default:
break;
} }
if (step is Step.Awake or Step.GameMainBegin) if (saveFlag)
{ {
CruiseAssistDebugUI.Show = Bind("Debug", "DebugWindowShow", false).Value; Save();
CruiseAssistPlugin.Enable = Bind("Setting", "Enable", true).Value;
CruiseAssistPlugin.Conf.MarkVisitedFlag = Bind("Setting", "MarkVisited", true).Value;
CruiseAssistPlugin.Conf.SelectFocusFlag = Bind("Setting", "SelectFocus", true).Value;
CruiseAssistPlugin.Conf.HideDuplicateHistoryFlag = Bind("Setting", "HideDuplicateHistory", true).Value;
CruiseAssistPlugin.Conf.AutoDisableLockCursorFlag = Bind("Setting", "AutoDisableLockCursor", false).Value;
CruiseAssistPlugin.Conf.ShowMainWindowWhenTargetSelectedEvenNotSailModeFlag = Bind("Setting", "ShowMainWindowWhenTargetSelectedEvenNotSailMode", true).Value;
CruiseAssistPlugin.Conf.CloseStarListWhenSetTargetPlanetFlag = Bind("Setting", "CloseStarListWhenSetTargetPlanet", false).Value;
CruiseAssistPlugin.Conf.HideBottomCloseButtonFlag = Bind("Setting", "HideBottomCloseButton", true).Value;
CruiseAssistMainUI.Scale = Bind("Setting", "UIScale", 150).Value;
var viewModeStr = Bind("Setting", "MainWindowViewMode", CruiseAssistMainUIViewMode.Full.ToString()).Value;
EnumUtils.TryParse(viewModeStr, out CruiseAssistMainUI.ViewMode);
for (var i = 0; i < 2; i++)
{
CruiseAssistMainUI.Rect[i].x = Bind("State", $"MainWindow{i}Left", 100).Value;
CruiseAssistMainUI.Rect[i].y = Bind("State", $"MainWindow{i}Top", 100).Value;
CruiseAssistStarListUI.Rect[i].x = Bind("State", $"StarListWindow{i}Left", 100).Value;
CruiseAssistStarListUI.Rect[i].y = Bind("State", $"StarListWindow{i}Top", 100).Value;
CruiseAssistConfigUI.Rect[i].x = Bind("State", $"ConfigWindow{i}Left", 100).Value;
CruiseAssistConfigUI.Rect[i].y = Bind("State", $"ConfigWindow{i}Top", 100).Value;
}
CruiseAssistStarListUI.ListSelected = Bind("State", "StarListWindowListSelected", 0).Value;
CruiseAssistDebugUI.Rect.x = Bind("State", "DebugWindowLeft", 100).Value;
CruiseAssistDebugUI.Rect.y = Bind("State", "DebugWindowTop", 100).Value;
}
if (step is Step.Awake or Step.GameMainBegin or Step.State or Step.ChangeSeed)
{
if (DSPGame.IsMenuDemo || GameMain.galaxy == null)
{
var flag6 = CruiseAssistPlugin.Seed != -1;
if (flag6)
{
CruiseAssistPlugin.Seed = -1;
CruiseAssistPlugin.History = new List<int>();
CruiseAssistPlugin.Bookmark = new List<int>();
LogManager.LogInfo("clear seed.");
} }
} }
else
{ private static bool OnState()
if (CruiseAssistPlugin.Seed != GameMain.galaxy.seed)
{
CruiseAssistPlugin.Seed = GameMain.galaxy.seed;
CruiseAssistPlugin.History = ListUtils.ParseToIntList(Bind("Save", $"History_{CruiseAssistPlugin.Seed}", "").Value);
CruiseAssistPlugin.Bookmark = ListUtils.ParseToIntList(Bind("Save", $"Bookmark_{CruiseAssistPlugin.Seed}", "").Value);
LogManager.LogInfo($"change seed {CruiseAssistPlugin.Seed}.");
}
}
}
if (step == Step.State)
{ {
var saveFlag = false;
LogManager.LogInfo("check state."); LogManager.LogInfo("check state.");
saveFlag |= UpdateEntry("Setting", "Enable", CruiseAssistPlugin.Enable); saveFlag |= UpdateEntry("Setting", "Enable", CruiseAssistPlugin.Enable);
saveFlag |= UpdateEntry("Setting", "MarkVisited", CruiseAssistPlugin.Conf.MarkVisitedFlag); saveFlag |= UpdateEntry("Setting", "MarkVisited", CruiseAssistPlugin.Conf.MarkVisitedFlag);
@@ -107,10 +72,69 @@ internal class CruiseAssistConfigManager(ConfigFile config) : ConfigManager(conf
saveFlag |= UpdateEntry("Save", $"Bookmark_{CruiseAssistPlugin.Seed}", ListUtils.ToString(CruiseAssistPlugin.Bookmark)); saveFlag |= UpdateEntry("Save", $"Bookmark_{CruiseAssistPlugin.Seed}", ListUtils.ToString(CruiseAssistPlugin.Bookmark));
} }
CruiseAssistMainUI.NextCheckGameTick = long.MaxValue; CruiseAssistMainUI.NextCheckGameTick = long.MaxValue;
return saveFlag;
} }
if (saveFlag)
private static void OnAwakeOrGameMainBeginOrStateOrChangeSeed()
{ {
Save(); if (DSPGame.IsMenuDemo || GameMain.galaxy == null)
{
var reset = CruiseAssistPlugin.Seed != -1;
if (!reset) return;
CruiseAssistPlugin.Seed = -1;
CruiseAssistPlugin.History = new List<int>();
CruiseAssistPlugin.Bookmark = new List<int>();
LogManager.LogInfo("clear seed.");
} }
else
{
if (CruiseAssistPlugin.Seed == GameMain.galaxy.seed) return;
CruiseAssistPlugin.Seed = GameMain.galaxy.seed;
CruiseAssistPlugin.History = ListUtils.ParseToIntList(Bind("Save", $"History_{CruiseAssistPlugin.Seed}", "").Value);
CruiseAssistPlugin.Bookmark = ListUtils.ParseToIntList(Bind("Save", $"Bookmark_{CruiseAssistPlugin.Seed}", "").Value);
LogManager.LogInfo($"change seed {CruiseAssistPlugin.Seed}.");
}
}
private static void OnAwakeOrGameMainBegin()
{
CruiseAssistDebugUI.Show = Bind("Debug", "DebugWindowShow", false).Value;
CruiseAssistPlugin.Enable = Bind("Setting", "Enable", true).Value;
CruiseAssistPlugin.Conf.MarkVisitedFlag = Bind("Setting", "MarkVisited", true).Value;
CruiseAssistPlugin.Conf.SelectFocusFlag = Bind("Setting", "SelectFocus", true).Value;
CruiseAssistPlugin.Conf.HideDuplicateHistoryFlag = Bind("Setting", "HideDuplicateHistory", true).Value;
CruiseAssistPlugin.Conf.AutoDisableLockCursorFlag = Bind("Setting", "AutoDisableLockCursor", false).Value;
CruiseAssistPlugin.Conf.ShowMainWindowWhenTargetSelectedEvenNotSailModeFlag = Bind("Setting", "ShowMainWindowWhenTargetSelectedEvenNotSailMode", true).Value;
CruiseAssistPlugin.Conf.CloseStarListWhenSetTargetPlanetFlag = Bind("Setting", "CloseStarListWhenSetTargetPlanet", false).Value;
CruiseAssistPlugin.Conf.HideBottomCloseButtonFlag = Bind("Setting", "HideBottomCloseButton", true).Value;
CruiseAssistMainUI.Scale = Bind("Setting", "UIScale", 150).Value;
var viewModeStr = Bind("Setting", "MainWindowViewMode", CruiseAssistMainUIViewMode.Full.ToString()).Value;
EnumUtils.TryParse(viewModeStr, out CruiseAssistMainUI.ViewMode);
for (var i = 0; i < 2; i++)
{
CruiseAssistMainUI.Rect[i].x = Bind("State", $"MainWindow{i}Left", 100).Value;
CruiseAssistMainUI.Rect[i].y = Bind("State", $"MainWindow{i}Top", 100).Value;
CruiseAssistStarListUI.Rect[i].x = Bind("State", $"StarListWindow{i}Left", 100).Value;
CruiseAssistStarListUI.Rect[i].y = Bind("State", $"StarListWindow{i}Top", 100).Value;
CruiseAssistConfigUI.Rect[i].x = Bind("State", $"ConfigWindow{i}Left", 100).Value;
CruiseAssistConfigUI.Rect[i].y = Bind("State", $"ConfigWindow{i}Top", 100).Value;
}
CruiseAssistStarListUI.ListSelected = Bind("State", "StarListWindowListSelected", 0).Value;
CruiseAssistDebugUI.Rect.x = Bind("State", "DebugWindowLeft", 100).Value;
CruiseAssistDebugUI.Rect.y = Bind("State", "DebugWindowTop", 100).Value;
}
private static bool OnAwake()
{
var configEntry = Bind("Base", "ModVersion", "0.0.37", "Don't change.");
configEntry.Value = "0.0.37";
Migration("State", "MainWindow0Left", 100, "State", "InfoWindowLeft");
Migration("State", "MainWindow0Top", 100, "State", "InfoWindowTop");
Migration("State", "MainWindow0Left", 100, "State", "MainWindowLeft");
Migration("State", "MainWindow0Top", 100, "State", "MainWindowTop");
Migration("State", "StarListWindow0Left", 100, "State", "StarListWindowLeft");
Migration("State", "StarListWindow0Top", 100, "State", "StarListWindowTop");
Migration("Setting", "CloseStarListWhenSetTargetPlanet", false, "Setting", "HideStarListWhenSetTargetPlanet");
return true;
} }
} }

View File

@@ -1,5 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq; using System.Linq;
using BepInEx; using BepInEx;
using CruiseAssist.Commons; using CruiseAssist.Commons;
@@ -137,14 +139,38 @@ public class CruiseAssistPlugin : BaseUnityPlugin
public static CruiseAssistState State = CruiseAssistState.Inactive; public static CruiseAssistState State = CruiseAssistState.Inactive;
public static bool Interrupt = false; public static bool Interrupt = false;
public static int Seed = -1; public static int Seed = -1;
public static List<int> History = new List<int>(); public static List<int> History = [];
public static List<int> Bookmark = new List<int>(); public static List<int> HistoryDistinct = [];
public static List<int> Bookmark = [];
public static HashSet<int> BookmarkSet = [];
public static readonly Func<StarData, string> GetStarName = star => star.displayName; public static readonly Func<StarData, string> GetStarName = star => star.displayName;
public static readonly Func<PlanetData, string> GetPlanetName = planet => planet.displayName; public static readonly Func<PlanetData, string> GetPlanetName = planet => planet.displayName;
internal static readonly List<ICruiseAssistExtensionAPI> Extensions = []; internal static readonly List<ICruiseAssistExtensionAPI> Extensions = [];
private Harmony _harmony; private Harmony _harmony;
private static bool _initialized; private static bool _initialized;
public static bool HasBookmark(int id) => BookmarkSet.Contains(id);
public static bool AddBookmark(int id)
{
if (!BookmarkSet.Add(id)) return false;
Bookmark.Add(id);
return true;
}
public static bool RemoveBookmark(int id)
{
if (!BookmarkSet.Remove(id)) return false;
Bookmark.Remove(id);
return true;
}
public static void ClearBookmark()
{
Bookmark.Clear();
BookmarkSet.Clear();
}
public static class Conf public static class Conf
{ {
public static bool MarkVisitedFlag = true; public static bool MarkVisitedFlag = true;

View File

@@ -32,15 +32,8 @@ internal class Patch_PlayerMoveWalk
} }
} }
if (!CruiseAssistPlugin.Enable) if (!CruiseAssistPlugin.Enable) return;
{
CruiseAssistPlugin.Extensions.ForEach(delegate(ICruiseAssistExtensionAPI extension)
{
extension.SetInactive();
});
}
else
{
var indicatorAstroId = GameMain.mainPlayer.navigation.indicatorAstroId; var indicatorAstroId = GameMain.mainPlayer.navigation.indicatorAstroId;
if (indicatorAstroId != 0 && CruiseAssistPlugin.SelectTargetAstroId != indicatorAstroId) if (indicatorAstroId != 0 && CruiseAssistPlugin.SelectTargetAstroId != indicatorAstroId)
{ {
@@ -65,18 +58,6 @@ internal class Patch_PlayerMoveWalk
{ {
if (GameMain.localStar != null && CruiseAssistPlugin.SelectTargetStar.id == GameMain.localStar.id) if (GameMain.localStar != null && CruiseAssistPlugin.SelectTargetStar.id == GameMain.localStar.id)
{ {
if (CruiseAssistPlugin.SelectTargetPlanet == null && GameMain.localPlanet != null)
{
CruiseAssistPlugin.SelectTargetStar = null;
CruiseAssistPlugin.SelectTargetAstroId = 0;
GameMain.mainPlayer.navigation.indicatorAstroId = 0;
CruiseAssistPlugin.Extensions.ForEach(delegate(ICruiseAssistExtensionAPI extension)
{
extension.SetInactive();
});
return;
}
if (CruiseAssistPlugin.SelectTargetPlanet != null) if (CruiseAssistPlugin.SelectTargetPlanet != null)
{ {
if (GameMain.localPlanet != null && CruiseAssistPlugin.SelectTargetPlanet.id == GameMain.localPlanet.id) if (GameMain.localPlanet != null && CruiseAssistPlugin.SelectTargetPlanet.id == GameMain.localPlanet.id)
@@ -95,6 +76,17 @@ internal class Patch_PlayerMoveWalk
} }
else else
{ {
if (GameMain.localPlanet != null)
{
CruiseAssistPlugin.SelectTargetStar = null;
CruiseAssistPlugin.SelectTargetAstroId = 0;
GameMain.mainPlayer.navigation.indicatorAstroId = 0;
CruiseAssistPlugin.Extensions.ForEach(delegate(ICruiseAssistExtensionAPI extension)
{
extension.SetInactive();
});
return;
}
if (CruiseAssistPlugin.ReticuleTargetPlanet != null) if (CruiseAssistPlugin.ReticuleTargetPlanet != null)
{ {
CruiseAssistPlugin.TargetPlanet = CruiseAssistPlugin.ReticuleTargetPlanet; CruiseAssistPlugin.TargetPlanet = CruiseAssistPlugin.ReticuleTargetPlanet;
@@ -157,5 +149,4 @@ internal class Patch_PlayerMoveWalk
}); });
} }
} }
}
} }

View File

@@ -14,16 +14,24 @@ internal class Patch_UISailPanel
public static IEnumerable<CodeInstruction> OnUpdate_Transpiler(IEnumerable<CodeInstruction> instructions) public static IEnumerable<CodeInstruction> OnUpdate_Transpiler(IEnumerable<CodeInstruction> instructions)
{ {
var codeMatcher = new CodeMatcher(instructions); var codeMatcher = new CodeMatcher(instructions);
codeMatcher.MatchForward(true, new CodeMatch(OpCodes.Ldarg_0)); codeMatcher.MatchForward(true,
codeMatcher.InsertAndAdvance( new CodeMatch(OpCodes.Ldarg_0)
).InsertAndAdvance(
Transpilers.EmitDelegate<Action>(delegate Transpilers.EmitDelegate<Action>(delegate
{ {
CruiseAssistPlugin.ReticuleTargetPlanet = null; CruiseAssistPlugin.ReticuleTargetPlanet = null;
CruiseAssistPlugin.ReticuleTargetStar = null; CruiseAssistPlugin.ReticuleTargetStar = null;
}) })
); );
codeMatcher.MatchForward(true, new CodeMatch(OpCodes.Bge_Un), new CodeMatch(OpCodes.Ldloc_S), new CodeMatch(OpCodes.Stloc_S), new CodeMatch(OpCodes.Ldc_I4_1), new CodeMatch(OpCodes.Stloc_S), new CodeMatch(OpCodes.Ldloc_S), new CodeMatch(OpCodes.Stloc_S)); codeMatcher.MatchForward(true,
codeMatcher.Advance(1).InsertAndAdvance( new CodeMatch(OpCodes.Bge_Un),
new CodeMatch(OpCodes.Ldloc_S),
new CodeMatch(OpCodes.Stloc_S),
new CodeMatch(OpCodes.Ldc_I4_1),
new CodeMatch(OpCodes.Stloc_S),
new CodeMatch(OpCodes.Ldloc_S),
new CodeMatch(OpCodes.Stloc_S)
).Advance(1).InsertAndAdvance(
new CodeInstruction(OpCodes.Ldloc_0), new CodeInstruction(OpCodes.Ldloc_0),
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(StarData), "planets")), new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(StarData), "planets")),
new CodeInstruction(OpCodes.Ldloc_S, 21), new CodeInstruction(OpCodes.Ldloc_S, 21),
@@ -39,8 +47,8 @@ internal class Patch_UISailPanel
new CodeMatch(OpCodes.Ldc_I4_1), new CodeMatch(OpCodes.Ldc_I4_1),
new CodeMatch(OpCodes.Stloc_S), new CodeMatch(OpCodes.Stloc_S),
new CodeMatch(OpCodes.Ldloc_S), new CodeMatch(OpCodes.Ldloc_S),
new CodeMatch(OpCodes.Stloc_S)); new CodeMatch(OpCodes.Stloc_S)
codeMatcher.Advance(1).InsertAndAdvance( ).Advance(1).InsertAndAdvance(
new CodeInstruction(OpCodes.Ldloc_S, 20), new CodeInstruction(OpCodes.Ldloc_S, 20),
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(GalaxyData), "stars")), new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(GalaxyData), "stars")),
new CodeInstruction(OpCodes.Ldloc_S, 24), new CodeInstruction(OpCodes.Ldloc_S, 24),

View File

@@ -833,6 +833,13 @@ public static class CruiseAssistMainUI
{ {
VFAudio.Create("ui-click-0", null, Vector3.zero, true); VFAudio.Create("ui-click-0", null, Vector3.zero, true);
CruiseAssistPlugin.Enable = !CruiseAssistPlugin.Enable; CruiseAssistPlugin.Enable = !CruiseAssistPlugin.Enable;
if (!CruiseAssistPlugin.Enable)
{
CruiseAssistPlugin.Extensions.ForEach(delegate(ICruiseAssistExtensionAPI extension)
{
extension.SetInactive();
});
}
NextCheckGameTick = GameMain.gameTick + 300L; NextCheckGameTick = GameMain.gameTick + 300L;
} }
GUILayout.EndVertical(); GUILayout.EndVertical();

View File

@@ -1,9 +1,8 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using CruiseAssist.Commons;
using HarmonyLib; using HarmonyLib;
using UnityEngine; using UnityEngine;
using JetBrains.Annotations;
namespace CruiseAssist.UI; namespace CruiseAssist.UI;
@@ -11,7 +10,9 @@ public static class CruiseAssistStarListUI
{ {
private static GUIStyle _toolbarStyle; private static GUIStyle _toolbarStyle;
private static GUIStyle _nameLabelStyle; private static GUIStyle _nameLabelStyle;
private static GUIStyle _nameLabelHighlightStyle;
private static GUIStyle _nRangeLabelStyle; private static GUIStyle _nRangeLabelStyle;
private static GUIStyle _nRangeLabelHighlightStyle;
private static GUIStyle _hRangeLabelStyle; private static GUIStyle _hRangeLabelStyle;
private static GUIStyle _nActionButtonStyle; private static GUIStyle _nActionButtonStyle;
private static GUIStyle _hActionButtonStyle; private static GUIStyle _hActionButtonStyle;
@@ -20,6 +21,7 @@ public static class CruiseAssistStarListUI
private static GUIStyle _verticalScrollbarStyle; private static GUIStyle _verticalScrollbarStyle;
private static GUIStyle _commonButtonStyle; private static GUIStyle _commonButtonStyle;
private static readonly string[] Tabs = ["Normal", "History", "Bookmark"]; private static readonly string[] Tabs = ["Normal", "History", "Bookmark"];
private static readonly string[][] ButtonTexts = private static readonly string[][] ButtonTexts =
[ [
["Target", "Bookmark"], ["Target", "Bookmark"],
@@ -40,19 +42,38 @@ public static class CruiseAssistStarListUI
fixedWidth = 240f, fixedWidth = 240f,
stretchHeight = true, stretchHeight = true,
fontSize = 14, fontSize = 14,
alignment = TextAnchor.MiddleLeft alignment = TextAnchor.MiddleLeft,
};
_nameLabelHighlightStyle = new GUIStyle(_nameLabelStyle)
{
normal =
{
textColor = Color.cyan
}
}; };
_nRangeLabelStyle = new GUIStyle(GUI.skin.label) _nRangeLabelStyle = new GUIStyle(GUI.skin.label)
{ {
fixedWidth = 60f, fixedWidth = 60f,
fixedHeight = 20f, fixedHeight = 20f,
fontSize = 14, fontSize = 14,
alignment = TextAnchor.MiddleRight alignment = TextAnchor.MiddleRight,
normal = {textColor = Color.white}
};
_nRangeLabelHighlightStyle = new GUIStyle(_nRangeLabelStyle)
{
normal =
{
textColor = Color.cyan
}
}; };
_hRangeLabelStyle = new GUIStyle(_nRangeLabelStyle) _hRangeLabelStyle = new GUIStyle(_nRangeLabelStyle)
{ {
fixedHeight = 40f fixedHeight = 40f
}; };
_hRangeLabelHighlightStyle = new GUIStyle(_hRangeLabelStyle)
{
fixedHeight = 40f
};
_nActionButtonStyle = new GUIStyle(CruiseAssistMainUI.BaseButtonStyle) _nActionButtonStyle = new GUIStyle(CruiseAssistMainUI.BaseButtonStyle)
{ {
fixedWidth = 40f, fixedWidth = 40f,
@@ -153,6 +174,7 @@ public static class CruiseAssistStarListUI
ListSelected = selectedIndex; ListSelected = selectedIndex;
CruiseAssistMainUI.NextCheckGameTick = GameMain.gameTick + 300L; CruiseAssistMainUI.NextCheckGameTick = GameMain.gameTick + 300L;
} }
GUILayout.EndHorizontal(); GUILayout.EndHorizontal();
ScrollPos[ListSelected] = GUILayout.BeginScrollView(ScrollPos[ListSelected], GUIStyle.none, _verticalScrollbarStyle); ScrollPos[ListSelected] = GUILayout.BeginScrollView(ScrollPos[ListSelected], GUIStyle.none, _verticalScrollbarStyle);
var selectTargetPlanet = CruiseAssistPlugin.SelectTargetPlanet; var selectTargetPlanet = CruiseAssistPlugin.SelectTargetPlanet;
@@ -160,77 +182,23 @@ public static class CruiseAssistStarListUI
{ {
case 0: case 0:
UpdateStarPlanetList(); UpdateStarPlanetList();
var localStar = GameMain.localStar; foreach (var celestialBody in _celestialBodies)
var selectTargetStar = CruiseAssistPlugin.SelectTargetStar;
var targetStarId = selectTargetStar == null ? -1 : selectTargetStar.id;
GameMain.galaxy.stars.Select(star => new Commons.Tuple<StarData, double>(star, (star.uPosition - GameMain.mainPlayer.uPosition).magnitude)).OrderBy(tuple => tuple.Item2).Do(delegate(Commons.Tuple<StarData, double> tuple)
{
var star = tuple.Item1;
var range = tuple.Item2;
var starName = CruiseAssistPlugin.GetStarName(star);
var ok = false;
if (localStar != null && star.id == localStar.id)
{
ok = true;
}
else
{
if (star.id == targetStarId && GameMain.history.universeObserveLevel >= (range >= 14400000.0 ? 4 : 3))
{
ok = true;
}
}
if (ok)
{
star.planets.Select(planet => new Commons.Tuple<PlanetData, double>(planet, (planet.uPosition - GameMain.mainPlayer.uPosition).magnitude)).AddItem(new Commons.Tuple<PlanetData, double>(null, (star.uPosition - GameMain.mainPlayer.uPosition).magnitude)).OrderBy(tuple2 => tuple2.Item2).Do(delegate(Commons.Tuple<PlanetData, double> tuple2)
{ {
var selected = celestialBody.Selected;
GUILayout.BeginHorizontal(); GUILayout.BeginHorizontal();
var planetData = tuple2.Item1; GUILayout.Label(celestialBody.Name, selected ? _nameLabelHighlightStyle : _nameLabelStyle);
var distance = tuple2.Item2;
_nameLabelStyle.normal.textColor = Color.white;
_nRangeLabelStyle.normal.textColor = Color.white;
float height;
if (planetData == null)
{
if (selectTargetPlanet == null && selectTargetStar != null && star.id == selectTargetStar.id)
{
_nameLabelStyle.normal.textColor = Color.cyan;
_nRangeLabelStyle.normal.textColor = Color.cyan;
}
var name = starName;
if (CruiseAssistPlugin.Conf.MarkVisitedFlag)
{
name = (star.planets.Any(p => p.factory != null) ? VisitedMark : NonVisitMark) + name;
}
GUILayout.Label(name, _nameLabelStyle);
height = _nameLabelStyle.CalcHeight(new GUIContent(name), _nameLabelStyle.fixedWidth);
}
else
{
if (selectTargetPlanet != null && planetData.id == selectTargetPlanet.id)
{
_nameLabelStyle.normal.textColor = Color.cyan;
_nRangeLabelStyle.normal.textColor = Color.cyan;
}
var name = starName + " - " + CruiseAssistPlugin.GetPlanetName(planetData);
if (CruiseAssistPlugin.Conf.MarkVisitedFlag)
{
name = (planetData.factory != null ? VisitedMark : NonVisitMark) + name;
}
GUILayout.Label(name, _nameLabelStyle);
height = _nameLabelStyle.CalcHeight(new GUIContent(name), _nameLabelStyle.fixedWidth);
}
GUILayout.FlexibleSpace(); GUILayout.FlexibleSpace();
GUILayout.Label(CruiseAssistMainUI.RangeToString(planetData == null ? range : distance), height < 30f ? _nRangeLabelStyle : _hRangeLabelStyle); GUILayout.Label(CruiseAssistMainUI.RangeToString(celestialBody.Range), selected ? _nRangeLabelHighlightStyle : _nRangeLabelStyle);
if (GUILayout.Button(ActionSelected[ListSelected] == 0 ? "SET" : planetData == null ? "-" : CruiseAssistPlugin.Bookmark.Contains(planetData.id) ? "DEL" : "ADD", height < 30f ? _nActionButtonStyle : _hActionButtonStyle)) if (GUILayout.Button(ActionSelected[ListSelected] == 0 ? "SET" :
celestialBody.IsPlanet ? celestialBody.InBookmark ? "DEL" : "ADD" : "-",
_nActionButtonStyle))
{ {
VFAudio.Create("ui-click-0", null, Vector3.zero, true); VFAudio.Create("ui-click-0", null, Vector3.zero, true);
var planetData = celestialBody.PlanetData;
if (ActionSelected[ListSelected] == 0) if (ActionSelected[ListSelected] == 0)
{ {
SelectStar(star, planetData); SelectStar(celestialBody.StarData, planetData);
var closeStarListWhenSetTargetPlanetFlag = CruiseAssistPlugin.Conf.CloseStarListWhenSetTargetPlanetFlag; if (CruiseAssistPlugin.Conf.CloseStarListWhenSetTargetPlanetFlag)
if (closeStarListWhenSetTargetPlanetFlag)
{ {
Show[_wIdx] = false; Show[_wIdx] = false;
} }
@@ -239,15 +207,16 @@ public static class CruiseAssistStarListUI
{ {
if (planetData != null) if (planetData != null)
{ {
if (CruiseAssistPlugin.Bookmark.Contains(planetData.id)) if (CruiseAssistPlugin.RemoveBookmark(planetData.id))
{ {
CruiseAssistPlugin.Bookmark.Remove(planetData.id); celestialBody.InBookmark = false;
} }
else else
{ {
if (CruiseAssistPlugin.Bookmark.Count <= 128) if (CruiseAssistPlugin.Bookmark.Count <= 128)
{ {
CruiseAssistPlugin.Bookmark.Add(planetData.id); CruiseAssistPlugin.AddBookmark(planetData.id);
celestialBody.InBookmark = true;
CruiseAssistMainUI.NextCheckGameTick = GameMain.gameTick + 300L; CruiseAssistMainUI.NextCheckGameTick = GameMain.gameTick + 300L;
} }
} }
@@ -255,47 +224,17 @@ public static class CruiseAssistStarListUI
} }
} }
GUILayout.EndHorizontal(); GUILayout.EndHorizontal();
});
} }
else
{
GUILayout.BeginHorizontal();
_nameLabelStyle.normal.textColor = Color.white;
_nRangeLabelStyle.normal.textColor = Color.white;
if (selectTargetStar != null && star.id == selectTargetStar.id)
{
_nameLabelStyle.normal.textColor = Color.cyan;
_nRangeLabelStyle.normal.textColor = Color.cyan;
}
var name = starName;
if (CruiseAssistPlugin.Conf.MarkVisitedFlag)
{
name = (star.planets.Count(p => p.factory != null) > 0 ? VisitedMark : NonVisitMark) + name;
}
GUILayout.Label(name, _nameLabelStyle);
var height = _nameLabelStyle.CalcHeight(new GUIContent(name), _nameLabelStyle.fixedWidth);
GUILayout.FlexibleSpace();
GUILayout.Label(CruiseAssistMainUI.RangeToString(range), height < 30f ? _nRangeLabelStyle : _hRangeLabelStyle);
if (GUILayout.Button(ActionSelected[ListSelected] == 0 ? "SET" : "-", height < 30f ? _nActionButtonStyle : _hActionButtonStyle))
{
VFAudio.Create("ui-click-0", null, Vector3.zero, true);
if (ActionSelected[ListSelected] == 0)
{
SelectStar(star, null);
}
}
GUILayout.EndHorizontal();
}
});
break; break;
case 1 or 2: case 1 or 2:
{ {
var highlighted = false; var highlighted = false;
var enumBookmark = ListSelected != 1 ? CruiseAssistPlugin.Bookmark.ToList() : Enumerable.Reverse(CruiseAssistPlugin.History); var enumBookmark = ListSelected != 1 ? CruiseAssistPlugin.Bookmark : Enumerable.Reverse(CruiseAssistPlugin.History);
if (ListSelected == 1 && ActionSelected[ListSelected] != 2 && CruiseAssistPlugin.Conf.HideDuplicateHistoryFlag) if (ListSelected == 1 && ActionSelected[ListSelected] != 2 && CruiseAssistPlugin.Conf.HideDuplicateHistoryFlag)
{ {
enumBookmark = enumBookmark.Distinct(); enumBookmark = Enumerable.Reverse(CruiseAssistPlugin.HistoryDistinct);
} }
var listIndex = -1; var listIndex = -1;
enumBookmark.Do(delegate(int id) enumBookmark.Do(delegate(int id)
{ {
@@ -311,12 +250,14 @@ public static class CruiseAssistStarListUI
_nRangeLabelStyle.normal.textColor = Color.cyan; _nRangeLabelStyle.normal.textColor = Color.cyan;
highlighted = true; highlighted = true;
} }
GUILayout.BeginHorizontal(); GUILayout.BeginHorizontal();
var name = CruiseAssistPlugin.GetStarName(planetData.star) + " - " + CruiseAssistPlugin.GetPlanetName(planetData); var name = CruiseAssistPlugin.GetStarName(planetData.star) + " - " + CruiseAssistPlugin.GetPlanetName(planetData);
if (CruiseAssistPlugin.Conf.MarkVisitedFlag) if (CruiseAssistPlugin.Conf.MarkVisitedFlag)
{ {
name = (planetData.factory != null ? VisitedMark : NonVisitMark) + name; name = (planetData.factory != null ? VisitedMark : NonVisitMark) + name;
} }
GUILayout.Label(name, _nameLabelStyle); GUILayout.Label(name, _nameLabelStyle);
var height = _nameLabelStyle.CalcHeight(new GUIContent(name), _nameLabelStyle.fixedWidth); var height = _nameLabelStyle.CalcHeight(new GUIContent(name), _nameLabelStyle.fixedWidth);
GUILayout.FlexibleSpace(); GUILayout.FlexibleSpace();
@@ -348,7 +289,10 @@ public static class CruiseAssistStarListUI
} }
else else
{ {
if (GUILayout.Button(ActionSelected[ListSelected] == 0 ? "SET" : ActionSelected[ListSelected] == 2 ? ListSelected == 1 && listIndex == 0 ? "-" : "DEL" : CruiseAssistPlugin.Bookmark.Contains(id) ? "DEL" : "ADD", height < 30f ? _nActionButtonStyle : _hActionButtonStyle)) if (GUILayout.Button(
ActionSelected[ListSelected] == 0 ? "SET" :
ActionSelected[ListSelected] == 2 ? ListSelected == 1 && listIndex == 0 ? "-" : "DEL" :
CruiseAssistPlugin.Bookmark.Contains(id) ? "DEL" : "ADD", height < 30f ? _nActionButtonStyle : _hActionButtonStyle))
{ {
VFAudio.Create("ui-click-0", null, Vector3.zero, true); VFAudio.Create("ui-click-0", null, Vector3.zero, true);
switch (ActionSelected[ListSelected]) switch (ActionSelected[ListSelected])
@@ -408,11 +352,13 @@ public static class CruiseAssistStarListUI
} }
} }
} }
GUILayout.EndHorizontal(); GUILayout.EndHorizontal();
}); });
break; break;
} }
} }
GUILayout.EndScrollView(); GUILayout.EndScrollView();
GUILayout.FlexibleSpace(); GUILayout.FlexibleSpace();
GUILayout.BeginHorizontal(); GUILayout.BeginHorizontal();
@@ -422,12 +368,14 @@ public static class CruiseAssistStarListUI
ActionSelected[ListSelected]++; ActionSelected[ListSelected]++;
ActionSelected[ListSelected] %= ButtonTexts[ListSelected].Length; ActionSelected[ListSelected] %= ButtonTexts[ListSelected].Length;
} }
GUILayout.FlexibleSpace(); GUILayout.FlexibleSpace();
if (!CruiseAssistPlugin.Conf.HideBottomCloseButtonFlag && GUILayout.Button("Close", _commonButtonStyle)) if (!CruiseAssistPlugin.Conf.HideBottomCloseButtonFlag && GUILayout.Button("Close", _commonButtonStyle))
{ {
VFAudio.Create("ui-click-0", null, Vector3.zero, true); VFAudio.Create("ui-click-0", null, Vector3.zero, true);
Show[_wIdx] = false; Show[_wIdx] = false;
} }
GUILayout.EndHorizontal(); GUILayout.EndHorizontal();
GUILayout.EndVertical(); GUILayout.EndVertical();
if (GUI.Button(new Rect(Rect[_wIdx].width - 16f, 1f, 16f, 16f), "", CruiseAssistMainUI.CloseButtonStyle)) if (GUI.Button(new Rect(Rect[_wIdx].width - 16f, 1f, 16f, 16f), "", CruiseAssistMainUI.CloseButtonStyle))
@@ -435,13 +383,13 @@ public static class CruiseAssistStarListUI
VFAudio.Create("ui-click-0", null, Vector3.zero, true); VFAudio.Create("ui-click-0", null, Vector3.zero, true);
Show[_wIdx] = false; Show[_wIdx] = false;
} }
GUI.DragWindow(); GUI.DragWindow();
} }
public static void SelectStar(StarData star, PlanetData planet) public static void SelectStar(StarData star, PlanetData planet)
{ {
if (star == CruiseAssistPlugin.SelectTargetStar && planet == CruiseAssistPlugin.SelectTargetPlanet) return; if (star == CruiseAssistPlugin.SelectTargetStar && planet == CruiseAssistPlugin.SelectTargetPlanet) return;
_celestialBodies = null;
CruiseAssistPlugin.SelectTargetStar = star; CruiseAssistPlugin.SelectTargetStar = star;
CruiseAssistPlugin.SelectTargetPlanet = planet; CruiseAssistPlugin.SelectTargetPlanet = planet;
var uiGame = UIRoot.instance.uiGame; var uiGame = UIRoot.instance.uiGame;
@@ -483,11 +431,9 @@ public static class CruiseAssistStarListUI
GameMain.mainPlayer.navigation.indicatorAstroId = 0; GameMain.mainPlayer.navigation.indicatorAstroId = 0;
} }
} }
CruiseAssistPlugin.SelectTargetAstroId = GameMain.mainPlayer.navigation.indicatorAstroId; CruiseAssistPlugin.SelectTargetAstroId = GameMain.mainPlayer.navigation.indicatorAstroId;
CruiseAssistPlugin.Extensions.ForEach(delegate(ICruiseAssistExtensionAPI extension) CruiseAssistPlugin.Extensions.ForEach(delegate(ICruiseAssistExtensionAPI extension) { extension.SetTargetAstroId(CruiseAssistPlugin.SelectTargetAstroId); });
{
extension.SetTargetAstroId(CruiseAssistPlugin.SelectTargetAstroId);
});
} }
private static void UIStarmap_OnStarClick(UIStarmap starmap, UIStarmapStar star) private static void UIStarmap_OnStarClick(UIStarmap starmap, UIStarmapStar star)
@@ -498,10 +444,12 @@ public static class CruiseAssistStarListUI
{ {
starmap.screenCameraController.DisablePositionLock(); starmap.screenCameraController.DisablePositionLock();
} }
starmap.focusPlanet = null; starmap.focusPlanet = null;
starmap.focusStar = star; starmap.focusStar = star;
starmap._lastClickTime = 0.0; starmap._lastClickTime = 0.0;
} }
starmap.forceUpdateCursorView = true; starmap.forceUpdateCursorView = true;
} }
@@ -513,10 +461,12 @@ public static class CruiseAssistStarListUI
{ {
starmap.screenCameraController.DisablePositionLock(); starmap.screenCameraController.DisablePositionLock();
} }
starmap.focusPlanet = planet; starmap.focusPlanet = planet;
starmap.focusStar = null; starmap.focusStar = null;
starmap._lastClickTime= 0.0; starmap._lastClickTime = 0.0;
} }
starmap.forceUpdateCursorView = true; starmap.forceUpdateCursorView = true;
} }
@@ -524,6 +474,8 @@ public static class CruiseAssistStarListUI
{ {
_celestialBodies = null; _celestialBodies = null;
_stars = null; _stars = null;
_localStarPlanets = null;
_selectedStarPlanets = null;
_nextCheckTick = 0; _nextCheckTick = 0;
_lastLocalStar = null; _lastLocalStar = null;
_lastLocalPlanet = null; _lastLocalPlanet = null;
@@ -536,42 +488,23 @@ public static class CruiseAssistStarListUI
var num = (int)(value > 0.0 ? value + 0.5 : value - 0.5); var num = (int)(value > 0.0 ? value + 0.5 : value - 0.5);
if (func == 23 && num > 2) if (func == 23 && num > 2)
{ {
_celestialBodies = null; _stars = null;
} }
} }
private static void UpdateStarPlanetList() private static void UpdateStarPlanetList()
{ {
var gameMain = GameMain.instance; if (_stars == null)
if (gameMain == null) return;
var gameData = GameMain.data;
if (gameData == null) return;
if (_stars == null) LoadAllStars();
if (_celestialBodies == null) LoadCurrentStarPlanets();
var localPlanet = gameData.localPlanet;
var mainPlayer = gameData.mainPlayer;
if (localPlanet != null && localPlanet == _lastLocalPlanet)
{ {
if (gameMain.timei < _nextCheckTick) return; LoadAllStars();
_nextCheckTick = gameMain.timei + 300; LoadLocalStarPlanets();
LoadSelectedStarPlanets();
SortCelestialBodies();
return; return;
} }
_lastLocalPlanet = localPlanet;
_lastPlayerPos = mainPlayer.uPosition; var reorder = LoadLocalStarPlanets();
_nextCheckTick = gameMain.timei + 300; if (LoadSelectedStarPlanets() || reorder) SortCelestialBodies();
var localStar = gameData.localStar;
if (localStar == _lastLocalStar)
{
if ((mainPlayer.uPosition - _lastPlayerPos).sqrMagnitude < 2000.0 * 2000.0)
return;
}
else
{
_lastLocalStar = localStar;
if (localStar != null)
LoadCurrentStarPlanets();
}
SortStars();
} }
private static void LoadAllStars() private static void LoadAllStars()
@@ -593,54 +526,125 @@ public static class CruiseAssistStarListUI
} }
} }
private static void LoadCurrentStarPlanets() private static bool LoadLocalStarPlanets()
{ {
_celestialBodies = [.._stars]; var localPlanet = GameMain.data.localPlanet;
if (localPlanet != null && localPlanet == _lastLocalPlanet)
{
if (GameMain.instance.timei < _nextCheckTick) return false;
_nextCheckTick = GameMain.instance.timei + 300;
return true;
}
_lastLocalPlanet = GameMain.data.localPlanet;
var localStar = GameMain.localStar; var localStar = GameMain.localStar;
var markVisitedFlag = CruiseAssistPlugin.Conf.MarkVisitedFlag; var mainPlayer = GameMain.data.mainPlayer;
if (localStar != null) var currentPos = mainPlayer.uPosition;
if (localStar == _lastLocalStar)
{ {
if (GameMain.instance.timei < _nextCheckTick) return false;
if ((currentPos - _lastPlayerPos).sqrMagnitude < 2000.0 * 2000.0)
return true;
}
_lastLocalStar = localStar;
_lastPlayerPos = currentPos;
_nextCheckTick = GameMain.instance.timei + 300;
if (localStar == null)
{
if (_localStarPlanets is { Count: 0 }) return false;
_localStarPlanets = [];
return true;
}
_localStarPlanets = [];
var markVisitedFlag = CruiseAssistPlugin.Conf.MarkVisitedFlag;
foreach (var planet in localStar.planets) foreach (var planet in localStar.planets)
{ {
if (planet == null) continue; if (planet == null) continue;
var visted = markVisitedFlag && planet.factory != null; var visted = markVisitedFlag && planet.factory != null;
_celestialBodies.Add(new CelestialBody _localStarPlanets.Add(new CelestialBody
{ {
PlanetData = planet, PlanetData = planet,
Name = (visted ? VisitedMark : NonVisitMark) + CruiseAssistPlugin.GetPlanetName(planet), Name = (visted ? VisitedMark : NonVisitMark) + CruiseAssistPlugin.GetPlanetName(planet),
Pos = planet.uPosition, Pos = planet.uPosition,
IsPlanet = true,
Visited = visted, Visited = visted,
IsPlanet = true InBookmark = CruiseAssistPlugin.HasBookmark(planet.id)
}); });
} }
return true;
} }
private static bool LoadSelectedStarPlanets()
{
var selectedStar = CruiseAssistPlugin.SelectTargetStar; var selectedStar = CruiseAssistPlugin.SelectTargetStar;
if (selectedStar == null || selectedStar == localStar) return; if (selectedStar == _lastSelectedStar)
{
if (_selectedStarPlanets != null) return false;
_selectedStarPlanets = [];
return true;
}
_lastSelectedStar = selectedStar;
if (selectedStar == null || selectedStar == GameMain.localStar)
{
if (_selectedStarPlanets is { Count: 0 }) return false;
_selectedStarPlanets = [];
return true;
}
var range = (selectedStar.uPosition - GameMain.mainPlayer.uPosition).magnitude; var range = (selectedStar.uPosition - GameMain.mainPlayer.uPosition).magnitude;
if (GameMain.history.universeObserveLevel < (range >= 14400000.0 ? 4 : 3)) return; if (GameMain.history.universeObserveLevel < (range >= 14400000.0 ? 4 : 3))
{
if (_selectedStarPlanets is { Count: 0 }) return false;
_selectedStarPlanets = [];
return true;
}
_selectedStarPlanets = [];
var markVisitedFlag = CruiseAssistPlugin.Conf.MarkVisitedFlag;
foreach (var planet in selectedStar.planets) foreach (var planet in selectedStar.planets)
{ {
if (planet == null) continue; if (planet == null) continue;
var visted = markVisitedFlag && planet.factory != null; var visted = markVisitedFlag && planet.factory != null;
_celestialBodies.Add(new CelestialBody _selectedStarPlanets.Add(new CelestialBody
{ {
PlanetData = planet, PlanetData = planet,
Name = (visted ? VisitedMark : NonVisitMark) + CruiseAssistPlugin.GetPlanetName(planet), Name = (visted ? VisitedMark : NonVisitMark) + CruiseAssistPlugin.GetPlanetName(planet),
Pos = planet.uPosition, Pos = planet.uPosition,
IsPlanet = true,
Visited = visted, Visited = visted,
IsPlanet = true InBookmark = CruiseAssistPlugin.HasBookmark(planet.id)
}); });
} }
return true;
}
private static void SortCelestialBodies()
{
_celestialBodies = [.._stars, .._localStarPlanets, .._selectedStarPlanets];
var uPos = GameMain.mainPlayer.uPosition;
var selectedId = CruiseAssistPlugin.SelectTargetPlanet?.id ?? 0;
var selectedStarId = CruiseAssistPlugin.SelectTargetStar?.id ?? 0;
foreach (var body in _celestialBodies)
{
if (body.IsPlanet)
{
body.Pos = body.PlanetData.uPosition;
body.Range = (body.Pos - uPos).magnitude - body.PlanetData.realRadius;
body.Selected = body.PlanetData.id == selectedId || (body.PlanetData.star?.id ?? 0) == selectedStarId;
}
else
{
body.Pos = body.StarData.uPosition;
body.Range = (body.Pos - uPos).magnitude - (body.StarData.viewRadius - 120f);
body.Selected = body.StarData.id == selectedStarId;
}
} }
private static void SortStars()
{
var uPos = GameMain.mainPlayer.uPosition;
foreach (var body in _celestialBodies)
{
body.Range = (body.Pos - uPos).magnitude;
}
_celestialBodies.Sort((s1, s2) => s1.Range.CompareTo(s2.Range)); _celestialBodies.Sort((s1, s2) => s1.Range.CompareTo(s2.Range));
} }
@@ -651,35 +655,45 @@ public static class CruiseAssistStarListUI
public string Name; public string Name;
public VectorLF3 Pos; public VectorLF3 Pos;
public double Range; public double Range;
public bool Visited;
public bool IsPlanet; public bool IsPlanet;
public bool Selected;
public bool Visited;
public bool InBookmark;
} }
private static List<CelestialBody> _celestialBodies; private static List<CelestialBody> _celestialBodies;
private static List<CelestialBody> _stars; private static List<CelestialBody> _stars;
private static List<CelestialBody> _localStarPlanets;
private static List<CelestialBody> _selectedStarPlanets;
private static long _nextCheckTick; private static long _nextCheckTick;
private static StarData _lastLocalStar; private static StarData _lastLocalStar;
private static PlanetData _lastLocalPlanet; private static PlanetData _lastLocalPlanet;
private static StarData _lastSelectedStar;
private static VectorLF3 _lastPlayerPos = VectorLF3.zero; private static VectorLF3 _lastPlayerPos = VectorLF3.zero;
private static int _wIdx; private static int _wIdx;
public const float WindowWidth = 400f; public const float WindowWidth = 400f;
public const float WindowHeight = 480f; public const float WindowHeight = 480f;
public static readonly bool[] Show = new bool[2]; public static readonly bool[] Show = new bool[2];
public static readonly Rect[] Rect = public static readonly Rect[] Rect =
[ [
new Rect(0f, 0f, 400f, 480f), new Rect(0f, 0f, 400f, 480f),
new Rect(0f, 0f, 400f, 480f) new Rect(0f, 0f, 400f, 480f)
]; ];
public static int ListSelected; public static int ListSelected;
private static readonly int[] ActionSelected = new int[3]; private static readonly int[] ActionSelected = new int[3];
private static readonly float[] LastCheckWindowLeft = [float.MinValue, float.MinValue]; private static readonly float[] LastCheckWindowLeft = [float.MinValue, float.MinValue];
private static readonly float[] LastCheckWindowTop = [float.MinValue, float.MinValue]; private static readonly float[] LastCheckWindowTop = [float.MinValue, float.MinValue];
private static readonly Vector2[] ScrollPos = private static readonly Vector2[] ScrollPos =
[ [
Vector2.zero, Vector2.zero,
Vector2.zero, Vector2.zero,
Vector2.zero Vector2.zero
]; ];
private const string VisitedMark = "● "; private const string VisitedMark = "● ";
private const string NonVisitMark = ""; private const string NonVisitMark = "";
} }