mirror of
https://github.com/MoltenMods/Unify.git
synced 2026-10-19 17:56:57 +00:00
Updated for v2021.5.10s
Stopped objects appearing when opening language
This commit is contained in:
1 parent
7b4a916d84
commit
3feb94b45d
7 files changed
+86
-188
No files matched your search
@@ -31,7 +31,7 @@ namespace Unify.Controls
|
|||||||
public AspectPosition Position { get; }
|
public AspectPosition Position { get; }
|
||||||
public UnityEngine.UI.Button.ButtonClickedEvent OnClick { get; }
|
public UnityEngine.UI.Button.ButtonClickedEvent OnClick { get; }
|
||||||
|
|
||||||
private Button(string text, Vector2 size, Vector2 position)
|
private Button(string text)
|
||||||
{
|
{
|
||||||
GameObject = Object.Instantiate(_instance).DontDestroy();
|
GameObject = Object.Instantiate(_instance).DontDestroy();
|
||||||
|
|
||||||
@@ -40,25 +40,46 @@ namespace Unify.Controls
|
|||||||
OnClick = GameObject.GetComponent<PassiveButton>().OnClick;
|
OnClick = GameObject.GetComponent<PassiveButton>().OnClick;
|
||||||
_spriteRenderer = GameObject.GetComponent<SpriteRenderer>();
|
_spriteRenderer = GameObject.GetComponent<SpriteRenderer>();
|
||||||
_boxCollider2D = GameObject.GetComponent<BoxCollider2D>();
|
_boxCollider2D = GameObject.GetComponent<BoxCollider2D>();
|
||||||
|
|
||||||
|
var size = new Vector2(Text.preferredWidth, Text.preferredHeight);
|
||||||
|
|
||||||
Text.text = text;
|
Text.text = text;
|
||||||
Text.rectTransform.sizeDelta = size;
|
Text.rectTransform.sizeDelta = size;
|
||||||
Position.DistanceFromEdge = new Vector3(position.x, position.y, -100f);
|
Position.DistanceFromEdge =
|
||||||
|
new Vector3(Text.preferredWidth / 2f + 0.1f, Text.preferredHeight / 2f + 0.1f, -100f);
|
||||||
_spriteRenderer.size = size;
|
_spriteRenderer.size = size;
|
||||||
_boxCollider2D.size = size;
|
_boxCollider2D.size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<Button> Create(string text, Vector2 size, Vector2 position)
|
public static async Task<Button> Create(string text)
|
||||||
{
|
{
|
||||||
await Initialized.Task;
|
await Initialized.Task;
|
||||||
|
|
||||||
return new Button(text, size, position);
|
return new Button(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async void Create(string text, Vector2 size, Vector2 position, Action<Button> callback)
|
public Button SetText(string newText)
|
||||||
{
|
{
|
||||||
var newButton = await Create(text, size, position);
|
Text.text = newText;
|
||||||
callback(newButton);
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Button SetSize(Vector2 newSize)
|
||||||
|
{
|
||||||
|
Size = newSize;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Button SetDistanceFromEdge(Vector2 newPosition)
|
||||||
|
{
|
||||||
|
Position.DistanceFromEdge = new Vector3(newPosition.x, newPosition.y, -100f);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Button SetAlignment(AspectPosition.EdgeAlignments newAlignment)
|
||||||
|
{
|
||||||
|
Position.Alignment = newAlignment;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void InitializeBaseButton()
|
public static void InitializeBaseButton()
|
||||||
@@ -96,7 +117,7 @@ namespace Unify.Controls
|
|||||||
_instance.GetComponent<ConditionalHide>().Destroy();
|
_instance.GetComponent<ConditionalHide>().Destroy();
|
||||||
_instance.GetComponentInChildren<TextTranslatorTMP>().Destroy();
|
_instance.GetComponentInChildren<TextTranslatorTMP>().Destroy();
|
||||||
_instance.GetComponentInChildren<TextMeshPro>().text = "Button";
|
_instance.GetComponentInChildren<TextMeshPro>().text = "Button";
|
||||||
|
|
||||||
Initialized.SetResult(true);
|
Initialized.SetResult(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,77 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Reactor.Extensions;
|
|
||||||
using TMPro;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.SceneManagement;
|
|
||||||
using Object = UnityEngine.Object;
|
|
||||||
|
|
||||||
namespace Unify.Controls
|
|
||||||
{
|
|
||||||
public class Popup
|
|
||||||
{
|
|
||||||
private static readonly TaskCompletionSource<bool> Initialized = new TaskCompletionSource<bool>();
|
|
||||||
private static GameObject _instance;
|
|
||||||
|
|
||||||
public GameObject GameObject { get; }
|
|
||||||
public TextMeshPro Text { get; }
|
|
||||||
|
|
||||||
private Popup(string text)
|
|
||||||
{
|
|
||||||
GameObject = Object.Instantiate(_instance).DontDestroy();
|
|
||||||
|
|
||||||
Text = GameObject.GetComponentInChildren<TextMeshPro>();
|
|
||||||
|
|
||||||
Text.text = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static async Task<Popup> Create(string text)
|
|
||||||
{
|
|
||||||
await Initialized.Task;
|
|
||||||
|
|
||||||
return new Popup(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static async void Create(string text, Action<Popup> callback)
|
|
||||||
{
|
|
||||||
var newPopup = await Create(text);
|
|
||||||
callback(newPopup);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void InitializeBasePopup()
|
|
||||||
{
|
|
||||||
BasePopup.Initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class BasePopup
|
|
||||||
{
|
|
||||||
public static void Initialize()
|
|
||||||
{
|
|
||||||
SceneManager.add_sceneLoaded((Action<Scene, LoadSceneMode>) OnSceneLoaded);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void OnSceneLoaded(Scene scene, LoadSceneMode loadSceneMode)
|
|
||||||
{
|
|
||||||
Instantiate();
|
|
||||||
|
|
||||||
SceneManager.remove_sceneLoaded((Action<Scene, LoadSceneMode>) OnSceneLoaded);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void Instantiate()
|
|
||||||
{
|
|
||||||
if (Initialized.Task.IsCompleted) return;
|
|
||||||
|
|
||||||
var disconnectPopup = GameObject.Find("DisconnectPopup");
|
|
||||||
if (!disconnectPopup) return;
|
|
||||||
|
|
||||||
_instance = Object.Instantiate(disconnectPopup).DontDestroy();
|
|
||||||
_instance.SetActive(false);
|
|
||||||
_instance.name = "Popup";
|
|
||||||
|
|
||||||
_instance.GetComponentInChildren<TextMeshPro>().text = "Popup";
|
|
||||||
|
|
||||||
Initialized.SetResult(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+52
-97
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using BepInEx.Configuration;
|
using BepInEx.Configuration;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using Reactor.Extensions;
|
using Reactor.Extensions;
|
||||||
using Unify.Controls;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Button = UnityEngine.UI.Button;
|
using Button = UnityEngine.UI.Button;
|
||||||
using Object = UnityEngine.Object;
|
using Object = UnityEngine.Object;
|
||||||
@@ -130,11 +130,12 @@ namespace Unify.Patches
|
|||||||
|
|
||||||
internal static void RefreshRegionMenu()
|
internal static void RefreshRegionMenu()
|
||||||
{
|
{
|
||||||
|
if (!GameObject.Find("RegionMenu")) return;
|
||||||
|
|
||||||
var regionButtons = DestroyableSingleton<RegionMenu>.Instance.ButtonPool.activeChildren.ToArray();
|
var regionButtons = DestroyableSingleton<RegionMenu>.Instance.ButtonPool.activeChildren.ToArray();
|
||||||
var defaultRegions = ServerManager.DefaultRegions;
|
var defaultRegions = ServerManager.DefaultRegions;
|
||||||
var showOfficials = UnifyPlugin.ShowOfficialRegions.Value;
|
var showOfficials = UnifyPlugin.ShowOfficialRegions.Value;
|
||||||
var showExtras = UnifyPlugin.ShowExtraRegions.Value;
|
var showExtras = UnifyPlugin.ShowExtraRegions.Value;
|
||||||
var firstCustomRegionIndex = OldRegions.Length + NewRegions.Length + ModRegions.Count;
|
|
||||||
|
|
||||||
for (int i = 0; i < regionButtons.Length; i++)
|
for (int i = 0; i < regionButtons.Length; i++)
|
||||||
{
|
{
|
||||||
@@ -144,10 +145,12 @@ namespace Unify.Patches
|
|||||||
var textTranslatorTemp = regionButton.GetComponentInChildren<TextTranslatorTMP>();
|
var textTranslatorTemp = regionButton.GetComponentInChildren<TextTranslatorTMP>();
|
||||||
if (textTranslatorTemp) textTranslatorTemp.Destroy();
|
if (textTranslatorTemp) textTranslatorTemp.Destroy();
|
||||||
|
|
||||||
|
int extraRegionCount = OldRegions.Length + NewRegions.Length + ModRegions.Count;
|
||||||
bool isCustomRegion = i >= OldRegions.Length;
|
bool isCustomRegion = i >= OldRegions.Length;
|
||||||
bool isCustomUserRegion = i >= OldRegions.Length + NewRegions.Length + ModRegions.Count;
|
bool isCustomUserRegion = i >= extraRegionCount;
|
||||||
float x = (!isCustomRegion && !showExtras ? 3f : 0) + (isCustomRegion ? 3f : 0) +
|
float x = (!isCustomRegion && !showExtras ? 3f : 0) + (isCustomRegion ? 3f : 0) +
|
||||||
(isCustomUserRegion ? 3f : 0) - 4.25f - (showOfficials ? 0 : 1.5f) - (showExtras ? 0 : 1.5f);
|
(isCustomUserRegion ? 3f : 0) - 4.25f - (!showOfficials || OldRegions.Length == 0 ? 1.5f : 0) -
|
||||||
|
(!showExtras || extraRegionCount == 0 ? 1.5f : 0);
|
||||||
float y = i - (isCustomRegion ? OldRegions.Length : 0) -
|
float y = i - (isCustomRegion ? OldRegions.Length : 0) -
|
||||||
(isCustomUserRegion ? NewRegions.Length + ModRegions.Count : 0);
|
(isCustomUserRegion ? NewRegions.Length + ModRegions.Count : 0);
|
||||||
|
|
||||||
@@ -177,17 +180,14 @@ namespace Unify.Patches
|
|||||||
regionButton.Text.text =
|
regionButton.Text.text =
|
||||||
RegionsEditor.IsActive ? $"{region.Name}\n{region.PingServer} {region.Servers[0].Port}" :
|
RegionsEditor.IsActive ? $"{region.Name}\n{region.PingServer} {region.Servers[0].Port}" :
|
||||||
region.Name;
|
region.Name;
|
||||||
|
|
||||||
if (i != firstCustomRegionIndex) continue;
|
|
||||||
|
|
||||||
PositionMoveButton(RegionsEditor.MoveUpButton, regionButtonPosition);
|
|
||||||
PositionMoveButton(RegionsEditor.MoveDownButton, regionButtonPosition, -0.5f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void RefreshDirectConnectButton()
|
internal static void RefreshDirectConnectButton()
|
||||||
{
|
{
|
||||||
|
if (!GameObject.Find("RegionMenu")) return;
|
||||||
|
|
||||||
if (DirectConnect) DirectConnect.gameObject.Destroy();
|
if (DirectConnect) DirectConnect.gameObject.Destroy();
|
||||||
|
|
||||||
RegionMenu regionMenu = DestroyableSingleton<RegionMenu>.Instance;
|
RegionMenu regionMenu = DestroyableSingleton<RegionMenu>.Instance;
|
||||||
@@ -195,6 +195,7 @@ namespace Unify.Patches
|
|||||||
|
|
||||||
DirectConnect = Object.Instantiate(joinGameButton.GameIdText, regionMenu.transform);
|
DirectConnect = Object.Instantiate(joinGameButton.GameIdText, regionMenu.transform);
|
||||||
DirectConnect.GetComponentInChildren<TextTranslatorTMP>().Destroy();
|
DirectConnect.GetComponentInChildren<TextTranslatorTMP>().Destroy();
|
||||||
|
DirectConnect.GetComponent<JoinGameButton>().Destroy();
|
||||||
DirectConnect.outputText.text = "Enter IP";
|
DirectConnect.outputText.text = "Enter IP";
|
||||||
DirectConnect.IpMode = true;
|
DirectConnect.IpMode = true;
|
||||||
DirectConnect.characterLimit = 15;
|
DirectConnect.characterLimit = 15;
|
||||||
@@ -206,12 +207,6 @@ namespace Unify.Patches
|
|||||||
int offset = NewRegions.Length + ModRegions.Count;
|
int offset = NewRegions.Length + ModRegions.Count;
|
||||||
DirectConnect.transform.localPosition = new Vector3(0, 1f - (offset / 2f), -100f);
|
DirectConnect.transform.localPosition = new Vector3(0, 1f - (offset / 2f), -100f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void PositionMoveButton(Controls.Button button, Vector3 regionButtonPosition, float yOffset=0)
|
|
||||||
{
|
|
||||||
button.GameObject.transform.localPosition =
|
|
||||||
new Vector3(regionButtonPosition.x + 1.45f, regionButtonPosition.y + yOffset, -100f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,75 +217,51 @@ namespace Unify.Patches
|
|||||||
private static Controls.Button _toggleOfficialsButton;
|
private static Controls.Button _toggleOfficialsButton;
|
||||||
private static Controls.Button _toggleExtrasButton;
|
private static Controls.Button _toggleExtrasButton;
|
||||||
|
|
||||||
private static Controls.Button _addRegionButton;
|
|
||||||
|
|
||||||
internal static Controls.Button MoveUpButton;
|
|
||||||
internal static Controls.Button MoveDownButton;
|
|
||||||
|
|
||||||
private static Popup _addRegionPopup;
|
|
||||||
|
|
||||||
internal static bool IsActive;
|
internal static bool IsActive;
|
||||||
|
|
||||||
public static async void SetUp()
|
internal static async void SetUp()
|
||||||
{
|
{
|
||||||
_addRegionPopup = await Popup.Create("Some text");
|
await SetUpSwitchButton();
|
||||||
|
await SetUpToggleOfficialsButton();
|
||||||
Controls.Button.Create("Edit", new Vector2(0.8f, 0.4f), new Vector2(0.5f, 0.3f), SetUpSwitchButton);
|
await SetUpToggleExtrasButton();
|
||||||
|
|
||||||
Controls.Button.Create("Toggle Official Regions", new Vector2(2f, 0.4f), new Vector2(1.1f, 1.3f),
|
|
||||||
SetUpToggleOfficialsButton);
|
|
||||||
Controls.Button.Create("Toggle Extra Regions", new Vector2(2f, 0.4f), new Vector2(1.1f, 1.8f),
|
|
||||||
SetUpToggleExtrasButton);
|
|
||||||
|
|
||||||
Controls.Button.Create("Add Region", new Vector2(2f, 0.4f), new Vector2(1.1f, 2.3f), SetUpAddRegionButton);
|
|
||||||
|
|
||||||
Controls.Button.Create("↑", new Vector2(0.4f, 0.4f), Vector2.zero, SetUpMoveUpButton);
|
|
||||||
Controls.Button.Create("↓", new Vector2(0.4f, 0.4f), Vector2.zero, SetUpMoveDownButton);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ShowRegionsEditor()
|
private static void SetRegionsEditorVisibility(bool visible)
|
||||||
{
|
{
|
||||||
IsActive = true;
|
IsActive = visible;
|
||||||
_switchButton.Text.text = "Back";
|
_toggleOfficialsButton.GameObject.SetActive(visible);
|
||||||
_toggleOfficialsButton.GameObject.SetActive(true);
|
_toggleExtrasButton.GameObject.SetActive(visible);
|
||||||
_toggleExtrasButton.GameObject.SetActive(true);
|
|
||||||
/*MoveUpButton.GameObject.SetActive(true);
|
|
||||||
MoveDownButton.GameObject.SetActive(true);
|
|
||||||
_addRegionButton.GameObject.SetActive(true);*/
|
|
||||||
|
|
||||||
RegionsPatch.RegionMenuPatches.RefreshRegionMenu();
|
RegionsPatch.RegionMenuPatches.RefreshRegionMenu();
|
||||||
RegionsPatch.DirectConnect.gameObject.SetActive(false);
|
|
||||||
|
if (visible)
|
||||||
|
{
|
||||||
|
_switchButton.Text.text = "Back";
|
||||||
|
RegionsPatch.DirectConnect.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_switchButton.Text.text = "Edit";
|
||||||
|
RegionsPatch.RegionMenuPatches.RefreshDirectConnectButton();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void HideRegionsEditor()
|
private static async Task SetUpSwitchButton()
|
||||||
{
|
{
|
||||||
IsActive = false;
|
_switchButton = await Controls.Button.Create("Edit");
|
||||||
_switchButton.Text.text = "Edit";
|
_switchButton.SetSize(new Vector2(0.8f, 0.4f)).SetDistanceFromEdge(new Vector2(0.5f, 0.3f));
|
||||||
_toggleOfficialsButton.GameObject.SetActive(false);
|
|
||||||
_toggleExtrasButton.GameObject.SetActive(false);
|
|
||||||
/*MoveUpButton.GameObject.SetActive(false);
|
|
||||||
MoveDownButton.GameObject.SetActive(false);
|
|
||||||
_addRegionButton.GameObject.SetActive(false);*/
|
|
||||||
|
|
||||||
RegionsPatch.RegionMenuPatches.RefreshRegionMenu();
|
|
||||||
RegionsPatch.RegionMenuPatches.RefreshDirectConnectButton();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void SetUpSwitchButton(Controls.Button button)
|
|
||||||
{
|
|
||||||
_switchButton = button;
|
|
||||||
|
|
||||||
_switchButton.OnClick.AddListener((Action) (() =>
|
_switchButton.OnClick.AddListener((Action) (() =>
|
||||||
{
|
{
|
||||||
if (IsActive) HideRegionsEditor();
|
SetRegionsEditorVisibility(!IsActive);
|
||||||
else ShowRegionsEditor();
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetUpToggleOfficialsButton(Controls.Button button)
|
private static async Task SetUpToggleOfficialsButton()
|
||||||
{
|
{
|
||||||
_toggleOfficialsButton = button;
|
_toggleOfficialsButton = await Controls.Button.Create("Toggle Official Regions");
|
||||||
|
_toggleOfficialsButton.SetSize(new Vector2(2f, 0.4f)).SetDistanceFromEdge(new Vector2(1.1f, 1.3f));
|
||||||
|
|
||||||
_toggleOfficialsButton.OnClick.AddListener((Action) (() =>
|
_toggleOfficialsButton.OnClick.AddListener((Action) (() =>
|
||||||
{
|
{
|
||||||
UnifyPlugin.ShowOfficialRegions.Value = !UnifyPlugin.ShowOfficialRegions.Value;
|
UnifyPlugin.ShowOfficialRegions.Value = !UnifyPlugin.ShowOfficialRegions.Value;
|
||||||
@@ -298,10 +269,11 @@ namespace Unify.Patches
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetUpToggleExtrasButton(Controls.Button button)
|
private static async Task SetUpToggleExtrasButton()
|
||||||
{
|
{
|
||||||
_toggleExtrasButton = button;
|
_toggleExtrasButton = await Controls.Button.Create("Toggle Extra Regions");
|
||||||
|
_toggleExtrasButton.SetSize(new Vector2(2f, 0.4f)).SetDistanceFromEdge(new Vector2(1.1f, 1.8f));
|
||||||
|
|
||||||
_toggleExtrasButton.OnClick.AddListener((Action) (() =>
|
_toggleExtrasButton.OnClick.AddListener((Action) (() =>
|
||||||
{
|
{
|
||||||
UnifyPlugin.ShowExtraRegions.Value = !UnifyPlugin.ShowExtraRegions.Value;
|
UnifyPlugin.ShowExtraRegions.Value = !UnifyPlugin.ShowExtraRegions.Value;
|
||||||
@@ -309,35 +281,13 @@ namespace Unify.Patches
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetUpMoveUpButton(Controls.Button button)
|
|
||||||
{
|
|
||||||
MoveUpButton = button;
|
|
||||||
|
|
||||||
MoveUpButton.GameObject.transform.position = DestroyableSingleton<RegionMenu>.Instance.transform.position;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void SetUpMoveDownButton(Controls.Button button)
|
|
||||||
{
|
|
||||||
MoveDownButton = button;
|
|
||||||
|
|
||||||
MoveDownButton.GameObject.transform.position = DestroyableSingleton<RegionMenu>.Instance.transform.position;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void SetUpAddRegionButton(Controls.Button button)
|
|
||||||
{
|
|
||||||
_addRegionButton = button;
|
|
||||||
|
|
||||||
_addRegionButton.OnClick.AddListener((Action) (() =>
|
|
||||||
{
|
|
||||||
_addRegionPopup.GameObject.SetActive(true);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
[HarmonyPatch(typeof(RegionMenu), nameof(RegionMenu.Open))]
|
[HarmonyPatch(typeof(RegionMenu), nameof(RegionMenu.Open))]
|
||||||
public static class OpenRegionsEditorPatch
|
public static class OpenRegionsEditorPatch
|
||||||
{
|
{
|
||||||
public static void Postfix()
|
public static void Postfix()
|
||||||
{
|
{
|
||||||
|
if (!GameObject.Find("RegionMenu")) return;
|
||||||
|
|
||||||
_switchButton.GameObject.SetActive(true);
|
_switchButton.GameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -356,12 +306,17 @@ namespace Unify.Patches
|
|||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
public static bool DisableRegionButtonsPatch()
|
public static bool DisableRegionButtonsPatch()
|
||||||
{
|
{
|
||||||
return !IsActive;
|
if (IsActive) return false;
|
||||||
|
|
||||||
|
Hide();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Hide()
|
private static void Hide()
|
||||||
{
|
{
|
||||||
HideRegionsEditor();
|
if (!RegionsPatch.DirectConnect) return;
|
||||||
|
|
||||||
|
SetRegionsEditorVisibility(false);
|
||||||
|
|
||||||
_switchButton.GameObject.SetActive(false);
|
_switchButton.GameObject.SetActive(false);
|
||||||
RegionsPatch.DirectConnect.gameObject.SetActive(false);
|
RegionsPatch.DirectConnect.gameObject.SetActive(false);
|
||||||
|
|||||||
+1
-2
@@ -21,7 +21,7 @@ namespace Unify
|
|||||||
{
|
{
|
||||||
public const string Id = "daemon.unify";
|
public const string Id = "daemon.unify";
|
||||||
private const string Name = "Unify";
|
private const string Name = "Unify";
|
||||||
private const string Version = "4.2.0";
|
private const string Version = "5.0.0";
|
||||||
|
|
||||||
public static ConfigFile ConfigFile { get; private set; }
|
public static ConfigFile ConfigFile { get; private set; }
|
||||||
|
|
||||||
@@ -46,7 +46,6 @@ namespace Unify
|
|||||||
Harmony.PatchAll();
|
Harmony.PatchAll();
|
||||||
|
|
||||||
Button.InitializeBaseButton();
|
Button.InitializeBaseButton();
|
||||||
// Popup.InitializeBasePopup();
|
|
||||||
RegionsEditor.SetUp();
|
RegionsEditor.SetUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -1,20 +1,20 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>netstandard2.1</TargetFramework>
|
||||||
<Version>4.2.0</Version>
|
<Version>5.0.0</Version>
|
||||||
<Mappings>NuclearPowered/Mappings:0.4.0</Mappings>
|
<Mappings>DaemonBeast/Mappings:0.5.0</Mappings>
|
||||||
|
|
||||||
<Description>Region mod</Description>
|
<Description>Region mod</Description>
|
||||||
<Authors>Daemon</Authors>
|
<Authors>Daemon</Authors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(GamePlatform)' == 'Steam'">
|
<PropertyGroup Condition="'$(GamePlatform)' == 'Steam'">
|
||||||
<GameVersion>2021.4.14s</GameVersion>
|
<GameVersion>2021.5.10s</GameVersion>
|
||||||
<DefineConstants>$(DefineConstants);STEAM</DefineConstants>
|
<DefineConstants>$(DefineConstants);STEAM</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(GamePlatform)' == 'Itch'">
|
<PropertyGroup Condition="'$(GamePlatform)' == 'Itch'">
|
||||||
<GameVersion>2021.4.14i</GameVersion>
|
<GameVersion>2021.5.10i</GameVersion>
|
||||||
<DefineConstants>$(DefineConstants);ITCH</DefineConstants>
|
<DefineConstants>$(DefineConstants);ITCH</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user