using System; using System.Collections.Generic; using System.Linq; using MaidStatus; using UnityEngine; using wf; public class MaidExaminationCtrl : BaseCreateViewerCtrl { public void Init(MaidExaminationMgr maidExaminationMgr, GameObject goPanel) { this.m_mgr = maidExaminationMgr; this.m_goPanel = goPanel; } private void InitViewer() { this.m_unitPrefabPath = "SceneCompetitiveShow/Prefab/AcquiredClassUnit"; this.m_goUnitParent = UTY.GetChildObject(this.m_goPanel, "Viewer/AcquiredClassViewer/ListParent/Contents/UnitParent", false); this.m_goViewer = UTY.GetChildObject(this.m_goPanel, "Viewer", false); GameObject childObject = UTY.GetChildObject(this.m_goViewer, "ContractType", false); this.m_lContractType = UTY.GetChildObject(childObject, "Value", false).GetComponent(); GameObject childObject2 = UTY.GetChildObject(this.m_goViewer, "Name", false); this.m_lLastName = UTY.GetChildObject(childObject2, "LastName", false).GetComponent(); this.m_lFirstName = UTY.GetChildObject(childObject2, "FirstName", false).GetComponent(); this.m_txtMaidIcon = UTY.GetChildObject(this.m_goViewer, "MaidIcon", false).GetComponent(); GameObject childObject3 = UTY.GetChildObject(this.m_goViewer, "AcquiredClassViewer", false); this.m_lMessageBox = UTY.GetChildObject(childObject3, "MessageBox", false).GetComponent(); this.m_goNext = UTY.GetChildObject(this.m_goViewer, "Next", false); UIButton component = this.m_goNext.GetComponent(); EventDelegate.Add(component.onClick, new EventDelegate.Callback(this.m_mgr.ClickNext)); this.m_goOk = UTY.GetChildObject(this.m_goViewer, "Ok", false); UIButton component2 = this.m_goOk.GetComponent(); EventDelegate.Add(component2.onClick, new EventDelegate.Callback(this.m_mgr.ClickOk)); } public void CreateMaidExaminationViewer(List listData, int maidNo) { if (!this.m_init) { this.InitViewer(); this.m_init = true; } this.bSomeoneGetClass = base.HasListData(listData); if (!this.bSomeoneGetClass) { this.m_goViewer.SetActive(false); if (CompetitiveShowMgr.is_effect_ones) { GameMain.Instance.SysDlg.Show("今回は新しいクラスを\n誰も貰えませんでした。", SystemDialog.TYPE.OK, new SystemDialog.OnClick(this.m_mgr.CloseMaidExaminationPanel), null); } else { GameMain.Instance.SysDlg.Show("新しいクラスを貰えませんでした。", SystemDialog.TYPE.OK, new SystemDialog.OnClick(this.m_mgr.CloseMaidExaminationPanel), null); } return; } this.m_goViewer.SetActive(true); bool flag = false; this.m_data = listData[maidNo]; if (listData.Count - 1 > maidNo) { flag = true; } this.m_goNext.SetActive(flag); this.m_goOk.SetActive(!flag); base.CreateViewer(this.m_data); } protected override void SetDataForViewer() { this.m_lContractType.text = EnumConvert.GetString(this.m_data.contractType); this.m_lLastName.text = this.m_data.lastName; this.m_lFirstName.text = this.m_data.firstName; this.m_txtMaidIcon.mainTexture = this.m_data.maidIcon; List list = new List(); if (this.m_data.arrayAcquiredMaidClassType != null) { foreach (int id in this.m_data.arrayAcquiredMaidClassType) { list.Add(JobClass.GetData(id).drawName); } } List list2 = new List(); if (this.m_data.arrayAcquiredYotogiClassType != null) { foreach (int id2 in this.m_data.arrayAcquiredYotogiClassType) { list2.Add(YotogiClass.GetData(id2).drawName); } } string[] array = list.Concat(list2).ToArray(); if (array == null || array.Count() == 0) { this.m_lMessageBox.text = "新しいクラスを貰えませんでした。"; } else { this.m_lMessageBox.text = string.Empty; foreach (string text in array) { GameObject gameObject = UnityEngine.Object.Instantiate(this.m_goUnitPrefab); UILabel component = gameObject.GetComponent(); string arg = text; component.fontSize = 21; component.overflowMethod = UILabel.Overflow.ShrinkContent; component.text = string.Format("{0}を入手", arg); gameObject.name = string.Format("Msg_Acquired_{0}", arg); base.SetTransformInfo(gameObject); } Utility.ResetNGUI(this.m_goUnitParent.GetComponent()); Utility.ResetNGUI(this.m_goUnitParent.transform.parent.parent.GetComponentInChildren()); } this.SetScrollBarLineActive(array); } private void SetScrollBarLineActive(string[] merge) { if (merge != null) { bool flag = 4 < merge.Count(); } } public void DispSystemDialog() { this.m_goViewer.SetActive(false); if (CompetitiveShowMgr.is_effect_ones) { GameMain.Instance.SysDlg.Show("今回新しくクラスを\n獲得したメイドは以上です。", SystemDialog.TYPE.OK, new SystemDialog.OnClick(this.m_mgr.CloseMaidExaminationPanel), null); } else { this.m_mgr.CloseMaidExaminationPanel(); } } private MaidExaminationMgr m_mgr; private MaidExaminationCtrl.MaidExamination m_data; private GameObject m_goPanel; private GameObject m_goViewer; private GameObject m_goNext; private GameObject m_goOk; private UITexture m_txtMaidIcon; private UILabel m_lContractType; private UILabel m_lLastName; private UILabel m_lFirstName; private UILabel m_lMessageBox; private bool bSomeoneGetClass; private bool m_init; private const string UNIT_PARENT_PATH = "Viewer/AcquiredClassViewer/ListParent/Contents/UnitParent"; private const string UNIT_PREFAB_PATH = "SceneCompetitiveShow/Prefab/AcquiredClassUnit"; private const string SYSTEM_UI_ROOT_PATH = "__GameMain__/SystemUI Root"; private const string TEMPLATE_MSG_ACQUIRED_CLASS = "{0}を入手"; private const string TEMPLATE_NAME = "Msg_Acquired_{0}"; private const string MSG_RESULT_GET_CLASS = "今回新しくクラスを\n獲得したメイドは以上です。"; private const string MSG_DIDNOT_GET_CLASS = "新しいクラスを貰えませんでした。"; private const string MSG_EVERYTHING_DIDNOT_GET_CLASS = "今回は新しいクラスを\n誰も貰えませんでした。"; private const int COUNT_ACQUIRED_CLASS = 4; public class MaidExamination { public MaidExaminationCtrl.MaidExamination Copy() { return (MaidExaminationCtrl.MaidExamination)base.MemberwiseClone(); } public int[] arrayAcquiredMaidClassType; public int[] arrayAcquiredYotogiClassType; public Contract contractType; public Texture2D maidIcon; public string firstName; public string lastName; } }