123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300 |
- using System;
- using System.Collections.Generic;
- using com.workman.cm3d2.button;
- using PlayerStatus;
- using Schedule;
- using UnityEngine;
- using wf;
- public class DailyCtrl : MonoBehaviour
- {
- public void Init(DailyMgr mgr, GameObject goPanel)
- {
- this.m_mgr = mgr;
- this.m_goPanel = goPanel;
- }
- public void DisplayViewer(DailyMgr.Daily daily)
- {
- if (!this.m_bInit)
- {
- this.m_bInit = true;
- foreach (DailyCtrl.ButtonData buttonData in this.menuButtons)
- {
- EventDelegate.Add(buttonData.button.onClick, new EventDelegate.Callback(this.m_mgr.OnClickMenuButton));
- }
- }
- foreach (DailyCtrl.ButtonData buttonData2 in this.menuButtons)
- {
- buttonData2.active = true;
- }
- DailyCtrl.ButtonType[] array3;
- if (daily == DailyMgr.Daily.Daytime)
- {
- if (DailyMgr.IsLegacy)
- {
- array3 = new DailyCtrl.ButtonType[]
- {
- DailyCtrl.ButtonType.Dance,
- DailyCtrl.ButtonType.FacilityManagement,
- DailyCtrl.ButtonType.Casino,
- DailyCtrl.ButtonType.Trophy,
- DailyCtrl.ButtonType.PhotoMode,
- DailyCtrl.ButtonType.DeskCustomize,
- DailyCtrl.ButtonType.MyRoomCustom,
- DailyCtrl.ButtonType.Casino,
- DailyCtrl.ButtonType.Shop,
- DailyCtrl.ButtonType.FacilityManagement,
- DailyCtrl.ButtonType.LegacyMode,
- DailyCtrl.ButtonType.Karaoke,
- DailyCtrl.ButtonType.EventScenario,
- DailyCtrl.ButtonType.ManEdit,
- DailyCtrl.ButtonType.Credit,
- DailyCtrl.ButtonType.NPCEdit
- };
- }
- else
- {
- array3 = new DailyCtrl.ButtonType[]
- {
- DailyCtrl.ButtonType.Dance,
- DailyCtrl.ButtonType.Casino,
- DailyCtrl.ButtonType.CompetitiveShow
- };
- }
- }
- else if (DailyMgr.IsLegacy)
- {
- array3 = new DailyCtrl.ButtonType[]
- {
- DailyCtrl.ButtonType.Schedule,
- DailyCtrl.ButtonType.CompetitiveShow,
- DailyCtrl.ButtonType.Trophy,
- DailyCtrl.ButtonType.PhotoMode,
- DailyCtrl.ButtonType.DeskCustomize,
- DailyCtrl.ButtonType.MyRoomCustom,
- DailyCtrl.ButtonType.Casino,
- DailyCtrl.ButtonType.Shop,
- DailyCtrl.ButtonType.FacilityManagement,
- DailyCtrl.ButtonType.LegacyMode,
- DailyCtrl.ButtonType.Karaoke,
- DailyCtrl.ButtonType.EventScenario,
- DailyCtrl.ButtonType.ManEdit,
- DailyCtrl.ButtonType.Credit,
- DailyCtrl.ButtonType.Dance,
- DailyCtrl.ButtonType.NPCEdit
- };
- }
- else
- {
- array3 = new DailyCtrl.ButtonType[]
- {
- DailyCtrl.ButtonType.Schedule,
- DailyCtrl.ButtonType.CompetitiveShow,
- DailyCtrl.ButtonType.LegacyMode
- };
- }
- this.GetMenuButton(DailyCtrl.ButtonType.NPCEdit).active = (!Product.VBA && PluginData.IsEnabled("GP001"));
- foreach (DailyCtrl.ButtonType type in array3)
- {
- this.GetMenuButton(type).active = false;
- }
- Status status = GameMain.Instance.CharacterMgr.status;
- if (!status.isAvailableDance)
- {
- this.GetMenuButton(DailyCtrl.ButtonType.Dance).active = false;
- }
- if (!status.isAvailableCompetitiveShow)
- {
- this.GetMenuButton(DailyCtrl.ButtonType.CompetitiveShow).active = false;
- }
- if (!status.isAvailableShop)
- {
- this.GetMenuButton(DailyCtrl.ButtonType.Shop).active = false;
- }
- if (!KaraokeDataManager.IsExistKaraokeData(false))
- {
- this.GetMenuButton(DailyCtrl.ButtonType.Karaoke).active = false;
- }
- this.m_goPanel.SetActive(true);
- this.SetAllButtonEnable(true);
- if (!CasinoDataMgr.Instance.GetCasinoFacility(true) && !CasinoDataMgr.Instance.GetCasinoFacility(false))
- {
- this.GetMenuButton(DailyCtrl.ButtonType.Casino).button.isEnabled = false;
- }
- if (!DailyMgr.IsLegacy && daily == DailyMgr.Daily.Daytime)
- {
- UIButton button = this.GetMenuButton(DailyCtrl.ButtonType.LegacyMode).button;
- if (GameUty.IsEnabledCompatibilityMode && PluginData.IsEnabled("Legacy"))
- {
- EventDelegate.Add(button.onClick, new EventDelegate.Callback(this.BackUpScheduleSlot));
- this.GetMenuButton(DailyCtrl.ButtonType.LegacyMode).button.isEnabled = this.IsEnabledLegacyMode();
- }
- else
- {
- this.GetMenuButton(DailyCtrl.ButtonType.LegacyMode).active = false;
- }
- }
- foreach (UITable table in this.m_goPanel.GetComponentsInChildren<UITable>())
- {
- Utility.ResetNGUI(table);
- }
- foreach (UIGrid grid in this.m_goPanel.GetComponentsInChildren<UIGrid>())
- {
- Utility.ResetNGUI(grid);
- }
- StatusViewer component = UTY.GetChildObject(this.m_goPanel, "StatusViewer", false).GetComponent<StatusViewer>();
- component.isEnabledClubNameChangeButton = true;
- component.isEnabledMainBusinessChangeButton = false;
- if (PluginData.IsEnabled("GP001") && daily == DailyMgr.Daily.Daytime && !DailyMgr.IsLegacy)
- {
- component.isEnabledGameModeChangeButton = true;
- }
- else
- {
- component.isEnabledGameModeChangeButton = false;
- }
- }
- public DailyCtrl.ButtonData GetMenuButton(DailyCtrl.ButtonType type)
- {
- foreach (DailyCtrl.ButtonData buttonData in this.menuButtons)
- {
- if (buttonData.type == type)
- {
- return buttonData;
- }
- }
- return new DailyCtrl.ButtonData
- {
- button = null,
- type = type
- };
- }
- public DailyCtrl.ButtonData GetMenuButton(UIButton button)
- {
- foreach (DailyCtrl.ButtonData buttonData in this.menuButtons)
- {
- if (buttonData.button == button)
- {
- return buttonData;
- }
- }
- return new DailyCtrl.ButtonData
- {
- button = null,
- type = DailyCtrl.ButtonType.Next
- };
- }
- private bool IsEnabledCompetitiveShow()
- {
- return this.m_mgr.GetCurrentDaily() == DailyMgr.Daily.Daytime && GameMain.Instance.CharacterMgr.status.isAvailableCompetitiveShow;
- }
- private bool IsEnabledShop()
- {
- return GameMain.Instance.CharacterMgr.status.isAvailableShop;
- }
- private bool IsEnabledDance()
- {
- return this.m_mgr.GetCurrentDaily() == DailyMgr.Daily.Night && GameMain.Instance.CharacterMgr.status.isAvailableDance;
- }
- private bool IsEnabledVRCom()
- {
- return this.m_mgr.GetCurrentDaily() == DailyMgr.Daily.Daytime && false;
- }
- private bool IsEnabledLegacyMode()
- {
- List<Maid> stockMaidList = GameMain.Instance.CharacterMgr.GetStockMaidList();
- bool result = false;
- foreach (Maid maid in stockMaidList)
- {
- if (maid != null && maid.status.isCompatiblePersonality)
- {
- result = true;
- }
- }
- return result;
- }
- public void SetAllButtonEnable(bool enable)
- {
- foreach (DailyCtrl.ButtonData buttonData in this.menuButtons)
- {
- if (buttonData.button.gameObject.activeSelf)
- {
- buttonData.button.isEnabled = enable;
- }
- }
- }
- public void BackUpScheduleSlot()
- {
- ScheduleAPI.BackUpScheduleSlot();
- }
- [SerializeField]
- private DailyCtrl.ButtonData[] menuButtons;
- private DailyMgr m_mgr;
- private Dictionary<DailyCtrl.ButtonType, GameObject> m_dicRank;
- private GameObject m_goPanel;
- private ButtonEnable m_btnEnable;
- private bool m_bInit;
- public enum ButtonType
- {
- Dance,
- Schedule,
- MaidManagement,
- EventScenario,
- Shop,
- FacilityManagement,
- CompetitiveShow,
- Casino,
- Save,
- Load,
- Trophy,
- FreeMode,
- PhotoMode,
- DeskCustomize,
- ManEdit,
- LegacyMode,
- Karaoke,
- Credit,
- Next,
- MyRoomCustom,
- NPCEdit
- }
- [Serializable]
- public class ButtonData
- {
- public bool active
- {
- get
- {
- return this.button.gameObject.activeSelf;
- }
- set
- {
- this.button.gameObject.SetActive(value);
- }
- }
- [SerializeField]
- public DailyCtrl.ButtonType type;
- [SerializeField]
- public UIButton button;
- }
- }
|