using System; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Kasizuki { public class KasizukiMainMenu : WfScreenChildren { public override void Awake() { base.Awake(); GameObject gameObject = base.transform.parent.parent.gameObject; this.m_SwitchingWindowDic = new Dictionary(); this.m_SwitchingWindowDic.Add("部屋選択", UTY.GetChildObject(gameObject, "Window Select Club", false).GetComponent()); this.m_SwitchingWindowDic.Add("メインメニュー", base.root_obj.GetComponent()); this.m_SwitchingWindowDic.Add("メイド情報", UTY.GetChildObject(gameObject, "MaidMiniManagement", false).AddComponent()); this.m_SwitchingWindowDic.Add("セーブロード", UTY.GetChildObject(gameObject, "SaveAndLoadPanel", false).GetComponent()); this.m_SwitchingWindowDic.Add("男選択", UTY.GetChildObject(gameObject, "Window Select Man", false).GetComponent()); this.m_SwitchingWindowDic.Add("施設情報", UTY.GetChildObject(gameObject, "Window Play Info", false).GetComponent()); this.SetUpMainMenu(); this.SetUpSelectRoom(); this.SetUpSaveLoad(); this.SetUpManSelect(); this.SetUpPlayInfo(); } protected override void OnCall() { this.m_SwitchingWindowDic["部屋選択"].GetCache("OK").isEnabled = (KasizukiMainMenu.m_NowSelectingRoom != null); this.m_SwitchingWindowDic["メイド情報"].OnOpen = delegate { MaidMiniManagementCtrl component = base.parent_mgr.children_dic["MaidInfo"].GetComponent(); component.buttonDic["エディット"].gameObject.SetActive(component.selectMaid != null); }; if ((base.parent_mgr as SceneKasizukiMainMenu).isReturnEdit) { MaidMiniManagementCtrl maidMiniManagementCtrl = base.parent_mgr.children_dic["MaidInfo"] as MaidMiniManagementCtrl; if (KasizukiMainMenu.m_NowSelectingRoom != null) { KasizukiCharacterSelectCtrl charaSelect = maidMiniManagementCtrl.charaSelectMgr; maidMiniManagementCtrl.selectMaid = null; charaSelect.callbackGetMaidList = delegate { ManDataType nowManType = (ManDataType)GameMain.Instance.KasizukiMgr.GetNowManType(); List playDatas = KasizukiMainMenu.m_NowSelectingRoom.GetPlayDatas(); List list = new List(); foreach (PlayData.Data data in playDatas) { if (data.enableManTypeDic[nowManType]) { list.Add(data); } } HashSet hashSet = new HashSet(); foreach (PlayData.Data data2 in list) { List filteringPlayDataMaidArray = data2.GetFilteringPlayDataMaidArray(nowManType); foreach (Maid item in filteringPlayDataMaidArray) { hashSet.Add(item); } } charaSelect.callbackGetMaidList = null; return new List(hashSet); }; } this.OpenSwitchingWindow("メイド情報", true); this.SetMaidInfoWindowParameter(KasizukiMainMenu.m_BackUpBeforeMaidInfoParameter); } else { this.OpenSwitchingWindow("メインメニュー", true); } if ((base.parent_mgr as SceneKasizukiMainMenu).isUpdateMaidStatus) { CharacterMgr characterMgr = GameMain.Instance.CharacterMgr; Maid maid = characterMgr.GetMaid(0); if (maid != null) { Debug.Log("メイドの仕事回数、好感度を更新"); KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr; bool systemData = kasizukiMgr.GetSystemData(SystemDataType.仕事回数ロック); int num = kasizukiMgr.GetMaidData(maid, MaidDataType.仕事回数, false); if (!systemData) { kasizukiMgr.SetMaidData(maid, MaidDataType.仕事回数, num + 1, false); } if (!kasizukiMgr.GetSystemData(SystemDataType.好感度ロック)) { if (kasizukiMgr.GetNowManType() != 10) { if (kasizukiMgr.GetNowManType() == 20) { num = kasizukiMgr.GetMaidData(maid, MaidDataType.好感度\uFF3F傅き男1, false); num += 4; kasizukiMgr.SetMaidData(maid, MaidDataType.好感度\uFF3F傅き男1, num, false); } } } Debug.Log("プレイ回数を更新"); num = kasizukiMgr.GetSystemData(SystemDataType.プレイ回数); num++; kasizukiMgr.SetSystemData(SystemDataType.プレイ回数, num, false); } } } private void SetUpMainMenu() { NGUIWindow nguiwindow = this.m_SwitchingWindowDic["メインメニュー"]; foreach (UIButton uibutton in new List { nguiwindow.CacheChildObject("parent button/Grid/男選択", "男選択"), nguiwindow.CacheChildObject("parent button/Grid/クラブ", "クラブ"), nguiwindow.CacheChildObject("parent button/Grid/セーブ", "セーブ"), nguiwindow.CacheChildObject("parent button/Grid/ロード", "ロード"), nguiwindow.CacheChildObject("parent button/Grid/ヒロイン", "ヒロイン"), nguiwindow.CacheChildObject("parent button/Grid/フリー", "フリー"), nguiwindow.CacheChildObject("parent button/Grid/タイトルに戻る", "タイトルに戻る") }) { EventDelegate.Add(uibutton.onClick, new EventDelegate.Callback(this.OnClickButton)); } } private void SetUpSelectRoom() { NGUIWindow nguiwindow = this.m_SwitchingWindowDic["部屋選択"]; nguiwindow.CacheChildObject("OK", "OK"); nguiwindow.CacheChildObject("Cancel", "Cancel"); EventDelegate.Add(nguiwindow.GetCache("OK").onClick, delegate { this.OnOKRoom(); }); EventDelegate.Add(nguiwindow.GetCache("Cancel").onClick, delegate { this.OpenSwitchingWindow("メインメニュー", false); }); nguiwindow.GetComponent().SetCallbackOnClick(new Action(this.OnSelectRoom)); } private void SetUpSaveLoad() { NGUIWindow nguiwindow = this.m_SwitchingWindowDic["セーブロード"]; KasizukiSaveAndLoadCtrl component = nguiwindow.GetComponent(); NDebug.Assert(component != null, "セーブロードUIが取得できない"); KasizukiSaveAndLoadCtrl kasizukiSaveAndLoadCtrl = component; kasizukiSaveAndLoadCtrl.onClickCancel = (Action)Delegate.Combine(kasizukiSaveAndLoadCtrl.onClickCancel, new Action(delegate { this.OpenSwitchingWindow("メインメニュー", false); })); KasizukiSaveAndLoadCtrl kasizukiSaveAndLoadCtrl2 = component; kasizukiSaveAndLoadCtrl2.onClickNewGame = (Action)Delegate.Combine(kasizukiSaveAndLoadCtrl2.onClickNewGame, new Action(delegate { SceneKasizukiMainMenu mgr = base.parent_mgr as SceneKasizukiMainMenu; mgr.CameraFadeOut(delegate { mgr.UpdateMan(delegate { mgr.CameraFadeIn(null); this.OpenSwitchingWindow("メインメニュー", true); }); }, 0.5f); })); KasizukiSaveAndLoadCtrl kasizukiSaveAndLoadCtrl3 = component; kasizukiSaveAndLoadCtrl3.onLoad = (Action)Delegate.Combine(kasizukiSaveAndLoadCtrl3.onLoad, new Action(delegate { SceneKasizukiMainMenu mgr = base.parent_mgr as SceneKasizukiMainMenu; mgr.CameraFadeOut(delegate { mgr.UpdateMan(delegate { mgr.CameraFadeIn(null); this.OpenSwitchingWindow("メインメニュー", true); }); }, 0.5f); })); KasizukiSaveAndLoadCtrl kasizukiSaveAndLoadCtrl4 = component; kasizukiSaveAndLoadCtrl4.onSave = (Action)Delegate.Combine(kasizukiSaveAndLoadCtrl4.onSave, new Action(delegate { int nowOriginSaveDataNumber = GameMain.Instance.KasizukiMgr.NowOriginSaveDataNumber; if (GameMain.Instance.GetSaveDataHeader(nowOriginSaveDataNumber) == null) { NDebug.Assert("本編セーブデータ" + nowOriginSaveDataNumber + "番の取得に失敗しました", false); return; } GameMain.Instance.SerializeKasizukiOnly(nowOriginSaveDataNumber); })); KasizukiSaveAndLoadCtrl kasizukiSaveAndLoadCtrl5 = component; kasizukiSaveAndLoadCtrl5.onDelete = (Action)Delegate.Combine(kasizukiSaveAndLoadCtrl5.onDelete, new Action(delegate { int nowOriginSaveDataNumber = GameMain.Instance.KasizukiMgr.NowOriginSaveDataNumber; if (GameMain.Instance.GetSaveDataHeader(nowOriginSaveDataNumber) == null) { NDebug.Assert("本編セーブデータ" + nowOriginSaveDataNumber + "番の取得に失敗しました", false); return; } GameMain.Instance.SerializeKasizukiOnly(nowOriginSaveDataNumber); })); } private void SetUpManSelect() { NGUIWindow nguiwindow = this.m_SwitchingWindowDic["男選択"]; nguiwindow.CacheChildObject("OK", "OK"); nguiwindow.CacheChildObject("Cancel", "Cancel"); EventDelegate.Add(nguiwindow.GetCache("OK").onClick, delegate { this.OpenSwitchingWindow("メインメニュー", false); }); EventDelegate.Add(nguiwindow.GetCache("Cancel").onClick, delegate { this.OpenSwitchingWindow("メインメニュー", false); }); KasizukiManSelectCtrl compManSelect = nguiwindow.GetComponent(); if (compManSelect) { NGUIWindow nguiwindow2 = nguiwindow; nguiwindow2.OnOpen = (Action)Delegate.Combine(nguiwindow2.OnOpen, new Action(delegate { int nowManType = GameMain.Instance.KasizukiMgr.GetNowManType(); compManSelect.OnClickManListButton(nowManType); })); KasizukiManSelectCtrl compManSelect2 = compManSelect; compManSelect2.OnClickManTypeButton = (Action)Delegate.Combine(compManSelect2.OnClickManTypeButton, new Action(delegate(int manTypeID) { KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr; kasizukiMgr.SetNowManType(manTypeID); SceneKasizukiMainMenu sceneMgr = this.parent_mgr as SceneKasizukiMainMenu; sceneMgr.UpdateMan(delegate { sceneMgr.CameraFadeIn(null); }); })); } } private void SetUpPlayInfo() { NGUIWindow window = this.m_SwitchingWindowDic["施設情報"]; window.CacheChildObject("OK", "OK"); window.CacheChildObject("Cancel", "Cancel"); KasizukiPlayInfoCtrl comp = window.GetComponent(); RoomData.Data selectingRoomData = null; ManData.Data selectingManData = null; PlayData.Data selectingPlayData = null; EventDelegate.Add(window.GetCache("OK").onClick, delegate { MaidMiniManagementCtrl maidMiniManagementCtrl = this.parent_mgr.children_dic["MaidInfo"] as MaidMiniManagementCtrl; this.StartFree(maidMiniManagementCtrl.selectMaid, selectingRoomData, selectingManData, selectingPlayData); }); EventDelegate.Set(window.GetCache("Cancel").onClick, delegate { this.OpenSwitchingWindow("メインメニュー", false); }); Action actResetDescriptionWindow = delegate { UILabel cache = comp.descriptionCache.GetCache("説明文"); uGUIListViewer cache2 = comp.descriptionCache.GetCache("条件一覧"); cache.text = string.Empty; cache2.ResetList(); }; Action actSetDescriptionWindow = delegate(PlayData.Data playData) { UILabel cache = comp.descriptionCache.GetCache("説明文"); cache.text = playData.strDescription; uGUIListViewer cache2 = comp.descriptionCache.GetCache("条件一覧"); string[] strConditionArray = playData.strConditionArray; cache2.Show(strConditionArray.Length, delegate(int index, Transform trans) { UILabel component = UTY.GetChildObject(trans.gameObject, "Value", false).GetComponent(); UILabel component2 = UTY.GetChildObject(trans.gameObject, "Number", false).GetComponent(); component.text = strConditionArray[index]; component2.text = (index + 1).ToString(); }); cache2.GetComponent().Reposition(); }; Action actSetOKButtonEnable = delegate(RoomData.Data roomData, ManData.Data manData, PlayData.Data playData) { UIButton cache = window.GetCache("OK"); cache.isEnabled = (roomData != null && manData != null && playData != null); }; NGUIWindow window2 = window; window2.OnOpen = (Action)Delegate.Combine(window2.OnOpen, new Action(delegate { selectingManData = ManData.GetData(GameMain.Instance.KasizukiMgr.GetNowManType()); List datas; if (!GameMain.Instance.CharacterMgr.status.lockNTRPlay) { datas = RoomData.GetDatas((RoomData.Data data) => data.isExistUpwardRoom && !data.isOnlyNTR); } else { datas = RoomData.GetDatas(delegate(RoomData.Data data) { RoomData.Data subordinateRoomData = data.GetSubordinateRoomData(); if (subordinateRoomData != null) { return false; } if (!data.enableManTypeDic[ManDataType.主人公]) { return false; } if (!data.isEnableNTR && !data.isOnlyNTR) { return false; } List playDatas = data.GetPlayDatas(); for (int i = 0; i < playDatas.Count; i++) { if (playDatas[i].enableManTypeDic[ManDataType.主人公]) { return true; } } return false; }); } comp.OpenRoomList(datas, selectingRoomData); actResetDescriptionWindow(); actSetOKButtonEnable(selectingRoomData, selectingManData, selectingPlayData); })); KasizukiPlayInfoCtrl comp6 = comp; comp6.onClickRoom = (Action)Delegate.Combine(comp6.onClickRoom, new Action(delegate(RoomData.Data roomData) { selectingRoomData = roomData; comp.OpenManList(ManData.GetAllDatas(true, true), selectingManData, delegate(UIWFTabButton item, ManData.Data data) { bool flag = selectingRoomData.enableManTypeDic[data.manType]; if (!flag && item.isSelected) { item.SetSelect(false); } item.gameObject.SetActive(flag); }); List datas = PlayData.GetDatas((PlayData.Data data) => data.roomID == selectingRoomData.ID && data.enableManTypeDic[selectingManData.manType]); comp.OpenPlayList(datas, null); actResetDescriptionWindow(); selectingPlayData = null; actSetOKButtonEnable(selectingRoomData, selectingManData, selectingPlayData); })); KasizukiPlayInfoCtrl comp2 = comp; comp2.onClickMan = (Action)Delegate.Combine(comp2.onClickMan, new Action(delegate(ManData.Data manData) { selectingManData = manData; List datas = PlayData.GetDatas((PlayData.Data data) => data.roomID == selectingRoomData.ID && data.enableManTypeDic[selectingManData.manType]); comp.OpenPlayList(datas, null); actResetDescriptionWindow(); selectingPlayData = null; actSetOKButtonEnable(selectingRoomData, selectingManData, selectingPlayData); })); KasizukiPlayInfoCtrl comp3 = comp; comp3.onClickPlay = (Action)Delegate.Combine(comp3.onClickPlay, new Action(delegate(PlayData.Data playData) { selectingPlayData = playData; actSetDescriptionWindow(selectingPlayData); actSetOKButtonEnable(selectingRoomData, selectingManData, selectingPlayData); })); KasizukiPlayInfoCtrl comp4 = comp; comp4.onHoverPlay = (Action)Delegate.Combine(comp4.onHoverPlay, new Action(delegate(PlayData.Data playData) { actSetDescriptionWindow(playData); })); KasizukiPlayInfoCtrl comp5 = comp; comp5.onOutPlay = (Action)Delegate.Combine(comp5.onOutPlay, new Action(delegate(PlayData.Data playData) { if (selectingPlayData == null) { actResetDescriptionWindow(); } else { actSetDescriptionWindow(selectingPlayData); } })); } protected void OnClickButton() { NGUIWindow nguiwindow = this.m_SwitchingWindowDic["メインメニュー"]; List values = nguiwindow.cachedObjectDic.Values; if (!values.Contains(UIButton.current)) { NDebug.Warning(string.Format("クリックされたボタン名に対応するボタンがありません\n{0}", UIButton.current.name)); } string name = UIButton.current.name; if (name == "男選択") { this.OpenSwitchingWindow("男選択", false); } else if (name == "クラブ") { if (!this.CheckPlayableRoom()) { GameMain.Instance.SysDlg.Show("利用可能な施設がありません。", SystemDialog.TYPE.OK, null, null); return; } if (!this.CheckPlayableMaid()) { GameMain.Instance.SysDlg.Show("プレイ可能なメイドがいません。", SystemDialog.TYPE.OK, null, null); return; } this.OnSelectRoom(null); this.OpenSwitchingWindow("部屋選択", false); (this.m_SwitchingWindowDic["部屋選択"] as ClubRoomSelectCtrl).SetData(); } else if (name == "セーブ") { this.OpenSwitchingWindow("セーブロード", false); KasizukiSaveAndLoadCtrl component = this.m_SwitchingWindowDic["セーブロード"].GetComponent(); component.Open(SaveAndLoadMgr.ViewType.Save, true); } else if (name == "ロード") { this.OpenSwitchingWindow("セーブロード", false); KasizukiSaveAndLoadCtrl component2 = this.m_SwitchingWindowDic["セーブロード"].GetComponent(); component2.Open(SaveAndLoadMgr.ViewType.Load, true); } else if (name == "ヒロイン") { this.OpenSwitchingWindow("メイド情報", false); this.SetMaidInfoWindowParameter("ヒロイン情報"); } else if (name == "フリー") { this.OpenSwitchingWindow("メイド情報", false); this.SetMaidInfoWindowParameter("フリーモード"); } else if (name == "タイトルに戻る") { GameMain.Instance.SysDlg.Show("保存されていない情報は失われます。\nタイトルに戻りますか?", SystemDialog.TYPE.YES_NO, delegate { GameMain.Instance.SysDlg.Close(); GameMain.Instance.LoadScene("SceneToTitle"); GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color)); }, delegate { GameMain.Instance.SysDlg.Close(); }); } } public void OpenSwitchingWindow(string name, bool isImmediate = false) { Dictionary switchingWindowDic = this.m_SwitchingWindowDic; if (switchingWindowDic == null) { NDebug.Assert("ウィンドウの配列にnullが指定されました", false); } if (!switchingWindowDic.ContainsKey(name)) { NDebug.Assert(string.Format("ウィンドウの配列には「{0}」のキーが存在しません", name), false); } if (name == "メインメニュー") { MaidMiniManagementCtrl maidMiniManagementCtrl = base.parent_mgr.children_dic["MaidInfo"] as MaidMiniManagementCtrl; maidMiniManagementCtrl.selectMaid = null; } foreach (KeyValuePair keyValuePair in switchingWindowDic) { if (keyValuePair.Key == name) { if (isImmediate) { keyValuePair.Value.Open(0.01f, null); } else { keyValuePair.Value.Open(0.25f, null); } } else if (isImmediate) { keyValuePair.Value.Close(0.01f, null); } else { keyValuePair.Value.Close(0.25f, null); } } } public void CloseSwitchingWindowAll(bool isImmediate = false) { Dictionary switchingWindowDic = this.m_SwitchingWindowDic; if (switchingWindowDic == null) { NDebug.Assert("ウィンドウの配列にnullが指定されました", false); } foreach (KeyValuePair keyValuePair in switchingWindowDic) { if (isImmediate) { keyValuePair.Value.Close(0.01f, null); } else { keyValuePair.Value.Close(0.25f, null); } } } private bool CheckPlayableRoom() { ManDataType nowManType = (ManDataType)GameMain.Instance.KasizukiMgr.GetNowManType(); foreach (RoomData.Data data in RoomData.GetAllDatas(true)) { if (data.enableManTypeDic[nowManType]) { if (data.IsExistFacility()) { return true; } } } return false; } private bool CheckPlayableMaid() { ManDataType nowManType = (ManDataType)GameMain.Instance.KasizukiMgr.GetNowManType(); foreach (RoomData.Data data in RoomData.GetAllDatas(true)) { if (data.enableManTypeDic[nowManType]) { if (data.IsExistFacility()) { foreach (PlayData.Data data2 in data.GetPlayDatas()) { if (data2.enableManTypeDic[nowManType]) { List filteringPlayDataMaidArray = data2.GetFilteringPlayDataMaidArray(nowManType); if (filteringPlayDataMaidArray != null && filteringPlayDataMaidArray.Count > 0) { return true; } } } } } } return false; } private void OnSelectRoom(RoomData.Data roomData) { KasizukiMainMenu.m_NowSelectingRoom = roomData; this.m_SwitchingWindowDic["部屋選択"].GetCache("OK").isEnabled = (KasizukiMainMenu.m_NowSelectingRoom != null); } private void OnOKRoom() { if (KasizukiMainMenu.m_NowSelectingRoom == null) { NDebug.Warning("現在選択している部屋の情報がnullでした"); return; } MaidMiniManagementCtrl maidMiniManagementCtrl = base.parent_mgr.children_dic["MaidInfo"] as MaidMiniManagementCtrl; KasizukiCharacterSelectCtrl charaSelect = maidMiniManagementCtrl.charaSelectMgr; maidMiniManagementCtrl.selectMaid = null; charaSelect.callbackGetMaidList = delegate { ManDataType nowManType = (ManDataType)GameMain.Instance.KasizukiMgr.GetNowManType(); List playDatas = KasizukiMainMenu.m_NowSelectingRoom.GetPlayDatas(); List list = new List(); foreach (PlayData.Data data in playDatas) { if (data.enableManTypeDic[nowManType]) { list.Add(data); } } HashSet hashSet = new HashSet(); foreach (PlayData.Data data2 in list) { List filteringPlayDataMaidArray = data2.GetFilteringPlayDataMaidArray(nowManType); foreach (Maid item in filteringPlayDataMaidArray) { hashSet.Add(item); } } charaSelect.callbackGetMaidList = null; return new List(hashSet); }; GameMain.Instance.KasizukiMgr.SetSystemData(SystemDataType.選択部屋, KasizukiMainMenu.m_NowSelectingRoom.ID, true); this.OpenSwitchingWindow("メイド情報", false); this.SetMaidInfoWindowParameter("ヒロイン選択"); } private void SetMaidInfoWindowParameter(string openType) { MaidMiniManagementCtrl window = base.parent_mgr.children_dic["MaidInfo"] as MaidMiniManagementCtrl; window.Open(); window.Call(); if (openType == "ヒロイン情報") { window.onClickOK = delegate { this.OpenSwitchingWindow("メインメニュー", false); }; window.buttonDic["OK"].isEnabled = true; window.buttonDic["Cancel"].gameObject.SetActive(false); if (window.selectMaid == null) { window.CloseSwitchingWindowAll(true); } window.UpdateMaidInfoButtonEnable(window.selectMaid != null, true); MaidMiniStatusCtrl window4 = window.GetWindow("ステータス"); Collider component = window4.GetCache("FreeComment").GetComponent(); component.enabled = true; window4.GetCache("Appeal").SetEnableEditing(true); window.GetWindow("パラメータロック").transform.localScale = Vector3.one; } else if (openType == "ヒロイン選択") { window.onClickOK = delegate { this.StartSenario(window.selectMaid, KasizukiMainMenu.m_NowSelectingRoom); }; window.onClickCancel = delegate { this.OpenSwitchingWindow("部屋選択", false); this.OnSelectRoom(null); (this.m_SwitchingWindowDic["部屋選択"] as ClubRoomSelectCtrl).SetData(); }; window.buttonDic["OK"].isEnabled = (window.selectMaid != null); window.buttonDic["Cancel"].gameObject.SetActive(true); if (window.selectMaid == null) { window.CloseSwitchingWindowAll(true); } window.UpdateMaidInfoButtonEnable(window.selectMaid != null, true); MaidMiniStatusCtrl window2 = window.GetWindow("ステータス"); Collider component2 = window2.GetCache("FreeComment").GetComponent(); component2.enabled = false; window2.GetCache("Appeal").SetEnableEditing(false); window.GetWindow("パラメータロック").transform.localScale = Vector3.one; } else if (openType == "フリーモード") { window.onClickOK = delegate { this.OpenSwitchingWindow("施設情報", false); UIButton cache = this.m_SwitchingWindowDic["施設情報"].GetCache("Cancel"); EventDelegate.Set(cache.onClick, delegate { this.OpenSwitchingWindow("メイド情報", false); this.SetMaidInfoWindowParameter("フリーモード"); }); }; window.onClickCancel = delegate { this.OpenSwitchingWindow("メインメニュー", false); }; window.buttonDic["OK"].isEnabled = (window.selectMaid != null); window.buttonDic["Cancel"].gameObject.SetActive(true); if (window.selectMaid == null) { window.CloseSwitchingWindowAll(true); } window.UpdateMaidInfoButtonEnable(window.selectMaid != null, true); MaidMiniStatusCtrl window3 = window.GetWindow("ステータス"); Collider component3 = window3.GetCache("FreeComment").GetComponent(); component3.enabled = false; window3.GetCache("Appeal").SetEnableEditing(false); window.GetWindow("パラメータロック").transform.localScale = Vector3.zero; } else { NDebug.Warning(string.Format("メイド情報ウィンドウのレイアウト設定の文字列が対応していません\n渡された文字列:{0}", openType)); } KasizukiMainMenu.m_BackUpBeforeMaidInfoParameter = openType; } private void StartSenario(Maid targetMaid, RoomData.Data targetRoom) { ManData.Data data = ManData.GetData(GameMain.Instance.KasizukiMgr.GetNowManType()); Debug.LogFormat("傅きモードのシナリオを開始します\r\n選択状態↓\r\nメイド:{0}\r\n選択した部屋:{1}\r\n選択した男:{2}\r\n", new object[] { targetMaid.status.fullNameJpStyle, targetRoom.drawName, data.drawName }); PlayData.Data optimalConditionData = PlayData.GetOptimalConditionData(targetMaid, targetRoom, data.manType); string scenarioFileNameReplace = optimalConditionData.GetScenarioFileNameReplace(targetMaid); Debug.LogFormat("呼び出すシナリオは「{0}」になりました", new object[] { scenarioFileNameReplace }); if (!GameUty.FileSystem.IsExistentFile(scenarioFileNameReplace + ".ks")) { NDebug.Warning(string.Format("シナリオファイル「{0}」が見つかりません。\nシナリオ呼び出しは行いません。", scenarioFileNameReplace + ".ks")); return; } SceneKasizukiMainMenu sceneKasizukiMainMenu = base.parent_mgr as SceneKasizukiMainMenu; if (!sceneKasizukiMainMenu.moveScreen.IsExistNextLabel()) { sceneKasizukiMainMenu.moveScreen.SetNextLabel(sceneKasizukiMainMenu.strScriptReturnLabel); } this.Finish(); } private void StartFree(Maid targetMaid, RoomData.Data targetRoom, ManData.Data targetMan, PlayData.Data targetPlay) { Debug.LogFormat("傅きモードの回想を開始します\r\n選択状態↓\r\nメイド:{0}\r\n選択した部屋:{1}\r\n選択した男:{2}\r\n選択したプレイ情報:{3}\r\n", new object[] { targetMaid.status.fullNameJpStyle, targetRoom.drawName, targetMan.drawName, targetPlay.drawName }); string scenarioFileNameReplace = targetPlay.GetScenarioFileNameReplace(targetMaid); Debug.LogFormat("呼び出すシナリオは「{0}」になりました", new object[] { scenarioFileNameReplace }); if (!GameUty.FileSystem.IsExistentFile(scenarioFileNameReplace + ".ks")) { NDebug.Warning(string.Format("シナリオファイル「{0}」が見つかりません。\nシナリオ呼び出しは行いません。", scenarioFileNameReplace + ".ks")); return; } Debug.Log("システムデータのフラグを一時的に書き換え"); KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr; kasizukiMgr.SetSystemData(SystemDataType.選択部屋, targetRoom.ID, false); kasizukiMgr.SetNowManType(targetMan.ID); GameMain.Instance.ScriptMgr.EvalScript("tf['傅き再生_ファイル名'] = '" + scenarioFileNameReplace + "';"); SceneKasizukiMainMenu sceneKasizukiMainMenu = base.parent_mgr as SceneKasizukiMainMenu; if (!sceneKasizukiMainMenu.moveScreen.IsExistNextLabel()) { sceneKasizukiMainMenu.moveScreen.SetNextLabel(sceneKasizukiMainMenu.strScriptReturnLabelFree); } this.Finish(); } protected override void OnFinish() { this.CloseSwitchingWindowAll(true); KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr; Maid man = kasizukiMgr.GetMan(); kasizukiMgr.SetManModel(man, (ManDataType)kasizukiMgr.GetNowManType()); kasizukiMgr.UpdateManModel(man, null); man.Visible = false; CharacterMgr characterMgr = GameMain.Instance.CharacterMgr; MaidMiniManagementCtrl maidMiniManagementCtrl = base.parent_mgr.children_dic["MaidInfo"] as MaidMiniManagementCtrl; characterMgr.SetActiveMaid(maidMiniManagementCtrl.selectMaid, 0); maidMiniManagementCtrl.selectMaid.Visible = true; maidMiniManagementCtrl.selectMaid.AllProcPropSeqStart(); base.StartCoroutine(this.CoroutineWaitPropSeq(maidMiniManagementCtrl.selectMaid, delegate { SceneKasizukiMainMenu sceneKasizukiMainMenu = base.parent_mgr as SceneKasizukiMainMenu; if (!string.IsNullOrEmpty(sceneKasizukiMainMenu.moveScreen.next_label)) { sceneKasizukiMainMenu.CallScreen("Move"); } })); } private IEnumerator CoroutineWaitPropSeq(Maid target, Action callback) { while (target.IsBusy) { yield return null; } if (callback != null) { callback(); } yield break; } private static string m_BackUpBeforeMaidInfoParameter = string.Empty; private const string STR_MESSAGE_NOTHING_ROOM = "利用可能な施設がありません。"; private const string STR_MESSAGE_NOTHING_MAID = "プレイ可能なメイドがいません。"; private const string STR_MESSAGE_END = "保存されていない情報は失われます。\nタイトルに戻りますか?"; private static RoomData.Data m_NowSelectingRoom; private Dictionary m_SwitchingWindowDic; } }