Example #1
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;
    }
Example #2
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;
    }
Example #3
0
 private void OnFinishGetTimeCloud(DataSerializerErrorCode errNo, Boolean isSuccess, Double timestamp)
 {
     if (isSuccess && errNo == DataSerializerErrorCode.Success)
     {
         this.latestCloudTime = timestamp;
         if (this.currentState == CloudUI.State.LoadPreview)
         {
             base.StartCoroutine(this.OnFinishedLoadPreview_delay(true));
         }
         else if (this.currentState == CloudUI.State.Sync)
         {
             base.StartCoroutine(this.OnFinishedSync_delay(true));
         }
     }
     else
     {
         this.isLocalFileExist = false;
         this.isCloudFileExist = false;
         this.localPreview     = (SharedDataPreviewSlot)null;
         this.cloudPreview     = (SharedDataPreviewSlot)null;
         if (this.currentState == CloudUI.State.LoadPreview)
         {
             base.StartCoroutine(this.OnFinishedLoadPreview_delay(false));
         }
         else if (this.currentState == CloudUI.State.Sync)
         {
             base.StartCoroutine(this.OnFinishedSync_delay(false));
         }
     }
 }
Example #4
0
    private void SaveDataFinishDelegate(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID, Boolean isSuccess, SharedDataPreviewSlot preview)
    {
        global::Debug.Log("SaveDataFinishDelegate()");
        PersistenSingleton <UIManager> .Instance.SetPlayerControlEnable(true, (Action)null);

        if (!PersistenSingleton <EventEngine> .Instance.GetUserControl())
        {
            PersistenSingleton <UIManager> .Instance.IsPlayerControlEnable = false;
        }
    }
Example #5
0
 private void LoadDataFinishDelegate(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID, Boolean isSuccess)
 {
     if (isSuccess)
     {
         this.message = "Loaded. Success. Have fun!";
     }
     else
     {
         this.message = "Fail! Data not found?";
     }
     this.isLoading = false;
 }
Example #6
0
 private void AutosaveDataFinishDelegate(DataSerializerErrorCode errNo, Boolean isSuccess)
 {
     if (isSuccess)
     {
         this.message = "Autosaved. Success. Have fun!";
     }
     else
     {
         this.message = "Fail! Data not found?";
     }
     this.isLoading = false;
 }
Example #7
0
 private void AutoloadDataFinishDelegate(DataSerializerErrorCode errNo, Boolean isSuccess)
 {
     if (isSuccess)
     {
         OnScreenLog.Add("Autoloaded. Success. Have fun!");
     }
     else
     {
         OnScreenLog.Add("Fail! Data not found?");
     }
     this.isLoading = false;
 }
Example #8
0
 private void OnFinishedLoadPreview(DataSerializerErrorCode errNo, Boolean isSuccess, SharedDataPreviewSlot localData, SharedDataPreviewSlot cloudData)
 {
     if (errNo == DataSerializerErrorCode.Success)
     {
         this.corruptFile = CloudUI.Sync.None;
         if (isSuccess)
         {
             this.isLocalFileExist = (localData != (SharedDataPreviewSlot)null);
             this.isCloudFileExist = (cloudData != (SharedDataPreviewSlot)null);
             this.localPreview     = localData;
             this.cloudPreview     = cloudData;
         }
         else
         {
             this.isLocalFileExist = false;
             this.isCloudFileExist = false;
             this.localPreview     = (SharedDataPreviewSlot)null;
             this.cloudPreview     = (SharedDataPreviewSlot)null;
         }
         if (this.isLocalFileExist)
         {
             FF9StateSystem.Serializer.GetLocalSaveLatestTimestamp(new ISharedDataSerializer.OnGetLatestSaveTimestamp(this.OnFinishGetTimeLocal));
         }
         else
         {
             this.OnFinishGetTimeLocal(DataSerializerErrorCode.Success, true, 0.0);
         }
     }
     else
     {
         if (localData == null)
         {
             this.corruptFile = CloudUI.Sync.Upload;
         }
         else if (cloudData == null)
         {
             this.corruptFile = CloudUI.Sync.Download;
         }
         this.isLocalFileExist = (localData != (SharedDataPreviewSlot)null);
         this.isCloudFileExist = (cloudData != (SharedDataPreviewSlot)null);
         this.localPreview     = localData;
         this.cloudPreview     = cloudData;
         if (this.currentState == CloudUI.State.LoadPreview)
         {
             base.StartCoroutine(this.OnFinishedLoadPreview_delay(false));
         }
         else if (this.currentState == CloudUI.State.Sync)
         {
             base.StartCoroutine(this.OnFinishedSync_delay(false));
         }
     }
 }
Example #9
0
 private void SaveDataFinishDelegate(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID, Boolean isSuccess, SharedDataPreviewSlot preview)
 {
     if (isSuccess)
     {
         this.message = "Saved. Success. Have fun!";
     }
     else
     {
         this.message = "Fail. Something wrong?";
     }
     this.isLoading        = false;
     this.savedPreviewSlot = preview;
 }
Example #10
0
 private void LoadSlotPreviewDelgate(DataSerializerErrorCode errNo, Int32 slotID, List <SharedDataPreviewSlot> data)
 {
     if (data != null)
     {
         this.message = "Loaded. Success. Have fun!";
     }
     else
     {
         this.message = "Fail!";
     }
     this.previewSlotList = data;
     this.isLoading       = false;
 }
Example #11
0
    private void LoadDataFinishDelegate(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID, Boolean isSuccess)
    {
        global::Debug.Log("LoadDataFinishDelegate()");
        PersistenSingleton <UIManager> .Instance.SetPlayerControlEnable(true, (Action)null);

        if (!PersistenSingleton <EventEngine> .Instance.GetUserControl())
        {
            PersistenSingleton <UIManager> .Instance.IsPlayerControlEnable = false;
        }
        EventEngine instance = PersistenSingleton <EventEngine> .Instance;

        instance.ReplaceFieldMap();
        PersistenSingleton <UIManager> .Instance.ChangeUIState(UIManager.UIState.FieldHUD);
    }
Example #12
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;
    }
Example #13
0
    private void DisplayCorruptAccessDialog(String group, SaveLoadUI.SerializeType serializeType, DataSerializerErrorCode errorCode)
    {
        String key;

        switch (errorCode)
        {
        case DataSerializerErrorCode.FileCorruption:
        case DataSerializerErrorCode.DataCorruption:
            key = "LocalDecryptFailed";
            break;

        case DataSerializerErrorCode.CloudDataCorruption:
            key = "CloudDataCorrupt";
            break;

        case DataSerializerErrorCode.CloudConnectionTimeout:
            key = "CloudConnectionTimeout";
            break;

        case DataSerializerErrorCode.CloudFileNotFound:
            key = "CloudFileNotFound";
            break;

        case DataSerializerErrorCode.CloudConnectionError:
            key = "CloudDataUnknownError";
            break;

        default:
            key = "CloudDataUnknownError";
            break;
        }
        this.noSaveDataDialog = Singleton <DialogManager> .Instance.AttachDialog(Localization.Get(key), 0, 0, Dialog.TailPosition.Center, Dialog.WindowStyle.WindowStylePlain, Vector2.zero, Dialog.CaptionType.Notice);

        ButtonGroupState.DisableAllGroup(true);
        base.Loading = true;
        base.StartCoroutine(this.HideSaveInfoDialog(group));
    }
Example #14
0
 private void AutosaveDataStartDelegate(DataSerializerErrorCode errNo)
 {
     this.isLoading = true;
     this.message   = "Start autosave";
 }
Example #15
0
    private void DisplayFileInfo(CloudUI.FileCloudInfoHUD fileHud, SharedDataPreviewSlot file, Boolean isCorrupt, DataSerializerErrorCode status)
    {
        fileHud.Self.SetActive(true);
        if (file != null)
        {
            fileHud.Container.SetActive(true);
            fileHud.EmptySlotTextGameObject.SetActive(false);
            Int32   num   = 1;
            String  text  = String.Empty;
            String  empty = String.Empty;
            Boolean flag  = false;
            Int32   num2  = 0;
            foreach (SharedDataPreviewCharacterInfo sharedDataPreviewCharacterInfo in file.CharacterInfoList)
            {
                fileHud.CharacterAvatarList[num2].alpha      = 0f;
                fileHud.CharacterAvatarList[num2].spriteName = String.Empty;
                if (sharedDataPreviewCharacterInfo != null)
                {
                    if (!flag)
                    {
                        num  = sharedDataPreviewCharacterInfo.Level;
                        text = sharedDataPreviewCharacterInfo.Name;
                        flag = true;
                    }
                    fileHud.CharacterAvatarList[num2].alpha = 1f;
                    FF9UIDataTool.DisplayCharacterAvatar(sharedDataPreviewCharacterInfo.SerialID, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), fileHud.CharacterAvatarList[num2], false);
                }
                num2++;
            }
            fileHud.LeaderNameLabel.text   = text;
            fileHud.LeaderLvLabel.text     = num.ToString();
            fileHud.GilLabel.text          = file.Gil.ToString() + "[YSUB=1.3][sub]G";
            fileHud.LocationNameLabel.text = file.Location;
            Color  color = FF9TextTool.White;
            Double num3  = (Double)(file.PlayDuration % 360000f);
            switch ((Int32)(file.PlayDuration / 360000f))
            {
            case 0:
                color = FF9TextTool.White;
                break;

            case 1:
                color = FF9TextTool.Red;
                break;

            case 2:
                color = FF9TextTool.Yellow;
                break;

            case 3:
                color = FF9TextTool.Cyan;
                break;

            case 4:
                color = FF9TextTool.Magenta;
                break;

            case 5:
                color = FF9TextTool.Green;
                break;

            default:
                num3  = 359999.0;
                color = FF9TextTool.Green;
                break;
            }
            String text2 = ((Int32)(num3 / 3600.0)).ToString("0#");
            String text3 = ((Int32)(num3 / 60.0) % 60).ToString("0#");
            String text4 = ((Int32)num3 % 60).ToString("0#");
            fileHud.TimeLabel.color = color;
            fileHud.TimeLabel.text  = String.Concat(new String[]
            {
                text2,
                " : ",
                text3,
                " : ",
                text4
            });
            this.DisplayWindowBackground(fileHud.Self, (file.win_type != 0UL) ? FF9UIDataTool.BlueAtlas : FF9UIDataTool.GrayAtlas);
        }
        else
        {
            fileHud.Container.SetActive(false);
            fileHud.EmptySlotTextGameObject.SetActive(true);
            fileHud.EmptySlotTextLabel.color = FF9TextTool.White;
            if (isCorrupt)
            {
                switch (status)
                {
                case DataSerializerErrorCode.FileCorruption:
                case DataSerializerErrorCode.DataCorruption:
                    fileHud.EmptySlotTextLabel.text  = Localization.Get("LocalDecryptFailed");
                    fileHud.EmptySlotTextLabel.color = FF9TextTool.Red;
                    goto IL_3E7;

                case DataSerializerErrorCode.CloudDataCorruption:
                    fileHud.EmptySlotTextLabel.text  = Localization.Get("CloudDataCorrupt");
                    fileHud.EmptySlotTextLabel.color = FF9TextTool.Red;
                    goto IL_3E7;

                case DataSerializerErrorCode.CloudConnectionTimeout:
                    fileHud.EmptySlotTextLabel.text = Localization.Get("CloudConnectionTimeout");
                    goto IL_3E7;

                case DataSerializerErrorCode.CloudDataUnknownError:
                    fileHud.EmptySlotTextLabel.text = Localization.Get("CloudDataUnknownError");
                    goto IL_3E7;
                }
                fileHud.EmptySlotTextLabel.text = Localization.Get("EmptyFile");
                IL_3E7 :;
            }
            else
            {
                fileHud.EmptySlotTextLabel.text = Localization.Get("EmptyFile");
            }
            this.UpdateEmptySlotLabelSize(fileHud.EmptySlotTextLabel);
        }
    }
Example #16
0
 private void LoadDataStartDelgate(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID)
 {
     this.isLoading = true;
     this.message   = "Start to read data";
 }
Example #17
0
 private void OnFinishedSaveFile(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID, Boolean isSuccess, SharedDataPreviewSlot data)
 {
     base.StartCoroutine(this.OnFinishedSaveFile_delay(errNo, slotID, saveID, isSuccess, data));
 }
Example #18
0
 private void OnFinishedLoadFile(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID, Boolean isSuccess)
 {
     base.StartCoroutine(this.OnFinishedLoadFile_delay(errNo, slotID, saveID, isSuccess));
 }
Example #19
0
 private void SaveDataStartDelegate(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID)
 {
     this.isLoading = true;
     this.message   = "Start to write data";
 }
Example #20
0
 private void OnFinishedLoadPreview(DataSerializerErrorCode errNo, Int32 slotID, List <SharedDataPreviewSlot> data)
 {
     base.StartCoroutine(this.OnFinishedLoadPreview_delay(errNo, slotID, data));
 }
Example #21
0
 private void HasAutoloadDataFinishDelegate(DataSerializerErrorCode errNo, Boolean hasAutoloadData)
 {
     OnScreenLog.Add((!hasAutoloadData) ? "No, you haven't" : "Yes, you have");
 }
Example #22
0
 private void SaveDataStartDelegate(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID)
 {
     global::Debug.Log("SaveDataStartDelegate()");
     PersistenSingleton <UIManager> .Instance.SetPlayerControlEnable(false, (Action)null);
 }