|
@@ -33,8 +33,10 @@ namespace GFGGame
|
|
|
private string[] _wordList;
|
|
|
private int _wordIndex = 0;
|
|
|
private bool _isShowLetters;
|
|
|
+ private bool _canClickBtnNext;
|
|
|
private string _currentWords;
|
|
|
private string _storyStartID;
|
|
|
+ private string lastTextFieldType; // 上一段文本框的类型
|
|
|
|
|
|
//屏幕效果中
|
|
|
private Action<object> _onScreenEffectComplete;
|
|
@@ -111,6 +113,7 @@ namespace GFGGame
|
|
|
}
|
|
|
_speedAutoPlay = FightDataManager.Instance.dialogSpeed;
|
|
|
_autoPlay = false;
|
|
|
+ lastTextFieldType = "";
|
|
|
UpdateSpeedUpBtn();
|
|
|
_dialogListLookBack = new List<string>();
|
|
|
object[] datas = viewData as object[];
|
|
@@ -146,6 +149,7 @@ namespace GFGGame
|
|
|
FightDataManager.Instance.dialogSpeed = _speedAutoPlay;
|
|
|
}
|
|
|
_ui.m_btnBack.visible = InstanceZonesDataManager.CheckLevelPass(100001001);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
@@ -165,6 +169,7 @@ namespace GFGGame
|
|
|
MusicManager.Instance.Play(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
|
|
|
_onCompleteStoryDialogCall = null;
|
|
|
_onCompleteStoryDialogCallParam = null;
|
|
|
+ StoryDialogDataManager.Instance.Clear();
|
|
|
}
|
|
|
|
|
|
private void OnClickBtnBack()
|
|
@@ -176,7 +181,11 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnNext()
|
|
|
{
|
|
|
- // StopAutoPlay();
|
|
|
+ if (!_canClickBtnNext)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ StopAutoPlay();
|
|
|
if (_onScreenEffectComplete != null)
|
|
|
{
|
|
|
Timers.inst.Remove(OnScreenEffectComplete);
|
|
@@ -190,6 +199,7 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnLookBack()
|
|
|
{
|
|
|
+ StopAutoPlay();
|
|
|
if (_ui.m_btnSkip.enabled)
|
|
|
{
|
|
|
ViewManager.Show<StoryLookBackView>(_storyStartID);
|
|
@@ -260,7 +270,7 @@ namespace GFGGame
|
|
|
{
|
|
|
StoryDialogCfg storyDialogCfg = (StoryDialogCfg)_stepListToRead[0];
|
|
|
_stepListToRead.RemoveAt(0);
|
|
|
- InitStepContent(storyDialogCfg);
|
|
|
+ Timers.inst.StartCoroutine(InitStepContent(storyDialogCfg));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -315,8 +325,13 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void InitStepContent(StoryDialogCfg storyDialogCfg)
|
|
|
+ private IEnumerator InitStepContent(StoryDialogCfg storyDialogCfg)
|
|
|
{
|
|
|
+ _canClickBtnNext = false;
|
|
|
+ StoryDialogDataManager.Instance.waitPicFade = false;
|
|
|
+ HideAllDialogUI();
|
|
|
+
|
|
|
+ // Init resource
|
|
|
_currentStepCfg = storyDialogCfg;
|
|
|
UpdateMusic(storyDialogCfg.musicRes);
|
|
|
UpdateBg(storyDialogCfg.bgRes);
|
|
@@ -325,6 +340,18 @@ namespace GFGGame
|
|
|
PlayShake(storyDialogCfg.shakeInfoArr);
|
|
|
string content = storyDialogCfg.content;
|
|
|
content = storyDialogCfg.content.Replace("self", RoleDataManager.roleName);
|
|
|
+
|
|
|
+ bool delay = StoryDialogDataManager.Instance.waitBgChange;
|
|
|
+ while (StoryDialogDataManager.Instance.waitBgChange)
|
|
|
+ {
|
|
|
+ yield return new WaitForEndOfFrame();
|
|
|
+ }
|
|
|
+ if (delay)
|
|
|
+ {
|
|
|
+ yield return new WaitForSeconds(0.4f);
|
|
|
+ }
|
|
|
+
|
|
|
+ _canClickBtnNext = true;
|
|
|
if (content.IndexOf("//") >= 0)
|
|
|
{
|
|
|
showList(content);
|
|
@@ -340,9 +367,6 @@ namespace GFGGame
|
|
|
StopAutoPlay();
|
|
|
_ui.m_btnAutoPlay.enabled = false;
|
|
|
_wordTextField = null;
|
|
|
- _ui.m_dialogText.target.visible = false;
|
|
|
- _ui.m_dialogName.target.visible = false;
|
|
|
- _ui.m_dialogHead.target.visible = false;
|
|
|
_ui.m_list.visible = true;
|
|
|
_ui.m_list.RemoveChildrenToPool();
|
|
|
string[] list = Regex.Split(content, "//");
|
|
@@ -359,6 +383,14 @@ namespace GFGGame
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private void HideAllDialogUI()
|
|
|
+ {
|
|
|
+ _ui.m_dialogText.target.visible = false;
|
|
|
+ _ui.m_dialogName.target.visible = false;
|
|
|
+ _ui.m_dialogHead.target.visible = false;
|
|
|
+ _ui.m_list.visible = false;
|
|
|
+ }
|
|
|
+
|
|
|
private void ShowDialog(StoryDialogCfg storyDialogCfg)
|
|
|
{
|
|
|
if (storyDialogCfg.showChangeName == 1 && StorageDataManager.Instance.GetStorageValue(ConstStorageId.CHANGE_NAME) == 0)
|
|
@@ -390,8 +422,6 @@ namespace GFGGame
|
|
|
if (!string.IsNullOrEmpty(headAniRes) || storyDialogCfg.suitId > 0)
|
|
|
{
|
|
|
//显示对话框半身像
|
|
|
- _ui.m_dialogText.target.visible = false;
|
|
|
- _ui.m_dialogName.target.visible = false;
|
|
|
_ui.m_dialogHead.target.visible = true;
|
|
|
_ui.m_dialogHead.m_txtName.text = roleName;
|
|
|
_ui.m_dialogHead.m_comphead.m_head.visible = false;
|
|
@@ -433,11 +463,10 @@ namespace GFGGame
|
|
|
}
|
|
|
_wordTextField = _ui.m_dialogHead.m_txtContent;
|
|
|
_arrow = _ui.m_dialogHead.m_iconNext;
|
|
|
+ lastTextFieldType = "head";
|
|
|
}
|
|
|
else if (!string.IsNullOrEmpty(headRes))
|
|
|
{
|
|
|
- _ui.m_dialogText.target.visible = false;
|
|
|
- _ui.m_dialogName.target.visible = false;
|
|
|
_ui.m_dialogHead.target.visible = true;
|
|
|
_ui.m_dialogHead.m_txtName.text = roleName;
|
|
|
_ui.m_dialogHead.m_comphead.m_head.visible = true;
|
|
@@ -446,26 +475,32 @@ namespace GFGGame
|
|
|
_ui.m_dialogHead.m_comphead.m_head.url = ResPathUtil.GetNpcHeadPath(headRes);
|
|
|
_wordTextField = _ui.m_dialogHead.m_txtContent;
|
|
|
_arrow = _ui.m_dialogHead.m_iconNext;
|
|
|
+ lastTextFieldType = "head";
|
|
|
}
|
|
|
else if (!string.IsNullOrEmpty(roleName))
|
|
|
{
|
|
|
- _ui.m_dialogText.target.visible = false;
|
|
|
_ui.m_dialogName.target.visible = true;
|
|
|
- _ui.m_dialogHead.target.visible = false;
|
|
|
_ui.m_dialogName.m_txtName.text = roleName;
|
|
|
_wordTextField = _ui.m_dialogName.m_txtContent;
|
|
|
_arrow = _ui.m_dialogName.m_iconNext;
|
|
|
+
|
|
|
+ if (!lastTextFieldType.Equals("name"))
|
|
|
+ {
|
|
|
+ lastTextFieldType = "name";
|
|
|
+ _ui.m_t0.Play();
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
_ui.m_dialogText.target.visible = true;
|
|
|
- _ui.m_dialogName.target.visible = false;
|
|
|
- _ui.m_dialogHead.target.visible = false;
|
|
|
_wordTextField = _ui.m_dialogText.m_txtContent;
|
|
|
_arrow = _ui.m_dialogText.m_iconNext;
|
|
|
+ lastTextFieldType = "text";
|
|
|
}
|
|
|
_wordList = Regex.Split(words, "&&");
|
|
|
_wordIndex = 0;
|
|
|
+
|
|
|
ShowNextDialog();
|
|
|
}
|
|
|
|
|
@@ -485,7 +520,8 @@ namespace GFGGame
|
|
|
{
|
|
|
_wordTextField.data = null;
|
|
|
}
|
|
|
- StartShowLetters();
|
|
|
+
|
|
|
+ Timers.inst.StartCoroutine(StartShowLetters());
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -530,13 +566,22 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void StartShowLetters()
|
|
|
+ private IEnumerator StartShowLetters()
|
|
|
{
|
|
|
_isShowLetters = true;
|
|
|
_arrow.target.visible = false;
|
|
|
_wordTextField.verticalAlign = VertAlignType.Top;
|
|
|
_wordTextField.text = "";
|
|
|
ArrayList letters = StoryUtil.GetLettersList(_currentWords);
|
|
|
+
|
|
|
+ if (StoryDialogDataManager.Instance.waitPicFade)
|
|
|
+ {
|
|
|
+ StoryDialogDataManager.Instance.waitPicFade = false;
|
|
|
+ _canClickBtnNext = false;
|
|
|
+ yield return new WaitForSeconds(0.4f);
|
|
|
+ _canClickBtnNext = true;
|
|
|
+ }
|
|
|
+
|
|
|
Timers.inst.Add(GameConst.LETTERS_INTERVAL_MAX / _speedAutoPlay, 0, UpdateLetters, letters);
|
|
|
}
|
|
|
|