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; }
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; }
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)); } } }
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; } }
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; }
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; }
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; }
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)); } } }
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; }
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; }
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); }
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; }
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)); }
private void AutosaveDataStartDelegate(DataSerializerErrorCode errNo) { this.isLoading = true; this.message = "Start autosave"; }
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); } }
private void LoadDataStartDelgate(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID) { this.isLoading = true; this.message = "Start to read data"; }
private void OnFinishedSaveFile(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID, Boolean isSuccess, SharedDataPreviewSlot data) { base.StartCoroutine(this.OnFinishedSaveFile_delay(errNo, slotID, saveID, isSuccess, data)); }
private void OnFinishedLoadFile(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID, Boolean isSuccess) { base.StartCoroutine(this.OnFinishedLoadFile_delay(errNo, slotID, saveID, isSuccess)); }
private void SaveDataStartDelegate(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID) { this.isLoading = true; this.message = "Start to write data"; }
private void OnFinishedLoadPreview(DataSerializerErrorCode errNo, Int32 slotID, List <SharedDataPreviewSlot> data) { base.StartCoroutine(this.OnFinishedLoadPreview_delay(errNo, slotID, data)); }
private void HasAutoloadDataFinishDelegate(DataSerializerErrorCode errNo, Boolean hasAutoloadData) { OnScreenLog.Add((!hasAutoloadData) ? "No, you haven't" : "Yes, you have"); }
private void SaveDataStartDelegate(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID) { global::Debug.Log("SaveDataStartDelegate()"); PersistenSingleton <UIManager> .Instance.SetPlayerControlEnable(false, (Action)null); }