maint: hotreload updated to 1.13.7
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
||||
using SingularityGroup.HotReload.Localization;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SingularityGroup.HotReload {
|
||||
internal class ConnectionDialog : MonoBehaviour {
|
||||
[Header("UI controls")]
|
||||
|
||||
[Header(Localization.Translations.MenuItems.UIControls)]
|
||||
public Button buttonHide;
|
||||
|
||||
[Header("Information")]
|
||||
[Header(Localization.Translations.MenuItems.Information)]
|
||||
public Text textSummary;
|
||||
public Text textSuggestion;
|
||||
|
||||
@@ -38,7 +40,7 @@ namespace SingularityGroup.HotReload {
|
||||
}
|
||||
|
||||
/// <param name="summary">One of the <see cref="ConnectionSummary"/> constants</param>
|
||||
public void SetSummary(string summary = ConnectionSummary.Connected) {
|
||||
public void SetSummary(string summary) {
|
||||
if (textSummary != null) textSummary.text = summary;
|
||||
isConnected = summary == ConnectionSummary.Connected;
|
||||
}
|
||||
@@ -49,7 +51,7 @@ namespace SingularityGroup.HotReload {
|
||||
void Update() {
|
||||
textSuggestion.enabled = isConnected;
|
||||
if (SyncPatchCounts()) {
|
||||
textSuggestion.text = $"Patches: {pendingPatches} pending, {patchesApplied} applied";
|
||||
textSuggestion.text = string.Format(Localization.Translations.Dialogs.PatchesStatus, pendingPatches, patchesApplied);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,14 +69,14 @@ namespace SingularityGroup.HotReload {
|
||||
/// Therefore, we use short and simple messages.
|
||||
/// </remarks>
|
||||
internal static class ConnectionSummary {
|
||||
public const string Cancelled = "Cancelled";
|
||||
public const string Connecting = "Connecting ...";
|
||||
public const string Handshaking = "Handshaking ...";
|
||||
public const string DifferencesFound = "Differences found";
|
||||
public const string Connected = "Connected!";
|
||||
public static string Cancelled => Localization.Translations.Dialogs.ConnectionStateCancelled;
|
||||
public static string Connecting => Localization.Translations.Dialogs.ConnectionStateConnecting;
|
||||
public static string Handshaking => Localization.Translations.Dialogs.ConnectionStateHandshaking;
|
||||
public static string DifferencesFound => Localization.Translations.Dialogs.ConnectionStateDifferencesFound;
|
||||
public static string Connected => Localization.Translations.Dialogs.ConnectionStateConnected;
|
||||
// reconnecting can be shown for a long time, so a longer message is okay
|
||||
public const string TryingToReconnect = "Trying to reconnect ...";
|
||||
public const string Disconnected = "Disconnected";
|
||||
public static string TryingToReconnect => Localization.Translations.Dialogs.TryingToReconnect;
|
||||
public static string Disconnected => Localization.Translations.Dialogs.Disconnected;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -14,8 +14,8 @@ namespace SingularityGroup.HotReload {
|
||||
public GameObject connectedPrompt;
|
||||
public GameObject questionPrompt;
|
||||
|
||||
[Header("Other")]
|
||||
[Tooltip("Used when project does not create an EventSystem early enough")]
|
||||
[Header(Localization.Translations.MenuItems.Other)]
|
||||
[Tooltip(Localization.Translations.MenuItems.FalllbackEventSystem)]
|
||||
public GameObject fallbackEventSystem;
|
||||
|
||||
#region Singleton
|
||||
@@ -33,7 +33,7 @@ namespace SingularityGroup.HotReload {
|
||||
if (_I == null) {
|
||||
// allow showing prompts in editor (for testing)
|
||||
if (!Application.isEditor && !PlayerEntrypoint.IsPlayerWithHotReload()) {
|
||||
throw new NotSupportedException("IsPlayerWithHotReload() is false");
|
||||
throw new NotSupportedException(Localization.Translations.Errors.IsPlayerWithHotReloadFalse);
|
||||
}
|
||||
var go = Instantiate(HotReloadSettingsObject.I.PromptsPrefab,
|
||||
new Vector3(0, 0, 0), Quaternion.identity);
|
||||
@@ -134,8 +134,7 @@ namespace SingularityGroup.HotReload {
|
||||
/// Scene must contain an EventSystem and StandaloneInputModule, otherwise clicking/tapping on the overlay does nothing.
|
||||
private void DoEnsureEventSystem() {
|
||||
if (EventSystem.current == null) {
|
||||
Log.Info($"No EventSystem is active, enabling an EventSystem inside Hot Reload {name} prefab." +
|
||||
" A Unity EventSystem and an Input module is required for tapping buttons on the Unity UI.");
|
||||
Log.Info(string.Format(Localization.Translations.Settings.NoEventSystemWarning, name));
|
||||
fallbackEventSystem.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using SingularityGroup.HotReload.Localization;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SingularityGroup.HotReload {
|
||||
class QuestionDialog : MonoBehaviour {
|
||||
|
||||
[Header("Information")]
|
||||
[Header(Localization.Translations.MenuItems.Information)]
|
||||
public Text textSummary;
|
||||
public Text textSuggestion;
|
||||
|
||||
[Header("UI controls")]
|
||||
[Header(Localization.Translations.MenuItems.UIControls)]
|
||||
public Button buttonContinue;
|
||||
public Button buttonCancel;
|
||||
public Button buttonMoreInfo;
|
||||
@@ -50,9 +51,11 @@ namespace SingularityGroup.HotReload {
|
||||
internal class Config {
|
||||
public string summary;
|
||||
public string suggestion;
|
||||
public string continueButtonText = "Continue";
|
||||
public string cancelButtonText = "Cancel";
|
||||
public string moreInfoUrl = "https://hotreload.net/documentation#handling-different-commits";
|
||||
public string continueButtonText = Localization.Translations.Dialogs.ContinueButtonText;
|
||||
public string cancelButtonText = Localization.Translations.Dialogs.CancelButtonText;
|
||||
public string moreInfoUrl = PackageConst.DefaultLocale == Locale.SimplifiedChinese ?
|
||||
"https://hotreload.net/zh/documentation/on-device#处理不同的提交" :
|
||||
"https://hotreload.net/documentation/on-device#handling-different-commits";
|
||||
}
|
||||
|
||||
/// hide this dialog
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
||||
using JetBrains.Annotations;
|
||||
using SingularityGroup.HotReload.Localization;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SingularityGroup.HotReload {
|
||||
internal class RetryDialog : MonoBehaviour {
|
||||
[Header("UI controls")]
|
||||
[Header(Localization.Translations.MenuItems.UIControls)]
|
||||
public Button buttonHide;
|
||||
public Button buttonRetryAutoPair;
|
||||
public Button buttonTroubleshoot;
|
||||
@@ -52,7 +53,10 @@ namespace SingularityGroup.HotReload {
|
||||
});
|
||||
|
||||
buttonTroubleshoot.onClick.AddListener(() => {
|
||||
Application.OpenURL("https://hotreload.net/documentation#connection-issues");
|
||||
var docsUrl = PackageConst.DefaultLocale == Locale.SimplifiedChinese ?
|
||||
"https://hotreload.net/zh/documentation/on-device#连接问题" :
|
||||
"https://hotreload.net/documentation/on-device#connection-issues" ;
|
||||
Application.OpenURL(docsUrl);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -73,9 +77,9 @@ namespace SingularityGroup.HotReload {
|
||||
// assumes that auto-pair already tried for several seconds
|
||||
// suggestions to help the user when auto-pair is failing
|
||||
var networkText = Application.isMobilePlatform ? "WiFi" : "LAN/WiFi";
|
||||
var noWifiNetwork = $"Is this device connected to {networkText}?";
|
||||
var waitForCompiling = "Wait for compiling to finish before trying again";
|
||||
var targetNetworkIsReachable = $"Make sure you're on the same {networkText} network. Also ensure Hot Reload is running";
|
||||
var noWifiNetwork = string.Format(Localization.Translations.Dialogs.IsConnected, networkText);
|
||||
var waitForCompiling = Localization.Translations.Dialogs.WaitForCompiling;
|
||||
var targetNetworkIsReachable = string.Format(Localization.Translations.Dialogs.TargetNetworkIsReachable, networkText);
|
||||
|
||||
if (Application.internetReachability != NetworkReachability.ReachableViaLocalAreaNetwork) {
|
||||
textSuggestion.text = noWifiNetwork;
|
||||
@@ -87,7 +91,7 @@ namespace SingularityGroup.HotReload {
|
||||
textSuggestion.text = targetNetworkIsReachable;
|
||||
}
|
||||
|
||||
textSummary.text = autoConnect ? "Auto-pair encountered an issue" : "Connection failed";
|
||||
textSummary.text = autoConnect ? Localization.Translations.Dialogs.AutoPairEncounteredIssue : Localization.Translations.Dialogs.ConnectionFailed;
|
||||
|
||||
if (enableDebugging && textForDebugging) {
|
||||
textForDebugging.enabled = true;
|
||||
|
||||
Reference in New Issue
Block a user