Merge branch 'bugfix/问题修复' into 'develop'
fix: 部分QA问题处理 See merge request aibis-dream/aibis-dream!786
This commit is contained in:
@@ -242,11 +242,11 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: -1
|
||||
m_MinWidth: 137.5
|
||||
m_MinHeight: -1
|
||||
m_PreferredWidth: 137.5
|
||||
m_PreferredHeight: -1
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleWidth: 0
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
||||
--- !u!1 &9149096767179396398
|
||||
@@ -398,9 +398,9 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: -1
|
||||
m_MinWidth: 0
|
||||
m_MinHeight: -1
|
||||
m_PreferredWidth: -1
|
||||
m_PreferredWidth: 0
|
||||
m_PreferredHeight: -1
|
||||
m_FlexibleWidth: 1
|
||||
m_FlexibleHeight: -1
|
||||
|
||||
@@ -109,6 +109,11 @@ namespace AibisDream
|
||||
yield return _dialogueRunner.Stop();
|
||||
}
|
||||
|
||||
// Yarn Spinner runs IEnumerator commands as coroutines on the
|
||||
// DialogueRunner. Stopping the dialogue does not stop those detached
|
||||
// coroutines, so cancel them explicitly before a scene/session teardown.
|
||||
_dialogueRunner?.StopAllCoroutines();
|
||||
|
||||
SavePointEvaluator.ResetForProject(null);
|
||||
YarnVariableStorage.Instance.Clear();
|
||||
DialogUIManager.Instance.HideDialog();
|
||||
|
||||
@@ -539,14 +539,17 @@ namespace AibisDream
|
||||
}
|
||||
|
||||
EnumEventSystem.Global.Send(GameLifecycleEvent.SessionEnding);
|
||||
ResumeSessionInternal(sendEvent: _session.IsPaused);
|
||||
yield return FadeIn();
|
||||
|
||||
if (DialogController.Instance != null)
|
||||
{
|
||||
yield return DialogController.Instance.StopDialogRoutine();
|
||||
}
|
||||
|
||||
// The in-game terminal remains visible while this transition
|
||||
// covers the gameplay behind it.
|
||||
yield return FadeIn();
|
||||
UIManager.Instance.GetPanel<InGameTerminalPanel>()?.CloseForSessionEnd();
|
||||
|
||||
// The showcase belongs to the loaded gameplay scene, so clear it
|
||||
// while that scene is still alive and hidden behind the fade.
|
||||
ResetPresentationEffects();
|
||||
@@ -579,6 +582,7 @@ namespace AibisDream
|
||||
UIManager.Instance.HidePanel<EndPanel>();
|
||||
yield return LocalizationKit.WaitUntilReady();
|
||||
|
||||
ResumeSessionInternal(sendEvent: _session.IsPaused);
|
||||
_session.ResetRuntimeState();
|
||||
TrySetPhase(GameSessionPhase.MainMenu);
|
||||
EnumEventSystem.Global.Send(GameLifecycleEvent.SessionEnded);
|
||||
|
||||
@@ -14,6 +14,8 @@ namespace AibisDream
|
||||
|
||||
private CanvasGroup _canvasGroup;
|
||||
private BubbleSlotGroupData? _pendingBubbleData;
|
||||
private bool _isCanvasOpen = true;
|
||||
private bool _isDialogVisualVisible = true;
|
||||
|
||||
public override void OnSingletonInit()
|
||||
{
|
||||
@@ -23,6 +25,8 @@ namespace AibisDream
|
||||
_canvasGroup = gameObject.AddComponent<CanvasGroup>();
|
||||
}
|
||||
|
||||
ApplyCanvasGroupState();
|
||||
|
||||
EnumEventSystem.Global.Register<DialogEventEnum, LineInfo>(DialogEventEnum.LineStart, AddDialogueLine);
|
||||
EnumEventSystem.Global.Register<DialogEventEnum, LineInfo>(DialogEventEnum.LineHistoryAppend, AddDialogueLine);
|
||||
EnumEventSystem.Global.Register<DialogEventEnum, LineInfo>(DialogEventEnum.OptionSelected, AddDialogueLine);
|
||||
@@ -67,12 +71,14 @@ namespace AibisDream
|
||||
|
||||
public void CloseCanvas()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
_isCanvasOpen = false;
|
||||
ApplyCanvasGroupState();
|
||||
}
|
||||
|
||||
public void OpenCanvas()
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
_isCanvasOpen = true;
|
||||
ApplyCanvasGroupState();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -80,12 +86,18 @@ namespace AibisDream
|
||||
/// </summary>
|
||||
public void SetDialogVisualVisible(bool visible)
|
||||
{
|
||||
if (_canvasGroup == null)
|
||||
{
|
||||
_canvasGroup = GetComponent<CanvasGroup>();
|
||||
}
|
||||
_isDialogVisualVisible = visible;
|
||||
ApplyCanvasGroupState();
|
||||
}
|
||||
|
||||
_canvasGroup.alpha = visible ? 1f : 0f;
|
||||
private void ApplyCanvasGroupState()
|
||||
{
|
||||
_canvasGroup.alpha = _isCanvasOpen && _isDialogVisualVisible ? 1f : 0f;
|
||||
|
||||
// SetDialogVisualVisible remains visual-only. Pause-driven canvas state
|
||||
// exclusively controls whether dialogue UI can interact or block raycasts.
|
||||
_canvasGroup.interactable = _isCanvasOpen;
|
||||
_canvasGroup.blocksRaycasts = _isCanvasOpen;
|
||||
}
|
||||
|
||||
public void HideDialog()
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace AibisDream.UI
|
||||
private readonly Stack<InGameTerminalPage> _backStack = new();
|
||||
private InGameTerminalPage _currentPage = InGameTerminalPage.None;
|
||||
private bool _pausedByPanel;
|
||||
private bool _isReturningToMainMenu;
|
||||
|
||||
public bool IsOpen => gameObject.activeSelf && _currentPage != InGameTerminalPage.None;
|
||||
public bool IsCloseable => false;
|
||||
@@ -69,6 +70,7 @@ namespace AibisDream.UI
|
||||
return;
|
||||
}
|
||||
|
||||
_isReturningToMainMenu = false;
|
||||
if (!IsOpen)
|
||||
{
|
||||
_backStack.Clear();
|
||||
@@ -124,12 +126,22 @@ namespace AibisDream.UI
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_isReturningToMainMenu)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Back();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
if (_isReturningToMainMenu)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Close(restoreAmb: true);
|
||||
}
|
||||
|
||||
@@ -144,8 +156,34 @@ namespace AibisDream.UI
|
||||
|
||||
public void CloseToMainMenu()
|
||||
{
|
||||
Close(restoreAmb: false);
|
||||
GameManager.Instance.TryReturnToMainMenu();
|
||||
if (_isReturningToMainMenu || GameManager.Instance == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (GameManager.Instance.TryReturnToMainMenu())
|
||||
{
|
||||
// Keep this full-screen panel visible while the global transition
|
||||
// covers the gameplay behind it. GameManager closes it only after
|
||||
// the screen is fully covered.
|
||||
_isReturningToMainMenu = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void CloseForSessionEnd()
|
||||
{
|
||||
HideAllPages();
|
||||
_backStack.Clear();
|
||||
_currentPage = InGameTerminalPage.None;
|
||||
|
||||
if (_pausedByPanel)
|
||||
{
|
||||
TerminalUIAudio.NotifyPauseMenuAmbExit(restorePrevious: false);
|
||||
_pausedByPanel = false;
|
||||
}
|
||||
|
||||
_isReturningToMainMenu = false;
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public void SetHeader(string title, string status = "")
|
||||
|
||||
@@ -13,13 +13,11 @@ namespace AibisDream.UI
|
||||
if (actorNameText != null)
|
||||
{
|
||||
actorNameText.text = lineInfo.character.GetActorName();
|
||||
actorNameText.ForceMeshUpdate();
|
||||
}
|
||||
|
||||
if (lineText != null)
|
||||
{
|
||||
lineText.text = lineInfo.GetRecordLine();
|
||||
lineText.ForceMeshUpdate();
|
||||
}
|
||||
|
||||
gameObject.SetActive(true);
|
||||
|
||||
Reference in New Issue
Block a user