/// <summary> /// Refresh language text once. /// </summary> public void Refresh() { JCS_GUIUtil.SetLangText(this.mLangData, this.mText); #if TMP_PRO JCS_GUIUtil.SetLangText(this.mLangData, this.mTextMesh); #endif }
/* Functions */ public override void JCS_OnClickCallback() { JCS_GUIUtil.DeactivePanels(mDialogueObjects, mPlaySound); JCS_GUIUtil.DeactivePanels(mTweenPanels); }
private void DeactivePanel() { JCS_GUIUtil.DeactivePanels(mDialogueObjects, mPlaySound); JCS_GUIUtil.DeactivePanels(mTweenPanels); }
/// <summary> /// Update the dropdown data. /// /// Call this when the option data from the dropdown object /// has been updated. /// </summary> public void UpdateDropdownData() { // Clear it before we refresh. mDropdownRealTexts.Clear(); int centerLetterPos = mMaxLetters / 2; if (JCS_Mathf.IsOdd(mMaxLetters)) { centerLetterPos += 1; } int halfDotCount = mDotCount / 2; string dot = "."; /* First get the dot string. */ { for (int count = 1; count < mDotCount; ++count) { dot += "."; } } int index = -1; foreach (Dropdown.OptionData od in mDropdown.options) { ++index; // Check if we need to shortcut this. string textData = od.text; if (IsShortcutText(textData, dot)) { // Add the value from backup then. mDropdownRealTexts.Add(mDropdownBackupTexts[index]); continue; } // add the text. mDropdownRealTexts.Add(textData); // make another backup. mDropdownBackupTexts.Add(textData); int textDataLen = textData.Length; // Check if we need the fold the option text. if (textDataLen <= mMaxLetters) { continue; } int firstReplacePos = centerLetterPos - halfDotCount; int secondReplacePos = firstReplacePos; if (JCS_Mathf.IsOdd(mDotCount)) { if (mApproachSec) { secondReplacePos += 1; } else { firstReplacePos += 1; } } // We start counting from the text data length. // So we simply just minus it. secondReplacePos = textDataLen - secondReplacePos; string newTextData = // First half of the text data. textData.Substring(0, firstReplacePos) // Add replace dots. + dot // Add the second half of the text data. + textData.Substring(secondReplacePos, textDataLen - secondReplacePos); // Apply new text data. od.text = newTextData; } // Refresh the selection. JCS_GUIUtil.Dropdown_RefreshSelection(mDropdown); }