public static void Show(Vector3 position, String message) { if (QuadMistGetCardDialog.main.dialog != (UnityEngine.Object)null) { Singleton <DialogManager> .Instance.ReleaseDialogToPool(QuadMistGetCardDialog.main.dialog); QuadMistGetCardDialog.main.dialog = (Dialog)null; } UILabel dialogLabel = Singleton <DialogManager> .Instance.GetDialogLabel(); Int32 width = dialogLabel.width; dialogLabel.width = Convert.ToInt32(UIManager.UIContentSize.x); dialogLabel.ProcessText(); dialogLabel.UpdateNGUIText(); Int32 num = Convert.ToInt32((NGUIText.CalculatePrintedSize2(message).x + Dialog.DialogPhraseXPadding * 2f) / UIManager.ResourceXMultipier) + 1; dialogLabel.width = width; QuadMistGetCardDialog.main.dialog = Singleton <DialogManager> .Instance.AttachDialog(String.Concat(new Object[] { "[STRT=", num, ",1][CENT][NANI][IMME]", message, "[TIME=-1]" }), 0, 1, Dialog.TailPosition.AutoPosition, Dialog.WindowStyle.WindowStylePlain, new Vector2(10000f, 10000f), Dialog.CaptionType.None); QuadMistGetCardDialog.main.dialog.transform.localPosition = new Vector3(0f, -220f); }
private IEnumerator ShowDialogWithCoroutine(Hand playerHand) { this.isReady = false; if (this.dialog != (UnityEngine.Object)null) { Singleton <DialogManager> .Instance.ReleaseDialogToPool(this.dialog); } String text = FF9TextTool.CardName((Int32)playerHand.SelectedUI.Data.id); UILabel dialogLabel = Singleton <DialogManager> .Instance.GetDialogLabel(); Int32 oldWidth = dialogLabel.width; dialogLabel.width = Convert.ToInt32(UIManager.UIContentSize.x); dialogLabel.ProcessText(); dialogLabel.UpdateNGUIText(); Int32 width = Convert.ToInt32((NGUIText.CalculatePrintedSize2(text).x + Dialog.DialogPhraseXPadding * 2f) / UIManager.ResourceXMultipier) + 1; dialogLabel.width = oldWidth; this.dialog = Singleton <DialogManager> .Instance.AttachDialog(String.Concat(new Object[] { "[STRT=", width, ",1][CENT][NANI][IMME]", text, "[TIME=-1]" }), 0, 1, Dialog.TailPosition.AutoPosition, Dialog.WindowStyle.WindowStylePlain, new Vector2(10000f, 10000f), Dialog.CaptionType.None); this.dialog.Panel.depth -= 2; this.dialog.phrasePanel.depth -= 2; while (this.dialog.CurrentState != Dialog.State.CompleteAnimation) { yield return(new WaitForEndOfFrame()); } Vector2 targetPosition = this.CalculateDialogTargetPosition(playerHand.Select, playerHand.Count); TweenPosition tweenPos = this.dialog.GetComponent <TweenPosition>(); if (tweenPos == (UnityEngine.Object)null) { tweenPos = this.dialog.gameObject.AddComponent <TweenPosition>(); } tweenPos.ignoreTimeScale = false; tweenPos.from = new Vector3(targetPosition.x + 800f, targetPosition.y); tweenPos.to = targetPosition; tweenPos.ResetToBeginning(); tweenPos.duration = 0.3f; tweenPos.enabled = true; tweenPos.animationCurve = this.AnimationCurv; Single countDown = tweenPos.duration; while (countDown >= 0f) { countDown -= Time.deltaTime; yield return(new WaitForEndOfFrame()); } UnityEngine.Object.Destroy(tweenPos); this.isReady = true; yield break; }
private Single FF9Help_ComputeWindow() { this.phraseLabel.ProcessText(); this.phraseLabel.UpdateNGUIText(); Vector2 vector = NGUIText.CalculatePrintedSize2(this.phrase); this.dialogRect.z = vector.x + (Single)HelpDialog.FF9HELP_X_SPACE; this.dialogRect.w = vector.y + (Single)HelpDialog.FF9HELP_Y_SPACE; if (this.dialogRect.z >= this.clipRect.z) { this.dialogRect.z = this.clipRect.z; } if (this.dialogRect.w >= this.clipRect.w) { this.dialogRect.w = this.clipRect.w; } if (!this.tail) { this.dialogTail = HelpDialog.FF9HELP_NONE; this.dialogRect.x = this.position.x; this.dialogRect.y = this.position.y; return(0f); } Int32 num = (Int32)(this.position.y + (Single)HelpDialog.FF9HELP_GAP_BOTTOM - this.clipRect.y); Int32 num2 = (Int32)(this.clipRect.y + this.clipRect.w - (this.position.y + (Single)HelpDialog.FF9HELP_GAP_TOP)); if (num > num2) { this.dialogTail = HelpDialog.FF9HELP_BOTTOM; this.dialogRect.y = this.position.y + (Single)HelpDialog.FF9HELP_GAP_BOTTOM - this.dialogRect.w / 2f; } else { this.dialogTail = HelpDialog.FF9HELP_TOP; this.dialogRect.y = this.position.y + (Single)HelpDialog.FF9HELP_GAP_TOP + this.dialogRect.w / 2f; } num = (Int32)(this.position.x + (Single)HelpDialog.FF9HELP_GAP_RIGHT - this.clipRect.x); num2 = (Int32)(this.clipRect.x + this.clipRect.z / 2f - (this.position.x + (Single)HelpDialog.FF9HELP_GAP_LEFT)); Int32 num3; if (num > num2) { this.dialogTail |= HelpDialog.FF9HELP_RIGHT; num3 = (Int32)this.position.x + HelpDialog.FF9HELP_GAP_RIGHT; } else { this.dialogTail |= HelpDialog.FF9HELP_LEFT; num3 = (Int32)this.position.x; } this.dialogRect.x = (Single)(num3 - ((Int32)this.dialogRect.z >> 1)); if (this.dialogRect.x - this.dialogRect.z / 2f < this.clipRect.x) { this.dialogRect.x = this.clipRect.x + this.dialogRect.z / 2f; } if (this.dialogRect.x + this.dialogRect.z / 2f > this.clipRect.x + this.clipRect.z) { this.dialogRect.x = this.clipRect.x + this.clipRect.z - this.dialogRect.z / 2f; } if ((this.dialogTail & HelpDialog.FF9HELP_RIGHT) != 0) { return((Single)num3 - this.dialogRect.x); } return(Mathf.Max((Single)HelpDialog.FF9HELP_WIN_MINX, (Single)num3 - (this.dialogRect.x - this.dialogRect.z / 2f))); }