1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using I2.Loc;
- using PlayerStatus;
- using UnityEngine;
- using UnityEngine.Events;
- using UnityEngine.UI;
- public class SceneFacilityManagement : MonoBehaviour
- {
- public static string GetDialogText(string termName)
- {
- return LocalizationManager.GetTranslation("Dialog/施設/" + termName, true, 0, true, false, null, null);
- }
- public static string GetDialogText(string termName, params string[] args)
- {
- return string.Format(LocalizationManager.GetTranslation("Dialog/施設/" + termName, true, 0, true, false, null, null), args);
- }
- 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 = SceneFacilityManagement.GetDialogText("空き部屋に施設を配置しますか?");
- }
- else
- {
- messageText = SceneFacilityManagement.GetDialogText("『{0}』が配置されています。施設を変更しますか?", new string[]
- {
- facility.facilityName
- });
- }
- if (facility && !FacilityDataTable.GetFacilityCanBeDestroy(facility.param.typeID, true))
- {
- this.OpenDialog(SceneFacilityManagement.GetDialogText("『{0}』は変更出来ない施設です。", new string[]
- {
- facility.facilityName
- }), 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>();
- Localize component2 = componentInChildren2.GetComponent<Localize>();
- componentInChildren2.text = facilityStatus.name;
- if (component2 != null)
- {
- component2.SetTerm(facilityStatus.termName);
- }
- 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>();
- Localize component2 = component.GetComponent<Localize>();
- Text component3 = trans.Find("Text Recipe Number").GetComponent<Text>();
- uGUIListViewer component4 = trans.Find("parent materials").GetComponent<uGUIListViewer>();
- uGUIListViewer component5 = trans.Find("parent conditions").GetComponent<uGUIListViewer>();
- uGUIListViewer component6 = trans.Find("parent default parameter").GetComponent<uGUIListViewer>();
- uGUIListViewer component7 = trans.Find("parent additional parameter").GetComponent<uGUIListViewer>();
- Facility.PowerUpRecipe facilityPowerUpRecipe = FacilityDataTable.GetFacilityPowerUpRecipe(recipeArray[i].id);
- component.text = facilityPowerUpRecipe.name;
- if (component2 != null)
- {
- component2.SetTerm("SceneFacilityManagement/強化種類/" + facilityPowerUpRecipe.name);
- }
- component3.text = string.Format("RECIPE {0}", i + 1);
- this.SetUpRecipeMaterialList(component4, recipeArray[i]);
- this.SetUpRecipeConditionList(component5, recipeArray[i].id);
- this.SetUpFacilityParams(component6, recipeArray[i].defaultParameter);
- this.SetUpFacilityParams(component7, recipeArray[i].additionalParameter);
- });
- }
- else
- {
- componentInChildren.Show<Transform>(1, delegate(int i, Transform trans)
- {
- Text component = trans.Find("Text Recipe Name").GetComponent<Text>();
- Localize component2 = component.GetComponent<Localize>();
- Text component3 = trans.Find("Text Recipe Number").GetComponent<Text>();
- uGUIListViewer component4 = trans.Find("parent materials").GetComponent<uGUIListViewer>();
- uGUIListViewer component5 = trans.Find("parent conditions").GetComponent<uGUIListViewer>();
- uGUIListViewer component6 = trans.Find("parent default parameter").GetComponent<uGUIListViewer>();
- uGUIListViewer component7 = trans.Find("parent additional parameter").GetComponent<uGUIListViewer>();
- component.text = "レシピ無し";
- if (component2 != null)
- {
- component2.SetTerm("SceneFacilityManagement/強化種類/レシピ無し");
- }
- component3.text = string.Empty;
- component4.ResetList();
- component5.ResetList();
- component6.ResetList();
- component7.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>();
- Localize component2 = component.GetComponent<Localize>();
- Text component3 = trans.Find("Text Category Number").GetComponent<Text>();
- Text component4 = trans.Find("Text Material Name").GetComponent<Text>();
- Localize component5 = component4.GetComponent<Localize>();
- string facilityPowerUpMaterialCategoryName = FacilityDataTable.GetFacilityPowerUpMaterialCategoryName(categoryID);
- string text = string.Empty;
- if (FacilityDataTable.IsExistPowerUpMaterial(materialID))
- {
- text = FacilityDataTable.GetFacilityPowerUpMaterial(materialID).name;
- }
- component.text = facilityPowerUpMaterialCategoryName;
- if (component2 != null)
- {
- component2.SetTerm("SceneFacilityManagement/強化素材カテゴリー/" + facilityPowerUpMaterialCategoryName);
- }
- component4.text = text;
- if (component5 != null)
- {
- component5.SetTerm("SceneFacilityManagement/強化素材/" + text);
- }
- component3.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>();
- Localize component = componentsInChildren[0].GetComponent<Localize>();
- componentsInChildren[0].text = data.conditions[i];
- if (component != null)
- {
- component.SetTerm("SceneFacilityManagement/実行条件/" + 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>();
- Localize component = componentInChildren.GetComponent<Localize>();
- KeyValuePair<string, int> keyValuePair = paramList[i];
- componentInChildren.text = string.Format("{0} +{1}", keyValuePair.Key, keyValuePair.Value);
- if (component != null)
- {
- component.TermArgs = new Localize.ArgsPair[]
- {
- Localize.ArgsPair.Create(keyValuePair.Value.ToString())
- };
- component.SetTerm("SceneFacilityManagement/パラメータ/" + keyValuePair.Key);
- }
- });
- }
- 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(SceneFacilityManagement.GetDialogText("資金が不足する設定は出来ません。"), SystemDialog.TYPE.OK, null, null);
- return;
- }
- string messageText = string.Empty;
- string defaultName = this.m_CreatingFacility.defaultName;
- string translation = LocalizationManager.GetTranslation(this.m_CreatingFacility.defaultTermName, true, 0, true, false, null, null);
- if (!string.IsNullOrEmpty(translation))
- {
- defaultName = translation;
- }
- if (facility)
- {
- messageText = SceneFacilityManagement.GetDialogText("『{0}』を、『{1}』に設定します。よろしいですか?", new string[]
- {
- facility.facilityName,
- defaultName
- });
- }
- else
- {
- messageText = SceneFacilityManagement.GetDialogText("『{0}』を設定します。よろしいですか?", new string[]
- {
- defaultName
- });
- }
- 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(SceneFacilityManagement.GetDialogText("『{0}』を設定しました。", new string[]
- {
- defaultName
- }), 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 dialogText = SceneFacilityManagement.GetDialogText("施設の設定をリセットします。よろしいですか?");
- this.OpenDialog(dialogText, SystemDialog.TYPE.YES_NO, delegate
- {
- this.OpenDialog(SceneFacilityManagement.GetDialogText("施設の設定をリセットしました。"), 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(SceneFacilityManagement.GetDialogText("『{0}』を撤去します。よろしいですか?※施設強化及び服装設定もリセットされます", new string[]
- {
- facilityName
- }), SystemDialog.TYPE.YES_NO, delegate
- {
- this.FacilityMgr.SetNextDayFacility(this.m_SelectingFacilityIndex, null);
- this.OpenDialog(SceneFacilityManagement.GetDialogText("『{0}』を撤去予定に設定しました。", new string[]
- {
- facilityName
- }), SystemDialog.TYPE.OK, null, null);
- this.OpenFacilityUIConstruction();
- }, delegate
- {
- });
- }
- else
- {
- this.OpenDialog(SceneFacilityManagement.GetDialogText("『{0}』は撤去出来ない施設です。", new string[]
- {
- facilityName
- }), SystemDialog.TYPE.OK, null, null);
- }
- }
- public void OpenNowFacilityList(bool isOn)
- {
- SceneFacilityManagement.<OpenNowFacilityList>c__AnonStoreyC <OpenNowFacilityList>c__AnonStoreyC = new SceneFacilityManagement.<OpenNowFacilityList>c__AnonStoreyC();
- <OpenNowFacilityList>c__AnonStoreyC.$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__AnonStoreyC.enableFacilityArray = new List<Facility>();
- for (int j = 0; j < facilityArray.Length; j++)
- {
- if (facilityArray[j])
- {
- <OpenNowFacilityList>c__AnonStoreyC.enableFacilityArray.Add(facilityArray[j]);
- }
- }
- uGUIListViewer component = this.m_UIFacilityTypeList.GetComponent<uGUIListViewer>();
- component.Show<Transform>(<OpenNowFacilityList>c__AnonStoreyC.enableFacilityArray.Count, delegate(int i, Transform trans)
- {
- Text componentInChildren = trans.GetComponentInChildren<Text>();
- Toggle componentInChildren2 = trans.GetComponentInChildren<Toggle>();
- componentInChildren.text = <OpenNowFacilityList>c__AnonStoreyC.enableFacilityArray[i].facilityName;
- componentInChildren2.onValueChanged.AddListener(delegate(bool value)
- {
- if (!value)
- {
- return;
- }
- <OpenNowFacilityList>c__AnonStoreyC.ShowFacilityPowerUpList(<OpenNowFacilityList>c__AnonStoreyC.enableFacilityArray[i]);
- if (!<OpenNowFacilityList>c__AnonStoreyC.m_UIFacilityInfoMiniWindow.gameObject.activeSelf)
- {
- <OpenNowFacilityList>c__AnonStoreyC.m_UIFacilityInfoMiniWindow.gameObject.SetActive(true);
- }
- <OpenNowFacilityList>c__AnonStoreyC.m_UIFacilityInfoMiniWindow.SetFacilityInfo(<OpenNowFacilityList>c__AnonStoreyC.enableFacilityArray[i], true);
- <OpenNowFacilityList>c__AnonStoreyC.m_UIFacilityInfoMiniWindow.viewType = FacilityInfoUI.ViewType.DefaultMode;
- });
- });
- }
- public void OpenFacilityInfoList(bool isOn)
- {
- SceneFacilityManagement.<OpenFacilityInfoList>c__AnonStoreyE <OpenFacilityInfoList>c__AnonStoreyE = new SceneFacilityManagement.<OpenFacilityInfoList>c__AnonStoreyE();
- <OpenFacilityInfoList>c__AnonStoreyE.$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__AnonStoreyE.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__AnonStoreyE.enableFacilityArray.Add(facilityStatusArray[j]);
- }
- IL_18C:;
- }
- uGUIListViewer component = this.m_UIFacilityTypeList.GetComponent<uGUIListViewer>();
- component.Show<Transform>(<OpenFacilityInfoList>c__AnonStoreyE.enableFacilityArray.Count, delegate(int i, Transform trans)
- {
- Text componentInChildren = trans.GetComponentInChildren<Text>();
- Localize componentInChildren2 = trans.GetComponentInChildren<Localize>();
- Toggle componentInChildren3 = trans.GetComponentInChildren<Toggle>();
- componentInChildren.text = <OpenFacilityInfoList>c__AnonStoreyE.enableFacilityArray[i].name;
- if (componentInChildren2 != null)
- {
- componentInChildren2.SetTerm(<OpenFacilityInfoList>c__AnonStoreyE.enableFacilityArray[i].termName);
- }
- componentInChildren3.onValueChanged.AddListener(delegate(bool value)
- {
- if (!value)
- {
- return;
- }
- <OpenFacilityInfoList>c__AnonStoreyE.m_CreatingFacility.Init(<OpenFacilityInfoList>c__AnonStoreyE.enableFacilityArray[i].typeID);
- <OpenFacilityInfoList>c__AnonStoreyE.ShowFacilityPowerUpList(<OpenFacilityInfoList>c__AnonStoreyE.m_CreatingFacility);
- if (!<OpenFacilityInfoList>c__AnonStoreyE.m_UIFacilityInfoMiniWindow.gameObject.activeSelf)
- {
- <OpenFacilityInfoList>c__AnonStoreyE.m_UIFacilityInfoMiniWindow.gameObject.SetActive(true);
- }
- <OpenFacilityInfoList>c__AnonStoreyE.m_UIFacilityInfoMiniWindow.SetFacilityInfo(<OpenFacilityInfoList>c__AnonStoreyE.m_CreatingFacility, true);
- <OpenFacilityInfoList>c__AnonStoreyE.m_UIFacilityInfoMiniWindow.viewType = FacilityInfoUI.ViewType.ConstructMode;
- });
- });
- }
- public void OpenFacilityCostumeSettingWindow(bool isOn)
- {
- if (!isOn)
- {
- return;
- }
- this.OpenFacilityCostumeSettingWindow();
- }
- public void OpenFacilityCostumeSettingWindow()
- {
- SceneFacilityManagement.<OpenFacilityCostumeSettingWindow>c__AnonStorey10 <OpenFacilityCostumeSettingWindow>c__AnonStorey = new SceneFacilityManagement.<OpenFacilityCostumeSettingWindow>c__AnonStorey10();
- <OpenFacilityCostumeSettingWindow>c__AnonStorey.$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__AnonStorey.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__AnonStorey.enableFacilityArray.Add(facility);
- }
- }
- uGUIListViewer component = this.m_UIFacilityTypeList.GetComponent<uGUIListViewer>();
- <OpenFacilityCostumeSettingWindow>c__AnonStorey.tempSelectFacility = GameMain.Instance.FacilityMgr.tempSelectFacility;
- component.Show<Transform>(<OpenFacilityCostumeSettingWindow>c__AnonStorey.enableFacilityArray.Count, delegate(int i, Transform trans)
- {
- Text componentInChildren = trans.GetComponentInChildren<Text>();
- Toggle componentInChildren2 = trans.GetComponentInChildren<Toggle>();
- componentInChildren.text = <OpenFacilityCostumeSettingWindow>c__AnonStorey.enableFacilityArray[i].facilityName;
- componentInChildren2.onValueChanged.AddListener(delegate(bool value)
- {
- if (!value)
- {
- return;
- }
- <OpenFacilityCostumeSettingWindow>c__AnonStorey.OpenCostumeSettingWindow(<OpenFacilityCostumeSettingWindow>c__AnonStorey.enableFacilityArray[i]);
- if (!<OpenFacilityCostumeSettingWindow>c__AnonStorey.m_UIFacilityInfoMiniWindow.gameObject.activeSelf)
- {
- <OpenFacilityCostumeSettingWindow>c__AnonStorey.m_UIFacilityInfoMiniWindow.gameObject.SetActive(true);
- }
- <OpenFacilityCostumeSettingWindow>c__AnonStorey.m_UIFacilityInfoMiniWindow.SetFacilityInfo(<OpenFacilityCostumeSettingWindow>c__AnonStorey.enableFacilityArray[i], true);
- <OpenFacilityCostumeSettingWindow>c__AnonStorey.m_UIFacilityInfoMiniWindow.viewType = FacilityInfoUI.ViewType.DefaultMode;
- });
- if (<OpenFacilityCostumeSettingWindow>c__AnonStorey.tempSelectFacility != null && <OpenFacilityCostumeSettingWindow>c__AnonStorey.enableFacilityArray[i] == <OpenFacilityCostumeSettingWindow>c__AnonStorey.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;
- }
- }
|