private void PopNavigationUI(NavigationData nd) { if (backSequence.Count > 0) { backSequence.Pop(); } if (nd.beingHidedUI == null) { return; } //显示所有的保存的UI for (int i = 0; i < nd.beingHidedUI.Count; i++) { WindowID backId = nd.beingHidedUI[i]; ShowWindowForNavigation(backId); if (i == nd.beingHidedUI.Count - 1) { UIControllerBase window = GetGameWindowFromCache(backId); if (window.UIConfigData.navigationMode == UIWindowNavigationMode.NormalNavigation) { this.lastNavigationWindow = this.curNavigationWindow; this.curNavigationWindow = window; } } } }
private void ExecuteNavigationLogic(UIControllerBase baseWindow) { WindowConfigData windowData = baseWindow.UIConfigData; //1. 是导航UI 就保存当前显示的UI后 保存他们信息 if (baseWindow.IsNavigationTypeUI) { //保存当前UI信息 PushCurrentUIInfoToStack(baseWindow); } else if (baseWindow.UIConfigData.showMode == UIWindowShowMode.HideOtherWindow) {//导航类型的UI打开也会关闭所有UI, 避免冲突. HideAllShownWindow(); } //2. 主UI就重置导航信息Stack, 主UI是所有导航的根 if (baseWindow.UIConfigData.forceClearNavigation) { Debug.Log("<color=cyan>## [进入主UI, reset the backSequenceData for the navigation system.]##</color>"); ClearBackSequence(); } else { //3. 如果一个UI经过导航,到了关卡UI, 进入战斗后战斗UI不保存导航信息, 战斗失败可以选择回到关卡UI或者装备强化UI //选择关卡UI需要继续原来的导航, 选择进入强化UI就需要清除所有的导航信息. //if( condition from config, if need to check navigation) //CheckBackSequenceData(baseWindow); } }
// Token: 0x06012673 RID: 75379 RVA: 0x004B9CC0 File Offset: 0x004B7EC0 protected void OnRankItemFill(UIControllerBase itemCtrl) { if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_OnRankItemFillUIControllerBase_hotfix != null) { this.m_OnRankItemFillUIControllerBase_hotfix.call(new object[] { this, itemCtrl }); return; } BJLuaObjHelper.IsSkipLuaHotfix = false; RankingListItemUIController rankingListItemUIController = itemCtrl as RankingListItemUIController; int itemIndex = rankingListItemUIController.GetItemIndex(); if (itemIndex >= this.m_cachedRankList.PlayerList.Count) { return; } RankingTargetPlayerInfo rankingTargetPlayerInfo = this.m_cachedRankList.PlayerList[itemIndex]; string heroName = string.Empty; if (this.m_cachedRankList.Type == RankingListType.ChampionHero) { IConfigDataLoader configDataLoader = GameManager.Instance.ConfigDataLoader as IConfigDataLoader; ConfigDataHeroInfo configDataHeroInfo = configDataLoader.GetConfigDataHeroInfo(rankingTargetPlayerInfo.PlayerInfo.ChampionHeroId); if (configDataHeroInfo != null) { heroName = configDataHeroInfo.Name; } } rankingListItemUIController.UpdateItemInfo(this.m_cachedRankList.Type, rankingTargetPlayerInfo.PlayerInfo.HeadIcon, itemIndex + 1, rankingTargetPlayerInfo.PlayerInfo.Level, rankingTargetPlayerInfo.PlayerInfo.Name, rankingTargetPlayerInfo.Score, heroName); }
public virtual void DestroyAllWindow(List <UIWindowType> exceptionList) { destoryCacheList.Clear(); if (dicWindowsCache != null) { //选择需要清理的UI, 排除exceptionList里面的类型 foreach (KeyValuePair <int, UIControllerBase> ui in dicWindowsCache) { UIControllerBase baseWindow = ui.Value; if (exceptionList != null && exceptionList.Contains(baseWindow.UIConfigData.windowType)) { continue; } destoryCacheList.Add((int)baseWindow.ID); baseWindow.DestroyWindow(); } //清理UI if (destoryCacheList.Count > 0) { for (int i = 0; i < destoryCacheList.Count; i++) { int windowsID = destoryCacheList[i]; dicWindowsCache.Remove(windowsID); if (dicShownWindows.ContainsKey(windowsID)) { dicShownWindows.Remove(windowsID); } } } backSequence.Clear(); } }
void OnBtnServerOther() { //PlayerPreferenceData.ClientLoginCount = PlayerPreferenceData.ClientLoginCount + 1; UIControllerBase <ServerChooseController> .Instance().SwitchWindow((int)ServerChooseController.Window.ServerList); ServerChooseController.Instance().hideGroundPic(); }
void Awake() { m_curDataList.Clear(); UIControllerBase <WorldBossWindow> .SetInstance(this); HuaShanPVPData.WorldBossCurPage = 1; }
public void ShowWindow(WindowID id, WindowContextDataBase showContextData = null) { UIControllerBase baseWindow = PrepareUI(id, showContextData); if (baseWindow != null) { Show(baseWindow, id, showContextData); } }
/// <summary> /// Funzione che spegne il menù corrente /// </summary> public virtual void ClearCurrentMenu() { if (currentMenu != null) { currentMenu.ToggleMenu(false); } currentMenu = null; OnCurrentMenuChange(currentMenu); }
public void EndAnimationCallback() { currentAnimPanel.Enable(true); anim.SetTrigger("GoToEmpty"); currentAnimPanel = null; currentAnimPanelCallback?.Invoke(); currentAnimPanelCallback = null; }
// Use this for initialization void Start() { //界面--状态机 uIControllerBase = new UIControllerBase(); //摄像机的控制 //cameraController = new CameraController(); //cameraController.GameStart(); //主角 }
/// <summary> /// Funzione che setta il menù corrente a quello del tipo passato eseguendo un fade. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="_fadeInTime"></param> /// <param name="_fadeOutTime"></param> /// <param name="_fadeInCallBack"></param> /// <param name="_fadeOutCallBack"></param> /// <returns></returns> public bool SetCurrentMenu <T>(float _fadeInTime = 0, float _fadeOutTime = 0, Action _fadeInCallBack = null, Action _fadeOutCallBack = null) where T : UIControllerBase { if (fadeImage == null) { return(false); } // se entrambi i tempi sono minori di zero eseguo la funzione base senza fade if (_fadeInTime <= 0 && _fadeOutTime <= 0) { return(SetCurrentMenu <T>()); } else { UIControllerBase menuToSet = GetMenu <T>(); if (menuToSet == null) { // non ho trovato il tipo del menù return(false); } else if (currentMenu != null && currentMenu.GetType() == typeof(T)) { // sto riaccendendo il menù corrente return(true); } else { // cambio effettivamente menù for (int i = 0; i < menus.Count; i++) { menus[i].ToggleMenu(false); } // lancio il fade in del pannello fadeImage.DOFade(1, _fadeInTime).OnComplete(() => { // eseguo il cambio del menù attivo currentMenu = menuToSet; currentMenu.ToggleMenu(true); OnCurrentMenuChange(currentMenu); // al completamento del fade in, se non è nulla, esegue la callback sul fade in _fadeInCallBack?.Invoke(); //lancio il fade out del pannello fadeImage.DOFade(0, _fadeOutTime).OnComplete(() => { // al completamento del fade in, se non è nulla, esegue la callback sul fade out _fadeOutCallBack?.Invoke(); }); }); return(true); } } }
// Token: 0x06000862 RID: 2146 RVA: 0x00024E94 File Offset: 0x00023094 public override void OnPointerClick(PointerEventData eventData) { if (!UIControllerBase.CheckAndUpdateCurrFrameButtonClickStateInfo()) { return; } if (this.onClick != null) { this.onClick(base.gameObject); } }
private void Show(UIControllerBase baseWindow, WindowID id, WindowContextDataBase contextData = null) { baseWindow.ShowWindow(contextData); dicShownWindows[(int)id] = baseWindow; if (baseWindow.UIConfigData.navigationMode == UIWindowNavigationMode.NormalNavigation) { lastNavigationWindow = curNavigationWindow; curNavigationWindow = baseWindow; Debug.Log("<color=magenta>### current Navigation window </color>" + baseWindow.ID.ToString()); } }
// Token: 0x06011C88 RID: 72840 RVA: 0x0049A214 File Offset: 0x00498414 protected override void OnRetryLoginButtonClicked(UIControllerBase ctrl) { if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_OnRetryLoginButtonClickedUIControllerBase_hotfix != null) { this.m_OnRetryLoginButtonClickedUIControllerBase_hotfix.call(new object[] { this, ctrl }); return; } BJLuaObjHelper.IsSkipLuaHotfix = false; base.OnRetryLoginButtonClicked(ctrl); }
/// <summary> /// Destroy all window /// </summary> public virtual void DestroyAllWindow() { if (dicWindowsCache != null) { foreach (KeyValuePair <int, UIControllerBase> ui in dicWindowsCache) { UIControllerBase baseWindow = ui.Value; baseWindow.DestroyWindow(); } dicWindowsCache.Clear(); dicShownWindows.Clear(); backSequence.Clear(); } }
private void LoadWeapon(GameObject Obj, string szBindPoint, string szResName, Tab_WeaponModel tabWeaponModel) { List <object> param = new List <object>(); if (Singleton <ObjManager> .Instance.MainPlayer != null) { param.Add(szBindPoint); param.Add(Singleton <ObjManager> .Instance.MainPlayer.WeaponEffectGem); param.Add(null); param.Add(Singleton <ObjManager> .Instance.MainPlayer.Profession); param.Add(Singleton <ObjManager> .Instance.MainPlayer.CurWeaponDataID); if (szBindPoint == "Weapon_L") { param.Add(new Vector3(tabWeaponModel.LeftRotX, tabWeaponModel.LeftRotY, tabWeaponModel.LeftRotZ)); } else if (szBindPoint == "Weapon_R") { param.Add(new Vector3(tabWeaponModel.RightRotX, tabWeaponModel.RightRotY, tabWeaponModel.RightRotZ)); } param.Add(tabWeaponModel); Singleton <ObjManager> .GetInstance().ReloadWeapon(Obj, szResName, Singleton <ObjManager> .GetInstance().AsycReloadWeaponOver, param); } else { if (UIControllerBase <RoleChooseLogic> .Instance() != null) { param.Add(szBindPoint); param.Add(-1); param.Add(null); param.Add(UIControllerBase <RoleChooseLogic> .Instance().GetRoleProfess()); param.Add(-1); if (szBindPoint == "Weapon_L") { param.Add(new Vector3(tabWeaponModel.LeftRotX, tabWeaponModel.LeftRotY, tabWeaponModel.LeftRotZ)); } else if (szBindPoint == "Weapon_R") { param.Add(new Vector3(tabWeaponModel.RightRotX, tabWeaponModel.RightRotY, tabWeaponModel.RightRotZ)); } param.Add(tabWeaponModel); Singleton <ObjManager> .GetInstance().ReloadWeapon(Obj, szResName, Singleton <ObjManager> .GetInstance().AsycReloadWeaponOver, param); } } }
//重新打开导航UI private void ShowWindowForNavigation(WindowID id) { if (!IsWindowRegistered(id)) { return; } if (dicShownWindows.ContainsKey((int)id)) { return; } UIControllerBase baseWindow = GetGameWindowFromCache(id); baseWindow.ShowWindow(); dicShownWindows[(int)baseWindow.ID] = baseWindow; }
public void DestroyController(UIControllerBase controller) { if (null != controller) { _controllers.Remove(controller.GetType()); try { controller.Dispose(); } catch (Exception e) { Console.Error.WriteLine(e.Message); Console.Error.WriteLine(e.StackTrace); } } }
// Token: 0x0600D6FB RID: 55035 RVA: 0x003A87C4 File Offset: 0x003A69C4 public void Init(UIControllerBase ownerCtrl, bool isCareItemClick = true) { if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_InitUIControllerBaseBoolean_hotfix != null) { this.m_InitUIControllerBaseBoolean_hotfix.call(new object[] { this, ownerCtrl, isCareItemClick }); return; } BJLuaObjHelper.IsSkipLuaHotfix = false; this.m_ownerCtrl = ownerCtrl; PoolObject component = base.GetComponent <PoolObject>(); if (component != null) { component.EventOnScrollCellIndex += this.ScrollCellIndex; } Button component2 = base.GetComponent <Button>(); if (component2 != null && isCareItemClick) { component2.enabled = true; component2.onClick.AddListener(new UnityAction(this.OnScrollItemClick)); if (component2 as ButtonEx != null) { (component2 as ButtonEx).onDoubleClick.AddListener(new UnityAction(this.OnScrollItemDoubleClick)); } } else if (component2 != null && !isCareItemClick) { component2.enabled = false; } this.m_3dTouchEventTrigger = base.GetComponent <ThreeDTouchEventListener>(); if (this.m_3dTouchEventTrigger != null && isCareItemClick) { this.m_3dTouchEventTrigger.EventOnThreeDTouchTriggered += this.OnScrollItem3DTouch; } }
// 如果当前存在BackSequence数据 // 1.栈顶界面不是当前要显示的界面需要清空BackSequence(导航被重置), // [精炼失败/战斗UI 可以选择去向3个不同的UI, 不要求点击返回后回到依然精炼UI, 精炼失败UI不保存导航信息, ] // 2.栈顶界面是当前显示界面,如果类型为(NeedBack)则需要显示所有backShowTargets界面 // 栈顶不是即将显示界面(导航序列被打断) // 如果当前导航队列顶部元素和当前显示的界面一致,表示和当前的导航数衔接上,后续导航直接使用导航数据 // 不一致则表示,导航已经失效,下次点击返回按钮,我们直接根据window的preWindowId确定跳转到哪一个界面 private void CheckBackSequenceData(UIControllerBase baseWindow) { if (baseWindow.IsNavigationTypeUI) { if (backSequence.Count > 0) { NavigationData backData = backSequence.Peek(); if (backData.showingUI != null) { if (backData.showingUI.ID != baseWindow.ID) { ClearBackSequence(); } } else { Debug.LogError("最近的导航信息中,showingUI is null!"); } } } }
// Token: 0x06011C89 RID: 72841 RVA: 0x0049A28C File Offset: 0x0049848C protected override void OnReturnToLoginConfirmButtonClicked(UIControllerBase ctrl) { if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_OnReturnToLoginConfirmButtonClickedUIControllerBase_hotfix != null) { this.m_OnReturnToLoginConfirmButtonClickedUIControllerBase_hotfix.call(new object[] { this, ctrl }); return; } BJLuaObjHelper.IsSkipLuaHotfix = false; ReloginUITask.s_prevReloginSuccessCallBack = null; ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext; if (projectLPlayerContext != null && projectLPlayerContext.GetChatComponent().DataDirty) { projectLPlayerContext.GetChatComponent().SaveChatHistoryData(); } base.OnReturnToLoginConfirmButtonClicked(ctrl); }
// Token: 0x060121DE RID: 74206 RVA: 0x004AA960 File Offset: 0x004A8B60 public void UpdateItemInfo(int headFrameId, bool isLock, bool isSelected) { if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_UpdateItemInfoInt32BooleanBoolean_hotfix != null) { this.m_UpdateItemInfoInt32BooleanBoolean_hotfix.call(new object[] { this, headFrameId, isLock, isSelected }); return; } BJLuaObjHelper.IsSkipLuaHotfix = false; this.HeadFrameId = headFrameId; UIUtility.SetPlayerHeadFrame(this.m_headFrameTransform, headFrameId, false, (!isLock) ? "Normal" : "Lock"); if (this.AutoInitLocalizedString && this.m_headFrameTransform.gameObject != null) { UIControllerBase.InitLocalizedString(this.m_headFrameTransform.gameObject); } this.m_toggle.isOn = isSelected; }
public void ServerSelected(string name) { for (int i = 0; i < m_itemList.Count; ++i) { bool bHightLight = m_itemList[i].name == name; m_itemList[i].GetComponent <ServerListItem>().EnableHeightLight(bHightLight); } m_curSelectItemName = name; int curID = 0; if (int.TryParse(name, out curID)) { for (int i = 0; i < LoginData.serverListData.Count; ++i) { if (LoginData.serverListData[i].m_id == curID) { UIControllerBase <ServerChooseController> .Instance().SelectServerListItem(LoginData.serverListData[i]); } } } }
// Token: 0x0600D6FD RID: 55037 RVA: 0x003A89C0 File Offset: 0x003A6BC0 public void OnScrollItemClick() { if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_OnScrollItemClick_hotfix != null) { this.m_OnScrollItemClick_hotfix.call(new object[] { this }); return; } BJLuaObjHelper.IsSkipLuaHotfix = false; if (!UIControllerBase.CheckAndUpdateCurrFrameButtonClickStateInfo()) { return; } if (this.m_3dTouchEventTrigger != null && this.m_3dTouchEventTrigger.IsThreeDTouchTriggered) { return; } if (this.EventOnUIItemClick != null) { this.EventOnUIItemClick(this.m_ownerCtrl); } }
public void InitFakeObjWeapon(GameObject Obj, int nCurWeaponID, Tab_FakeObject FakeObjTable) { // 重载武器 bool defaultVisual = false; Tab_ItemVisual WeaponVisual = null; Tab_EquipAttr tabEquipAttr = TableManager.GetEquipAttrByID(nCurWeaponID, 0); if (tabEquipAttr != null) { Tab_ItemVisual tabWeaponVisual = TableManager.GetItemVisualByID(tabEquipAttr.ModelId, 0); if (tabWeaponVisual != null) { WeaponVisual = tabWeaponVisual; } else { defaultVisual = true; } } else { defaultVisual = true; } if (defaultVisual) { Tab_ItemVisual tabDefaultVisual = TableManager.GetItemVisualByID(GlobeVar.DEFAULT_VISUAL_ID, 0); if (tabDefaultVisual == null) { return; } WeaponVisual = tabDefaultVisual; } int nWeaponModelID = -1; if (WeaponVisual == null) { return; } if (Singleton <ObjManager> .Instance.MainPlayer == null) { if (UIControllerBase <RoleChooseLogic> .Instance() != null) { int nProfession = -1; nProfession = UIControllerBase <RoleChooseLogic> .Instance().GetRoleProfess(); if (nProfession == (int)CharacterDefine.PROFESSION.SHAOLIN) { nWeaponModelID = WeaponVisual.WeaponModelIDShaoLin; } else if (nProfession == (int)CharacterDefine.PROFESSION.TIANSHAN) { nWeaponModelID = WeaponVisual.WeaponModelIDTianShan; } else if (nProfession == (int)CharacterDefine.PROFESSION.DALI) { nWeaponModelID = WeaponVisual.WeaponModelIDDaLi; } else if (nProfession == (int)CharacterDefine.PROFESSION.XIAOYAO) { nWeaponModelID = WeaponVisual.WeaponModelIDXiaoYao; } else if (nProfession == (int)CharacterDefine.PROFESSION.GAIBANG) { nWeaponModelID = WeaponVisual.WeaponModelIDGaiBang; } } } else { nWeaponModelID = Singleton <ObjManager> .Instance.MainPlayer.GetWeaponModelID(WeaponVisual); } Tab_WeaponModel tabWeaponModel = TableManager.GetWeaponModelByID(nWeaponModelID, 0); if (tabWeaponModel == null) { return; } int playerProfession = -1; if (Singleton <ObjManager> .Instance.MainPlayer == null) { if (UIControllerBase <RoleChooseLogic> .Instance()) { playerProfession = UIControllerBase <RoleChooseLogic> .Instance().GetRoleProfess(); } } else { playerProfession = Singleton <ObjManager> .Instance.MainPlayer.Profession; } if (playerProfession == (int)CharacterDefine.PROFESSION.TIANSHAN || playerProfession == (int)CharacterDefine.PROFESSION.GAIBANG) { LoadWeapon(Obj, "Weapon_L", tabWeaponModel.ResPath + "_L", tabWeaponModel); LoadWeapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", tabWeaponModel); } else if (playerProfession == (int)CharacterDefine.PROFESSION.XIAOYAO) { LoadWeapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", tabWeaponModel); } else { LoadWeapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", tabWeaponModel); } }
void Awake() { UIControllerBase <CountDownLogic> .SetInstance(this); }
void Awake() { UIControllerBase <ServerListWindow> .SetInstance(this); }
void OnBtnBackClick() { UIControllerBase <ServerChooseController> .Instance().SwitchWindow((int)ServerChooseController.Window.ServerTop); ServerChooseController.Instance().showGroundPic(); }
void Awake() { UIControllerBase <AutoDrugLogic> .SetInstance(this); }
void OnSelectPageClick() { UIControllerBase <ServerListWindow> .Instance().ServerPageSelected(gameObject.name); }