/// <summary> /// 设置活动标签 /// </summary> /// <param name="tabId"></param> public void SetActiveTab(int tabId, bool force = false) { if (tabId == activeTabId && !force) { return; } if (null != m_ctor_CategoryTagContent) { if (m_lst_mallTabDatas == null) { StructTabData(); } UITabGrid grid = m_ctor_CategoryTagContent.GetGrid <UITabGrid>(m_lst_mallTabDatas.IndexOf(activeTabId)); if (null != grid) { grid.SetHightLight(false); } grid = m_ctor_CategoryTagContent.GetGrid <UITabGrid>(m_lst_mallTabDatas.IndexOf(tabId)); if (null != grid) { grid.SetHightLight(true); } } activeTabId = tabId; //手动设置二级页签 dicActiveTabGrid[2] = tabId; CreateMallUIList(); }
/// <summary> /// 设置活动标签 /// </summary> /// <param name="tabId"></param> public void SetActiveTab(int tabId, bool force = false, bool needFocus = false) { if (tabId == mActiveSecondTab && !force) { return; } if (null != m_ctor_CategoryTagContent) { UITabGrid grid = m_ctor_CategoryTagContent.GetGrid <UITabGrid>(m_lst_mallTabDatas.IndexOf(mActiveSecondTab)); if (null != grid) { grid.SetHightLight(false); } grid = m_ctor_CategoryTagContent.GetGrid <UITabGrid>(m_lst_mallTabDatas.IndexOf(tabId)); if (null != grid) { grid.SetHightLight(true); } if (needFocus) { m_ctor_CategoryTagContent.FocusGrid(m_lst_mallTabDatas.IndexOf(tabId)); } } mActiveSecondTab = tabId; //手动设置二级页签 dicActiveTabGrid[2] = tabId; CreateMallUIList(); }
/// <summary> /// 设置页签状态 /// </summary> /// <param name="status">页签状态</param> /// <param name="force">是否强制更新</param> private void SetStatus(MuhonPanel.TabMode status, bool force = false) { SetEvolvePre(false); if (this.status == status && !force) { return; } if (this.status == TabMode.JinHua) { ResetEvolveAnim(); } ResetAutoUseDQ(); ResetModulesStatus(); if (null != m_dic_tabs) { UITabGrid tab = null; if (m_dic_tabs.TryGetValue(this.status, out tab)) { tab.SetHightLight(false); } if (m_dic_tabs.TryGetValue(status, out tab)) { tab.SetHightLight(true); } } this.status = status; UpdateWidgetsVisbleStatus(); if (!IsMuhonListEmpty()) { InitStatusdWidgets(); UpdateDataUIByStatus(); } }
/// <summary> /// /// </summary> /// <param name="mode"></param> /// <param name="force"></param> private void SetMode(ClanDeclareMode mode, bool force = false) { if (m_em_cur == mode && !force) { return; } UITabGrid tabGrid = null; if (null != m_dic_tabs && m_dic_tabs.TryGetValue(m_em_cur, out tabGrid)) { tabGrid.SetHightLight(false); } if (null != m_dic_tabs && m_dic_tabs.TryGetValue(mode, out tabGrid)) { tabGrid.SetHightLight(true); } m_em_cur = mode; UpdateVisibleWidgets(); if (mode == ClanDeclareMode.History) { BuildHistoryList(); } else if (mode == ClanDeclareMode.Search) { ClearSearchInfo(); } }
void SelectTab(int tabID, bool force = false) { if (m_ctor_TreasureTypeRoot == null) { return; } if (previousTab == tabID && force) { return; } //--------------------------------------------- UITabGrid tabGrid = m_ctor_TreasureTypeRoot.GetGrid <UITabGrid>((int)previousTab - 1 > 0 ? (int)previousTab - 1 : 0); if (tabGrid != null) { tabGrid.SetHightLight(false); } tabGrid = m_ctor_TreasureTypeRoot.GetGrid <UITabGrid>((int)tabID - 1 > 0 ? (int)tabID - 1 : 0); if (tabGrid != null) { tabGrid.SetHightLight(true); } CreateLeftList(tabID); previousTab = tabID; }
/// <summary> /// 设置当前面板模式 /// </summary> /// <param name="mode"></param> private void SetMode(ClanPanelMode mode, bool force = false) { if (mode == panelMode && !force) { return; } if (null != m_dic_clanPanlTabs) { UITabGrid tab = null; if (m_dic_clanPanlTabs.TryGetValue(panelMode, out tab)) { tab.SetHightLight(false); } if (m_dic_clanPanlTabs.TryGetValue(mode, out tab)) { tab.SetHightLight(true); } } panelMode = mode; UpdatePanelWidgetsVisibleStatus(); InitVisbileWidgets(); BuildModeData(); UpdatePanel(); SetApplyRedPoint(); }
/// <summary> /// 设置活动标签 /// </summary> /// <param name="tabId"></param> public void SetActiveTab(int tabId, bool force = false, bool needFocus = false) { if (tabId == mActiveSecondTab && !force) { return; } if (null != m_ctor_CategoryTagContent) { UITabGrid grid = m_ctor_CategoryTagContent.GetGrid <UITabGrid>(m_lst_mallTabDatas.IndexOf(mActiveSecondTab)); if (null != grid) { grid.SetHightLight(false); } grid = m_ctor_CategoryTagContent.GetGrid <UITabGrid>(m_lst_mallTabDatas.IndexOf(tabId)); if (null != grid) { grid.SetHightLight(true); } if (needFocus) { m_ctor_CategoryTagContent.FocusGrid(m_lst_mallTabDatas.IndexOf(tabId)); } } mActiveSecondTab = tabId; //手动设置二级页签 dicActiveTabGrid[2] = tabId; //皇令 if (memActiveFirstTab == TabMode.HuangLing) { m_trans_HuangLing.gameObject.SetActive(true); m_trans_Mall.gameObject.SetActive(false); m_trans_Recharge.gameObject.SetActive(false); m_label_TipsLabel.text = DataManager.Manager <TextManager>().GetLocalText(LocalTextType.Local_TXT_Noble_1); CreateNobleGrids(); } //充值 else if (memActiveFirstTab == TabMode.ChongZhi) { m_trans_HuangLing.gameObject.SetActive(false); m_trans_Mall.gameObject.SetActive(false); m_trans_Recharge.gameObject.SetActive(true); CreateRechargeGrids(); } //商城相关 else { m_trans_HuangLing.gameObject.SetActive(false); m_trans_Mall.gameObject.SetActive(true); m_trans_Recharge.gameObject.SetActive(false); CreateMallUIList(); } }
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 OnGridUpdate(UIGridBase gridBase, int index) { if (gridBase is UITabGrid) { UITabGrid tGrid = gridBase as UITabGrid; Category c = null; if (category.TryGetCategory(selectfTabID, out c)) { Category s = c.ChildCategoryData[index]; tGrid.SetGridData(s.Id); tGrid.SetName(s.Name, 3); tGrid.SetHightLight(s.Id == selectsTabID); } } else if (gridBase is UIExchangeGrid) { UIExchangeGrid eGrid = gridBase as UIExchangeGrid; Category f = null; Category s = null; if (category.TryGetCategory(selectfTabID, out f) && f.TryGetCategory(selectsTabID, out s)) { eGrid.SetGridData(s.Datas[index]); eGrid.SetHightLight(s.Datas[index] == selectExchangeId); } } }
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); } } } }
void OnUpdataGridData(UIGridBase grid, int index) { if (grid is UIDeliverGrid) { UIDeliverGrid tab = grid as UIDeliverGrid; if (index < m_lstTransfers.Count) { tab.SetGridData(index); tab.SetData(m_lstTransfers[index]); } } if (grid is UITabGrid) { UITabGrid tab = grid as UITabGrid; if (index < m_lst_TabType.Count) { tab.SetGridData(index); if (m_dic_TabName.ContainsKey(m_lst_TabType[index])) { tab.SetName(m_dic_TabName[m_lst_TabType[index]]); } tab.SetHightLight(index == activedIndex); } } }
/// <summary> /// 设置二级活动页签 /// </summary> /// <param name="tabID"></param> /// <param name="force"></param> /// <param name="focus"></param> private void SetSecondActiveTab(uint tabID, bool force = false, bool focus = false) { if (selectsTabID == tabID && !force) { return; } Category f = null; if (category.TryGetCategory(selectfTabID, out f)) { Category cur = null; Category next = null; if (f.TryGetCategory(tabID, out next)) { int index = 0; UITabGrid tabGrid = null; if (f.TryGetCategory(selectsTabID, out cur)) { index = f.ChildCategoryData.IndexOf(cur); tabGrid = m_ctor_CategoryTagContent.GetGrid <UITabGrid>(index); if (null != tabGrid) { tabGrid.SetHightLight(false); } } index = f.ChildCategoryData.IndexOf(next); tabGrid = m_ctor_CategoryTagContent.GetGrid <UITabGrid>(index); if (null != tabGrid) { tabGrid.SetHightLight(true); } selectsTabID = tabID; if (focus) { m_ctor_CategoryTagContent.FocusGrid(index); } m_ctor_ExchangeScrollView.CreateGrids(next.Datas.Count); if (next.Datas.Count > 0) { SetSelectId(next.Datas[0], force, focus); } } } }
/// <summary> /// 选中的页签 /// </summary> /// <param name="id"></param> void SetSelectTab(uint id) { UITabGrid grid = m_tabGridCreator.GetGrid <UITabGrid>(m_lstHomeTradeTab.IndexOf(m_nSelectTabId)); if (grid != null) { grid.SetHightLight(false); } grid = m_tabGridCreator.GetGrid <UITabGrid>(m_lstHomeTradeTab.IndexOf(id)); if (grid != null) { grid.SetHightLight(true); } m_nSelectTabId = id; CreateMallUIList(); }
void SetActiveTab(int tabID, uint monsterID = 0, bool needFocus = true) { if (null != m_ctor_HuntingTypeRoot) { UITabGrid tabGrid = m_ctor_HuntingTypeRoot.GetGrid <UITabGrid>((int)selecttype - 1 > 0 ? (int)selecttype - 1 : 0); if (tabGrid != null) { tabGrid.SetHightLight(false); } tabGrid = m_ctor_HuntingTypeRoot.GetGrid <UITabGrid>((int)tabID - 1 > 0 ? (int)tabID - 1 : 0); if (tabGrid != null) { tabGrid.SetHightLight(true); } CreateHuntingUIList(tabID, monsterID, needFocus); selecttype = tabID; uint HuntingScore = DataManager.Manager <DailyManager>().DayHuntingCoin; m_label_LieHunLabel.text = string.Format("{0}/{1}", HuntingScore, dm.HuntingCoinLimit); } }
/// <summary> /// 设置当前部位模式 /// </summary> /// <param name="mode"></param> /// <param name="force"></param> private void SetSelectEquipPartMode(EquipPartMode mode, bool force = false, bool defaultSelectData = true) { if (m_emEquipPartMode == mode && !force) { return; } UITabGrid tabGrid = null; if (null != m_dic_EquipPartDic && m_dic_EquipPartDic.TryGetValue(m_emEquipPartMode, out tabGrid)) { tabGrid.SetHightLight(false); } if (null != m_dic_EquipPartDic && m_dic_EquipPartDic.TryGetValue(mode, out tabGrid)) { tabGrid.SetHightLight(true); } m_emEquipPartMode = mode; BuildEquipPartList(defaultSelectData); }
private void SetMemberModeEnable(ClanMemberMode mode, bool visible) { UITabGrid grid = (m_dic_clanMemberTabs.ContainsKey(m_em_clanMemberMode)) ? m_dic_clanMemberTabs[m_em_clanMemberMode] : null; if (null != grid) { grid.SetHightLight(visible); } SetMemberModeWidgetVisble(mode, visible); }
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(); }
void SetSelectTab(int index, bool force = false) { if (index == activedIndex && !force || isNpcTransfer) { return; } UITabGrid tab = m_ctor_Right.GetGrid <UITabGrid>(activedIndex); if (tab != null) { tab.SetHightLight(false); } activedIndex = index; tab = m_ctor_Right.GetGrid <UITabGrid>(index); if (tab != null) { tab.SetHightLight(true); } StructDatas(); m_ctor_ScrollView.CreateGrids(m_lstTransfers.Count); }
/// <summary> /// 设置锻造加工模式 /// </summary> /// <param name="mode"></param> private void SetProccessMode(ForgingProccessMode mode, bool force = false) { if (this.m_em_fpm == mode && !force) { return; } UITabGrid grid = null; if (null != m_dic_fpTabs && m_dic_fpTabs.TryGetValue(m_em_fpm, out grid)) { grid.SetHightLight(false); } this.m_em_fpm = mode; if (null != m_dic_fpTabs && m_dic_fpTabs.TryGetValue(m_em_fpm, out grid)) { grid.SetHightLight(true); } ResetProccess(); UpdateProccess(Data); }
/// <summary> /// 设置一级活动页签 /// </summary> /// <param name="tabID"></param> /// <param name="force"></param> private void SetFirstActiveTab(uint tabID, bool force = false) { if (selectfTabID == tabID && !force) { return; } Category next = null; if (category.TryGetCategory(tabID, out next)) { Category cur = null; int index = 0; UITabGrid tabGrid = null; if (category.TryGetCategory(selectfTabID, out cur)) { index = category.ChildCategoryData.IndexOf(cur); tabGrid = m_ctor_RightTabRoot.GetGrid <UITabGrid>(index); if (null != tabGrid) { tabGrid.SetHightLight(false); } } index = category.ChildCategoryData.IndexOf(next); tabGrid = m_ctor_RightTabRoot.GetGrid <UITabGrid>(index); if (null != tabGrid) { tabGrid.SetHightLight(true); } selectfTabID = tabID; if (next.ChildCategoryData.Count > 0) { m_ctor_CategoryTagContent.CreateGrids(next.ChildCategoryData.Count); SetSecondActiveTab(next.ChildCategoryData[0].Id, force: true); } } }
void SetActiveDailyTab(DailyDataType type) { if (m_ctor_TabRoot != null) { UITabGrid tabGrid = m_ctor_TabRoot.GetGrid <UITabGrid>(m_listDataType.IndexOf(curDailyType)); if (tabGrid != null) { tabGrid.SetHightLight(false); } tabGrid = m_ctor_TabRoot.GetGrid <UITabGrid>(m_listDataType.IndexOf(type)); if (tabGrid != null) { tabGrid.SetHightLight(true); } m_trans_DailyNormalRoot.gameObject.SetActive(type != DailyDataType.ZhouLi); m_trans_CalendarPage.gameObject.SetActive(type == DailyDataType.ZhouLi); curDailyType = type; switch (type) { case DailyDataType.RiChangHuoDong: CreateDailyUIList(); break; case DailyDataType.XianShiHuoDong: CreateDailyUIList(); break; case DailyDataType.JiJiangKaiShi: CreateDailyUIList(); break; case DailyDataType.ZhouLi: InitCalendarCreators(); break; } } //面板状态改变 OnPanelStateChanged(); }
void ShowLeftBtnHigh(PetSkillType st) { foreach (var dic in m_leftBtnDic) { Transform btn = m_leftBtnDic[st]; if (btn != null) { UITabGrid tog = btn.GetComponent <UITabGrid>(); if (tog != null) { if (st == dic.Key) { tog.SetHightLight(true); } else { tog.SetHightLight(false); } } } } }
/// <summary> /// 设置模式 /// </summary> /// <param name="mode"></param> private void SetSkillMode(ClanSkillMode mode) { if (mode != m_em_skillMode) { UITabGrid tab = (m_dic_skillTabs.ContainsKey(m_em_skillMode) ? m_dic_skillTabs[m_em_skillMode] : null); if (null != tab) { tab.SetHightLight(false); } m_em_skillMode = mode; tab = (m_dic_skillTabs.ContainsKey(m_em_skillMode) ? m_dic_skillTabs[m_em_skillMode] : null); if (null != tab) { tab.SetHightLight(true); } StructClanSkillsData(); BuildClanSkillList(); UpdateSkill(); } }
/// <summary> /// 商城格子数据刷新 /// </summary> /// <param name="grid"></param> /// <param name="index"></param> private void OnUpdateMallGridData(UIGridBase grid, int index) { if (grid is UITabGrid) { if (index > DailyTabValues.Count) { Engine.Utility.Log.Error("DailyPanel OnUpdateMallGridData faield,mallTabDic data errir"); return; } UITabGrid tabGrid = grid as UITabGrid; tabGrid.SetName(DailyTabValues[index]); tabGrid.SetHightLight(activeTabId == index ? true : false); tabGrid.SetGridData(index); } else if (grid is UIDailyGrid) { DailyDataBase data = dailyDataList[index]; if (DataManager.Manager <DailyManager>().ActiveDic.ContainsKey(data.id)) { LivenessData list = DataManager.Manager <DailyManager>().ActiveDic[data.id]; if (data != null && list != null) { UIDailyGrid dailyGrid = grid as UIDailyGrid; dailyGrid.SetDailyData(data, list); dailyGrid.SetSelect(index == m_lstDailyID.IndexOf(selectDailyId)); dailyGrid.onClickDailyGrid = onClickDailyGrid; } } } else if (grid is UIDailyCalendarGrid) { UIDailyCalendarGrid data = grid as UIDailyCalendarGrid; if (data != null) { data.SetGridData(dailyIDs[index]); data.SetBg(todayIsMatch); } } else if (grid is UIDailyRewardGrid) { UIDailyRewardGrid data = grid as UIDailyRewardGrid; if (data != null) { if (index < m_lstRewardID.Count) { data.SetGridData(m_lstRewardID[index]); } } } }
/// <summary> /// 设置活动标签 /// </summary> /// <param name="tabId"></param> public void SetActiveTab(int tabId, bool force = false) { if (tabId == activeTabId && !force) { return; } if (null != m_ctor_CarryShopTabScrollView) { UITabGrid grid = m_ctor_CarryShopTabScrollView.GetGrid <UITabGrid>(m_lst_shoptabs.IndexOf(activeTabId)); if (null != grid) { grid.SetHightLight(false); } grid = m_ctor_CarryShopTabScrollView.GetGrid <UITabGrid>(m_lst_shoptabs.IndexOf(tabId)); if (null != grid) { grid.SetHightLight(true); } } activeTabId = tabId; CreateCarryShopUIList(); }
/// <summary> /// 更新功能toggle可视状态 /// </summary> private void UpdateMuhonToggleVisible() { UITabGrid tabGrid = null; bool visible = false; for (TabMode i = TabMode.ShengJi; i < TabMode.Max; i++) { visible = IsStatus(i); if (null != m_dic_tabs && m_dic_tabs.TryGetValue(i, out tabGrid)) { tabGrid.SetHightLight(visible); } } }
public void SetHighLight(UITabGrid tab) { foreach (var dic in m_dicGroup) { if (dic.Value == tab) { tab.SetHightLight(true); } else { dic.Value.SetHightLight(false); } } }
/// <summary> /// 单元格刷新委托 /// </summary> /// <param name="gridBase"></param> /// <param name="index"></param> private void OnUIGridUpdate(UIGridBase grid, int index) { if (grid is UITabGrid) { UITabGrid tab = grid as UITabGrid; tab.SetGridData((ConsignmentItemMode)(index + 1)); tab.SetName(tabNames[index]); if (previous == null && index == 0) { tab.SetHightLight(true); previous = tab; } } }
/// <summary> /// 设置当前面板的功能模式 /// </summary> /// <param name="mode"></param> private void SetPanelMode(PropPanelMode mode, bool force = false) { if (m_em_panelMode == mode && !force) { return; } UITabGrid tab = null; if (null != m_dic_panelTab && m_dic_panelTab.TryGetValue(m_em_panelMode, out tab)) { tab.SetHightLight(false); } m_em_panelMode = mode; if (null != m_dic_panelTab && m_dic_panelTab.TryGetValue(m_em_panelMode, out tab)) { tab.SetHightLight(true); } UpdatePanelVisibleWidgets(); UpdatePanel(); ViewRemainTimeContent(false); }
/// <summary> /// 设置当前模式 /// </summary> /// <param name="mode"></param> private void SetMode(ClanCreateMode mode, bool force = false) { if (IsMode(mode) && !force) { return; } if (null != m_dic_Toggles) { UITabGrid tab = null; if (!IsMode(mode) && m_dic_Toggles.TryGetValue(m_em_clanCreateMode, out tab)) { tab.SetHightLight(false); } if (m_dic_Toggles.TryGetValue(mode, out tab)) { tab.SetHightLight(true); } } m_em_clanCreateMode = mode; UpdateWidgetsVisibleStatus(); InitMode(); BuildMode(); UpdateMode(); }