123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using PlayerStatus;
- using UnityEngine;
- using UnityEngine.Events;
- using UnityEngine.UI;
- public class SceneFacilityManagement : MonoBehaviour
- {
- private FacilityManager FacilityMgr
- {
- get
- {
- if (this.m_FacilityMgr == null)
- {
- this.m_FacilityMgr = GameMain.Instance.FacilityMgr;
- }
- return this.m_FacilityMgr;
- }
- }
- public FacilityInfoUI UIFacilityInfoBottomViewer
- {
- get
- {
- return this.m_UIFacilityInfoConstruction;
- }
- }
- public bool enableSetUpCameraAndBG
- {
- get
- {
- return this.m_EnableSetUpCameraAndBG;
- }
- set
- {
- this.m_EnableSetUpCameraAndBG = value;
- }
- }
- public long nowMoney
- {
- get
- {
- Status status = GameMain.Instance.CharacterMgr.status;
- return status.money;
- }
- set
- {
- Status status = GameMain.Instance.CharacterMgr.status;
- status.money = value;
- this.UpdateTextNumber(this.m_UITextNowMoney, value);
- }
- }
- public long nowCost
- {
- get
- {
- return this.m_NowCost;
- }
- set
- {
- this.m_NowCost = value;
- this.UpdateTextNumber(this.m_UITextNowCost, value);
- }
- }
- private void Awake()
- {
- if (this.m_StartDestroyEventObject != null)
- {
- this.m_StartDestroyEventObject.m_EventOnStart.AddListener(delegate()
- {
- GameMain.Instance.SoundMgr.PlayBGM(this.m_PlayBGM, 0.5f, true);
- });
- }
- }
- private void Start()
- {
- if (this.m_UIClubStatusViewer)
- {
- this.m_UIClubStatusViewer.gameObject.SetActive(false);
- }
- if (this.enableSetUpCameraAndBG)
- {
- this.SetUpBackGroundAndCamera();
- }
- this.UpdateTextNumber(this.m_UITextNowMoney, this.nowMoney);
- this.UpdateTextNumber(this.m_UITextNowCost, this.nowCost);
- this.m_UITextNowMoney.transform.parent.gameObject.SetActive(false);
- this.m_UITextNowCost.transform.parent.gameObject.SetActive(false);
- int typeID = FacilityDataTable.GetFacilityStatusArray(true)[0].typeID;
- this.m_CreatingFacility = GameMain.Instance.FacilityMgr.CreateNewFacility(typeID);
- this.m_CreatingFacility.transform.SetParent(base.transform, false);
- this.OpenFacilityUIConstruction();
- this.GetTagBackup();
- }
- private void SetUpBackGroundAndCamera()
- {
- GameMain.Instance.BgMgr.ChangeBg("EmpireClub_Entrance");
- GameMain.Instance.MainCamera.FadeIn(0.5f, false, null, true, true, default(Color));
- CameraMain mainCamera = GameMain.Instance.MainCamera;
- GameMain.Instance.MainLight.Reset();
- mainCamera.Reset(CameraMain.CameraType.Target, false);
- mainCamera.SetTargetPos(new Vector3(0f, 5.5f, 11f), true);
- mainCamera.SetDistance(1.4f, true);
- mainCamera.SetAroundAngle(new Vector2(180f, 3f), true);
- mainCamera.SetTargetOffset(Vector3.zero, false);
- }
- private void UpdateTextNumber(Text text, long number)
- {
- text.text = string.Format("{0:#,0}", number);
- }
- public long CalcNowCost()
- {
- long num = 0L;
- Dictionary<int, Facility> nextDayFacilityArray = this.FacilityMgr.GetNextDayFacilityArray();
- List<Facility> list = new List<Facility>(nextDayFacilityArray.Values);
- for (int i = 0; i < list.Count; i++)
- {
- Facility facility = list[i];
- if (facility != null)
- {
- num += (long)FacilityDataTable.GetFacilityDefaultCost(facility.param.typeID, true);
- }
- }
- return num;
- }
- public void OpenDialog(string messageText, SystemDialog.TYPE openType, Action actionOK, Action actionCANCEL)
- {
- uGUIUtility.SetActiveEventSystem(false);
- GameMain.Instance.SysDlg.Show(messageText, openType, delegate
- {
- GameMain.Instance.SysDlg.Close();
- uGUIUtility.SetActiveEventSystem(true);
- if (actionOK != null)
- {
- actionOK();
- }
- }, delegate
- {
- GameMain.Instance.SysDlg.Close();
- uGUIUtility.SetActiveEventSystem(true);
- if (actionCANCEL != null)
- {
- actionCANCEL();
- }
- });
- }
- private void ButtonEvent_OK_OpenMainMenu()
- {
- this.ButtonEventSceneClose();
- }
- private void SetMoneyParamWindowVisible(bool isVisible)
- {
- Transform parent = this.m_UITextNowMoney.transform.parent;
- if (parent)
- {
- parent.gameObject.SetActive(isVisible);
- }
- }
- public void OpenFacilityUIMaidSchedule()
- {
- this.m_UIMainMenu.gameObject.SetActive(true);
- this.m_UIFacilityDetails.gameObject.SetActive(true);
- this.m_UIFacilityPowerUpList.gameObject.SetActive(false);
- this.m_UIFacilityTypeList.gameObject.SetActive(false);
- this.m_UIFacilityCostume.gameObject.SetActive(false);
- this.m_UIFacilityInfoMiniWindow.gameObject.SetActive(false);
- this.m_UIButtonOK.gameObject.SetActive(true);
- this.m_UIButtonRESET.gameObject.SetActive(true);
- this.m_UIButtonCANCEL.gameObject.SetActive(false);
- this.m_UIToggleVisibleFacilityInfo.gameObject.SetActive(true);
- if (this.m_UIClubStatusViewer)
- {
- this.m_UIClubStatusViewer.gameObject.SetActive(false);
- }
- this.SetMoneyParamWindowVisible(true);
- this.nowMoney = this.nowMoney;
- this.nowCost = this.CalcNowCost();
- this.m_UIToggleVisibleFacilityInfo.isOn = false;
- this.m_UIButtonOK.onClick.RemoveAllListeners();
- this.m_UIButtonOK.onClick.AddListener(new UnityAction(this.ButtonEvent_OK_OpenMainMenu));
- this.SetOKButtonEnable(true);
- this.m_UIFacilityInfoConstruction.gameObject.SetActive(false);
- this.m_UIButtonRESET.interactable = (this.FacilityMgr.GetNextDayFacilityArray().Count > 0);
- int facilityCountMax = this.FacilityMgr.FacilityCountMax;
- uGUIListViewer component = this.m_UIFacilityDetails.GetComponent<uGUIListViewer>();
- component.Show<Transform>(facilityCountMax, delegate(int i, Transform trans)
- {
- GameObject gameObject = trans.gameObject;
- SceneFacilityManagement.FacilityDetailsUI facilityDetailsUI = gameObject.AddComponent<SceneFacilityManagement.FacilityDetailsUI>();
- Facility facility = this.FacilityMgr.GetFacility(i);
- if (facility == null)
- {
- facilityDetailsUI.m_Button.gameObject.SetActive(false);
- facilityDetailsUI.m_FacilityInfoUI.imageFacilityThumbnail.color = new Color(0f, 0f, 0f, 0.25f);
- ColorBlock colors = facilityDetailsUI.m_Toggle.colors;
- Color highlightedColor = colors.highlightedColor;
- highlightedColor.a = 0f;
- colors.highlightedColor = highlightedColor;
- facilityDetailsUI.m_Toggle.colors = colors;
- }
- else
- {
- facilityDetailsUI.m_FacilityInfoUI.imageFacilityThumbnail.color = new Color(1f, 1f, 1f, 1f);
- }
- FacilityInfoUI component2 = trans.GetComponent<FacilityInfoUI>();
- component2.SetFacilityInfo(facility, false);
- component2.SetNameChangeEnable(facility != null);
- facilityDetailsUI.m_Toggle.onValueChanged.RemoveAllListeners();
- facilityDetailsUI.m_Toggle.onValueChanged.AddListener(delegate(bool value)
- {
- if (!value)
- {
- return;
- }
- this.m_SelectingFacilityIndex = i;
- if (!this.m_UIFacilityInfoConstruction.gameObject.activeSelf)
- {
- this.m_UIFacilityInfoConstruction.gameObject.SetActive(true);
- }
- this.m_UIFacilityInfoConstruction.SetFacilityInfo(facility, false);
- this.m_UIButtonDestroyFacility.interactable = (facility != null);
- });
- if (i == this.m_SelectingFacilityIndex)
- {
- Selectable componentInChildren = trans.GetComponentInChildren<Selectable>();
- if (componentInChildren.interactable)
- {
- uGUIUtility.SetSelectedGameObject(gameObject);
- facilityDetailsUI.m_Toggle.isOn = true;
- }
- }
- });
- }
- public void OpenFacilityUIConstruction(bool isOn)
- {
- if (!isOn)
- {
- return;
- }
- this.OpenFacilityUIConstruction();
- }
- public void OpenFacilityUIConstruction()
- {
- this.m_UIMainMenu.gameObject.SetActive(true);
- this.m_UIFacilityDetails.gameObject.SetActive(true);
- this.m_UIFacilityPowerUpList.gameObject.SetActive(false);
- this.m_UIFacilityTypeList.gameObject.SetActive(false);
- this.m_UIFacilityCostume.gameObject.SetActive(false);
- this.m_UIFacilityInfoMiniWindow.gameObject.SetActive(false);
- this.m_UIButtonOK.gameObject.SetActive(true);
- this.m_UIButtonRESET.gameObject.SetActive(true);
- this.m_UIButtonCANCEL.gameObject.SetActive(false);
- this.m_UIToggleVisibleFacilityInfo.gameObject.SetActive(true);
- if (this.m_UIClubStatusViewer)
- {
- this.m_UIClubStatusViewer.gameObject.SetActive(false);
- }
- this.SetMoneyParamWindowVisible(true);
- this.nowMoney = this.nowMoney;
- this.nowCost = this.CalcNowCost();
- this.m_UIToggleVisibleFacilityInfo.isOn = false;
- this.m_UIButtonOK.onClick.RemoveAllListeners();
- this.m_UIButtonOK.onClick.AddListener(new UnityAction(this.ButtonEvent_OK_OpenMainMenu));
- this.SetOKButtonEnable(true);
- this.m_UIFacilityInfoConstruction.gameObject.SetActive(false);
- this.m_UIButtonRESET.interactable = (this.FacilityMgr.GetNextDayFacilityArray().Count > 0);
- int facilityCountMax = this.FacilityMgr.FacilityCountMax;
- uGUIListViewer component = this.m_UIFacilityDetails.GetComponent<uGUIListViewer>();
- component.Show<Transform>(facilityCountMax, delegate(int i, Transform trans)
- {
- GameObject gameObject = trans.gameObject;
- SceneFacilityManagement.FacilityDetailsUI facilityDetailsUI = gameObject.AddComponent<SceneFacilityManagement.FacilityDetailsUI>();
- Facility facility = null;
- if (this.FacilityMgr.GetNextDayFacilityExist(i))
- {
- facility = this.FacilityMgr.GetNextDayFacility(i);
- facilityDetailsUI.m_ChangeImage.SetActive(facility != null);
- facilityDetailsUI.m_DeleteImage.SetActive(facility == null && this.FacilityMgr.GetFacility(i) != null);
- if (facility == null)
- {
- facility = this.FacilityMgr.GetFacility(i);
- }
- }
- else
- {
- facility = this.FacilityMgr.GetFacility(i);
- }
- if (facility == null)
- {
- facilityDetailsUI.m_Button.gameObject.SetActive(false);
- facilityDetailsUI.m_FacilityInfoUI.imageFacilityThumbnail.color = new Color(0f, 0f, 0f, 0.25f);
- ColorBlock colors = facilityDetailsUI.m_Toggle.colors;
- Color highlightedColor = colors.highlightedColor;
- highlightedColor.a = 0f;
- colors.highlightedColor = highlightedColor;
- facilityDetailsUI.m_Toggle.colors = colors;
- }
- else
- {
- facilityDetailsUI.m_FacilityInfoUI.imageFacilityThumbnail.color = new Color(1f, 1f, 1f, 1f);
- }
- FacilityInfoUI component2 = trans.GetComponent<FacilityInfoUI>();
- component2.SetFacilityInfo(facility, false);
- component2.SetNameChangeEnable(facility != null);
- facilityDetailsUI.m_Toggle.onValueChanged.RemoveAllListeners();
- facilityDetailsUI.m_Toggle.onValueChanged.AddListener(delegate(bool value)
- {
- if (!value)
- {
- return;
- }
- this.m_SelectingFacilityIndex = i;
- if (!this.m_UIFacilityInfoConstruction.gameObject.activeSelf)
- {
- this.m_UIFacilityInfoConstruction.gameObject.SetActive(true);
- }
- this.m_UIFacilityInfoConstruction.SetFacilityInfo(facility, false);
- this.m_UIButtonDestroyFacility.interactable = (facility != null);
- });
- if (i == this.m_SelectingFacilityIndex)
- {
- Selectable componentInChildren = trans.GetComponentInChildren<Selectable>();
- if (componentInChildren.interactable)
- {
- uGUIUtility.SetSelectedGameObject(gameObject);
- facilityDetailsUI.m_Toggle.isOn = true;
- }
- }
- });
- }
- public void ButtonEvent_FacilityReplace()
- {
- int selectingFacilityIndex = this.m_SelectingFacilityIndex;
- Facility facility;
- if (this.FacilityMgr.GetNextDayFacilityExist(selectingFacilityIndex))
- {
- facility = this.FacilityMgr.GetNextDayFacility(selectingFacilityIndex);
- }
- else
- {
- facility = this.FacilityMgr.GetFacility(selectingFacilityIndex);
- }
- string messageText = string.Empty;
- if (facility == null)
- {
- messageText = "空き部屋に施設を配置しますか?";
- }
- else
- {
- messageText = "『" + facility.facilityName + "』\nが配置されています。\n施設を変更しますか?";
- }
- if (facility && !FacilityDataTable.GetFacilityCanBeDestroy(facility.param.typeID, true))
- {
- this.OpenDialog("『" + facility.facilityName + "』\nは変更出来ない施設です。", SystemDialog.TYPE.OK, null, null);
- }
- else
- {
- this.OpenDialog(messageText, SystemDialog.TYPE.YES_NO, delegate
- {
- this.m_CreatingFacility.param.typeID = 0;
- this.ShowFacilityTypeList();
- this.m_UIButtonRESET.gameObject.SetActive(false);
- this.m_UIToggleVisibleFacilityInfo.gameObject.SetActive(false);
- this.m_UIMainMenu.gameObject.SetActive(false);
- this.SetMoneyParamWindowVisible(true);
- }, null);
- }
- }
- public void ToggleEvent_VisibleFacilityInfo(bool b)
- {
- uGUIListViewer component = this.m_UIFacilityDetails.GetComponent<uGUIListViewer>();
- GameObject[] itemArray = component.ItemArray;
- if (itemArray == null)
- {
- return;
- }
- foreach (GameObject gameObject in itemArray)
- {
- SceneFacilityManagement.FacilityDetailsUI component2 = gameObject.GetComponent<SceneFacilityManagement.FacilityDetailsUI>();
- component2.m_ParentInfo.SetActive(b);
- }
- }
- public void ShowFacilityTypeList()
- {
- this.m_UIFacilityDetails.gameObject.SetActive(false);
- this.m_UIFacilityTypeList.gameObject.SetActive(true);
- this.m_UIFacilityPowerUpList.gameObject.SetActive(false);
- this.m_UIButtonCANCEL.gameObject.SetActive(true);
- this.m_UIButtonCANCEL.onClick.RemoveAllListeners();
- this.m_UIButtonCANCEL.onClick.AddListener(new UnityAction(this.OpenFacilityUIConstruction));
- this.m_UIButtonCANCEL.onClick.AddListener(delegate()
- {
- this.m_UIMainMenu.gameObject.SetActive(true);
- });
- this.m_UIButtonOK.onClick.RemoveAllListeners();
- this.m_UIButtonOK.onClick.AddListener(new UnityAction(this.ButtonEvent_OK_FacilityConstruction));
- this.SetOKButtonEnable(this.IsOKButtonEnable());
- this.SetUpFacilityTypeList();
- }
- private void SetUpFacilityTypeList()
- {
- SceneFacilityManagement.<SetUpFacilityTypeList>c__AnonStorey4 <SetUpFacilityTypeList>c__AnonStorey = new SceneFacilityManagement.<SetUpFacilityTypeList>c__AnonStorey4();
- <SetUpFacilityTypeList>c__AnonStorey.$this = this;
- uGUIListViewer component = this.m_UIFacilityTypeList.GetComponent<uGUIListViewer>();
- Facility facility;
- if (this.FacilityMgr.GetNextDayFacilityExist(this.m_SelectingFacilityIndex))
- {
- facility = this.FacilityMgr.GetNextDayFacility(this.m_SelectingFacilityIndex);
- }
- else
- {
- facility = this.FacilityMgr.GetFacility(this.m_SelectingFacilityIndex);
- }
- int num = -1;
- if (facility)
- {
- num = facility.param.typeID;
- }
- Facility.FacilityStatus[] facilityStatusArray = FacilityDataTable.GetFacilityStatusArray(true);
- <SetUpFacilityTypeList>c__AnonStorey.canBePlaceFacilityDataArray = new List<Facility.FacilityStatus>();
- Facility value;
- for (int j = 0; j < facilityStatusArray.Length; j++)
- {
- int typeID = facilityStatusArray[j].typeID;
- FacilityDataTable.FacilityDefaultData facilityDefaultData = FacilityDataTable.GetFacilityDefaultData(typeID, true);
- if (num != typeID)
- {
- if (!FacilityDataTable.GetFacilityDefaultPlacement(typeID, true))
- {
- if (GameMain.Instance.CharacterMgr.status.lockNTRPlay)
- {
- if (!facilityDefaultData.isEnableNTR)
- {
- goto IL_280;
- }
- }
- else if (facilityDefaultData.isOnlyNTR)
- {
- goto IL_280;
- }
- if (facilityDefaultData.name == "カジノ")
- {
- if (this.FacilityMgr.IsExistTypeFacility(facilityDefaultData.ID))
- {
- goto IL_280;
- }
- bool flag = false;
- foreach (KeyValuePair<int, Facility> keyValuePair in this.FacilityMgr.GetNextDayFacilityArray())
- {
- value = keyValuePair.Value;
- if (value != null && value.defaultName == "カジノ")
- {
- flag = true;
- break;
- }
- }
- if (flag)
- {
- goto IL_280;
- }
- }
- else if (facilityDefaultData.name == "高級カジノ")
- {
- if (this.FacilityMgr.IsExistTypeFacility(facilityDefaultData.ID))
- {
- goto IL_280;
- }
- bool flag2 = false;
- foreach (KeyValuePair<int, Facility> keyValuePair2 in this.FacilityMgr.GetNextDayFacilityArray())
- {
- Facility value2 = keyValuePair2.Value;
- if (value2 != null && value2.defaultName == "高級カジノ")
- {
- flag2 = true;
- break;
- }
- }
- if (flag2)
- {
- goto IL_280;
- }
- }
- <SetUpFacilityTypeList>c__AnonStorey.canBePlaceFacilityDataArray.Add(facilityStatusArray[j]);
- }
- }
- IL_280:;
- }
- component.Show<Transform>(<SetUpFacilityTypeList>c__AnonStorey.canBePlaceFacilityDataArray.Count, delegate(int i, Transform trans)
- {
- Facility.FacilityStatus facilityStatus = <SetUpFacilityTypeList>c__AnonStorey.canBePlaceFacilityDataArray[i];
- Toggle componentInChildren = trans.GetComponentInChildren<Toggle>();
- Text componentInChildren2 = trans.GetComponentInChildren<Text>();
- componentInChildren2.text = facilityStatus.name;
- componentInChildren.onValueChanged.AddListener(delegate(bool value)
- {
- if (!value)
- {
- return;
- }
- <SetUpFacilityTypeList>c__AnonStorey.m_CreatingFacility.Init(facilityStatus.typeID);
- <SetUpFacilityTypeList>c__AnonStorey.ShowFacilityPowerUpList(<SetUpFacilityTypeList>c__AnonStorey.m_CreatingFacility);
- long num2 = <SetUpFacilityTypeList>c__AnonStorey.CalcNowCost();
- num2 += (long)FacilityDataTable.GetFacilityDefaultCost(facilityStatus.typeID, true);
- if (<SetUpFacilityTypeList>c__AnonStorey.FacilityMgr.GetNextDayFacilityExist(<SetUpFacilityTypeList>c__AnonStorey.m_SelectingFacilityIndex))
- {
- Facility nextDayFacility = <SetUpFacilityTypeList>c__AnonStorey.FacilityMgr.GetNextDayFacility(<SetUpFacilityTypeList>c__AnonStorey.m_SelectingFacilityIndex);
- if (nextDayFacility)
- {
- num2 -= (long)FacilityDataTable.GetFacilityDefaultCost(nextDayFacility.param.typeID, true);
- }
- }
- <SetUpFacilityTypeList>c__AnonStorey.nowCost = num2;
- <SetUpFacilityTypeList>c__AnonStorey.m_CreatingFacility.Init(facilityStatus.typeID);
- <SetUpFacilityTypeList>c__AnonStorey.SetOKButtonEnable(<SetUpFacilityTypeList>c__AnonStorey.IsOKButtonEnable());
- if (!<SetUpFacilityTypeList>c__AnonStorey.m_UIFacilityInfoMiniWindow.gameObject.activeSelf)
- {
- <SetUpFacilityTypeList>c__AnonStorey.m_UIFacilityInfoMiniWindow.gameObject.SetActive(true);
- }
- <SetUpFacilityTypeList>c__AnonStorey.m_UIFacilityInfoMiniWindow.SetFacilityInfo(<SetUpFacilityTypeList>c__AnonStorey.m_CreatingFacility, true);
- <SetUpFacilityTypeList>c__AnonStorey.m_UIFacilityInfoMiniWindow.viewType = FacilityInfoUI.ViewType.ConstructMode;
- });
- });
- }
- public void ResetFacilityTypeList()
- {
- uGUIListViewer component = this.m_UIFacilityTypeList.GetComponent<uGUIListViewer>();
- component.ResetList();
- }
- private void ShowFacilityPowerUpList(Facility facility)
- {
- this.m_UIFacilityPowerUpList.gameObject.SetActive(true);
- this.SetUpFacilityPowerUpList(facility);
- }
- private void SetUpFacilityPowerUpList(Facility facility)
- {
- uGUIListViewer componentInChildren = this.m_UIFacilityPowerUpList.GetComponentInChildren<uGUIListViewer>();
- if (FacilityDataTable.IsExistFacilityPowerUpRecipe(facility.param.typeID, true))
- {
- Facility.RecipeData[] recipeArray = facility.recipe;
- componentInChildren.Show<Transform>(recipeArray.Length, delegate(int i, Transform trans)
- {
- Text component = trans.Find("Text Recipe Name").GetComponent<Text>();
- Text component2 = trans.Find("Text Recipe Number").GetComponent<Text>();
- uGUIListViewer component3 = trans.Find("parent materials").GetComponent<uGUIListViewer>();
- uGUIListViewer component4 = trans.Find("parent conditions").GetComponent<uGUIListViewer>();
- uGUIListViewer component5 = trans.Find("parent default parameter").GetComponent<uGUIListViewer>();
- uGUIListViewer component6 = trans.Find("parent additional parameter").GetComponent<uGUIListViewer>();
- Facility.PowerUpRecipe facilityPowerUpRecipe = FacilityDataTable.GetFacilityPowerUpRecipe(recipeArray[i].id);
- component.text = facilityPowerUpRecipe.name;
- component2.text = string.Format("RECIPE {0}", i + 1);
- this.SetUpRecipeMaterialList(component3, recipeArray[i]);
- this.SetUpRecipeConditionList(component4, recipeArray[i].id);
- this.SetUpFacilityParams(component5, recipeArray[i].defaultParameter);
- this.SetUpFacilityParams(component6, recipeArray[i].additionalParameter);
- });
- }
- else
- {
- componentInChildren.Show<Transform>(1, delegate(int i, Transform trans)
- {
- Text component = trans.Find("Text Recipe Name").GetComponent<Text>();
- Text component2 = trans.Find("Text Recipe Number").GetComponent<Text>();
- uGUIListViewer component3 = trans.Find("parent materials").GetComponent<uGUIListViewer>();
- uGUIListViewer component4 = trans.Find("parent conditions").GetComponent<uGUIListViewer>();
- uGUIListViewer component5 = trans.Find("parent default parameter").GetComponent<uGUIListViewer>();
- uGUIListViewer component6 = trans.Find("parent additional parameter").GetComponent<uGUIListViewer>();
- component.text = "レシピ無し";
- component2.text = string.Empty;
- component3.ResetList();
- component4.ResetList();
- component5.ResetList();
- component6.ResetList();
- });
- }
- }
- public void ResetFacilityPowerUpList()
- {
- uGUIListViewer componentInChildren = this.m_UIFacilityPowerUpList.GetComponentInChildren<uGUIListViewer>();
- if (componentInChildren)
- {
- componentInChildren.ResetList();
- }
- else
- {
- Debug.LogWarningFormat("{0}\u3000には「{1}」コンポーネントが無い", new object[]
- {
- this.m_UIFacilityPowerUpList.name,
- typeof(uGUIListViewer)
- });
- }
- }
- private void SetUpRecipeMaterialList(uGUIListViewer listViewer, Facility.RecipeData recipeData)
- {
- Facility.PowerUpRecipe facilityPowerUpRecipe = FacilityDataTable.GetFacilityPowerUpRecipe(recipeData.id);
- int[] materialCategoryIDArray = facilityPowerUpRecipe.materialCategoryIDArray;
- listViewer.Show<Transform>(materialCategoryIDArray.Length, delegate(int i, Transform trans)
- {
- int categoryID = materialCategoryIDArray[i];
- int materialID = recipeData.materialIDArray[i];
- Text component = trans.Find("Text Category Name").GetComponent<Text>();
- Text component2 = trans.Find("Text Category Number").GetComponent<Text>();
- Text component3 = trans.Find("Text Material Name").GetComponent<Text>();
- string facilityPowerUpMaterialCategoryName = FacilityDataTable.GetFacilityPowerUpMaterialCategoryName(categoryID);
- string text = string.Empty;
- if (FacilityDataTable.IsExistPowerUpMaterial(materialID))
- {
- text = FacilityDataTable.GetFacilityPowerUpMaterial(materialID).name;
- }
- component.text = facilityPowerUpMaterialCategoryName;
- component3.text = text;
- component2.text = string.Format("CATEGORY {0}", i + 1);
- });
- }
- private void SetUpRecipeConditionList(uGUIListViewer listViewer, int recipeID)
- {
- FacilityDataTable.FacilityRecipeData data = FacilityDataTable.GetFacilityRecipeData(recipeID);
- listViewer.Show<Transform>(data.conditions.Length, delegate(int i, Transform trans)
- {
- Text[] componentsInChildren = trans.GetComponentsInChildren<Text>();
- componentsInChildren[0].text = data.conditions[i];
- componentsInChildren[1].text = (i + 1).ToString();
- });
- }
- private void SetUpFacilityParams(uGUIListViewer listViewer, Facility.FacilityParameter parameter)
- {
- List<KeyValuePair<string, int>> paramList = new List<KeyValuePair<string, int>>();
- for (int j = 0; j < parameter.Length; j++)
- {
- if (parameter[j] > 0)
- {
- paramList.Add(new KeyValuePair<string, int>(parameter.GetParameterName(j), parameter[j]));
- }
- }
- listViewer.Show<Transform>(paramList.Count, delegate(int i, Transform trans)
- {
- Text componentInChildren = trans.GetComponentInChildren<Text>();
- KeyValuePair<string, int> keyValuePair = paramList[i];
- componentInChildren.text = string.Format("{0} +{1}", keyValuePair.Key, keyValuePair.Value);
- });
- }
- public void ButtonEvent_OK_FacilityConstruction()
- {
- Facility facility;
- if (this.FacilityMgr.GetNextDayFacilityExist(this.m_SelectingFacilityIndex))
- {
- facility = this.FacilityMgr.GetNextDayFacility(this.m_SelectingFacilityIndex);
- }
- else
- {
- facility = this.FacilityMgr.GetFacility(this.m_SelectingFacilityIndex);
- }
- long num = this.CalcNowCost();
- num += (long)FacilityDataTable.GetFacilityDefaultCost(this.m_CreatingFacility.param.typeID, true);
- if (this.FacilityMgr.GetNextDayFacilityExist(this.m_SelectingFacilityIndex))
- {
- Facility nextDayFacility = this.FacilityMgr.GetNextDayFacility(this.m_SelectingFacilityIndex);
- if (nextDayFacility)
- {
- num -= (long)FacilityDataTable.GetFacilityDefaultCost(nextDayFacility.param.typeID, true);
- }
- }
- if (num > this.nowMoney)
- {
- this.OpenDialog("資金が不足する設定は出来ません。", SystemDialog.TYPE.OK, null, null);
- return;
- }
- string messageText = string.Empty;
- if (facility)
- {
- messageText = string.Concat(new string[]
- {
- "『",
- facility.facilityName,
- "』\nを、\n『",
- this.m_CreatingFacility.defaultName,
- "』\nに設定します。\nよろしいですか?"
- });
- }
- else
- {
- messageText = "『" + this.m_CreatingFacility.defaultName + "』\nを設定します。\nよろしいですか?";
- }
- this.OpenDialog(messageText, SystemDialog.TYPE.YES_NO, delegate
- {
- Facility nextDayFacility2 = this.FacilityMgr.CreateNewFacility(this.m_CreatingFacility.param.typeID);
- this.FacilityMgr.SetNextDayFacility(this.m_SelectingFacilityIndex, nextDayFacility2);
- this.OpenDialog("『" + this.m_CreatingFacility.defaultName + "』\nを設定しました。", SystemDialog.TYPE.OK, delegate
- {
- this.ResetFacilityTypeList();
- this.ResetFacilityPowerUpList();
- }, null);
- this.m_CreatingFacility.param.typeID = 0;
- this.OpenFacilityUIConstruction();
- }, delegate
- {
- });
- }
- private bool IsOKButtonEnable()
- {
- return !(this.m_CreatingFacility == null) && FacilityDataTable.IsExistFacilityData(this.m_CreatingFacility.param.typeID, true);
- }
- private void SetOKButtonEnable(bool b)
- {
- this.m_UIButtonOK.interactable = b;
- }
- public void ButtonEvent_RESET_FacilityConstruction()
- {
- string messageText = "施設の設定をリセットします。\nよろしいですか?";
- this.OpenDialog(messageText, SystemDialog.TYPE.YES_NO, delegate
- {
- this.OpenDialog("施設の設定をリセットしました。", SystemDialog.TYPE.OK, delegate
- {
- this.ResetFacilityTypeList();
- this.ResetFacilityPowerUpList();
- }, null);
- this.FacilityMgr.ClearNextDayFacilityArray();
- this.OpenFacilityUIConstruction();
- this.m_CreatingFacility.param.typeID = 0;
- this.nowCost = this.CalcNowCost();
- }, delegate
- {
- });
- }
- private bool CheckFacilityCanBeDestroy(Facility facility)
- {
- return FacilityDataTable.GetFacilityCanBeDestroy(facility.param.typeID, true);
- }
- public void OpenDialogFacilityDestroy()
- {
- Facility facility;
- if (this.FacilityMgr.GetNextDayFacilityExist(this.m_SelectingFacilityIndex))
- {
- facility = this.FacilityMgr.GetNextDayFacility(this.m_SelectingFacilityIndex);
- }
- else
- {
- facility = this.FacilityMgr.GetFacility(this.m_SelectingFacilityIndex);
- }
- if (facility == null)
- {
- Debug.Log("[FacilityUIDestroy]撤去したい施設としてnullが指定されました");
- return;
- }
- string facilityName = facility.facilityName;
- if (this.CheckFacilityCanBeDestroy(facility))
- {
- this.OpenDialog("『" + facilityName + "』\nを撤去します。\nよろしいですか?\n※施設強化及び服装設定もリセットされます", SystemDialog.TYPE.YES_NO, delegate
- {
- this.FacilityMgr.SetNextDayFacility(this.m_SelectingFacilityIndex, null);
- this.OpenDialog("『" + facilityName + "』\nを撤去予定に設定しました。", SystemDialog.TYPE.OK, null, null);
- this.OpenFacilityUIConstruction();
- }, delegate
- {
- });
- }
- else
- {
- this.OpenDialog("『" + facilityName + "』\nは撤去出来ない施設です。", SystemDialog.TYPE.OK, null, null);
- }
- }
- public void OpenNowFacilityList(bool isOn)
- {
- SceneFacilityManagement.<OpenNowFacilityList>c__AnonStoreyB <OpenNowFacilityList>c__AnonStoreyB = new SceneFacilityManagement.<OpenNowFacilityList>c__AnonStoreyB();
- <OpenNowFacilityList>c__AnonStoreyB.$this = this;
- if (!isOn)
- {
- return;
- }
- this.m_UIFacilityDetails.gameObject.SetActive(false);
- this.m_UIFacilityPowerUpList.gameObject.SetActive(false);
- this.m_UIFacilityCostume.gameObject.SetActive(false);
- this.m_UIButtonOK.gameObject.SetActive(true);
- this.m_UIButtonRESET.gameObject.SetActive(false);
- this.m_UIButtonCANCEL.gameObject.SetActive(false);
- this.m_UIToggleVisibleFacilityInfo.gameObject.SetActive(false);
- if (this.m_UIClubStatusViewer)
- {
- this.m_UIClubStatusViewer.gameObject.SetActive(false);
- }
- this.m_UIFacilityTypeList.gameObject.SetActive(true);
- this.m_UIFacilityInfoMiniWindow.gameObject.SetActive(false);
- this.SetMoneyParamWindowVisible(false);
- this.m_UIButtonOK.onClick.RemoveAllListeners();
- this.m_UIButtonOK.onClick.AddListener(new UnityAction(this.ButtonEvent_OK_OpenMainMenu));
- this.SetOKButtonEnable(true);
- Facility[] facilityArray = this.FacilityMgr.GetFacilityArray();
- <OpenNowFacilityList>c__AnonStoreyB.enableFacilityArray = new List<Facility>();
- for (int j = 0; j < facilityArray.Length; j++)
- {
- if (facilityArray[j])
- {
- <OpenNowFacilityList>c__AnonStoreyB.enableFacilityArray.Add(facilityArray[j]);
- }
- }
- uGUIListViewer component = this.m_UIFacilityTypeList.GetComponent<uGUIListViewer>();
- component.Show<Transform>(<OpenNowFacilityList>c__AnonStoreyB.enableFacilityArray.Count, delegate(int i, Transform trans)
- {
- Text componentInChildren = trans.GetComponentInChildren<Text>();
- Toggle componentInChildren2 = trans.GetComponentInChildren<Toggle>();
- componentInChildren.text = <OpenNowFacilityList>c__AnonStoreyB.enableFacilityArray[i].facilityName;
- componentInChildren2.onValueChanged.AddListener(delegate(bool value)
- {
- if (!value)
- {
- return;
- }
- <OpenNowFacilityList>c__AnonStoreyB.ShowFacilityPowerUpList(<OpenNowFacilityList>c__AnonStoreyB.enableFacilityArray[i]);
- if (!<OpenNowFacilityList>c__AnonStoreyB.m_UIFacilityInfoMiniWindow.gameObject.activeSelf)
- {
- <OpenNowFacilityList>c__AnonStoreyB.m_UIFacilityInfoMiniWindow.gameObject.SetActive(true);
- }
- <OpenNowFacilityList>c__AnonStoreyB.m_UIFacilityInfoMiniWindow.SetFacilityInfo(<OpenNowFacilityList>c__AnonStoreyB.enableFacilityArray[i], true);
- <OpenNowFacilityList>c__AnonStoreyB.m_UIFacilityInfoMiniWindow.viewType = FacilityInfoUI.ViewType.DefaultMode;
- });
- });
- }
- public void OpenFacilityInfoList(bool isOn)
- {
- SceneFacilityManagement.<OpenFacilityInfoList>c__AnonStoreyD <OpenFacilityInfoList>c__AnonStoreyD = new SceneFacilityManagement.<OpenFacilityInfoList>c__AnonStoreyD();
- <OpenFacilityInfoList>c__AnonStoreyD.$this = this;
- if (!isOn)
- {
- return;
- }
- this.m_UIFacilityDetails.gameObject.SetActive(false);
- this.m_UIFacilityPowerUpList.gameObject.SetActive(false);
- this.m_UIFacilityCostume.gameObject.SetActive(false);
- this.m_UIButtonOK.gameObject.SetActive(true);
- this.m_UIButtonRESET.gameObject.SetActive(false);
- this.m_UIButtonCANCEL.gameObject.SetActive(false);
- this.m_UIToggleVisibleFacilityInfo.gameObject.SetActive(false);
- if (this.m_UIClubStatusViewer)
- {
- this.m_UIClubStatusViewer.gameObject.SetActive(false);
- }
- this.m_UIFacilityTypeList.gameObject.SetActive(true);
- this.m_UIFacilityInfoMiniWindow.gameObject.SetActive(false);
- this.SetMoneyParamWindowVisible(false);
- this.m_UIButtonOK.onClick.RemoveAllListeners();
- this.m_UIButtonOK.onClick.AddListener(new UnityAction(this.ButtonEvent_OK_OpenMainMenu));
- this.SetOKButtonEnable(true);
- Facility.FacilityStatus[] facilityStatusArray = FacilityDataTable.GetFacilityStatusArray(true);
- <OpenFacilityInfoList>c__AnonStoreyD.enableFacilityArray = new List<Facility.FacilityStatus>();
- for (int j = 0; j < facilityStatusArray.Length; j++)
- {
- FacilityDataTable.FacilityDefaultData facilityDefaultData = FacilityDataTable.GetFacilityDefaultData(facilityStatusArray[j].typeID, true);
- if (!facilityDefaultData.isDefaultPlace)
- {
- if (GameMain.Instance.CharacterMgr.status.lockNTRPlay)
- {
- if (!facilityDefaultData.isEnableNTR)
- {
- goto IL_18C;
- }
- }
- else if (facilityDefaultData.isOnlyNTR)
- {
- goto IL_18C;
- }
- <OpenFacilityInfoList>c__AnonStoreyD.enableFacilityArray.Add(facilityStatusArray[j]);
- }
- IL_18C:;
- }
- uGUIListViewer component = this.m_UIFacilityTypeList.GetComponent<uGUIListViewer>();
- component.Show<Transform>(<OpenFacilityInfoList>c__AnonStoreyD.enableFacilityArray.Count, delegate(int i, Transform trans)
- {
- Text componentInChildren = trans.GetComponentInChildren<Text>();
- Toggle componentInChildren2 = trans.GetComponentInChildren<Toggle>();
- componentInChildren.text = <OpenFacilityInfoList>c__AnonStoreyD.enableFacilityArray[i].name;
- componentInChildren2.onValueChanged.AddListener(delegate(bool value)
- {
- if (!value)
- {
- return;
- }
- <OpenFacilityInfoList>c__AnonStoreyD.m_CreatingFacility.Init(<OpenFacilityInfoList>c__AnonStoreyD.enableFacilityArray[i].typeID);
- <OpenFacilityInfoList>c__AnonStoreyD.ShowFacilityPowerUpList(<OpenFacilityInfoList>c__AnonStoreyD.m_CreatingFacility);
- if (!<OpenFacilityInfoList>c__AnonStoreyD.m_UIFacilityInfoMiniWindow.gameObject.activeSelf)
- {
- <OpenFacilityInfoList>c__AnonStoreyD.m_UIFacilityInfoMiniWindow.gameObject.SetActive(true);
- }
- <OpenFacilityInfoList>c__AnonStoreyD.m_UIFacilityInfoMiniWindow.SetFacilityInfo(<OpenFacilityInfoList>c__AnonStoreyD.m_CreatingFacility, true);
- <OpenFacilityInfoList>c__AnonStoreyD.m_UIFacilityInfoMiniWindow.viewType = FacilityInfoUI.ViewType.ConstructMode;
- });
- });
- }
- public void OpenFacilityCostumeSettingWindow(bool isOn)
- {
- if (!isOn)
- {
- return;
- }
- this.OpenFacilityCostumeSettingWindow();
- }
- public void OpenFacilityCostumeSettingWindow()
- {
- SceneFacilityManagement.<OpenFacilityCostumeSettingWindow>c__AnonStoreyF <OpenFacilityCostumeSettingWindow>c__AnonStoreyF = new SceneFacilityManagement.<OpenFacilityCostumeSettingWindow>c__AnonStoreyF();
- <OpenFacilityCostumeSettingWindow>c__AnonStoreyF.$this = this;
- this.nowCost = this.CalcNowCost();
- this.m_UIFacilityDetails.gameObject.SetActive(false);
- this.m_UIFacilityPowerUpList.gameObject.SetActive(false);
- this.m_UIButtonOK.gameObject.SetActive(true);
- this.m_UIButtonRESET.gameObject.SetActive(false);
- this.m_UIButtonCANCEL.gameObject.SetActive(false);
- this.m_UIToggleVisibleFacilityInfo.gameObject.SetActive(false);
- if (this.m_UIClubStatusViewer)
- {
- this.m_UIClubStatusViewer.gameObject.SetActive(false);
- }
- this.m_UIFacilityTypeList.gameObject.SetActive(true);
- this.m_UIFacilityInfoMiniWindow.gameObject.SetActive(false);
- this.SetMoneyParamWindowVisible(false);
- this.m_UIButtonOK.onClick.RemoveAllListeners();
- this.m_UIButtonOK.onClick.AddListener(new UnityAction(this.ButtonEvent_OK_OpenMainMenu));
- this.SetOKButtonEnable(true);
- Facility[] facilityArray = this.FacilityMgr.GetFacilityArray();
- <OpenFacilityCostumeSettingWindow>c__AnonStoreyF.enableFacilityArray = new List<Facility>();
- for (int j = 0; j < facilityArray.Length; j++)
- {
- Facility facility = null;
- if (this.FacilityMgr.GetNextDayFacilityExist(j))
- {
- facility = this.FacilityMgr.GetNextDayFacility(j);
- }
- else if (facilityArray[j])
- {
- facility = facilityArray[j];
- }
- if (facility != null)
- {
- <OpenFacilityCostumeSettingWindow>c__AnonStoreyF.enableFacilityArray.Add(facility);
- }
- }
- uGUIListViewer component = this.m_UIFacilityTypeList.GetComponent<uGUIListViewer>();
- <OpenFacilityCostumeSettingWindow>c__AnonStoreyF.tempSelectFacility = GameMain.Instance.FacilityMgr.tempSelectFacility;
- component.Show<Transform>(<OpenFacilityCostumeSettingWindow>c__AnonStoreyF.enableFacilityArray.Count, delegate(int i, Transform trans)
- {
- Text componentInChildren = trans.GetComponentInChildren<Text>();
- Toggle componentInChildren2 = trans.GetComponentInChildren<Toggle>();
- componentInChildren.text = <OpenFacilityCostumeSettingWindow>c__AnonStoreyF.enableFacilityArray[i].facilityName;
- componentInChildren2.onValueChanged.AddListener(delegate(bool value)
- {
- if (!value)
- {
- return;
- }
- <OpenFacilityCostumeSettingWindow>c__AnonStoreyF.OpenCostumeSettingWindow(<OpenFacilityCostumeSettingWindow>c__AnonStoreyF.enableFacilityArray[i]);
- if (!<OpenFacilityCostumeSettingWindow>c__AnonStoreyF.m_UIFacilityInfoMiniWindow.gameObject.activeSelf)
- {
- <OpenFacilityCostumeSettingWindow>c__AnonStoreyF.m_UIFacilityInfoMiniWindow.gameObject.SetActive(true);
- }
- <OpenFacilityCostumeSettingWindow>c__AnonStoreyF.m_UIFacilityInfoMiniWindow.SetFacilityInfo(<OpenFacilityCostumeSettingWindow>c__AnonStoreyF.enableFacilityArray[i], true);
- <OpenFacilityCostumeSettingWindow>c__AnonStoreyF.m_UIFacilityInfoMiniWindow.viewType = FacilityInfoUI.ViewType.DefaultMode;
- });
- if (<OpenFacilityCostumeSettingWindow>c__AnonStoreyF.tempSelectFacility != null && <OpenFacilityCostumeSettingWindow>c__AnonStoreyF.enableFacilityArray[i] == <OpenFacilityCostumeSettingWindow>c__AnonStoreyF.tempSelectFacility)
- {
- componentInChildren2.isOn = true;
- }
- });
- }
- private void OpenCostumeSettingWindow(Facility facility)
- {
- SceneFacilityManagement.m_CostumeEditFacilityIndex = GameMain.Instance.FacilityMgr.GetFacilityIndex(facility);
- GameMain.Instance.FacilityMgr.tempSelectFacility = facility;
- this.m_UIFacilityCostume.gameObject.SetActive(true);
- Facility.CostumeType typeCostume = facility.typeCostume;
- Toggle[] componentsInChildren = this.m_UIFacilityCostume.GetComponentsInChildren<Toggle>();
- for (int i = 0; i < componentsInChildren.Length; i++)
- {
- int num = i;
- Toggle toggle = componentsInChildren[num];
- Facility.CostumeType toggleType = (Facility.CostumeType)num;
- toggle.onValueChanged.RemoveAllListeners();
- toggle.onValueChanged.AddListener(delegate(bool value)
- {
- if (!value)
- {
- return;
- }
- facility.typeCostume = toggleType;
- this.m_UIButtonBeginCostumeSetting.interactable = (toggleType == Facility.CostumeType.Edit);
- Transform transform = this.m_UIFacilityCostume.Find("image thumbnail");
- if (transform != null)
- {
- RawImage component = transform.GetComponent<RawImage>();
- bool flag = facility.IsExistEditCostumeThumbnail();
- if (toggleType == Facility.CostumeType.Edit)
- {
- flag = facility.IsExistEditCostumeThumbnail();
- }
- else if (toggleType == Facility.CostumeType.Default)
- {
- flag = !string.IsNullOrEmpty(facility.defaultCostumeThumbnailName);
- }
- bool flag2 = (toggleType == Facility.CostumeType.Edit || toggleType == Facility.CostumeType.Default) && flag;
- if (transform.gameObject.activeSelf != flag2)
- {
- transform.gameObject.SetActive(flag2);
- }
- if (component.texture != null && string.IsNullOrEmpty(component.texture.name))
- {
- try
- {
- UnityEngine.Object.DestroyImmediate(component.texture, false);
- }
- catch
- {
- component.texture = null;
- }
- }
- if (flag2)
- {
- Texture2D texture = null;
- if (toggleType == Facility.CostumeType.Edit)
- {
- texture = facility.GetEditCostumeThumbnail();
- }
- else if (toggleType == Facility.CostumeType.Default)
- {
- texture = facility.GetDefaultCostumeThumbnail();
- }
- component.texture = texture;
- }
- else
- {
- component.texture = null;
- }
- }
- else
- {
- NDebug.Assert("メイドのサムネイル表示オブジェクトがありません", false);
- }
- });
- }
- for (int j = 0; j < componentsInChildren.Length; j++)
- {
- Toggle toggle2 = componentsInChildren[j];
- Facility.CostumeType costumeType = (Facility.CostumeType)j;
- toggle2.isOn = (typeCostume == costumeType);
- toggle2.onValueChanged.Invoke(toggle2.isOn);
- }
- this.m_UIButtonBeginCostumeSetting.interactable = (typeCostume == Facility.CostumeType.Edit);
- }
- public void ButtonEventBeginCostumeSetting()
- {
- GameMain.Instance.MainCamera.FadeOut(0.5f, false, delegate
- {
- this.UpdateMaidPropOfCostume(SceneFacilityManagement.m_CostumeEditFacilityIndex, delegate
- {
- ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
- scriptMgr.adv_kag.JumpLabel(this.m_strScriptEditLabel);
- scriptMgr.adv_kag.Exec();
- });
- }, true, default(Color));
- }
- public void ButtonEventSceneClose()
- {
- if (string.IsNullOrEmpty(this.m_strScriptReturnLabel))
- {
- Debug.Log("[SceneFacilityManagement]シーン終了時に飛ぶラベルがありませんでした");
- return;
- }
- GameMain.Instance.MainCamera.FadeOut(0.5f, false, delegate
- {
- ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
- scriptMgr.adv_kag.JumpLabel(this.m_strScriptReturnLabel);
- scriptMgr.adv_kag.Exec();
- }, true, default(Color));
- }
- private void GetTagBackup()
- {
- Dictionary<string, string> tag_backup = GameMain.Instance.ScriptMgr.adv_kag.tag_backup;
- string a;
- if (tag_backup != null && tag_backup.TryGetValue("name", out a) && a == "SceneFacilityManagement")
- {
- if (!tag_backup.TryGetValue("label", out this.m_strScriptReturnLabel))
- {
- this.m_strScriptReturnLabel = "*施設の管理画面を抜ける";
- }
- if (!tag_backup.TryGetValue("label_edit", out this.m_strScriptEditLabel))
- {
- this.m_strScriptEditLabel = "*施設のコスチュームのエディットを開く";
- }
- if (tag_backup.ContainsKey("update_costume"))
- {
- this.UpdateFacilityCostume(SceneFacilityManagement.m_CostumeEditFacilityIndex);
- this.OpenFacilityCostumeSettingWindow();
- this.OpenCostumeSettingWindow(GameMain.Instance.FacilityMgr.tempSelectFacility);
- }
- else
- {
- SceneFacilityManagement.m_CostumeEditFacilityIndex = -1;
- GameMain.Instance.FacilityMgr.tempSelectFacility = null;
- }
- }
- }
- private void UpdateFacilityCostume(int facilityIndex)
- {
- FacilityManager facilityMgr = GameMain.Instance.FacilityMgr;
- Facility facility = facilityMgr.GetNextDayFacility(facilityIndex);
- if (facility == null)
- {
- facility = facilityMgr.GetFacility(facilityIndex);
- if (facility == null)
- {
- Debug.LogWarning(string.Format("[SceneFacilityManagement]インデックス[{0}]番目の施設は存在しない", facilityIndex));
- return;
- }
- }
- Maid maidLeader = this.GetMaidLeader();
- if (maidLeader == null)
- {
- NDebug.Warning("メイド長が見つかりません");
- return;
- }
- facility.UpdateEditCostumeToMaidCostume(maidLeader);
- MPN[] facilityCostumeEnableMPN = FacilityDataTable.GetFacilityCostumeEnableMPN();
- for (int i = 0; i < facilityCostumeEnableMPN.Length; i++)
- {
- maidLeader.ResetProp(facilityCostumeEnableMPN[i], true);
- }
- maidLeader.AllProcPropSeqStart();
- maidLeader.Visible = false;
- Debug.Log(string.Format("[SceneFacilityManagement]施設「{0}」の指定コスチュームの更新終了", facility.facilityName));
- }
- private void UpdateMaidPropOfCostume(int facilityIndex, Action callback = null)
- {
- FacilityManager facilityMgr = GameMain.Instance.FacilityMgr;
- Facility facility = facilityMgr.GetNextDayFacility(facilityIndex);
- if (facility == null)
- {
- facility = facilityMgr.GetFacility(facilityIndex);
- if (facility == null)
- {
- Debug.LogWarning(string.Format("[SceneFacilityManagement]インデックス[{0}]番目の施設は存在しない", facilityIndex));
- if (callback != null)
- {
- callback();
- }
- return;
- }
- }
- Maid maid = this.GetMaidLeader();
- if (maid == null)
- {
- NDebug.Warning("メイド長が見つかりません");
- if (callback != null)
- {
- callback();
- }
- return;
- }
- GameMain.Instance.CharacterMgr.SetActiveMaid(maid, 0);
- maid.Visible = true;
- maid.AllProcPropSeqStart();
- base.StartCoroutine(this.coroutine_WaitmaidPropBusy(maid, delegate
- {
- facility.UpdateMaidCostumeToEditCostume(maid, true);
- maid.AllProcPropSeqStart();
- this.StartCoroutine(this.coroutine_WaitmaidPropBusy(maid, callback));
- }));
- }
- private IEnumerator coroutine_WaitmaidPropBusy(Maid maid, Action callback)
- {
- while (maid.IsBusy)
- {
- yield return null;
- }
- if (callback != null)
- {
- callback();
- }
- yield break;
- }
- private Maid GetMaidLeader()
- {
- Maid maid = null;
- CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
- for (int i = 0; i < characterMgr.GetMaidCount(); i++)
- {
- Maid maid2 = characterMgr.GetMaid(i);
- if (maid2 != null && maid2.status.leader)
- {
- maid = maid2;
- break;
- }
- }
- if (maid == null)
- {
- for (int j = 0; j < characterMgr.GetStockMaidCount(); j++)
- {
- Maid stockMaid = characterMgr.GetStockMaid(j);
- if (stockMaid != null && stockMaid.status.leader)
- {
- maid = stockMaid;
- break;
- }
- }
- }
- if (maid == null)
- {
- for (int k = 0; k < characterMgr.GetMaidCount(); k++)
- {
- Maid maid3 = characterMgr.GetMaid(k);
- if (maid3 != null)
- {
- maid = maid3;
- break;
- }
- }
- }
- if (maid == null)
- {
- for (int l = 0; l < characterMgr.GetStockMaidCount(); l++)
- {
- Maid stockMaid2 = characterMgr.GetStockMaid(l);
- if (stockMaid2 != null)
- {
- maid = stockMaid2;
- break;
- }
- }
- }
- return maid;
- }
- private FacilityManager m_FacilityMgr;
- [SerializeField]
- private Text m_UITextNowMoney;
- [SerializeField]
- private Text m_UITextNowCost;
- [SerializeField]
- private RectTransform m_UIMainMenu;
- [SerializeField]
- private RectTransform m_UIFacilityDetails;
- [SerializeField]
- private RectTransform m_UIFacilityTypeList;
- [SerializeField]
- private RectTransform m_UIFacilityCostume;
- [SerializeField]
- private RectTransform m_UIFacilityPowerUpList;
- [SerializeField]
- private FacilityInfoUI m_UIFacilityInfoConstruction;
- [SerializeField]
- private FacilityInfoUI m_UIFacilityInfoMiniWindow;
- [SerializeField]
- private Button m_UIButtonOK;
- [SerializeField]
- private Button m_UIButtonCANCEL;
- [SerializeField]
- private Button m_UIButtonRESET;
- [SerializeField]
- private Button m_UIButtonDestroyFacility;
- [SerializeField]
- private Toggle m_UIToggleVisibleFacilityInfo;
- [SerializeField]
- private Button m_UIButtonBeginCostumeSetting;
- [SerializeField]
- private StatusViewer m_UIClubStatusViewer;
- [SerializeField]
- private bool m_EnableSetUpCameraAndBG = true;
- private Facility m_CreatingFacility;
- private int m_SelectingFacilityIndex;
- private static int m_CostumeEditFacilityIndex = -1;
- [SerializeField]
- private StartDestroyEventObject m_StartDestroyEventObject;
- private string m_PlayBGM = "BGM009.ogg";
- private long m_NowCost;
- private string m_strScriptReturnLabel = string.Empty;
- private string m_strScriptEditLabel = string.Empty;
- private class FacilityDetailsUI : MonoBehaviour
- {
- private void Awake()
- {
- this.m_FacilityInfoUI = base.GetComponent<FacilityInfoUI>();
- this.m_Toggle = base.GetComponent<Toggle>();
- this.m_Button = base.GetComponentInChildren<Button>();
- this.m_ChangeImage = base.transform.Find("Image Change").gameObject;
- this.m_DeleteImage = base.transform.Find("Image Delete").gameObject;
- this.m_ParentInfo = base.transform.Find("Parent Info").gameObject;
- this.m_ChangeImage.SetActive(false);
- this.m_DeleteImage.SetActive(false);
- this.m_ParentInfo.SetActive(false);
- InputField facilityNameUI = this.m_FacilityInfoUI.textFacilityName;
- facilityNameUI.onEndEdit.RemoveAllListeners();
- facilityNameUI.onEndEdit.AddListener(delegate(string value)
- {
- Facility facility = this.m_FacilityInfoUI.facility;
- value = value.Trim();
- if (string.IsNullOrEmpty(value))
- {
- facilityNameUI.text = facility.facilityName;
- return;
- }
- facility.facilityName = value;
- facilityNameUI.enabled = false;
- });
- this.m_Button.onClick.AddListener(delegate()
- {
- facilityNameUI.enabled = true;
- facilityNameUI.interactable = true;
- facilityNameUI.ActivateInputField();
- });
- }
- private void Start()
- {
- InputField textFacilityName = this.m_FacilityInfoUI.textFacilityName;
- textFacilityName.interactable = false;
- }
- public FacilityInfoUI m_FacilityInfoUI;
- public Toggle m_Toggle;
- public Button m_Button;
- public GameObject m_ChangeImage;
- public GameObject m_DeleteImage;
- public GameObject m_ParentInfo;
- }
- }
|