123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- 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<PhotoWindowManager>();
- EventDelegate.Add(this.photo_mgr_.EndButton.onClick, new EventDelegate.Callback(this.OnEnd));
- this.photo_mgr_.CallEditSceneFunction = new Action<Maid>(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_;
- }
|