예제 #1
0
        public static String GetDialogCaptionText(Dialog.CaptionType captionType)
        {
            String result = String.Empty;

            switch (captionType)
            {
            case Dialog.CaptionType.Mognet:
            case Dialog.CaptionType.ActiveTimeEvent:
            case Dialog.CaptionType.Chocobo:
            case Dialog.CaptionType.Notice:
                result = Localization.Get(captionType.ToString());
                break;
            }
            return(result);
        }
예제 #2
0
    public Dialog AttachDialog(String phrase, Int32 width, Int32 lineCount, Dialog.TailPosition tailPos, Dialog.WindowStyle style, Vector2 pos, Dialog.CaptionType captionType = Dialog.CaptionType.None)
    {
        Dialog dialogFromPool = this.GetDialogFromPool();

        if (dialogFromPool != (UnityEngine.Object)null)
        {
            dialogFromPool.Reset();
            dialogFromPool.Width      = (Single)width;
            dialogFromPool.LineNumber = (Single)lineCount;
            dialogFromPool.Style      = style;
            dialogFromPool.Tail       = tailPos;
            dialogFromPool.Position   = pos;
            dialogFromPool.Id         = DialogManager.UIDialogId;
            dialogFromPool.Caption    = FF9TextTool.GetDialogCaptionText(captionType);
            dialogFromPool.Phrase     = phrase;
            dialogFromPool.Show();
            if (!this.isActivate)
            {
                this.ActivateDialogScene();
            }
        }
        return(dialogFromPool);
    }
예제 #3
0
    public Dialog AttachDialog(Int32 dialogId, Dialog.WindowStyle style, Int32 textId, PosObj po, Dialog.DialogIntDelegate listener, Dialog.CaptionType captionType)
    {
        Dialog dialogFromPool = this.GetDialogFromPool();

        if (dialogFromPool != null)
        {
            dialogFromPool.Reset();
            dialogFromPool.Id      = dialogId;
            dialogFromPool.Style   = style;
            dialogFromPool.Po      = po;
            dialogFromPool.TextId  = textId;
            dialogFromPool.Caption = FF9TextTool.GetDialogCaptionText(captionType);
            dialogFromPool.CapType = captionType;
            if (PersistenSingleton <UIManager> .Instance.UnityScene == UIManager.Scene.Battle)
            {
                if (FF9TextTool.IsBattleTextLoaded)
                {
                    dialogFromPool.Phrase = FF9TextTool.BattleText(textId);
                }
                else
                {
                    dialogFromPool.Phrase = String.Empty;
                    dialogFromPool.Style  = Dialog.WindowStyle.WindowStyleTransparent;
                }
            }
            else if (PersistenSingleton <UIManager> .Instance.UnityScene == UIManager.Scene.Field || PersistenSingleton <UIManager> .Instance.UnityScene == UIManager.Scene.World)
            {
                dialogFromPool.Phrase = FF9TextTool.FieldText(textId);

                // Subscribe
                Action onFieldTextUpdated = () =>
                {
                    dialogFromPool.Phrase = FF9TextTool.FieldText(textId);
                    dialogFromPool.Show();
                };
                FF9TextTool.FieldTextUpdated += onFieldTextUpdated;

                // Unsubscribe
                Dialog.DialogIntDelegate unsubscribe = (c) => FF9TextTool.FieldTextUpdated -= onFieldTextUpdated;
                listener = (Dialog.DialogIntDelegate)Delegate.Combine(unsubscribe, listener);
            }
            dialogFromPool.Show();
            dialogFromPool.AfterDialogHidden = listener;
            if (!this.isActivate)
            {
                this.ActivateDialogScene();
            }
        }
        return(dialogFromPool);
    }
예제 #4
0
    public void NewMesWin(Int32 mes, Int32 num, Int32 flags, PosObj targetPo)
    {
        EventEngine instance = PersistenSingleton <EventEngine> .Instance;

        if (this.IsSkipped(instance, mes, num, flags, targetPo))
        {
            return;
        }
        this.DisposWindowByID(num);
        Dialog.CaptionType captionType = Dialog.CaptionType.None;
        Dialog.WindowStyle windowStyle;
        if ((flags & 128) > 0)
        {
            windowStyle = Dialog.WindowStyle.WindowStyleAuto;
        }
        else
        {
            windowStyle = Dialog.WindowStyle.WindowStylePlain;
            if ((flags & 8) > 0)
            {
                captionType = Dialog.CaptionType.Mognet;
            }
            else if ((flags & 64) > 0)
            {
                captionType = Dialog.CaptionType.ActiveTimeEvent;
            }
        }
        if (windowStyle == Dialog.WindowStyle.WindowStylePlain)
        {
            targetPo = (PosObj)null;
        }
        if ((flags & 16) > 0)
        {
            windowStyle = Dialog.WindowStyle.WindowStyleTransparent;
        }
        else if ((flags & 4) > 0)
        {
            windowStyle = Dialog.WindowStyle.WindowStyleNoTail;
        }
        if ((flags & 1) <= 0)
        {
            ETb.sChoose     = ETb.sChooseInit;
            ETb.sChooseInit = 0;
        }
        if (instance.gMode == 3)
        {
            targetPo = (PosObj)null;
            if (mes != 40)
            {
                if (mes == 41)
                {
                    EIcon.ShowDialogBubble(true);
                }
            }
            else
            {
                EIcon.ShowDialogBubble(false);
            }
        }
        EventHUD.CheckSpecialHUDFromMesId(mes, true);
        if (FF9StateSystem.Common.FF9.fldMapNo == 1850 && FF9StateSystem.AndroidTVPlatform && (mes == 147 || mes == 148))
        {
            NGUIText.ForceShowButton = true;
        }
        Dialog dialog = Singleton <DialogManager> .Instance.AttachDialog(num, windowStyle, mes, targetPo, this.OnDialogFinish, captionType);

        if (FF9StateSystem.Common.FF9.fldMapNo == 1657)
        {
            switch (FF9StateSystem.Settings.CurrentLanguage)
            {
            case "English(US)":
            case "English(UK)":
            case "Spanish":
            case "German":
            case "Italian":
                if (mes == 183 || mes == 166)
                {
                    dialog.FocusToActor = false;
                }
                break;

            case "Japanese":
                if (mes == 187 || mes == 170)
                {
                    dialog.FocusToActor = false;
                }
                break;

            case "French":
                if (mes == 185 || mes == 168)
                {
                    dialog.FocusToActor = false;
                }
                break;
            }
        }

        if (dialog == (UnityEngine.Object)null)
        {
            return;
        }
        if ((flags & 32) > 0)
        {
            dialog.FocusToActor = false;
        }
        if (ETb.isMessageDebug)
        {
            global::Debug.Log(String.Concat(new Object[]
            {
                "NewMesWin => sid:",
                instance.gCur.sid,
                ", mes: ",
                mes,
                ", field id:",
                FF9TextTool.FieldZoneId,
                ", num: ",
                num,
                ", flags: ",
                flags,
                ", text:",
                dialog.Phrase
            }));
        }
        this.gMesCount++;
        EIcon.SetHereIcon(0);
        String currentLanguage = FF9StateSystem.Settings.CurrentLanguage;

        EMinigame.EidolonMuralAchievement(currentLanguage, mes);
        EMinigame.ExcellentLuckColorFortuneTellingAchievement(currentLanguage, mes);
        EMinigame.ProvokeMogAchievement(currentLanguage, mes);
        EMinigame.JumpingRopeAchievement(currentLanguage, mes);
        EMinigame.GetRewardFromQueenStellaAchievement();
        EMinigame.ShuffleGameAchievement(currentLanguage, mes);
        EMinigame.ChocoboBeakLV99Achievement(currentLanguage, mes);
        EMinigame.AtleteQueenAchievement_Debug(currentLanguage, mes);
        EMinigame.TreasureHunterSAchievement(currentLanguage, mes);
        ETb.FixChocoAccidenlyFly(dialog);
    }