PeGameSummary Gather() { PeGameSummary summary = new PeGameSummary(); summary.screenshot = ArchiveMgr.Instance.autoSave ? null : PeScreenshot.GetTex(); PeTrans tr = MainPlayer.Instance.entity.peTrans; if (tr != null) { summary.playerPos = tr.fastTravel ? tr.fastTravelPos : tr.position; } summary.gameTime = GameTime.Timer.Second; summary.playTime = (int)GameTime.PlayTime.Second; summary.saveTime = DateTime.Now; summary.sceneMode = PeGameMgr.sceneMode; summary.seed = summary.sceneMode == Pathea.PeGameMgr.ESceneMode.Story ? "NA" : RandomMapConfig.SeedString; PeEntity mainPlayer = PeCreature.Instance.mainPlayer; summary.playerName = null == mainPlayer ? "NA" : mainPlayer.ToString(); summary.gameLevel = PeGameMgr.gameLevel; return(summary); }
public void SetArchive(Pathea.PeGameSummary summary) { mSummary = summary; if (mSummary == null) { ClearInfo(); return; } mCharacterName.text = summary.playerName; mSaveTime.text = summary.saveTime.ToString(); switch (summary.sceneMode) { case Pathea.PeGameMgr.ESceneMode.Story: mGameType.text = "Story"; break; case Pathea.PeGameMgr.ESceneMode.Adventure: mGameType.text = "Adventure"; break; case Pathea.PeGameMgr.ESceneMode.Build: mGameType.text = "Build"; break; case Pathea.PeGameMgr.ESceneMode.Custom: mGameType.text = "Custom"; break; } }
public PeGameSummary Get() { byte[] buff = ArchiveMgr.Instance.GetData(ArchiveKey); if (null == buff || buff.Length <= 0) { return(null); } PeGameSummary s = new PeGameSummary(); return(s.Import(buff) ? s : null); }
void UpdateArchiveList() { for (int i = (int)Pathea.ArchiveMgr.ESave.Min; i < (int)Pathea.ArchiveMgr.ESave.Max; i++) { string dir = Pathea.ArchiveMgr.Instance.Load((Pathea.ArchiveMgr.ESave)i); Pathea.PeGameSummary summary = null; if (!string.IsNullOrEmpty(dir)) { summary = Pathea.PeGameSummary.Mgr.Instance.Get(); } mDataList[i - (int)Pathea.ArchiveMgr.ESave.Min].SetArchive(summary); } ChangeArvhive(mDataList[mIndex].Summary); }
void OnContinueBtn() { Pathea.ArchiveMgr.ESave idxToContinue = Pathea.ArchiveMgr.ESave.Auto1; string dir = Pathea.ArchiveMgr.Instance.Load(idxToContinue); Pathea.PeGameSummary summary = null; if (!string.IsNullOrEmpty(dir)) { summary = Pathea.PeGameSummary.Mgr.Instance.Get(); } if (summary == null) { Debug.Log("<color=aqua>Failed continue archive:" + idxToContinue + "</color>"); return; } Pathea.PeGameMgr.playerType = Pathea.PeGameMgr.EPlayerType.Single; Pathea.PeGameMgr.loadArchive = idxToContinue; Pathea.PeFlowMgr.Instance.LoadScene(Pathea.PeFlowMgr.EPeScene.GameScene, false); }
void ChangeArvhive(Pathea.PeGameSummary summary) { if (summary != null) { switch (summary.sceneMode) { case Pathea.PeGameMgr.ESceneMode.Story: mGametypeText.text = PELocalization.GetString(10007); //mSeedIDText.text = "Unknown"; //mSeedTitleText.text = "Area:"; mSeedRoot.SetActive(false); break; case Pathea.PeGameMgr.ESceneMode.Adventure: mGametypeText.text = PELocalization.GetString(10008); mSeedIDText.text = summary.seed; mSeedTitleText.text = PELocalization.GetString(8000361) + ":"; mSeedRoot.SetActive(true); break; case Pathea.PeGameMgr.ESceneMode.Build: mGametypeText.text = PELocalization.GetString(10009); mSeedIDText.text = summary.seed; mSeedTitleText.text = PELocalization.GetString(8000361) + ":"; mSeedRoot.SetActive(true); break; case Pathea.PeGameMgr.ESceneMode.Custom: mGametypeText.text = PELocalization.GetString(10222); mSeedIDText.text = PELocalization.GetString(8000558); mSeedTitleText.text = PELocalization.GetString(8000557); mSeedRoot.SetActive(false); break; default: break; } mInfoGrid.repositionNow = true; UTimer tmp_playtimer = new UTimer(); tmp_playtimer.Second = summary.playTime; if (tmp_playtimer.Day < 1) { mPlayTimeText.text = tmp_playtimer.FormatString("hh:mm:ss"); } else { mPlayTimeText.text = tmp_playtimer.FormatString("D days hh:mm:ss"); } PETimer tmp_gametimer = PETimerUtil.GetTmpTimer(); tmp_gametimer.Second = summary.gameTime; mGameTimeText.text = tmp_gametimer.FormatString("hh:mm:ss AP"); mSaveTex.enabled = true; mSaveTex.mainTexture = (summary.screenshot != null) ? summary.screenshot : mAutoTex; } else { mGametypeText.text = ""; mSeedIDText.text = ""; // mBorimText.text = ""; mPlayTimeText.text = ""; mGameTimeText.text = ""; mSaveTex.enabled = false; mSaveTex.mainTexture = null; } }