Esempio n. 1
0
    private IEnumerator OnFinishedSaveFile_delay(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID, Boolean isSuccess, SharedDataPreviewSlot data)
    {
        Single remainTime = Mathf.Max(2f - (Time.time - this.timeCounter), 0f);

        yield return(new WaitForSeconds(remainTime));

        this.progressBar.value = 1f;
        yield return(new WaitForSeconds(0.1f));

        base.Loading = false;
        this.LoadingAccessPanel.SetActive(false);
        if (isSuccess && errNo == DataSerializerErrorCode.Success)
        {
            FF9Sfx.FF9SFX_Play(1261);
            this.isFileExistList[this.currentFile] = true;
            this.isFileCorrupt[this.currentFile]   = false;
            this.DisplayFileInfo(this.currentFile, data);
            this.DisplaySuccessfulAccessDialog();
        }
        else
        {
            FF9Sfx.FF9SFX_Play(1046);
            global::Debug.Log("DISPLAYING CORRUPT DIALOG 2");
            FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpBlock");
            global::Debug.LogError("Cannot save file");
            this.DisplayCorruptAccessDialog(SaveLoadUI.FileGroupButton, SaveLoadUI.SerializeType.Save, errNo);
            this.isFileCorrupt[saveID] = true;
        }
        yield break;
    }
Esempio n. 2
0
    private IEnumerator OnFinishedLoadPreview_delay(DataSerializerErrorCode errNo, Int32 slotID, List <SharedDataPreviewSlot> data)
    {
        Single remainTime = Mathf.Max(2f - (Time.time - this.timeCounter), 0f);

        yield return(new WaitForSeconds(remainTime));

        base.Loading = false;
        if (errNo == DataSerializerErrorCode.Success)
        {
            FF9Sfx.FF9SFX_Play(1044);
            this.LoadingPreviewDialog.SetActive(false);
            if (this.type == SaveLoadUI.SerializeType.Load)
            {
                Boolean isNodata = true;
                foreach (SharedDataPreviewSlot slot in data)
                {
                    if (slot != null)
                    {
                        isNodata = false;
                        break;
                    }
                }
                if (isNodata)
                {
                    this.DisplayNoSaveFoundDialog();
                    FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpSlot");
                    yield break;
                }
            }
            else if (data == null)
            {
                data = new List <SharedDataPreviewSlot>();
                for (Int32 index = 0; index < 15; index++)
                {
                    data.Add((SharedDataPreviewSlot)null);
                }
            }
            ButtonGroupState.MuteActiveSound = true;
            base.Loading = true;
            base.FadingComponent.FadePingPong(delegate
            {
                this.SlotListPanel.SetActive(false);
                this.FileListPanel.SetActive(true);
                FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpBlock");
                this.DisplayFile(data);
            }, delegate
            {
                ButtonGroupState.MuteActiveSound = false;
                this.Loading = false;
            });
            yield break;
        }
        FF9Sfx.FF9SFX_Play(1046);
        global::Debug.Log("DISPLAYING CORRUPT DIALOG 1");
        FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpSlot");
        this.LoadingPreviewDialog.SetActive(false);
        this.DisplayCorruptAccessDialog(SaveLoadUI.SlotGroupButton, SaveLoadUI.SerializeType.Load, errNo);
        this.slotNameLabelList[slotID].color = FF9TextTool.Red;
        yield break;
    }
Esempio n. 3
0
 private void DisplayGilAndItemInfo()
 {
     this.EXPAndAPPhrasePanel.SetActive(false);
     this.GilAndItemPhrasePanel.SetActive(true);
     this.receiveGilLabel.text = (this.gilValue.value - this.gilValue.current).ToString() + "[YSUB=1.3][sub]G";
     this.currentGilLabel.text = Mathf.Min(FF9StateSystem.Common.FF9.party.gil, 9999999f).ToString() + "[YSUB=1.3][sub]G";
     FF9UIDataTool.DisplayTextLocalize(this.infoLabelGameObject, "BattleResultInfoGilItem");
     if (this.itemList.Count > 0)
     {
         this.ItemDetailPanel.SetActive(true);
         this.noItemLabel.SetActive(false);
         Int32 num = 0;
         foreach (FF9ITEM ff9ITEM in this.itemList)
         {
             ItemListDetailWithIconHUD itemListDetailWithIconHUD = this.itemHudList[num];
             itemListDetailWithIconHUD.Self.SetActive(true);
             FF9UIDataTool.DisplayItem((Int32)ff9ITEM.id, itemListDetailWithIconHUD.IconSprite, itemListDetailWithIconHUD.NameLabel, true);
             itemListDetailWithIconHUD.NumberLabel.text = ff9ITEM.count.ToString();
             num++;
         }
     }
     else
     {
         this.ItemDetailPanel.SetActive(false);
         this.noItemLabel.SetActive(true);
     }
     if (this.defaultCard != 255)
     {
         this.ItemDetailPanel.SetActive(true);
         this.cardHud.Self.SetActive(true);
         this.cardHud.NameLabel.text = FF9TextTool.CardName(this.defaultCard);
     }
 }
Esempio n. 4
0
 private void DisplayEXPAndAPInfo()
 {
     this.EXPAndAPPhrasePanel.SetActive(true);
     this.GilAndItemPhrasePanel.SetActive(false);
     this.expReceiveLabel.text = this.defaultExp.ToString();
     this.apReceiveLabel.text  = this.defaultAp.ToString();
     FF9UIDataTool.DisplayTextLocalize(this.infoLabelGameObject, "BattleResultInfoEXPAP");
 }
Esempio n. 5
0
 private void DisplaySuccessfulAccessDialog()
 {
     if (this.type == SaveLoadUI.SerializeType.Save)
     {
         this.SuccessfulAccessPanel.transform.position = this.fileInfoHudList[this.currentFile].Self.transform.position - new Vector3(0.8f, 0.05f);
         this.SuccessfulAccessPanel.SetActive(true);
         FF9UIDataTool.DisplayTextLocalize(this.successfulAccessGameObject, "SaveSuccess");
         base.Loading = true;
         base.StartCoroutine("HideSuccessfulAccessDialog");
     }
 }
Esempio n. 6
0
    private IEnumerator HideSuccessfulAccessDialog()
    {
        yield return(new WaitForSeconds(1.5f));

        this.SuccessfulAccessPanel.SetActive(false);
        FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpBlock");
        if (this.type == SaveLoadUI.SerializeType.Save)
        {
            base.Loading = false;
            ButtonGroupState.ActiveGroup = SaveLoadUI.FileGroupButton;
        }
        yield break;
    }
Esempio n. 7
0
 private void setSerialzeType(SaveLoadUI.SerializeType serailizeType)
 {
     if (serailizeType != SaveLoadUI.SerializeType.Save)
     {
         if (serailizeType == SaveLoadUI.SerializeType.Load)
         {
             FF9UIDataTool.DisplayTextLocalize(this.SerailizeTitleLabel, "Load");
         }
     }
     else
     {
         FF9UIDataTool.DisplayTextLocalize(this.SerailizeTitleLabel, "Save");
     }
 }
Esempio n. 8
0
    private void DisplaySlot()
    {
        Int32 num = 0;

        foreach (UILabel uilabel in this.slotNameLabelList)
        {
            uilabel.text  = String.Format(Localization.Get("SlotNo"), num + 1);
            uilabel.color = FF9TextTool.White;
            num++;
        }
        this.currentSlot        = FF9StateSystem.Settings.LatestSlot;
        this.helpSlotLabel.text = String.Format(Localization.Get("SlotNo"), this.currentSlot + 1);
        this.SlotListPanel.SetActive(true);
        this.FileListPanel.SetActive(false);
        FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpSlot");
    }
Esempio n. 9
0
    private IEnumerator OnFinishedLoadFile_delay(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID, Boolean isSuccess)
    {
        Single remainTime = Mathf.Max(2f - (Time.time - this.timeCounter), 0f);

        yield return(new WaitForSeconds(remainTime));

        this.progressBar.value = 1f;
        yield return(new WaitForSeconds(0.1f));

        this.LoadingAccessPanel.SetActive(false);
        if (isSuccess && errNo == DataSerializerErrorCode.Success)
        {
            FF9Sfx.FF9SFX_Play(1261);
            this.Hide(delegate
            {
                SoundLib.StopMovieMusic("FMV000", true);
                this.Loading = true;
                FF9StateSystem.Settings.SetSound();
                FF9StateSystem.Settings.SetSoundEffect();
                EventEngine instance = PersistenSingleton <EventEngine> .Instance;
                instance.ReplaceLoadMap();
                PersistenSingleton <UIManager> .Instance.TitleScene.SplashScreenEnabled = true;
                AchievementManager.ResyncNormalAchievements();
                FF9StateSystem.Settings.UpdateSetting();
                ff9.w_frameNewSession();
                SceneDirector.FadeEventSetColor(FadeMode.Sub, Color.white);
            });
        }
        else
        {
            FF9Sfx.FF9SFX_Play(1046);
            FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpBlock");
            global::Debug.LogError("Cannot load file");
            this.DisplayCorruptAccessDialog(SaveLoadUI.FileGroupButton, SaveLoadUI.SerializeType.Load, errNo);
            this.isFileCorrupt[saveID] = true;
            this.DisplayFileInfo(this.currentFile, (SharedDataPreviewSlot)null);
        }
        yield break;
    }
Esempio n. 10
0
 public override Boolean OnKeyCancel(GameObject go)
 {
     if (base.OnKeyCancel(go))
     {
         if (ButtonGroupState.ActiveGroup == SaveLoadUI.SlotGroupButton)
         {
             FF9Sfx.FF9SFX_Play(101);
             this.Hide(delegate
             {
                 PersistenSingleton <UIManager> .Instance.ChangeUIState(PersistenSingleton <UIManager> .Instance.HUDState);
             });
         }
         else if (ButtonGroupState.ActiveGroup == SaveLoadUI.FileGroupButton)
         {
             FF9Sfx.FF9SFX_Play(101);
             base.Loading = true;
             base.FadingComponent.FadePingPong(delegate
             {
                 FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpSlot");
                 this.SlotListPanel.SetActive(true);
                 this.FileListPanel.SetActive(false);
                 ButtonGroupState.ActiveGroup = SaveLoadUI.SlotGroupButton;
             }, delegate
             {
                 base.Loading = false;
             });
         }
         else if (ButtonGroupState.ActiveGroup == SaveLoadUI.ConfirmDialogGroupButton)
         {
             FF9Sfx.FF9SFX_Play(101);
             this.OverWriteDialog.SetActive(false);
             ButtonGroupState.ActiveGroup = SaveLoadUI.FileGroupButton;
         }
     }
     return(true);
 }
Esempio n. 11
0
 public override Boolean OnKeyConfirm(GameObject go)
 {
     if (base.OnKeyConfirm(go))
     {
         if (ButtonGroupState.ActiveGroup == SaveLoadUI.SlotGroupButton)
         {
             FF9Sfx.FF9SFX_Play(103);
             this.currentSlot = go.transform.GetSiblingIndex();
             ButtonGroupState.DisableAllGroup(true);
             this.LoadingPreviewDialog.SetActive(true);
             FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpCheck");
             base.Loading     = true;
             this.timeCounter = Time.time;
             FF9StateSystem.Serializer.LoadSlotPreview(this.currentSlot, new ISharedDataSerializer.OnLoadSlotFinish(this.OnFinishedLoadPreview));
         }
         else if (ButtonGroupState.ActiveGroup == SaveLoadUI.FileGroupButton)
         {
             this.currentFile = go.GetComponent <ScrollItemKeyNavigation>().ID;
             if (this.type == SaveLoadUI.SerializeType.Save)
             {
                 FF9Sfx.FF9SFX_Play(103);
                 if (this.isFileExistList[this.currentFile])
                 {
                     this.DisplayOverWriteDialog();
                     ButtonGroupState.ActiveGroup = SaveLoadUI.ConfirmDialogGroupButton;
                 }
                 else
                 {
                     ButtonGroupState.DisableAllGroup(true);
                     FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpSave");
                     FF9UIDataTool.DisplayTextLocalize(this.loadingAccessText, "WarningSaveData");
                     this.LoadingAccessPanel.SetActive(true);
                     base.StartCoroutine("RunProgressBar");
                     this.timeCounter = Time.time;
                     base.Loading     = true;
                     FF9StateSystem.Settings.UpdateTickTime();
                     FF9StateSystem.Serializer.Save(this.currentSlot, this.currentFile, (ISharedDataSerializer.OnSaveLoadStart)null, new ISharedDataSerializer.OnSaveFinish(this.OnFinishedSaveFile));
                 }
             }
             else if (this.isFileExistList[this.currentFile])
             {
                 FF9Sfx.FF9SFX_Play(103);
                 ButtonGroupState.DisableAllGroup(true);
                 FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpLoad");
                 FF9UIDataTool.DisplayTextLocalize(this.loadingAccessText, "WarningAccessData");
                 this.LoadingAccessPanel.SetActive(true);
                 base.StartCoroutine("RunProgressBar");
                 this.timeCounter = Time.time;
                 base.Loading     = true;
                 FF9StateSystem.Serializer.Load(this.currentSlot, this.currentFile, (ISharedDataSerializer.OnSaveLoadStart)null, new ISharedDataSerializer.OnLoadFinish(this.OnFinishedLoadFile));
             }
             else
             {
                 FF9Sfx.FF9SFX_Play(102);
             }
         }
         else if (ButtonGroupState.ActiveGroup == SaveLoadUI.ConfirmDialogGroupButton)
         {
             this.OverWriteDialog.SetActive(false);
             if (go.transform.GetSiblingIndex() == 1)
             {
                 FF9Sfx.FF9SFX_Play(103);
                 ButtonGroupState.DisableAllGroup(true);
                 FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpSave");
                 FF9UIDataTool.DisplayTextLocalize(this.loadingAccessText, "WarningSaveData");
                 this.LoadingAccessPanel.SetActive(true);
                 base.StartCoroutine("RunProgressBar");
                 this.timeCounter = Time.time;
                 base.Loading     = true;
                 FF9StateSystem.Settings.UpdateTickTime();
                 FF9StateSystem.Serializer.Save(this.currentSlot, this.currentFile, (ISharedDataSerializer.OnSaveLoadStart)null, new ISharedDataSerializer.OnSaveFinish(this.OnFinishedSaveFile));
             }
             else
             {
                 FF9Sfx.FF9SFX_Play(101);
                 ButtonGroupState.ActiveGroup = SaveLoadUI.FileGroupButton;
             }
         }
     }
     return(true);
 }