private static void DrawPlayer(int id) { Vector2 mpos = new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y); if (id == MenuBanList.selected) { GUI.DrawTexture(MenuBanList.rPlayerBack[id], MenuBanList.tRed); } else if (GUIM.Contains(MenuBanList.rPlayerBack[id], mpos)) { GUI.DrawTexture(MenuBanList.rPlayerBack[id], MenuBanList.tRed); if (Input.GetMouseButtonDown(0)) { MenuBanList.selected = id; } } else { GUI.DrawTexture(MenuBanList.rPlayerBack[id], MenuBanList.tGray); } GUI2.DrawTextRes(MenuBanList.rPlayerID[id], id.ToString(), TextAnchor.MiddleCenter, _Color.White, 0, 12, false); GUI2.DrawTextRes(MenuBanList.rPlayerName[id], MenuBanList.banList[id].playerName, TextAnchor.MiddleLeft, _Color.White, 0, 12, false); GUI2.DrawTextRes(MenuBanList.rPlayerSID[id], MenuBanList.banList[id].playerSID, TextAnchor.MiddleLeft, _Color.White, 0, 12, false); }
public static bool DrawItem(Rect r, MenuShop.CShopData data) { int num = (int)GUIM.YRES(1f); if (num < 1) { num = 1; } bool flag = false; Vector2 mpos = new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y); if (data == MenuShop.currData) { GUI.DrawTexture(r, MenuShop.tWhite); } else if (GUIM.Contains(r, mpos)) { GUI.DrawTexture(r, MenuShop.tGray); GUI.color = new Color(1f, 1f, 1f, 0.1f); GUI.DrawTexture(r, MenuShop.tWhite); GUI.color = Color.white; flag = true; } else { if (BaseData.item[data.wid] == 1) { GUI.color = new Color(1f, 1f, 1f, 0.05f); GUI.DrawTexture(r, MenuShop.tWhite); GUI.color = Color.white; } GUI.DrawTexture(new Rect(r.x, r.y, r.width, (float)num), MenuShop.tGray); GUI.DrawTexture(new Rect(r.x, r.y + r.height - (float)num, r.width, (float)num), MenuShop.tGray); GUI.DrawTexture(new Rect(r.x, r.y, (float)num, r.height), MenuShop.tGray); GUI.DrawTexture(new Rect(r.x + r.width - (float)num, r.y, (float)num, r.height), MenuShop.tGray); } if (data.level > 0) { BaseColor fontcolor = BaseColor.White; if (BaseData.iLevel < data.level) { fontcolor = BaseColor.Red; } GUIM.DrawText(r, "Lv." + data.level.ToString() + " ", TextAnchor.LowerRight, fontcolor, 1, 12, false); } if (data.section == 1) { GUI.DrawTexture(new Rect(r.x + GUIM.YRES(4f), r.y + GUIM.YRES(4f) + GUIM.YRES(33f), GUIM.YRES(88f), GUIM.YRES(22f)), data.icon); } if (data.section == 2) { GUI.DrawTexture(new Rect(r.x + GUIM.YRES(4f), r.y + GUIM.YRES(4f), GUIM.YRES(88f), GUIM.YRES(88f)), data.icon); } if (data.section == 3 || data.section == 4) { GUI.DrawTexture(new Rect(r.x + GUIM.YRES(4f), r.y + GUIM.YRES(4f), GUIM.YRES(88f), GUIM.YRES(88f)), data.icon); } if (data.section == 5) { GUI.DrawTexture(new Rect(r.x + GUIM.YRES(4f), r.y + GUIM.YRES(4f), GUIM.YRES(88f), GUIM.YRES(88f)), data.icon); } if (data.section == 0) { GUI.DrawTexture(new Rect(r.x + GUIM.YRES(4f), r.y + GUIM.YRES(4f) + GUIM.YRES(22f), GUIM.YRES(88f), GUIM.YRES(44f)), data.icon); } if (MenuInventory.isActive()) { bool flag2 = false; int id = WeaponData.GetId(data.name2); if (id > 0 && BaseData.profileWeapon[id] == data.wid) { flag2 = true; } if (BaseData.badge_back == data.wid || BaseData.badge_icon == data.wid || BaseData.mask_merc == data.wid || BaseData.mask_warcorp == data.wid || flag2) { GUI.color = Color.green; GUI.DrawTexture(new Rect(r.x + GUIM.YRES(4f), r.y + GUIM.YRES(4f), GUIM.YRES(10f), GUIM.YRES(10f)), MenuShop.apply); GUI.color = Color.white; } else if (flag && data.section > 0) { GUIM.DrawText(r, Lang.Get("_CLICK_TO_EQUIP"), TextAnchor.LowerCenter, BaseColor.White, 1, 10, false); } } bool result = false; if (GUIM.HideButton(r)) { MenuShop.currData = data; if (MenuShop.show) { if (MenuShop.currData.section == 3 || MenuShop.currData.section == 4) { MenuPlayer.PreviewMask(MenuShop.currData); MenuPlayer.SetPosition(0.9f, 0.03f, -1f); } else if (MenuShop.currData.section == 5) { MenuPlayer.playermodel = -1; if (MenuShop.currData.name2 == "ak47") { MenuPlayer.ChangePlayer(0, 6, 22); } else if (MenuShop.currData.name2 == "aks74u") { MenuPlayer.ChangePlayer(0, 7, 22); } else if (MenuShop.currData.name2 == "asval") { MenuPlayer.ChangePlayer(0, 8, 22); } else if (MenuShop.currData.name2 == "aug") { MenuPlayer.ChangePlayer(0, 18, 22); } else if (MenuShop.currData.name2 == "awp") { MenuPlayer.ChangePlayer(0, 22, 8); } else if (MenuShop.currData.name2 == "beretta") { MenuPlayer.ChangePlayer(0, 2, 22); } else if (MenuShop.currData.name2 == "bm4") { MenuPlayer.ChangePlayer(0, 9, 22); } else if (MenuShop.currData.name2 == "colt") { MenuPlayer.ChangePlayer(0, 3, 8); } else if (MenuShop.currData.name2 == "deagle") { MenuPlayer.ChangePlayer(0, 4, 8); } else if (MenuShop.currData.name2 == "famas") { MenuPlayer.ChangePlayer(0, 10, 22); } else if (MenuShop.currData.name2 == "glock17") { MenuPlayer.ChangePlayer(0, 1, 8); } else if (MenuShop.currData.name2 == "m4a1") { MenuPlayer.ChangePlayer(0, 11, 22); } else if (MenuShop.currData.name2 == "m24") { MenuPlayer.ChangePlayer(0, 21, 22); } else if (MenuShop.currData.name2 == "m90") { MenuPlayer.ChangePlayer(0, 23, 22); } else if (MenuShop.currData.name2 == "m110") { MenuPlayer.ChangePlayer(0, 20, 22); } else if (MenuShop.currData.name2 == "m249") { MenuPlayer.ChangePlayer(0, 25, 22); } else if (MenuShop.currData.name2 == "mp5") { MenuPlayer.ChangePlayer(0, 12, 22); } else if (MenuShop.currData.name2 == "mp7") { MenuPlayer.ChangePlayer(0, 13, 22); } else if (MenuShop.currData.name2 == "p90") { MenuPlayer.ChangePlayer(0, 14, 22); } else if (MenuShop.currData.name2 == "pkp") { MenuPlayer.ChangePlayer(0, 24, 22); } else if (MenuShop.currData.name2 == "qbz95") { MenuPlayer.ChangePlayer(0, 15, 22); } else if (MenuShop.currData.name2 == "remington") { MenuPlayer.ChangePlayer(0, 5, 22); } else if (MenuShop.currData.name2 == "spas12") { MenuPlayer.ChangePlayer(0, 16, 8); } else if (MenuShop.currData.name2 == "svd") { MenuPlayer.ChangePlayer(0, 19, 22); } else if (MenuShop.currData.name2 == "ump45") { MenuPlayer.ChangePlayer(0, 17, 22); } MenuPlayer.SetPosition(0.9f, 0.03f, -1f); } } result = true; } return(result); }