private void OnGUI() { GlobalVars.Instance.BeginGUI(VersionTextureManager.Instance.seasonTexture.texScreenBg); GUI.skin = GUISkinFinder.Instance.GetGUISkin(); if (SquadManager.Instance.IsMatching) { Rect clientRect = new Rect(((float)Screen.width - crdMatchingProgress.x) / 2f, ((float)Screen.height - crdMatchingProgress.y) / 2f, crdMatchingProgress.x, crdMatchingProgress.y); GUI.Window(1024, clientRect, MatchingProgress, string.Empty); } GUI.enabled = (!SquadManager.Instance.IsMatching && !DialogManager.Instance.IsModal); TextureUtil.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), texBg, ScaleMode.StretchToFill); GUI.Box(crdSquading, string.Empty, "BoxPopupBg"); LabelUtil.TextOut(crdSquadingTitleLabel, StringMgr.Instance.Get("MY_MATCH_TEAM"), "BigLabel", GlobalVars.Instance.txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); Color txtMainColor = GlobalVars.Instance.txtMainColor; GUI.Box(crdSquadInfo, string.Empty, "BoxFadeBlue"); Squad curSquad = SquadManager.Instance.CurSquad; if (curSquad != null) { LabelUtil.TextOut(crdName, curSquad.Name, "Label", txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdMemberCount, curSquad.MemberCountString, "Label", txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperCenter); LabelUtil.TextOut(crdRecord, curSquad.Record, "Label", txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperRight); } clanMemberList.OnGUI(); lobbyChat.OnGUI(); squadMemberList.OnGUI(); squadMode.OnGUI(); squadTool.OnGUI(); GUI.enabled = true; GlobalVars.Instance.EndGUI(); }
private void OnGUI() { GlobalVars.Instance.BeginGUI(VersionTextureManager.Instance.seasonTexture.texScreenBg); GUI.skin = GUISkinFinder.Instance.GetGUISkin(); GUI.enabled = !DialogManager.Instance.IsModal; GUI.Box(crdSquading, string.Empty, "BoxPopupBg"); LabelUtil.TextOut(crdSquadingTitleLabel, StringMgr.Instance.Get("MATCH_TEAM_LIST"), "BigLabel", GlobalVars.Instance.txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); squadList.OnGUI(); clanMemberList.OnGUI(); lobbyChat.OnGUI(); squadingTool.OnGUI(); GUI.enabled = true; GlobalVars.Instance.EndGUI(); }
private void OnGUI() { GlobalVars.Instance.BeginGUI(VersionTextureManager.Instance.seasonTexture.texScreenBg); GUI.skin = GUISkinFinder.Instance.GetGUISkin(); GUI.enabled = !DialogManager.Instance.IsModal; TextureUtil.DrawTexture(GlobalVars.Instance.UIScreenRect, texPopupBg, ScaleMode.StretchToFill); if (guiStep == 0) { GUI.Box(crdVLine, string.Empty, "DivideLineV"); if (GlobalVars.Instance.MyButton(crdCloseBtn, string.Empty, "BtnClose") || (!GlobalVars.Instance.IsModalAll() && GlobalVars.Instance.IsEscapePressed())) { Squad curSquad = SquadManager.Instance.CurSquad; if (curSquad != null) { if (SquadManager.Instance.CurSquad.Leader == MyInfoManager.Instance.Seq) { CSNetManager.Instance.Sock.SendCS_CLAN_MATCH_TEAM_GETBACK_REQ(MyInfoManager.Instance.ClanSeq, curSquad.Index); } else { P2PManager.Instance.Shutdown(); CSNetManager.Instance.Sock.SendCS_LEAVE_REQ(); CSNetManager.Instance.Sock.SendCS_LEAVE_SQUAD_REQ(); SquadManager.Instance.Leave(); CSNetManager.Instance.Sock.SendCS_LEAVE_SQUADING_REQ(); SquadManager.Instance.Clear(); GlobalVars.Instance.GotoLobbyRoomList = true; Application.LoadLevel("Lobby"); } } else { P2PManager.Instance.Shutdown(); CSNetManager.Instance.Sock.SendCS_LEAVE_REQ(); GlobalVars.Instance.GotoLobbyRoomList = true; Application.LoadLevel("Lobby"); } } channelLabel.OnGUI(); mirror.OnGUI(); ctfConfig.OnGUI(); lobbyChat.OnGUI(); playerListFrm.OnGUI(); briefingPanel.OnGUI(); GUI.Box(crdLine, string.Empty, "DivideLine"); GUIContent content = new GUIContent(StringMgr.Instance.Get("MY_EQUIP").ToUpper(), GlobalVars.Instance.iconMyItem); if (GlobalVars.Instance.MyButton3(crdMyEquipBtn, content, "BtnAction")) { if (MyInfoManager.Instance.Seq == RoomManager.Instance.Master || MyInfoManager.Instance.Status != 1) { guiStep = 1; equipmentFrm.Default(); CSNetManager.Instance.Sock.SendCS_SET_STATUS_REQ(6); } else { MessageBoxMgr.Instance.AddMessage(StringMgr.Instance.Get("CANT_ON_READY")); } } content = new GUIContent(StringMgr.Instance.Get("SHOPPING").ToUpper(), GlobalVars.Instance.iconCart); if (GlobalVars.Instance.MyButton3(crdShopBtn, content, "BtnAction")) { if (MyInfoManager.Instance.Seq == RoomManager.Instance.Master || MyInfoManager.Instance.Status != 1) { guiStep = 2; CSNetManager.Instance.Sock.SendCS_SET_STATUS_REQ(5); shopFrm.InitPreview(); } else { MessageBoxMgr.Instance.AddMessage(StringMgr.Instance.Get("CANT_ON_READY")); } } GUI.Box(crdMessengerBtnStatus, string.Empty, (!isMessenger) ? "IconArrowL" : "IconArrowR"); if (GlobalVars.Instance.MyButtonBold(crdMessengerBtn, StringMgr.Instance.Get("MESSENGER").ToUpper(), "BtnAction")) { isMessenger = !isMessenger; messenger.IsBriefing = isMessenger; lobbyChat.BtnActive(!isMessenger); messenger.ToggleLeftTop(); } if (isMessenger) { messenger.OnGUI(); } } else if (guiStep == 1) { bool enabled = GUI.enabled; if (GUI.enabled) { GUI.enabled = !equipmentFrm.CheckFilterCombo(); } if (GUI.enabled) { GUI.enabled = !bChatView; } Color byteColor2FloatColor = GlobalVars.Instance.GetByteColor2FloatColor(244, 151, 25); TextureUtil.DrawTexture(GlobalVars.Instance.UIScreenRect, texPopupBg, ScaleMode.StretchToFill); GUI.Box(crdVLine, string.Empty, "DivideLineV"); LabelUtil.TextOut(crdBigTitle, StringMgr.Instance.Get("MY_EQUIP").ToUpper(), "BigBtnLabel", byteColor2FloatColor, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); if (GlobalVars.Instance.MyButton(crdCloseBtn, string.Empty, "BtnClose") || (!GlobalVars.Instance.IsModalAll() && GlobalVars.Instance.IsEscapePressed())) { guiStep = 0; playerListFrm.ResetMyPlayerStyle(); CSNetManager.Instance.Sock.SendCS_SET_STATUS_REQ(0); } mirror.OnGUI(); equipmentFrm.OnGUI(); if (bChatView) { bool enabled2 = GUI.enabled; GUI.enabled = true; lobbyChat.OnGUI(); messenger.OnGUI(); GUI.enabled = enabled2; } GUI.enabled = enabled; equipmentFrm.DoFilterCombo(); } else if (guiStep == 2) { bool enabled3 = GUI.enabled; if (GUI.enabled) { GUI.enabled = !shopFrm.CheckFilterCombo(); } if (GUI.enabled) { GUI.enabled = !bChatView; } Color byteColor2FloatColor2 = GlobalVars.Instance.GetByteColor2FloatColor(244, 151, 25); TextureUtil.DrawTexture(GlobalVars.Instance.UIScreenRect, texPopupBg, ScaleMode.StretchToFill); GUI.Box(crdVLine, string.Empty, "DivideLineV"); LabelUtil.TextOut(crdBigTitle, StringMgr.Instance.Get("SHOPPING").ToUpper(), "BigBtnLabel", byteColor2FloatColor2, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); if (!shopFrm.GetBuyConfirm() && (GlobalVars.Instance.MyButton(crdCloseBtn, string.Empty, "BtnClose") || (!GlobalVars.Instance.IsModalAll() && GlobalVars.Instance.IsEscapePressed()))) { guiStep = 0; playerListFrm.ResetMyPlayerStyle(); shopFrm.RollbackPreview(); CSNetManager.Instance.Sock.SendCS_SET_STATUS_REQ(0); } mirror.OnGUI(); shopFrm.OnGUI(); if (bChatView) { bool enabled4 = GUI.enabled; GUI.enabled = true; lobbyChat.OnGUI(); messenger.OnGUI(); GUI.enabled = enabled4; } GUI.enabled = enabled3; shopFrm.DoFilterCombo(); } if (guiStep > 0 && GlobalVars.Instance.MyButton(new Rect(921f, 7f, 44f, 44f), new GUIContent(string.Empty, StringMgr.Instance.Get("CHATTING")), "BtnChatOnOff")) { bChatView = !bChatView; } GUI.enabled = true; GlobalVars.Instance.EndGUI(); }
private void OnGUI() { GlobalVars.Instance.BeginGUI(VersionTextureManager.Instance.seasonTexture.texScreenBg); GUI.skin = GUISkinFinder.Instance.GetGUISkin(); GUI.enabled = !DialogManager.Instance.IsModal; GUI.depth = 50; TextureUtil.DrawTexture(GlobalVars.Instance.UIScreenRect, texPopupBg, ScaleMode.StretchToFill); lobbyTools.OnGUI(); string[] array = new string[3] { StringMgr.Instance.Get("GAME_ROOMS_SUBTAB"), StringMgr.Instance.Get("ITEM_SHOPPING_MAINTAB"), StringMgr.Instance.Get("MY_ITEMS_MAINTAB") }; crdMainGrid.width = (float)(array.Length * 105); int num = selected; selected = GUI.SelectionGrid(crdMainGrid, selected, array, array.Length, "BtnMain"); if (num != selected && selected == 0) { ReleaseGuiStep(); } else if (num == 1 && selected == 2) { shopFrm.RollbackPreview(); } if (num != selected && selected == 2) { if (MyInfoManager.Instance.Seq == RoomManager.Instance.Master || MyInfoManager.Instance.Status != 1) { guiStep = 1; equipmentFrm.Default(); bChatView = false; lobbyChat.hideCloseButton(close: false); lobbyChat.SetChatStyle(LOBBYCHAT_STYLE.LOW); CSNetManager.Instance.Sock.SendCS_SET_STATUS_REQ(6); } else { selected = num; MessageBoxMgr.Instance.AddMessage(StringMgr.Instance.Get("CANT_ON_READY")); } } if (num != selected && selected == 1) { if (MyInfoManager.Instance.Seq == RoomManager.Instance.Master || MyInfoManager.Instance.Status != 1) { guiStep = 2; bChatView = false; lobbyChat.hideCloseButton(close: false); lobbyChat.SetChatStyle(LOBBYCHAT_STYLE.LOW); CSNetManager.Instance.Sock.SendCS_SET_STATUS_REQ(5); shopFrm.InitPreview(); } else { selected = num; MessageBoxMgr.Instance.AddMessage(StringMgr.Instance.Get("CANT_ON_READY")); } } if (SquadManager.Instance.IsMatching) { Rect clientRect = new Rect(((float)Screen.width - crdMatchingProgress.x) / 2f, ((float)Screen.height - crdMatchingProgress.y) / 2f, crdMatchingProgress.x, crdMatchingProgress.y); GUI.Window(1024, clientRect, MatchingProgress, string.Empty); } if (guiStep == 0) { GUI.Box(crdVLine, string.Empty, "DivideLineV"); channelLabel.OnGUI(); mirror.OnGUI(); switch (RoomManager.Instance.CurrentRoomType) { case Room.ROOM_TYPE.TEAM_MATCH: tmConfig.OnGUI(); break; case Room.ROOM_TYPE.INDIVIDUAL: imConfig.OnGUI(); break; case Room.ROOM_TYPE.MISSION: dmConfig.OnGUI(); break; case Room.ROOM_TYPE.CAPTURE_THE_FLAG: ctfConfig.OnGUI(); break; case Room.ROOM_TYPE.EXPLOSION: bmConfig.OnGUI(); break; case Room.ROOM_TYPE.BND: bndConfig.OnGUI(); break; case Room.ROOM_TYPE.BUNGEE: bgConfig.OnGUI(); break; case Room.ROOM_TYPE.ESCAPE: escConfig.OnGUI(); break; case Room.ROOM_TYPE.ZOMBIE: zombieConfig.OnGUI(); break; default: Debug.LogError("not support mode: " + RoomManager.Instance.CurrentRoomType); break; } lobbyChat.OnGUI(); if (RoomManager.Instance.CurrentRoomType == Room.ROOM_TYPE.INDIVIDUAL || RoomManager.Instance.CurrentRoomType == Room.ROOM_TYPE.ESCAPE || RoomManager.Instance.CurrentRoomType == Room.ROOM_TYPE.ZOMBIE) { playerListFrmIndividual.OnGUI(); } else if (RoomManager.Instance.CurrentRoomType == Room.ROOM_TYPE.MISSION) { playerListFrmDefense.OnGUI(); } else if (RoomManager.Instance.CurrentRoomType == Room.ROOM_TYPE.BUNGEE) { playerListFrmBungee.OnGUI(); } else { playerListFrm.OnGUI(); } if (RoomManager.Instance.IsKindOfIndividual) { briefingPanelIndividual.OnGUI(); } else if (RoomManager.Instance.CurrentRoomType == Room.ROOM_TYPE.MISSION) { briefingPanelDefense.OnGUI(); } else { briefingPanel.OnGUI(); } GUI.Box(crdLine, string.Empty, "DivideLine"); GUI.Box(crdMessengerBtnStatus, string.Empty, (!isMessenger) ? "IconArrowL" : "IconArrowR"); if (GlobalVars.Instance.MyButtonBold(crdMessengerBtn, StringMgr.Instance.Get("MESSENGER").ToUpper(), "BtnAction")) { isMessenger = !isMessenger; messengerReset(); } if (isMessenger) { messenger.OnGUI(); } } else if (guiStep == 1) { bool enabled = GUI.enabled; if (GUI.enabled) { GUI.enabled = !equipmentFrm.CheckFilterCombo(); } GUI.Box(crdVLine, string.Empty, "DivideLineV"); mirror.OnGUI(); equipmentFrm.OnGUI(); if (bChatView) { lobbyChat.OnGUI(); messenger.OnGUI(); } if (!bChatView) { Rect rc = new Rect(559f, 750f, 150f, 16f); if (GlobalVars.Instance.MyButton(rc, string.Empty, "BtnDropUp")) { bChatView = true; } } else { Rect rc2 = new Rect(559f, 472f, 150f, 16f); if (GlobalVars.Instance.MyButton(rc2, string.Empty, "BtnDropDown")) { bChatView = false; } } GUI.enabled = enabled; equipmentFrm.DoFilterCombo(); } else if (guiStep == 2) { bool enabled2 = GUI.enabled; if (GUI.enabled) { GUI.enabled = !shopFrm.CheckFilterCombo(); } GUI.Box(crdVLine, string.Empty, "DivideLineV"); mirror.OnGUI(); shopFrm.OnGUI(); if (bChatView) { lobbyChat.OnGUI(); messenger.OnGUI(); } if (!bChatView) { Rect rc3 = new Rect(559f, 750f, 150f, 16f); if (GlobalVars.Instance.MyButton(rc3, string.Empty, "BtnDropUp")) { bChatView = true; } } else { Rect rc4 = new Rect(559f, 472f, 150f, 16f); if (GlobalVars.Instance.MyButton(rc4, string.Empty, "BtnDropDown")) { bChatView = false; } } GUI.enabled = enabled2; shopFrm.DoFilterCombo(); } GUI.enabled = true; GlobalVars.Instance.EndGUI(); }