using System; using System.Collections; using System.Xml.Linq; using UnityEngine; public class PhotoModeMain : WfScreenChildren { public static void ResetComebackData() { PhotoModeMain.editTargetMaid = null; PhotoModeMain.backupSaveData = null; } public override void Awake() { base.Awake(); GameMain.Instance.StartCoroutine(this.Setup()); } private IEnumerator Setup() { GameMain.Instance.LoadIcon.NextLoadIcontImmediatelyDisplay(); GameMain.Instance.LoadIcon.force_draw_new = true; do { yield return null; } while (!GameMain.Instance.MenuDataBase.JobFinished()); for (int i = 0; i < 5; i++) { yield return null; } GameMain.Instance.LoadIcon.force_draw_new = false; this.photo_mgr_ = this.RootPanel.GetComponentInChildren(); EventDelegate.Add(this.photo_mgr_.EndButton.onClick, new EventDelegate.Callback(this.OnEnd)); this.photo_mgr_.CallEditSceneFunction = new Action(this.OnCallEdit); if (PhotoModeMain.backupSaveData != null) { base.SetFadeStatus(WfScreenChildren.FadeStatus.Wait); this.photo_mgr_.SaveAndLoadManager.ReadSave(PhotoModeMain.backupSaveData); } this.completedSetUp = true; this.photo_mgr_.Initialize(); yield break; } protected override void OnCall() { } protected override bool IsCallFadeIn() { return PhotoModeMain.backupSaveData == null && this.completedSetUp; } public void OnDestroy() { if (GameMain.Instance.isQuitting) { return; } GizmoRender.global_control_lock = false; if (GameMain.Instance != null && GameMain.Instance.MainCamera != null && GameMain.Instance.MainCamera.camera != null) { GameMain.Instance.MainCamera.camera.backgroundColor = Color.black; } if (GameMain.Instance != null && GameMain.Instance.CharacterMgr != null && PhotoModeMain.editTargetMaid != null) { GameMain.Instance.CharacterMgr.SetActiveMaid(PhotoModeMain.editTargetMaid, 0); PhotoModeMain.editTargetMaid = null; } else { PhotoModeMain.ResetComebackData(); } } public void OnEnd() { if (GameMain.Instance.SysDlg.IsDecided) { GameMain.Instance.SysDlg.ShowFromLanguageTerm("ScenePhotoMode/セーブしていないデータは失われます。終了しますか?", null, SystemDialog.TYPE.OK_CANCEL, new SystemDialog.OnClick(this.OnEndOk), null); } } public void OnEndOk() { GameMain.Instance.SysDlg.Close(); this.Finish(); } public void OnCallEdit(Maid maid) { PhotoModeMain.backupSaveData = this.photo_mgr_.SaveAndLoadManager.WriteSaveToXdocument(string.Empty, string.Empty); PhotoModeMain.editTargetMaid = maid; PhotoMode photoMode = base.parent_mgr as PhotoMode; this.photo_mgr_.OnEnd(); photoMode.move_screen.SetNextLabel(photoMode.edit_label_name); base.parent_mgr.CallScreen("Move"); } protected override void OnFinish() { this.photo_mgr_.OnEnd(); base.parent_mgr.CallScreen("Move"); } private static Maid editTargetMaid; private static XDocument backupSaveData; private bool completedSetUp; private PhotoWindowManager photo_mgr_; }