public void ShowMainMenu() { LoadMenuLevel(); GamePanel.SetActive(false); PauseMenu.SetActive(false); HelpPanel.SetActive(false); LevelPickerPanel.SetActive(false); LevelPickerContainerContainer.SetActive(false); //LevelPickerContainerFunContainer.SetActive(false); //LevelPickerContainerCommunityContainer.SetActive(false); LevelFailed.SetActive(false); LevelComplete.SetActive(false); MainMenu.SetActive(true); SetCameraPosition(true); SetCameraTouchX(false); if (MainMenu.activeSelf) { //if (!EventSystem.current.alreadySelecting) EventSystem.current.SetSelectedGameObject(PlayButton); } _canStartMoving = true; }
public void HideMainMenu() { GamePanel.SetActive(false); PauseMenu.SetActive(false); MainMenu.SetActive(false); HelpPanel.SetActive(false); LevelPickerPanel.SetActive(false); LevelFailed.SetActive(false); LevelComplete.SetActive(false); SetCameraPosition(false); }
public void HelpPanelOpen() { if (HelpPanel.activeSelf == false) { HelpPanel.SetActive(true); helpBtn.GetComponentInChildren <TextMeshProUGUI>().text = "Close"; } else { HelpPanel.SetActive(false); helpBtn.GetComponentInChildren <TextMeshProUGUI>().text = "Help"; } }
private void OnHelp() { OptionPanel.SetActive(false); HelpPanel.SetActive(true); }
public void HelpPanelClose() { HelpPanel.SetActive(false); }
public void BackButton() { BGPanel.SetActive(true); MiddlePanel.SetActive(true); HelpPanel.SetActive(false); }
protected override void OnClickListener(GameObject gob) { var btnid = (MenuBtn)UIEventListener.Get(gob).parameter; var gdata = App.GetGameData <TexasGameData>(); switch (btnid) { case MenuBtn.Menu_Btn: MenuFather.SetActive(true); foreach (var tween in BtnTweens) { tween.GetComponent <TweenColor>().ResetToBeginning(); tween.GetComponent <TweenScale>().ResetToBeginning(); } if (gdata.IsRoomGame) { //房卡没有换房 var changeBtn = Tools.GobSelectName(Buttons, MenuBtn.Change_Btn.ToString()); if (changeBtn != null) { changeBtn.SetActive(false); } MenuPanelGrid.cellHeight = 100; //解散房间 if (gdata.IsRoomOwner || gdata.IsPlayed) { var backBtn = Tools.GobSelectName(Buttons, MenuBtn.Back_Btn.ToString()); if (backBtn != null) { var sprName = "dismiss"; var btn = backBtn.GetComponent <UIButton>(); btn.normalSprite = sprName + "_up"; btn.pressedSprite = sprName + "_over"; btn.hoverSprite = sprName + "_over"; btn.disabledSprite = sprName + "_up"; } } } MenuBgTween.PlayForward(); break; case MenuBtn.Back_Btn: //开放模式下,走解散房间,否则更换房间 if (gdata.IsRoomGame) { DismissRoom(); } else { QuitRoom(); } CloseMenu(); break; case MenuBtn.Change_Btn: ChangeRoom(); CloseMenu(); break; case MenuBtn.PokerType_Btn: if (HelpPanel != null) { HelpPanel.SetActive(true); } CloseMenu(); break; case MenuBtn.Close_Btn: CloseMenu(); break; case MenuBtn.AddGold_Btn: { var selfInfo = gdata.GetPlayerInfo(); if (gdata.GStatus > YxEGameStatus.Over && selfInfo.State) { YxMessageBox.Show(new YxMessageBoxData { Msg = "正在游戏中,不能添加筹码!", IsTopShow = true, Delayed = 5, }); } else { //打开选择携带钱界面 App.GetGameManager <TexasGameManager>().GetGoldMagr.OpenPanel(selfInfo); } } break; case MenuBtn.Setting_Btn: OnClickSettingBtn(); CloseMenu(); break; case MenuBtn.History_Btn: var historyResultMgr = App.GetGameManager <TexasGameManager>().HistoryResultMgr; if (historyResultMgr != null) { historyResultMgr.ShowHistoryView(); } CloseMenu(); break; case MenuBtn.HelpBtn: break; } }
public void ShowHelp() { HideMainMenu(); HelpPanel.SetActive(true); }
protected virtual void OnClickListener(GameObject gob) { var btnid = (MenuBtn)UIEventListener.Get(gob).parameter; var gdata = App.GetGameData <TexasGameData>(); switch (btnid) { case MenuBtn.Menu_Btn: MenuFather.SetActive(true); foreach (GameObject tween in BtnTweens) { tween.GetComponent <TweenColor>().ResetToBeginning(); tween.GetComponent <TweenScale>().ResetToBeginning(); } MenuBgTween.PlayForward(); break; case MenuBtn.Back_Btn: //分清开房模式和非开放模式 if (gdata.IsRoomGame) { //游戏开始了就需要发起投票,否则玩家可以自主决定 if (gdata.IsPlayed) { YxMessageBox.Show(new YxMessageBoxData { Msg = "确定要发起投票,解散房间么?", Listener = (box, btnName) => { if (btnName == YxMessageBox.BtnLeft) { var gMgr = App.GetGameManager <TexasGameManager>(); var rmodeMgr = gMgr.RModelMagr; Debug.Log("RModelMgr.GetInstance().DismissRoom" + rmodeMgr.DismissRoom.activeSelf); if (!rmodeMgr.DismissRoom.activeSelf) { App.GetRServer <TexasGameServer>().DismissRoom(2); App.GetRServer <TexasGameServer>().DismissRoom(3); } else { Debug.Log("确定要发起投票,解散房间么?"); YxMessageBox.Show("请不要频繁发出解散请求!!", 5); rmodeMgr.DismissRoom.transform.GetChild(0).gameObject.SetActive(true); } } }, BtnStyle = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle, IsTopShow = true }); } else { //房主可以解散房间,玩家则是自己退出房间 if (gdata.SelfSeat == 0) { YxMessageBox.Show("确定要解散房间吗?", "", (box, btnName) => { if (btnName == YxMessageBox.BtnLeft) { App.GetRServer <TexasGameServer>().DismissRoom(); } }, true, YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle ); } else { YxMessageBox.Show("确定要退出房间么?", "", (box, btnName) => { if (btnName == YxMessageBox.BtnLeft) { App.QuitGame(); } }, true, YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle ); } } } else { var selfInfo = gdata.GetPlayerInfo(); if (gdata.GStatus == YxEGameStatus.PlayAndConfine && selfInfo.State) { YxMessageBox.Show("正在游戏中,结束后再退出!!!", 5); } else { YxMessageBox.Show("确定要退出游戏吗?", "", (box, btnName) => { if (btnName == YxMessageBox.BtnLeft) { App.QuitGame(); } }, true, YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle, null, 5); } } CloseMenu(); break; case MenuBtn.Change_Btn: { var selfInfo = gdata.GetPlayerInfo(); if (gdata.GStatus == YxEGameStatus.PlayAndConfine && selfInfo.State) { YxMessageBox.Show("正在游戏中,不能换房间!!!", 5); } else { var gMgr = App.GetGameManager <TexasGameManager>(); if (gMgr.IsResultDone) { gMgr.ResultDone(); } gMgr.Reset(); gMgr.BetMagr.Reset(); App.GetRServer <TexasGameServer>().OnAllowEnter(); YxWindowManager.ShowWaitFor(); } CloseMenu(); } break; case MenuBtn.PokerType_Btn: HelpPanel.SetActive(true); CloseMenu(); break; case MenuBtn.Close_Btn: CloseMenu(); break; case MenuBtn.AddGold_Btn: { var selfInfo = gdata.GetPlayerInfo(); if (gdata.GStatus == YxEGameStatus.PlayAndConfine && selfInfo.State) { YxMessageBox.Show("正在游戏中,不能添加筹码!", 5); } else { //打开选择携带钱界面 var gMgr = App.GetGameManager <TexasGameManager>(); gMgr.GetGoldMagr.OpenPanel(selfInfo); } } break; } }
public void ShowsHelp() { HelpPanel.SetActive(true); }
public void Back() { CreditsPanel.SetActive(false); HelpPanel.SetActive(false); ControlsPanel.SetActive(false); }