void InitTabs() { UITabGrid tab1 = m_trans_BaseProp.gameObject.GetComponent <UITabGrid>(); if (tab1 == null) { tab1 = m_trans_BaseProp.gameObject.AddComponent <UITabGrid>(); } if (tab1 != null) { if (!m_titleTabs.ContainsKey(m_trans_BaseProp.gameObject)) { m_titleTabs.Add(m_trans_BaseProp.gameObject, tab1); tab1.RegisterUIEventDelegate(OnUITabGridEventDlg); tab1.TabID = 100; } } UITabGrid tab2 = m_trans_DetailProp.gameObject.GetComponent <UITabGrid>(); if (tab2 == null) { tab2 = m_trans_DetailProp.gameObject.AddComponent <UITabGrid>(); } if (tab2 != null) { if (!m_titleTabs.ContainsKey(m_trans_DetailProp.gameObject)) { m_titleTabs.Add(m_trans_DetailProp.gameObject, tab2); tab2.RegisterUIEventDelegate(OnUITabGridEventDlg); tab2.TabID = 101; } } }
private void InitFriendSecondTabs() { if (null == m_dicFriendTabGrid && null != m_trans_SecondTab) { m_dicFriendTabGrid = new Dictionary <SecondTab, UITabGrid>(); UITabGrid tabGrid = null; for (SecondTab i = SecondTab.None + 1; i < SecondTab.Max; i++) { Transform ts = m_trans_SecondTab.Find(i.ToString()); if (null == ts) { continue; } tabGrid = ts.GetComponent <UITabGrid>(); if (tabGrid == null) { tabGrid = ts.gameObject.AddComponent <UITabGrid>(); } if (tabGrid != null) { tabGrid.TabID = (int)i; tabGrid.SetHightLight(false); if (!m_dicFriendTabGrid.ContainsKey(i)) { m_dicFriendTabGrid.Add(i, tabGrid); tabGrid.RegisterUIEventDelegate(OnFriendSecondTabsEvent); } } } } }
private void InitWidgets() { m_mgr = DataManager.Manager <ClanManger>(); m_dic_clanPanlTabs = new Dictionary <ClanPanelMode, UITabGrid>(); m_dic_clanPanlTs = new Dictionary <ClanPanelMode, Transform>(); UITabGrid grid = null; Transform ts = null; if (null != m_trans_FunctioToggles && null != m_trans_LeftContent) { for (ClanPanelMode i = ClanPanelMode.None + 1; i < ClanPanelMode.Max; i++) { ts = m_trans_FunctioToggles.Find("Clan" + i.ToString()); if (null != ts) { grid = ts.GetComponent <UITabGrid>(); if (null == grid) { grid = ts.gameObject.AddComponent <UITabGrid>(); } grid.SetGridData(i); grid.RegisterUIEventDelegate(OnUIGridEventDlg); grid.SetHightLight(false); m_dic_clanPanlTabs.Add(i, grid); } ts = m_trans_LeftContent.Find(i.ToString() + "Content"); if (null != ts) { m_dic_clanPanlTs.Add(i, ts); } } } }
protected override void OnLoading() { base.OnLoading(); RegisterGlobalUIEvent(true); m_lst_datas = new List <uint>(); if (null != m_input_Input) { m_input_Input.onChange.Add(new EventDelegate(() => { m_str_inpuSearchInfo = TextManager.GetTextByWordsCountLimitInUnicode(m_input_Input.value , TextManager.CONST_NAME_MAX_WORDS); m_input_Input.value = m_str_inpuSearchInfo; })); m_input_Input.onSubmit.Add(new EventDelegate(() => { m_str_inpuSearchInfo = TextManager.GetTextByWordsCountLimitInUnicode(m_input_Input.value , TextManager.CONST_NAME_MAX_WORDS); m_input_Input.value = m_str_inpuSearchInfo; })); } m_dic_tabs = new Dictionary <ClanDeclareMode, UITabGrid>(); m_dic_ts = new Dictionary <ClanDeclareMode, Transform>(); UITabGrid tab = null; Transform ts = null; for (ClanDeclareMode i = ClanDeclareMode.None + 1; i < ClanDeclareMode.Max; i++) { if (null != m_trans_ToggleContent) { ts = m_trans_ToggleContent.Find(i.ToString()); if (null == ts) { continue; } tab = ts.GetComponent <UITabGrid>(); if (null == tab) { tab = ts.gameObject.AddComponent <UITabGrid>(); } tab.SetGridData(i); tab.RegisterUIEventDelegate(OnGridEventDlg); m_dic_tabs.Add(i, tab); } if (null != m_trans_Content) { ts = m_trans_Content.Find(i.ToString()); if (null == ts) { continue; } m_dic_ts.Add(i, ts); } } SetMode(ClanDeclareMode.History, true); }
private void InitEquipPosWidgets() { if (null == m_dic_EquipPartDic) { m_dic_EquipPartDic = new Dictionary <EquipPartMode, UITabGrid>(); } m_dic_EquipPartDic.Clear(); StructEquipPartInlayData(); //生成装备部位 if (null != m_ctor_InlayScrollView && null != m_trans_UIEquipPosStatusGrid) { m_ctor_InlayScrollView.RefreshCheck(); m_ctor_InlayScrollView.Initialize <UIEquipPosStatusGrid>(m_trans_UIEquipPosStatusGrid.gameObject , OnUpdateInlayGrid, OnInlayGridUIEventDlg); } //列表 if (null == m_dic_EquipPartDic) { m_dic_EquipPartDic = new Dictionary <EquipPartMode, UITabGrid>(); } m_dic_EquipPartDic.Clear(); if (null == m_trans_PartTab) { Engine.Utility.Log.Error("ForgingPanel->InitForgingWidgets failed Transform ListTab null"); } else { UITabGrid tabGrid = null; Transform ts = null; for (EquipPartMode i = EquipPartMode.AttackPart; i < EquipPartMode.Max; i++) { ts = m_trans_PartTab.Find(i.ToString() + "Tab"); if (null == ts) { continue; } tabGrid = ts.GetComponent <UITabGrid>(); if (null == tabGrid) { tabGrid = ts.gameObject.AddComponent <UITabGrid>(); } tabGrid.SetGridData(i); tabGrid.RegisterUIEventDelegate(OnUIEventCallback); tabGrid.SetName(GetEquipPartModeName(i)); tabGrid.SetHightLight(false); m_dic_EquipPartDic.Add(i, tabGrid); } } RefreshAllTab(); }
/// <summary> /// 初始化仓库 /// </summary> private void InitWareHouse() { if (IsInitMode(KnapsackStatus.WareHouse)) { return; } SetInitMode(KnapsackStatus.WareHouse); Transform ts = null; UITabGrid tab = null; m_dic_wareHouseTabs = new Dictionary <GameCmd.PACKAGETYPE, UITabGrid>(); if (null != m_trans_WareHouseContent) { for (GameCmd.PACKAGETYPE i = GameCmd.PACKAGETYPE.PACKAGETYPE_STORE1; i <= GameCmd.PACKAGETYPE.PACKAGETYPE_STORE3; i++) { ts = m_trans_WareHouseContent.Find(GetWareHouseTabNameByStore(i)); if (null == ts) { continue; } tab = ts.GetComponent <UITabGrid>(); if (null == tab) { tab = ts.gameObject.AddComponent <UITabGrid>(); } if (null != tab) { tab.SetGridData(i); tab.RegisterUIEventDelegate(OnWareHouseGridUIEvent); tab.SetHightLight(false); m_dic_wareHouseTabs.Add(i, tab); } } } wareHouseItems = new List <uint>(); if (null != m_ctor_WareHouseItemGridScrollView && null != m_trans_UIItemGrid) { GameObject wareHosueGridClone = UIManager.GetResGameObj(GridID.Uiitemgrid) as GameObject; m_ctor_WareHouseItemGridScrollView.RefreshCheck(); //m_ctor_WareHouseItemGridScrollView.Initialize<UIItemGrid>((uint)GridID.Uiitemgrid // , UIManager.OnObjsCreate, UIManager.OnObjsRelease // , OnWareHouseGridDataUpdate, OnWareHouseGridUIEvent); m_ctor_WareHouseItemGridScrollView.Initialize <UIItemGrid>(m_trans_UIItemGrid.gameObject , OnWareHouseGridDataUpdate, OnWareHouseGridUIEvent); } }
/// <summary> /// 非自动添加的页签初始化 /// </summary> /// <param name="tabTrans">页签的Transform</param> /// <param name="nTabType">页签的类型</param> /// <param name="nindex">页签索引</param> public void InitTabGrids(Transform tabTrans, int nTabType, int nindex, string strName = "") { Dictionary <int, UITabGrid> dicTabs = null; if (!dicUITabGrid.TryGetValue(nTabType, out dicTabs)) { dicTabs = new Dictionary <int, UITabGrid>(6); dicUITabGrid.Add(nTabType, dicTabs); } UITabGrid tab = tabTrans.GetComponent <UITabGrid>(); if (tab == null) { tab = tabTrans.gameObject.AddComponent <UITabGrid>(); } if (tab != null) { tab.TabID = nindex; tab.TabType = nTabType; dicTabs[tab.TabID] = tab; if (!string.IsNullOrEmpty(strName)) { tab.SetName(strName); } tab.SetHightLight(false); tab.RegisterUIEventDelegate((eventType, data, param) => { switch (eventType) { case UIEventType.Click: if (data is UITabGrid) { UITabGrid tabGRid = data as UITabGrid; UIPanelBase panelbase = this as UIPanelBase; UIFrameManager.Instance.OnCilckTogglePanel(ref panelbase, tabGRid.TabType, tabGRid.TabID); } break; default: break; } }); } }
private void InitWidgets() { m_mgr = DataManager.Manager <ClanManger>(); m_dic_Toggles = new Dictionary <ClanCreateMode, UITabGrid>(); m_dic_trans = new Dictionary <ClanCreateMode, Transform>(); Transform ts = null; UITabGrid tab = null; for (ClanCreateMode i = ClanCreateMode.None; i < ClanCreateMode.Max; i++) { if (null != m_trans_FunctioToggles) { ts = m_trans_FunctioToggles.Find(i.ToString()); if (null != ts) { tab = ts.GetComponent <UITabGrid>(); if (null == tab) { tab = ts.gameObject.AddComponent <UITabGrid>(); } if (null != tab) { tab.SetGridData(i); tab.SetHightLight(false); tab.RegisterUIEventDelegate(OnUIGridEventDlg); m_dic_Toggles.Add(i, tab); } } } if (null != m_trans_FucContent) { ts = m_trans_FucContent.Find(i.ToString()); if (null == ts) { continue; } m_dic_trans.Add(i, ts); } } }
private void AddTab(UIPanelBase panelBase) { if (rightTabs == null) { return; } rightTabs.transform.parent = panelBase.transform; rightTabs.transform.localPosition = Vector3.zero; rightTabs.SetActive(true); //清空功能页签 m_dicTabFunc.Clear(); int index = 1; Dictionary <int, UITabGrid> dicTabs = null; if (!panelBase.dicUITabGrid.TryGetValue(index, out dicTabs)) { dicTabs = new Dictionary <int, UITabGrid>(6); panelBase.dicUITabGrid.Add(index, dicTabs); } dicTabs.Clear(); UITabGrid grid = null; List <UIPanelManager.PanelTabData.PanelTabUnit> tabUnitDatas = panelBase.PanelInfo.PanelTaData.GetTabUnitList(); UIPanelManager.PanelTabData.PanelTabUnit tabUnit = null; List <int> activeTabIndex = new List <int>(); bool tabFuncOpen = false; for (int i = 0; i < panelBase.PanelInfo.PanelTaData.Count; i++) { tabUnit = tabUnitDatas[i]; grid = m_lstTabGrid[tabUnit.PosIndex]; if (grid == null) { continue; } if (!activeTabIndex.Contains(tabUnit.PosIndex)) { activeTabIndex.Add(tabUnit.PosIndex); } //grid.transform.parent = root; grid.gameObject.SetActive(true); // grid.transform.localPosition = new UnityEngine.Vector3(0, -i * 93, 0); grid.SetHightLight(false); grid.TabID = tabUnit.EnumValue; grid.TabType = index; grid.SetName(tabUnit.EnumName); dicTabs.Add(grid.TabID, grid); grid.SetRedPointStatus(false); grid.SetSoundEffectType(ButtonPlay.ButtonSountEffectType.FuncTabFirst); tabFuncOpen = DataManager.Manager <GuideManager>().IsTabFuncOpen(tabUnit.FuncID); grid.SetOpenStatus(tabFuncOpen); grid.gameObject.name = tabUnit.ObjName; if (!tabFuncOpen && tabUnit.FuncID != 0 && !m_dicTabFunc.ContainsKey(tabUnit.FuncID)) { m_dicTabFunc.Add(tabUnit.FuncID, grid); } grid.RegisterUIEventDelegate((eventType, data, param) => { switch (eventType) { case UIEventType.Click: if (data is UITabGrid) { UITabGrid tabGRid = data as UITabGrid; OnCilckTogglePanel(ref panelBase, grid.TabType, tabGRid.TabID); } break; default: break; } }); } coudsss++; for (int j = 0; j < m_lstTabGrid.Count; j++) { if (!activeTabIndex.Contains(j)) { m_lstTabGrid[j].gameObject.SetActive(false); } } }
private void InitProccessWidgets() { if (IsInitStatus(ForgingPanelMode.Proccess)) { return; } SetInitStatus(ForgingPanelMode.Proccess, true); //装备 GameObject preObj = UIManager.GetResGameObj(GridID.Uiitemgrowshowgrid) as GameObject; if (null != preObj) { GameObject cloneObj = null; if (null != m_trans_ProcessInfoRoot && null == m_processGrowShow) { cloneObj = NGUITools.AddChild(m_trans_ProcessInfoRoot.gameObject, preObj); if (null != cloneObj) { m_processGrowShow = cloneObj.GetComponent <UIItemGrowShowGrid>(); if (null == m_processGrowShow) { m_processGrowShow = cloneObj.AddComponent <UIItemGrowShowGrid>(); } m_processGrowShow.RegisterUIEventDelegate(OnUIEventCallback); } } preObj = UIManager.GetResGameObj(GridID.Uiproccessgrid) as GameObject; if (null != m_trans_ProcessCostRoot && null == m_processRsGrowShow) { cloneObj = NGUITools.AddChild(m_trans_ProcessCostRoot.gameObject, preObj); if (null != cloneObj) { m_processRsGrowShow = cloneObj.GetComponent <UIProccessGrid>(); if (null == m_processRsGrowShow) { m_processRsGrowShow = cloneObj.AddComponent <UIProccessGrid>(); } m_processRsGrowShow.RegisterUIEventDelegate((eventType, data, param) => { if (eventType == UIEventType.Click) { if (data is UIItemInfoGrid) { UIItemInfoGrid infoGrid = data as UIItemInfoGrid; if (null != infoGrid && infoGrid.NotEnough && null != param && param is uint) { ShowItemGet((uint)param); } } else if (data is UIProccessGrid) { if (IsPanelMode(ForgingPanelMode.Proccess)) { if (!IsProccessMode(ForgingProccessMode.Fetch)) { if (null != param) { m_uint_selectRSBaseId = 0; m_processRsGrowShow.SetGridData(m_uint_selectRSBaseId, needUnload: true); } else { OnSelectProcessRuneStone(); } } } } } }); } } } if (null == m_dic_fpTabs) { m_dic_fpTabs = new Dictionary <ForgingProccessMode, UITabGrid>(); } m_dic_fpTabs.Clear(); Transform ts = null; if (null != m_trans_ProcessTabs) { UITabGrid tGrid = null; for (ForgingProccessMode i = ForgingProccessMode.Promote; i < ForgingProccessMode.Max; i++) { ts = m_trans_ProcessTabs.Find(i.ToString() + "Tab"); if (null == ts) { continue; } tGrid = ts.GetComponent <UITabGrid>(); if (null == tGrid) { tGrid = ts.gameObject.AddComponent <UITabGrid>(); } tGrid.SetGridData(i); tGrid.RegisterUIEventDelegate(OnUIEventCallback); tGrid.SetHightLight(false); m_dic_fpTabs.Add(i, tGrid); } } if (null == m_dic_propCurGrids) { m_dic_propCurGrids = new Dictionary <ForgingProccessPropertyIndex, UIEquipPropertyGrid>(); } m_dic_propCurGrids.Clear(); if (null == m_dic_propNextGrids) { m_dic_propNextGrids = new Dictionary <ForgingProccessPropertyIndex, UIEquipPropertyGrid>(); } m_dic_propNextGrids.Clear(); if (null == m_dic_propCBs) { m_dic_propCBs = new Dictionary <ForgingProccessPropertyIndex, UIToggle>(); } m_dic_propCBs.Clear(); UIEquipPropertyGrid uPGrid = null; UIToggle toggle = null; //属性格子 for (ForgingProccessPropertyIndex i = ForgingProccessPropertyIndex.One ; i < ForgingProccessPropertyIndex.Max; i++) { if (null != m_trans_ProccessPropertyContentRoot) { //Cur ts = Util.findTransform(m_trans_ProccessPropertyContentRoot, i.ToString() + "CPP"); if (null != ts) { uPGrid = ts.GetComponent <UIEquipPropertyGrid>(); if (null == uPGrid) { uPGrid = ts.gameObject.AddComponent <UIEquipPropertyGrid>(); } m_dic_propCurGrids.Add(i, uPGrid); } //Nex ts = Util.findTransform(m_trans_ProccessPropertyContentRoot, i.ToString() + "NPP"); if (null != ts) { uPGrid = ts.GetComponent <UIEquipPropertyGrid>(); if (null == uPGrid) { uPGrid = ts.gameObject.AddComponent <UIEquipPropertyGrid>(); } m_dic_propNextGrids.Add(i, uPGrid); } //CheckBox ts = Util.findTransform(m_trans_ProccessPropertyContentRoot, i.ToString() + "CB"); if (null != ts) { toggle = ts.GetComponent <UIToggle>(); if (null == uPGrid) { toggle = ts.gameObject.AddComponent <UIToggle>(); } m_dic_propCBs.Add(i, toggle); } } } SetProccessMode(ForgingProccessMode.Promote, true); //InitPromote(); //InitRemove(); //InitFetch(); }
private void InitMember() { if (!IsInitMode(ClanPanelMode.Member)) { m_dic_clanMemberTabs = new Dictionary <ClanMemberMode, UITabGrid>(); UITabGrid tabGrid = null; if (null != m_trans_MemberTab) { tabGrid = m_trans_MemberTab.GetComponent <UITabGrid>(); if (null == tabGrid) { tabGrid = m_trans_MemberTab.gameObject.AddComponent <UITabGrid>(); } tabGrid.SetDepth(5); tabGrid.SetHightLight(false); tabGrid.RegisterUIEventDelegate((eventType, data, param) => { if (eventType == UIEventType.Click) { SetMemberMode(ClanMemberMode.Member); } }); } m_dic_clanMemberTabs.Add(ClanMemberMode.Member, tabGrid); if (null != m_trans_ApplyTab) { tabGrid = m_trans_ApplyTab.GetComponent <UITabGrid>(); if (null == tabGrid) { tabGrid = m_trans_ApplyTab.gameObject.AddComponent <UITabGrid>(); } tabGrid.SetDepth(4); tabGrid.RegisterUIEventDelegate((eventType, data, param) => { if (eventType == UIEventType.Click) { SetMemberMode(ClanMemberMode.Apply); } }); tabGrid.SetHightLight(false); } m_dic_clanMemberTabs.Add(ClanMemberMode.Apply, tabGrid); if (null != m_trans_EventTab) { tabGrid = m_trans_EventTab.GetComponent <UITabGrid>(); if (null == tabGrid) { tabGrid = m_trans_EventTab.gameObject.AddComponent <UITabGrid>(); } tabGrid.SetDepth(4); tabGrid.RegisterUIEventDelegate((eventType, data, param) => { if (eventType == UIEventType.Click) { SetMemberMode(ClanMemberMode.Event); } }); tabGrid.SetHightLight(false); } m_dic_clanMemberTabs.Add(ClanMemberMode.Event, tabGrid); SetInitMode(ClanPanelMode.Member); } if (!IsInitMode(ClanMemberMode.Member) && m_em_clanMemberMode == ClanMemberMode.Member) { SetInitMode(ClanMemberMode.Member); if (null != m_trans_MemberScrollView && null == m_memberCreator) { m_memberCreator = m_trans_MemberScrollView.gameObject.AddComponent <UIGridCreatorBase>(); GameObject obj = m_trans_UIClanMemberGrid.gameObject; m_memberCreator.arrageMent = UIGridCreatorBase.Arrangement.Vertical; m_memberCreator.gridContentOffset = new UnityEngine.Vector2(0, 170); m_memberCreator.gridWidth = 1066; m_memberCreator.gridHeight = 64; m_memberCreator.RefreshCheck(); m_memberCreator.Initialize <UIClanMemberGrid>(obj, OnUpdateUIGrid, OnUIGridEventDlg); } } if (!IsInitMode(ClanMemberMode.Apply) && m_em_clanMemberMode == ClanMemberMode.Apply) { SetInitMode(ClanMemberMode.Apply); if (null != m_trans_MemberApplyScrollView && null == m_applyCreator) { m_applyCreator = m_trans_MemberApplyScrollView.gameObject.AddComponent <UIGridCreatorBase>(); GameObject obj = m_trans_UIClanApplyGrid.gameObject; m_applyCreator.arrageMent = UIGridCreatorBase.Arrangement.Vertical; m_applyCreator.gridContentOffset = new UnityEngine.Vector2(0, 170); m_applyCreator.gridWidth = 1066; m_applyCreator.gridHeight = 71; m_applyCreator.RefreshCheck(); m_applyCreator.Initialize <UIClanApplyGrid>(obj, OnUpdateUIGrid, OnUIGridEventDlg); } } ////请求申请列表 //GetClanApplyInfoList(); if (null != m_trans_MemmberInviteContent && m_trans_MemmberInviteContent.gameObject.activeSelf) { m_trans_MemmberInviteContent.gameObject.SetActive(false); } }
private void InitSkill() { if (IsInitMode(ClanPanelMode.Skill)) { return; } SetInitMode(ClanPanelMode.Skill); if (null != m_ctor_SkillScrollView) { m_ctor_SkillScrollView.RefreshCheck(); m_ctor_SkillScrollView.Initialize <UIClanSkillGrid>(m_trans_UIClanSkillGrid.gameObject, OnUpdateUIGrid, OnUIGridEventDlg); } UITabGrid tabGrid = null; if (null != m_trans_TabSkillLearn) { tabGrid = m_trans_TabSkillLearn.GetComponent <UITabGrid>(); if (null == tabGrid) { tabGrid = m_trans_TabSkillLearn.gameObject.AddComponent <UITabGrid>(); tabGrid.RegisterUIEventDelegate((eventType, data, param) => { if (eventType == UIEventType.Click) { SetSkillMode(ClanSkillMode.Learn); } }); m_dic_skillTabs.Add(ClanSkillMode.Learn, tabGrid); } } if (null != m_trans_TabSkillDev) { tabGrid = m_trans_TabSkillDev.GetComponent <UITabGrid>(); if (null == tabGrid) { tabGrid = m_trans_TabSkillDev.gameObject.AddComponent <UITabGrid>(); tabGrid.RegisterUIEventDelegate((eventType, data, param) => { if (eventType == UIEventType.Click) { SetSkillMode(ClanSkillMode.Dev); } }); m_dic_skillTabs.Add(ClanSkillMode.Dev, tabGrid); } } UICurrencyGrid cGrid = null; if (null != m_trans_SkillCost1) { cGrid = m_trans_SkillCost1.GetComponent <UICurrencyGrid>(); if (null == cGrid) { m_trans_SkillCost1.gameObject.AddComponent <UICurrencyGrid>(); } } if (null != m_trans_SkillCost2) { cGrid = m_trans_SkillCost2.GetComponent <UICurrencyGrid>(); if (null == cGrid) { m_trans_SkillCost2.gameObject.AddComponent <UICurrencyGrid>(); } } }