@@ -99,11 +99,11 @@ public class JCS_DialogueSystem : MonoBehaviour
9999 [ SerializeField ]
100100 private Image mRightImage = null ;
101101
102- [ Tooltip ( "Name tag ." ) ]
102+ [ Tooltip ( "Text box to display names ." ) ]
103103 [ SerializeField ]
104104 private JCS_TextObject mNameTag = null ;
105105
106- [ Tooltip ( "Main text GUI component to scroll ." ) ]
106+ [ Tooltip ( "Text box to display content messages ." ) ]
107107 [ SerializeField ]
108108 private JCS_TextObject mTextBox = null ;
109109
@@ -209,6 +209,21 @@ public class JCS_DialogueSystem : MonoBehaviour
209209 public bool ScrollingSelectBtnText { get { return this . mScrollingSelectBtnText ; } }
210210 public bool Skip { get { return this . mSkip ; } }
211211
212+ public Image CenterImage { get { return this . mCenterImage ; } }
213+ public Image LeftImage { get { return this . mLeftImage ; } }
214+ public Image RightImage { get { return this . mRightImage ; } }
215+ public JCS_TextObject NameTag { get { return this . mNameTag ; } }
216+ public JCS_TextObject TextBox { get { return this . mTextBox ; } }
217+ public RectTransform PanelTrans { get { return this . mPanelTrans ; } }
218+ public JCS_Button OkBtn { get { return this . mOkBtn ; } }
219+ public JCS_Button ExitBtn { get { return this . mExitBtn ; } }
220+ public JCS_Button YesBtn { get { return this . mYesBtn ; } }
221+ public JCS_Button NoBtn { get { return this . mNoBtn ; } }
222+ public JCS_Button PreviousBtn { get { return this . mPreviousBtn ; } }
223+ public JCS_Button NextBtn { get { return this . mNextBtn ; } }
224+ public JCS_Button AcceptBtn { get { return this . mAcceptBtn ; } }
225+ public JCS_Button DeclineBtn { get { return this . mDeclineBtn ; } }
226+
212227 public bool MakeHoverSelect { get { return this . mMakeHoverSelect ; } set { this . mMakeHoverSelect = value ; } }
213228 public JCS_DeltaTimeType DeltaTimeType { get { return this . mDeltaTimeType ; } set { this . mDeltaTimeType = value ; } }
214229 public JCS_DialogueScript DialogueScript { get { return this . mDialogueScript ; } set { this . mDialogueScript = value ; } }
@@ -646,7 +661,10 @@ public void ResetStats()
646661 mRenderSelectTextIndex = 0 ;
647662 mSelectTextIndex = 0 ;
648663
649- // reset message.
664+ // clear name tag
665+ mNameTag . text = "" ;
666+
667+ // clear text box
650668 mMessage = "" ;
651669 mTextBox . text = "" ;
652670
@@ -766,10 +784,28 @@ public void DecPage()
766784 }
767785
768786 /// <summary>
769- /// Continue with default condition .
787+ /// Go to previous page of the dialogue .
770788 /// </summary>
771- /// <returns> Return true if successful continue the dialogue. </returns>
772- public bool NextOrDispose ( )
789+ public bool Previous ( )
790+ {
791+ if ( ! mActive || mActiveThisFrame )
792+ return false ;
793+
794+ if ( ! IsVisible ( ) )
795+ return false ;
796+
797+ if ( SkipToEnd ( mCompleteTextBeforeAction ) )
798+ return false ;
799+
800+ PreviousBtnCallback ( ) ;
801+
802+ return true ;
803+ }
804+
805+ /// <summary>
806+ /// Go to next page of the dialogue.
807+ /// </summary>
808+ public bool Next ( )
773809 {
774810 if ( ! mActive || mActiveThisFrame )
775811 return false ;
@@ -782,6 +818,18 @@ public bool NextOrDispose()
782818
783819 NextBtnCallback ( ) ;
784820
821+ return true ;
822+ }
823+
824+ /// <summary>
825+ /// Like `Next` function but dispose it when possible.
826+ /// </summary>
827+ /// <returns> Return true if successful continue the dialogue. </returns>
828+ public bool NextOrDispose ( )
829+ {
830+ if ( ! Next ( ) )
831+ return false ;
832+
785833 if ( mMessage == "" )
786834 {
787835 Dispose ( ) ;
0 commit comments