public static void Draw() { if (!MenuOptions.show) { return; } float num = Time.time - MenuOptions.showtime + 0.001f; if (num > 0.05f) { num = 0.05f; } num *= 20f; Matrix4x4 matrix = GUI.matrix; Vector3 s = new Vector3(num, num, 1f); Vector3 pos = new Vector3(MenuOptions.rBack.center.x - MenuOptions.rBack.center.x * num, MenuOptions.rBack.center.y - MenuOptions.rBack.center.y * num, 1f); GUI.matrix = Matrix4x4.TRS(pos, Quaternion.identity, s); GUIM.DrawBox(MenuOptions.rBack, MenuOptions.tBlack); GUIM.DrawBox(MenuOptions.rBackSave, MenuOptions.tBlack); MenuOptions.DrawButtonOption(0, new Rect(MenuOptions.rBack.x + GUIM.YRES(4f), MenuOptions.rBack.y + GUIM.YRES(4f), GUIM.YRES(120f), GUIM.YRES(24f)), Lang.Get("_VIDEO")); MenuOptions.DrawButtonOption(1, new Rect(MenuOptions.rBack.x + GUIM.YRES(4f) + GUIM.YRES(124f) * 1f, MenuOptions.rBack.y + GUIM.YRES(4f), GUIM.YRES(120f), GUIM.YRES(24f)), Lang.Get("_AUDIO")); MenuOptions.DrawButtonOption(2, new Rect(MenuOptions.rBack.x + GUIM.YRES(4f) + GUIM.YRES(124f) * 2f, MenuOptions.rBack.y + GUIM.YRES(4f), GUIM.YRES(120f), GUIM.YRES(24f)), Lang.Get("_GAME")); MenuOptions.DrawButtonOption(3, new Rect(MenuOptions.rBack.x + GUIM.YRES(4f) + GUIM.YRES(124f) * 3f, MenuOptions.rBack.y + GUIM.YRES(4f), GUIM.YRES(120f), GUIM.YRES(24f)), Lang.Get("_CONTROL")); if (MenuOptions.currCat == 0) { MenuOptions.DrawVideo(); } else if (MenuOptions.currCat == 1) { MenuOptions.DrawAudio(); } else if (MenuOptions.currCat == 2) { MenuOptions.DrawGame(); } else if (MenuOptions.currCat == 3) { MenuOptions.DrawControl(); } if (GUIM.Button(MenuOptions.rButtonSave, BaseColor.Blue, Lang.Get("_SAVE"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true)) { Options.Save(); Options.Apply(); Options.ApplyResolution(); MenuOptions.saved = true; if (MenuOptions.ingame) { Options.ApplyInGame(); } Main.lastwidth = 0f; HUD.lastwidth = 0f; } if (MenuOptions.saved) { GUIM.DrawBox(MenuOptions.rBackSaved, MenuOptions.tBlack); GUIM.DrawText(MenuOptions.rBackSaved, Lang.Get("_OPTIONS_SAVED"), TextAnchor.MiddleCenter, BaseColor.Gray, 1, 12, false); } GUI.matrix = matrix; }
private static bool DrawPrice(Rect r, string cost, string gold, string goldbonus) { GUI.DrawTexture(r, MenuGold.tGray); Rect rect = r; r = new Rect(r.x, r.y, GUIM.YRES(128f), rect.height - GUIM.YRES(4f)); GUIM.DrawText(r, gold, TextAnchor.MiddleRight, BaseColor.White, 1, 20, true); r = new Rect(r.x + GUIM.YRES(130f), r.y, rect.height, rect.height); GUI.DrawTexture(new Rect(r.x + GUIM.YRES(4f), r.y + GUIM.YRES(4f), r.width - GUIM.YRES(8f), r.height - GUIM.YRES(8f)), MenuGold.tGold); if (goldbonus != string.Empty) { r = new Rect(r.x + r.height, r.y, GUIM.YRES(96f), rect.height - GUIM.YRES(4f)); GUIM.DrawText(r, goldbonus, TextAnchor.MiddleRight, BaseColor.White, 1, 20, true); r = new Rect(r.x + GUIM.YRES(98f), r.y, rect.height, rect.height); GUI.DrawTexture(new Rect(r.x + GUIM.YRES(4f), r.y + GUIM.YRES(4f), r.width - GUIM.YRES(8f), r.height - GUIM.YRES(8f)), MenuGold.tGold); r = new Rect(r.x + r.height + GUIM.YRES(4f), r.y, GUIM.YRES(96f), rect.height - GUIM.YRES(4f)); GUIM.DrawText(r, Lang.Get("_BONUS"), TextAnchor.MiddleLeft, BaseColor.White, 1, 20, true); } r = new Rect(rect.x + rect.width - GUIM.YRES(140f), r.y, GUIM.YRES(140f), rect.height); GUI.DrawTexture(r, MenuGold.tBuy); if (GameData.gVK) { r = new Rect(r.x, r.y, r.width, r.height - GUIM.YRES(4f)); GUIM.DrawText(new Rect(r.x, r.y, r.width - GUIM.YRES(72f), r.height), cost, TextAnchor.MiddleRight, BaseColor.White, 1, 20, true); GUI.DrawTexture(new Rect(r.x + GUIM.YRES(74f), r.y + GUIM.YRES(6f), GUIM.YRES(24f), GUIM.YRES(24f)), MenuGold.tVK); } if (GameData.gFB) { GUIM.DrawText(r, cost, TextAnchor.MiddleCenter, BaseColor.White, 1, 20, true); } return(GUIM.HideButton(r)); }
private static void DrawBadge() { GUIM.DrawText(new Rect(Profile.rBackBadge.x, Profile.rBackBadge.y - GUIM.YRES(18f), Profile.rBackBadge.width, GUIM.YRES(18f)), Lang.Get("_BADGE"), TextAnchor.MiddleLeft, BaseColor.White, 1, 12, false); Profile.mpos = new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y); GUIM.DrawBox(Profile.rBackBadge, Profile.tBlack); Rect position = new Rect(Profile.rBackBadge.x + GUIM.YRES(8f), Profile.rBackBadge.y + GUIM.YRES(8f), GUIM.YRES(240f), GUIM.YRES(60f)); Rect position2 = new Rect(Profile.rBackBadge.x + GUIM.YRES(4f) + GUIM.YRES(12f), Profile.rBackBadge.y + GUIM.YRES(8f), GUIM.YRES(60f), GUIM.YRES(60f)); if (BaseData.badge_back == 0) { GUI.DrawTexture(position, Profile.tBadgeBack); } else { GUI.DrawTexture(position, MenuShop.shopdata[BaseData.badge_back].icon); } if (BaseData.badge_icon == 0) { GUI.color = new Color(0f, 0f, 0f, 0.5f); GUI.DrawTexture(position2, Profile.tBadgeIcon); GUI.color = Color.white; } else { GUI.DrawTexture(position2, MenuShop.shopdata[BaseData.badge_icon].icon); } }
public static bool Button(Rect r, BaseColor c, string text, TextAnchor anchor, BaseColor tc, int fp, int size, bool shadow) { GUI.color = GUIM.colorlist[(int)c]; GUI.DrawTexture(r, GUIM.tButton); GUI.color = Color.white; GUIM.DrawText(r, text, anchor, tc, fp, size, shadow); return(GUIM.HideButton(r)); }
public static void DrawProfile() { GUIM.DrawText(new Rect(Profile.rBackProfile.x, Profile.rBackProfile.y - GUIM.YRES(18f), Profile.rBackProfile.width, GUIM.YRES(18f)), Lang.Get("_PROFILE"), TextAnchor.MiddleLeft, BaseColor.White, 1, 12, false); Profile.mpos = new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y); BaseColor fontcolor = BaseColor.White; GUIM.DrawBox(Profile.rBackProfile, Profile.tBlack); if (Main.avatar == null) { GUI.DrawTexture(Profile.rAvatar, Profile.tBlack); } else { GUI.DrawTexture(Profile.rAvatar, Main.avatar); } if (GUIM.HideButton(Profile.rBackName) && !GameData.gSteam) { Profile.inEdit = true; Profile.newname = BaseData.Name; } if (Profile.inEdit) { GUI.DrawTexture(Profile.rBackName, Profile.tGray); GUIM.DrawEdit(Profile.rBackName, ref Profile.newname, TextAnchor.MiddleCenter, BaseColor.White, 1, 14, true); } else { if (Profile.rBackName.Contains(Profile.mpos) && !GameData.gSteam) { GUI.DrawTexture(Profile.rBackName, Profile.tOrange); } else { GUI.DrawTexture(Profile.rBackName, Profile.tBlue); } GUIM.DrawText(Profile.rBackName, BaseData.Name, TextAnchor.MiddleCenter, fontcolor, 1, 14, true); } GUIM.DrawText(new Rect(Profile.rBackName.x, Profile.rBackProfile.y + GUIM.YRES(8f), Profile.rBackName.width, Profile.rBackName.height), Lang.Get("_NICKNAME"), TextAnchor.MiddleLeft, BaseColor.White, 1, 14, false); GUI.DrawTexture(new Rect(Profile.rBackProfile.x + GUIM.YRES(8f), Profile.rBackProfile.y + GUIM.YRES(80f), GUIM.YRES(48f), GUIM.YRES(24f)), Profile.tWhite); GUIM.DrawText(new Rect(Profile.rBackProfile.x + GUIM.YRES(8f), Profile.rBackProfile.y + GUIM.YRES(80f), GUIM.YRES(48f), GUIM.YRES(24f)), BaseData.Level, TextAnchor.MiddleCenter, BaseColor.Blue, 1, 14, false); GUI.DrawTexture(new Rect(Profile.rBackProfile.x + GUIM.YRES(58f), Profile.rBackProfile.y + GUIM.YRES(94f), GUIM.YRES(190f), GUIM.YRES(10f)), Profile.tGray); GUI.DrawTexture(new Rect(Profile.rBackProfile.x + GUIM.YRES(58f), Profile.rBackProfile.y + GUIM.YRES(94f), (float)BaseData.iProgress * 0.01f * GUIM.YRES(190f), GUIM.YRES(10f)), Profile.tOrange); GUIM.DrawText(new Rect(Profile.rBackProfile.x + GUIM.YRES(58f), Profile.rBackProfile.y + GUIM.YRES(80f), GUIM.YRES(190f), GUIM.YRES(12f)), BaseData.Progress, TextAnchor.MiddleRight, BaseColor.Gray, 1, 14, false); GUIM.DrawText(new Rect(Profile.rBackProfile.x + GUIM.YRES(58f), Profile.rBackProfile.y + GUIM.YRES(80f), GUIM.YRES(190f), GUIM.YRES(12f)), BaseData.EXPData, TextAnchor.MiddleLeft, BaseColor.Gray, 1, 14, false); if (GameData.gSteam) { return; } GUIM.DrawBox(Profile.rBackGold, Profile.tBlack); GUI.DrawTexture(new Rect(Profile.rBackGold.x + GUIM.YRES(14f), Profile.rBackGold.y + GUIM.YRES(6f), GUIM.YRES(30f), GUIM.YRES(30f)), Profile.tGold); GUIM.DrawText(new Rect(Profile.rBackGold.x + GUIM.YRES(50f), Profile.rBackGold.y + GUIM.YRES(1f), GUIM.YRES(110f), Profile.rBackGold.height - GUIM.YRES(4f)), BaseData.Gold, TextAnchor.MiddleLeft, BaseColor.White, 1, 20, false); Profile.DrawMenuButton(2, new Rect(Profile.rBackGold.x + GUIM.YRES(120f), Profile.rBackGold.y + GUIM.YRES(6f), GUIM.YRES(126f), GUIM.YRES(30f)), Profile.tGreen, Profile.tOrange); GUIM.DrawText(new Rect(Profile.rBackGold.x + GUIM.YRES(120f), Profile.rBackGold.y + GUIM.YRES(5f), GUIM.YRES(126f), GUIM.YRES(30f)), Lang.Get("_ADD_GOLD"), TextAnchor.MiddleCenter, BaseColor.White, 1, 14, true); }
private static bool DrawParamFloat(Rect r, string text, ref float param, float min, float max) { float num = param; GUIM.DrawText(r, text, TextAnchor.MiddleLeft, BaseColor.White, 1, 12, true); param = GUIM.DrawSlider(new Rect(r.x + r.width - GUIM.YRES(240f), r.y + GUIM.YRES(6f), GUIM.YRES(200f), GUIM.YRES(24f)), (int)GUIM.YRES(200f), min, max, param); param = ((float)((int)(param * 10f)) + 0.05f) / 10f; GUI.DrawTexture(new Rect(r.x + r.width - GUIM.YRES(32f), r.y, GUIM.YRES(32f), GUIM.YRES(24f)), MenuOptions.tGray); GUIM.DrawText(new Rect(r.x + r.width - GUIM.YRES(32f), r.y, GUIM.YRES(32f), GUIM.YRES(24f)), param.ToString("0.0"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true); return(param == num); }
public static void DrawButton(int state, string text, Rect r, Texture2D normal, Texture2D hover, Texture2D line) { TopBar.mpos = new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y); Rect position = new Rect(r.x + (r.width - GUIM.YRES(50f)) / 2f, r.y - GUIM.YRES(8f), GUIM.YRES(50f), GUIM.YRES(50f)); if (TopBar.clicktime[state] + 0.05f > Time.time) { GUI.DrawTexture(r, line); GUI.color = Color.black; GUI.DrawTexture(position, normal); GUI.color = Color.white; GUI.DrawTexture(new Rect(r.x, r.y + GUIM.YRES(38f), r.width, GUIM.YRES(16f)), line); GUIM.DrawText(new Rect(r.x, r.y + GUIM.YRES(38f), r.width, GUIM.YRES(16f)), text, TextAnchor.MiddleCenter, BaseColor.White, 1, 14, true); } else if (r.Contains(TopBar.mpos)) { TopBar.buttontime[state] = Time.time; GUI.DrawTexture(position, hover); GUI.DrawTexture(new Rect(r.x, r.y + GUIM.YRES(38f), r.width, GUIM.YRES(16f)), line); GUIM.DrawText(new Rect(r.x, r.y + GUIM.YRES(38f), r.width, GUIM.YRES(16f)), text, TextAnchor.MiddleCenter, BaseColor.White, 1, 14, true); if (Input.GetMouseButton(0)) { TopBar.clicktime[state] = Time.time; } } else { float num = Time.time - TopBar.buttontime[state]; float num2 = 16f - num * 100f; if (num2 < 2f) { num2 = 2f; } GUI.DrawTexture(position, normal); GUI.DrawTexture(new Rect(r.x, r.y + GUIM.YRES(38f), r.width, GUIM.YRES(num2)), line); } if (GUIM.HideButton(r)) { Main.HideAll(); if (state == 0) { MenuServers.SetActive(true); } if (state == 1) { MenuShop.SetActive(true); } if (state == 2) { MenuOptions.SetActive(true); } } }
public static void DrawMenu() { GUIM.DrawText(new Rect(Profile.rBackMenu.x, Profile.rBackMenu.y - GUIM.YRES(18f), Profile.rBackMenu.width, GUIM.YRES(18f)), Lang.Get("_PLAYER_MENU"), TextAnchor.MiddleLeft, BaseColor.White, 1, 12, false); GUIM.DrawBox(Profile.rBackMenu, Profile.tBlack); Profile.DrawMenuButton(0, new Rect(Profile.rBackMenu.x + GUIM.YRES(2f), Profile.rBackMenu.y + GUIM.YRES(0f), GUIM.YRES(40f), GUIM.YRES(40f)), Profile.tPlayer[0], Profile.tPlayer[1]); Profile.DrawMenuButton(1, new Rect(Profile.rBackMenu.x + GUIM.YRES(2f) + GUIM.YRES(40f), Profile.rBackMenu.y + GUIM.YRES(0f), GUIM.YRES(40f), GUIM.YRES(40f)), Profile.tInventory[0], Profile.tInventory[1]); GUI.color = new Color(1f, 1f, 1f, 0.4f); GUI.DrawTexture(new Rect(Profile.rBackMenu.x + (GUIM.YRES(2f) + GUIM.YRES(40f)) * 2f, Profile.rBackMenu.y + GUIM.YRES(4f), GUIM.YRES(40f), GUIM.YRES(32f)), Profile.tBlack); GUI.DrawTexture(new Rect(Profile.rBackMenu.x + (GUIM.YRES(2f) + GUIM.YRES(40f)) * 3f, Profile.rBackMenu.y + GUIM.YRES(4f), GUIM.YRES(40f), GUIM.YRES(32f)), Profile.tBlack); GUI.DrawTexture(new Rect(Profile.rBackMenu.x + (GUIM.YRES(2f) + GUIM.YRES(40f)) * 4f, Profile.rBackMenu.y + GUIM.YRES(4f), GUIM.YRES(40f), GUIM.YRES(32f)), Profile.tBlack); GUI.DrawTexture(new Rect(Profile.rBackMenu.x + (GUIM.YRES(2f) + GUIM.YRES(40f)) * 5f, Profile.rBackMenu.y + GUIM.YRES(4f), GUIM.YRES(40f), GUIM.YRES(32f)), Profile.tBlack); GUI.color = Color.white; }
private void DrawLoadingProgress(float progress) { GUI.DrawTexture(this.rLoadingBackgr, Main.tLoadingBackgr); GUIM.DrawText(this.rLoadingText, string.Concat(new object[] { Lang.Get("_LOADING"), " ", (int)(ContentLoader2_.progress * 100f), "%" }), TextAnchor.MiddleLeft, BaseColor.White, 0, 22, true); if (progress < 15f) { GUI.DrawTexture(this.rLoadingProgr, Main.tLoadingProgr1); } else if (progress >= 15f && progress < 31f) { GUI.DrawTexture(this.rLoadingProgr, Main.tLoadingProgr2); } else if (progress >= 31f && progress < 47f) { GUI.DrawTexture(this.rLoadingProgr, Main.tLoadingProgr3); } else if (progress >= 47f && progress < 63f) { GUI.DrawTexture(this.rLoadingProgr, Main.tLoadingProgr4); } else if (progress >= 63f && progress < 79f) { GUI.DrawTexture(this.rLoadingProgr, Main.tLoadingProgr5); } else if (progress >= 79f && progress < 95f) { GUI.DrawTexture(this.rLoadingProgr, Main.tLoadingProgr6); } else if (progress >= 95f) { GUI.DrawTexture(this.rLoadingProgr, Main.tLoadingProgr7); } Matrix4x4 matrix = GUI.matrix; GUIUtility.RotateAroundPivot(this.coolerAngle, new Vector2((float)Screen.width / 2f + GUI2.YRES(97f), (float)Screen.height / 2f + GUI2.YRES(0f))); GUI.DrawTexture(this.rLoadingCooler, Main.tLoadingCooler); GUI.matrix = matrix; }
private static void DrawMask() { GUIM.DrawText(new Rect(Profile.rBackMask.x, Profile.rBackMask.y - GUIM.YRES(18f), Profile.rBackMask.width, GUIM.YRES(18f)), Lang.Get("_MASKS"), TextAnchor.MiddleLeft, BaseColor.White, 1, 12, false); GUIM.DrawBox(Profile.rBackMask, Profile.tBlack); if (BaseData.mask_merc == 0) { GUI.DrawTexture(new Rect(Profile.rBackMask.x + GUIM.YRES(32f), Profile.rBackMask.y + GUIM.YRES(8f), GUIM.YRES(60f), GUIM.YRES(60f)), Profile.tMercMask); } else { GUI.DrawTexture(new Rect(Profile.rBackMask.x + GUIM.YRES(32f), Profile.rBackMask.y + GUIM.YRES(8f), GUIM.YRES(60f), GUIM.YRES(60f)), MenuShop.shopdata[BaseData.mask_merc].icon); } if (BaseData.mask_warcorp == 0) { GUI.DrawTexture(new Rect(Profile.rBackMask.x + Profile.rBackMask.width - GUIM.YRES(92f), Profile.rBackMask.y + GUIM.YRES(8f), GUIM.YRES(60f), GUIM.YRES(60f)), Profile.tCorpMask); } else { GUI.DrawTexture(new Rect(Profile.rBackMask.x + Profile.rBackMask.width - GUIM.YRES(92f), Profile.rBackMask.y + GUIM.YRES(8f), GUIM.YRES(60f), GUIM.YRES(60f)), MenuShop.shopdata[BaseData.mask_warcorp].icon); } }
public static void Draw() { if (!MenuFriends.show) { return; } GUIM.DrawText(new Rect((float)Screen.width / 2f + GUIM.YRES(240f), GUIM.YRES(110f) - GUIM.YRES(18f), GUIM.YRES(200f), GUIM.YRES(18f)), Lang.Get("_FRIENDS"), TextAnchor.MiddleLeft, BaseColor.White, 1, 12, false); int num = (int)GUIM.YRES(36f); int num2 = (int)GUIM.YRES(4f); int num3 = 0; int num4 = MenuFriends.currpage * 14; int num5 = (MenuFriends.currpage + 1) * 14; if (num5 > MenuFriends.friendlistorder.Count) { num5 = MenuFriends.friendlistorder.Count; } for (int i = num4; i < num5; i++) { MenuFriends.DrawFriend(new Rect((float)Screen.width / 2f + GUIM.YRES(240f), GUIM.YRES(110f) + (float)((num + num2) * num3), GUIM.YRES(200f), (float)num), MenuFriends.friendlistorder[i]); num3++; } if (GUIM.Button(new Rect((float)Screen.width / 2f + GUIM.YRES(396f), GUIM.YRES(110f) - GUIM.YRES(18f), GUIM.YRES(20f), GUIM.YRES(16f)), BaseColor.Black, "<", TextAnchor.MiddleCenter, BaseColor.Gray, 1, 16, false)) { MenuFriends.currpage--; if (MenuFriends.currpage < 0) { MenuFriends.currpage = 0; } } if (GUIM.Button(new Rect((float)Screen.width / 2f + GUIM.YRES(396f) + GUIM.YRES(24f), GUIM.YRES(110f) - GUIM.YRES(18f), GUIM.YRES(20f), GUIM.YRES(16f)), BaseColor.Black, ">", TextAnchor.MiddleCenter, BaseColor.Gray, 1, 16, false)) { MenuFriends.currpage++; if (MenuFriends.currpage > MenuFriends.friendlistorder.Count / 14) { MenuFriends.currpage = MenuFriends.friendlistorder.Count / 14; } } }
private static void DrawParamKey(Rect r, string text, ref KeyCode param) { GUIM.DrawText(r, text, TextAnchor.MiddleLeft, BaseColor.White, 1, 12, true); Rect r2 = new Rect(r.x + r.width - GUIM.YRES(80f), r.y, GUIM.YRES(80f), GUIM.YRES(24f)); bool flag = GUIM.Button(r2, BaseColor.Gray, param.ToString(), TextAnchor.MiddleCenter, BaseColor.White, 1, 14, false); if (flag) { MenuOptions.WaitKey = true; MenuOptions.rWaitKey = r; } if (MenuOptions.WaitKey && MenuOptions.rWaitKey == r) { GUIM.Button(r2, BaseColor.Red, "_", TextAnchor.MiddleCenter, BaseColor.White, 1, 14, false); if (Input.GetKeyDown(KeyCode.Escape)) { MenuOptions.WaitKey = false; } for (int i = 0; i < 32; i++) { if (vp_FPInput.control[i] == Event.current.keyCode) { return; } } if (Event.current.isKey) { param = Event.current.keyCode; MenuOptions.WaitKey = false; } if (Event.current.shift) { param = KeyCode.LeftShift; MenuOptions.WaitKey = false; } } }
private static void DrawFriend(Rect r, MenuFriends.FriendData f) { if (f == null) { return; } int num = (int)GUIM.YRES(2f); GUIM.DrawBox(r, MenuFriends.tBlack); if (f.avatar != null) { GUI.DrawTexture(new Rect(r.x + (float)num, r.y + (float)num, GUIM.YRES(32f), GUIM.YRES(32f)), f.avatar); } GUIM.DrawText(new Rect(r.x + GUIM.YRES(40f), r.y + (float)num, GUIM.YRES(140f), GUIM.YRES(20f)), f.name, TextAnchor.MiddleLeft, BaseColor.White, 1, 14, false); if (f.ingame) { GUIM.DrawText(new Rect(r.x + GUIM.YRES(40f), r.y + GUIM.YRES(16f), GUIM.YRES(140f), GUIM.YRES(20f)), "WARMODE", TextAnchor.MiddleLeft, BaseColor.Yellow, 0, 12, false); } else { string state = MenuFriends.GetState(f.state); GUIM.DrawText(new Rect(r.x + GUIM.YRES(40f), r.y + GUIM.YRES(16f), GUIM.YRES(140f), GUIM.YRES(20f)), state, TextAnchor.MiddleLeft, BaseColor.Gray, 0, 12, false); } }
public static void Draw() { if (!MenuShop.show) { return; } float num = Time.time - MenuShop.showtime + 0.001f; if (num > 0.05f) { num = 0.05f; } num *= 20f; Matrix4x4 matrix = GUI.matrix; Vector3 s = new Vector3(num, num, 1f); Vector3 pos = new Vector3(MenuShop.rBack.center.x - MenuShop.rBack.center.x * num, MenuShop.rBack.center.y - MenuShop.rBack.center.y * num, 1f); GUI.matrix = Matrix4x4.TRS(pos, Quaternion.identity, s); GUIM.DrawBox(MenuShop.rBackHeader, MenuShop.tBlack); GUIM.DrawBox(MenuShop.rBackBody, MenuShop.tBlack); if (MenuShop.currData != null) { if (MenuShop.currData.section == 1) { GUI.DrawTexture(new Rect(MenuShop.rBackHeader.x + GUIM.YRES(8f), MenuShop.rBackHeader.y + GUIM.YRES(8f) + GUIM.YRES(40f), GUIM.YRES(256f), GUIM.YRES(64f)), MenuShop.currData.icon); } if (MenuShop.currData.section == 2) { GUI.DrawTexture(new Rect(MenuShop.rBackHeader.x + GUIM.YRES(84f), MenuShop.rBackHeader.y + GUIM.YRES(20f), GUIM.YRES(120f), GUIM.YRES(120f)), MenuShop.currData.icon); } if (MenuShop.currData.section == 3 || MenuShop.currData.section == 4) { GUI.DrawTexture(new Rect(MenuShop.rBackHeader.x + GUIM.YRES(64f), MenuShop.rBackHeader.y + GUIM.YRES(8f), GUIM.YRES(160f), GUIM.YRES(160f)), MenuShop.currData.icon); } if (MenuShop.currData.section == 5) { GUI.DrawTexture(new Rect(MenuShop.rBackHeader.x + GUIM.YRES(16f), MenuShop.rBackHeader.y - GUIM.YRES(48f), GUIM.YRES(256f), GUIM.YRES(256f)), MenuShop.currData.icon); if (GUIM.Button(MenuShop.rView, BaseColor.Blue, string.Empty, TextAnchor.MiddleCenter, BaseColor.White, 0, 0, false)) { Main.HideAll(); MenuPreview.SetActive(true); MenuPreview.Preview(MenuShop.currData); } GUI.DrawTexture(MenuShop.rView, MenuShop.view); } if (BaseData.item[MenuShop.currData.wid] == 0) { BaseColor c = BaseColor.Green; if (MenuShop.inbuy) { c = BaseColor.Gray; } if (BaseData.iLevel < MenuShop.currData.level) { c = BaseColor.Red; } if (GUIM.Button(MenuShop.rBuy, c, Lang.Get("_BUY"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true) && BaseData.iLevel >= MenuShop.currData.level) { if (GameData.gSteam) { WebHandler.get_buy("&itemid=" + MenuShop.currData.wid.ToString()); } else if (GameData.gSocial) { WebHandler.set_buy("&itemid=" + MenuShop.currData.wid.ToString()); } MenuShop.inbuy = true; } } else { GUI.DrawTexture(MenuShop.rBuy, MenuShop.tGray); GUIM.DrawText(MenuShop.rBuy, Lang.Get("_ALREADY_HAVE"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false); } GUIM.DrawText(new Rect(MenuShop.rBuy.x, MenuShop.rBuy.y - GUIM.YRES(24f), MenuShop.rBuy.width, MenuShop.rBuy.height), Lang.Get("_COST") + ":", TextAnchor.MiddleLeft, BaseColor.White, 1, 12, false); string text = string.Format("{0:C}", (float)MenuShop.currData.cost / 100f); if (GameData.gSteam) { GUIM.DrawText(new Rect(MenuShop.rBuy.x, MenuShop.rBuy.y - GUIM.YRES(24f), MenuShop.rBuy.width, MenuShop.rBuy.height), text, TextAnchor.MiddleRight, BaseColor.White, 1, 12, false); } else if (GameData.gSocial) { text = MenuShop.CentToGold(MenuShop.currData.cost).ToString(); GUIM.DrawText(new Rect(MenuShop.rBuy.x, MenuShop.rBuy.y - GUIM.YRES(24f), MenuShop.rBuy.width - GUIM.YRES(14f), MenuShop.rBuy.height), text, TextAnchor.MiddleRight, BaseColor.White, 1, 12, false); GUI.DrawTexture(new Rect(MenuShop.rBuy.x + GUIM.YRES(108f), MenuShop.rBuy.y - GUIM.YRES(17f), GUIM.YRES(12f), GUIM.YRES(12f)), MenuShop.tGold); } GUIM.DrawText(new Rect(MenuShop.rBuy.x, MenuShop.rBackHeader.y + GUIM.YRES(8f), MenuShop.rBuy.width, MenuShop.rBuy.height), MenuShop.currData.name, TextAnchor.MiddleRight, BaseColor.White, 1, 12, false); } MenuShop.DrawButtonCategory(0, new Rect(MenuShop.rBackBody.x + GUIM.YRES(4f), MenuShop.rBackBody.y + GUIM.YRES(4f), GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_BADGES"), false); MenuShop.DrawButtonCategory(1, new Rect(MenuShop.rBackBody.x + GUIM.YRES(4f) + GUIM.YRES(84f), MenuShop.rBackBody.y + GUIM.YRES(4f), GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_MASKS"), false); MenuShop.DrawButtonCategory(2, new Rect(MenuShop.rBackBody.x + GUIM.YRES(4f) + GUIM.YRES(84f) * 2f, MenuShop.rBackBody.y + GUIM.YRES(4f), GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_WEAPONS"), false); MenuShop.scroll = GUIM.BeginScrollView(new Rect(MenuShop.rBackBody.x + GUIM.YRES(4f), MenuShop.rBackBody.y + GUIM.YRES(32f), MenuShop.rBackBody.width - GUIM.YRES(8f), MenuShop.rBackBody.height - GUIM.YRES(40f)), MenuShop.scroll, new Rect(0f, 0f, 0f, (float)MenuShop.hcount * GUIM.YRES(100f) - GUIM.YRES(4f))); int num2 = 0; int num3 = 0; for (int i = 0; i < 1024; i++) { if (MenuShop.shopdata[i] != null) { if (MenuShop.currCat != 0 || MenuShop.shopdata[i].section == 1 || MenuShop.shopdata[i].section == 2) { if (MenuShop.currCat != 1 || MenuShop.shopdata[i].section == 3 || MenuShop.shopdata[i].section == 4) { if (MenuShop.currCat != 2 || MenuShop.shopdata[i].section == 5) { MenuShop.DrawItem(new Rect((GUIM.YRES(96f) + GUIM.YRES(4f)) * (float)num2, (GUIM.YRES(96f) + GUIM.YRES(4f)) * (float)num3, GUIM.YRES(96f), GUIM.YRES(96f)), MenuShop.shopdata[i]); num2++; if (num2 >= 4) { num2 = 0; num3++; } } } } } } MenuShop.hcount = num3; if (num2 != 0) { MenuShop.hcount++; } GUIM.EndScrollView(); GUI.matrix = matrix; }
public static void DrawButton(int state, Rect r, string text, Texture2D icon) { BottomBar.mpos = new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y); if (BottomBar.click2time[state] + 0.05f > Time.time) { GUI.DrawTexture(r, BottomBar.tWhite); GUI.color = Color.black; GUI.DrawTexture(new Rect(r.x + (r.width - r.height) / 2f, r.y, r.height, r.height), icon); GUI.color = Color.white; GUI.DrawTexture(new Rect(r.x, r.y - GUIM.YRES(14f), r.width, GUIM.YRES(16f)), BottomBar.tWhite); GUIM.DrawText(new Rect(r.x, r.y - GUIM.YRES(14f), r.width, GUIM.YRES(16f)), text, TextAnchor.MiddleCenter, BaseColor.Black, 0, 10, false); } else if (r.Contains(BottomBar.mpos)) { BottomBar.button2time[state] = Time.time; GUI.DrawTexture(new Rect(r.x + (r.width - r.height) / 2f, r.y, r.height, r.height), icon); GUI.DrawTexture(new Rect(r.x, r.y - GUIM.YRES(14f), r.width, GUIM.YRES(16f)), BottomBar.tWhite); GUIM.DrawText(new Rect(r.x, r.y - GUIM.YRES(14f), r.width, GUIM.YRES(16f)), text, TextAnchor.MiddleCenter, BaseColor.Black, 0, 10, false); if (Input.GetMouseButton(0)) { BottomBar.click2time[state] = Time.time; } } else { float num = Time.time - BottomBar.button2time[state]; float num2 = 16f - num * 100f; if (num2 < 2f) { num2 = 2f; } GUI.DrawTexture(new Rect(r.x + (r.width - r.height) / 2f, r.y, r.height, r.height), icon); GUI.DrawTexture(new Rect(r.x, r.y + GUIM.YRES(2f - num2), r.width, GUIM.YRES(num2)), BottomBar.tWhite); } if (GUIM.HideButton(r)) { if (state == 0) { Lang.ChangeLanguage(); } if (state == 1) { if (Options.menuvol != 0f) { Options.menuvol = 0f; } else { Options.menuvol = 0.25f; } PlayerPrefs.SetFloat("menuvol", Options.menuvol); GameObject gameObject = GameObject.Find("Camera"); if (gameObject && gameObject.GetComponent <AudioSource>()) { gameObject.GetComponent <AudioSource>().volume = Options.menuvol; } } if (state == 2) { Options.ToggleFullScreen(); } } }
private static bool DrawParamInt(Rect r, string text, ref int param, string[] options) { bool result = false; BaseColor fontcolor = BaseColor.White; if (options == null && param == 0) { fontcolor = BaseColor.Gray; } GUIM.DrawText(r, text, TextAnchor.MiddleLeft, fontcolor, 1, 12, true); if (options == null) { Rect r2 = new Rect(r.x + r.width - GUIM.YRES(68f), r.y, GUIM.YRES(32f), GUIM.YRES(24f)); bool flag; if (param == 1) { flag = GUIM.Button(r2, BaseColor.White, MenuOptions.trigger[1], TextAnchor.MiddleCenter, BaseColor.Blue, 1, 10, false); } else { flag = GUIM.Button(r2, BaseColor.Gray, MenuOptions.trigger[1], TextAnchor.MiddleCenter, BaseColor.White, 1, 10, false); } if (flag) { param = 1; result = true; } Rect r3 = new Rect(r.x + r.width - GUIM.YRES(32f), r.y, GUIM.YRES(32f), GUIM.YRES(24f)); if (param == 0) { flag = GUIM.Button(r3, BaseColor.White, MenuOptions.trigger[0], TextAnchor.MiddleCenter, BaseColor.Blue, 1, 10, false); } else { flag = GUIM.Button(r3, BaseColor.Gray, MenuOptions.trigger[0], TextAnchor.MiddleCenter, BaseColor.White, 1, 10, false); } if (flag) { param = 0; result = true; } } else if (options.Length >= 1) { Rect rect = new Rect(r.x + r.width - GUIM.YRES(32f) - GUIM.YRES(4f) - GUIM.YRES(200f), r.y, GUIM.YRES(200f), GUIM.YRES(24f)); GUI.DrawTexture(rect, MenuOptions.tGray); GUIM.DrawText(rect, options[param], TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true); Rect rect2 = new Rect(rect.x - GUIM.YRES(4f) - GUIM.YRES(32f), r.y, GUIM.YRES(32f), GUIM.YRES(24f)); GUI.DrawTexture(rect2, MenuOptions.tGray); bool flag = GUIM.Button(rect2, BaseColor.Gray, "-", TextAnchor.MiddleCenter, BaseColor.White, 1, 16, false); if (flag) { param--; result = true; } Rect r4 = new Rect(r.x + r.width - GUIM.YRES(32f), r.y, GUIM.YRES(32f), GUIM.YRES(24f)); flag = GUIM.Button(r4, BaseColor.Gray, "+", TextAnchor.MiddleCenter, BaseColor.White, 1, 16, false); if (flag) { param++; result = true; } if (param < 0) { param = 0; result = false; } if (param >= options.Length) { param = options.Length - 1; result = false; } } return(result); }
private void OnGUI() { if (!this.show) { return; } GUI.depth = -1; GUI.color = new Color(1f, 1f, 1f, 0.8f); if (this.tBlack) { GUI.DrawTexture(this.rBlack, this.tBlack); } GUI.color = Color.white; float num = (float)Screen.height / 2f - 46f; for (int i = MainMenuConsole.log.Count - 1; i >= 0; i--) { GUIM.DrawText(new Rect(4f, num, (float)(Screen.width - 8), 24f), MainMenuConsole.log[i], TextAnchor.MiddleLeft, BaseColor.Gray, 0, 12, false); num -= 14f; } GUIM.DrawText(new Rect(0f, 0f, (float)(Screen.width - 4), 24f), "[MENU CONSOLE]", TextAnchor.MiddleRight, BaseColor.White, 0, 16, true); GUIM.DrawEdit(new Rect(4f, (float)Screen.height / 2f - 28f, (float)(Screen.width - 8), 24f), ref MainMenuConsole.command, TextAnchor.MiddleLeft, BaseColor.White, 0, 16, true); char character = Event.current.character; if ((character < 'a' || character > 'z') && (character < 'A' || character > 'Z') && (character < '0' || character > '9') && character != ' ' && character != '_' && character != '.') { Event.current.character = '\0'; } if (Event.current.isKey) { KeyCode keyCode = Event.current.keyCode; switch (keyCode) { case KeyCode.KeypadEnter: goto IL_1FB; case KeyCode.KeypadEquals: IL_1B8: if (keyCode == KeyCode.Return) { goto IL_1FB; } if (keyCode != KeyCode.BackQuote && keyCode != KeyCode.F10) { return; } MainMenuConsole.command = string.Empty; this.SetActive(false); Event.current.Use(); return; case KeyCode.UpArrow: { MainMenuConsole.command = MainMenuConsole.inputstore; TextEditor textEditor = (TextEditor)GUIUtility.GetStateObject(typeof(TextEditor), GUIUtility.keyboardControl); textEditor.selectIndex = MainMenuConsole.command.Length + 1; textEditor.cursorIndex = MainMenuConsole.command.Length + 1; return; } } goto IL_1B8; IL_1FB: MainMenuConsole.ParsingCommand(MainMenuConsole.command); MainMenuConsole.command = string.Empty; Event.current.Use(); } }
private void OnGUI() { Rect r = new Rect((float)Screen.width / 2f - GUIM.YRES(160f), (float)Screen.height / 2f - GUIM.YRES(30f), GUIM.YRES(400f), GUIM.YRES(80f)); if (GameData.gSteam) { if (!Steam.active) { GUIM.DrawBox(r, Main.tBlack); GUIM.DrawText(r, Lang.Get("_STEAM_NOT_LAUNCHED"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true); return; } if (!Steam.logged) { GUIM.DrawBox(r, Main.tBlack); GUIM.DrawText(r, Lang.Get("_STEAM_NOT_LOGGEDON"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true); return; } } if (!ContentLoader_.proceed) { UIManager.SetLoadingActive(true); return; } UIManager.SetLoadingActive(false); if (BaseData.banCost != string.Empty) { GUIM.DrawBox(r, Main.tBlack); Rect r2 = new Rect(r.x, r.y, r.width, r.height - GUIM.YRES(36f)); string str = "$" + BaseData.banCost; if (GameData.gVK) { str = BaseData.banCost + " г."; } if (GameData.gFB) { int num = Convert.ToInt32(BaseData.banCost); str = string.Format("{0:C}", (float)num * 0.12f); } GUIM.DrawText(r2, Lang.Get("_YOU_BANNED!_UNBAN_COST") + " - " + str, TextAnchor.MiddleCenter, BaseColor.White, 1, 16, true); Rect r3 = new Rect(r.x + GUIM.YRES(84f), r.y + GUIM.YRES(44f), GUIM.YRES(100f), GUIM.YRES(22f)); if (GameData.gSocial) { r3 = new Rect(r.x + GUIM.YRES(150f), r.y + GUIM.YRES(44f), GUIM.YRES(100f), GUIM.YRES(22f)); } if (Main.inbuySteam || Main.inbuySocial) { GUIM.Button(r3, BaseColor.Gray, Lang.Get("_UNBAN"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true); } else { if (GameData.gSteam && GUIM.Button(r3, BaseColor.Green, Lang.Get("_UNBAN"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true)) { WebHandler.get_buy("&itemid=10000"); Main.inbuySteam = true; } if (GameData.gVK && GUIM.Button(r3, BaseColor.Green, Lang.Get("_UNBAN"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true)) { Main.inbuySocial = true; Application.ExternalCall("order", new object[] { "item10000" }); } if (GameData.gFB && GUIM.Button(r3, BaseColor.Green, Lang.Get("_UNBAN"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true)) { Main.inbuySocial = true; FBManager.BuyUnbun(Convert.ToInt32(BaseData.banCost)); } } if (GameData.gSteam) { Rect r4 = new Rect(r.x + GUIM.YRES(216f), r.y + GUIM.YRES(44f), GUIM.YRES(100f), GUIM.YRES(22f)); if (GUIM.Button(r4, BaseColor.Red, Lang.Get("_EXIT"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true)) { Application.Quit(); } } return; } if (!Client.actualVersion) { GUIM.DrawBox(r, Main.tBlack); Rect r5 = new Rect(r.x, r.y, r.width, r.height - GUIM.YRES(36f)); if (GameData.gSteam) { GUIM.DrawText(r5, Lang.Get("_UPDATE_VERSION"), TextAnchor.MiddleCenter, BaseColor.White, 1, 16, true); Rect r6 = new Rect(r.x + GUIM.YRES(150f), r.y + GUIM.YRES(44f), GUIM.YRES(100f), GUIM.YRES(22f)); if (GUIM.Button(r6, BaseColor.Red, Lang.Get("_EXIT"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true)) { Application.Quit(); } } if (GameData.gSocial) { GUIM.DrawText(r, Lang.Get("_UPDATE_VERSION"), TextAnchor.MiddleCenter, BaseColor.White, 1, 16, true); } return; } if (!BaseData.Auth) { GUIM.DrawBox(r, Main.tBlack); GUIM.DrawText(r, Lang.Get("_AUTHORIZATION"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true); return; } if (Main.tVig) { GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), Main.tVig); } TopBar.Draw(); BottomBar.Draw(); Profile.Draw(); MenuPlayer.Draw(); MenuGold.Draw(); MenuServers.Draw(); MenuShop.Draw(); MenuOptions.Draw(); MenuInventory.Draw(); MenuPreview.Draw(); if (GameData.gSteam) { MenuFriends.Draw(); } }
public static void Draw() { if (!MenuServers.show) { return; } float num = Time.time - MenuServers.showtime + 0.001f; if (num > 0.05f) { num = 0.05f; } num *= 20f; Matrix4x4 matrix = GUI.matrix; Vector3 s = new Vector3(num, num, 1f); Vector3 pos = new Vector3(MenuServers.rBack.center.x - MenuServers.rBack.center.x * num, MenuServers.rBack.center.y - MenuServers.rBack.center.y * num, 1f); GUI.matrix = Matrix4x4.TRS(pos, Quaternion.identity, s); GUIM.DrawBox(MenuServers.rBack, MenuServers.tBlack); Rect rect = new Rect(MenuServers.rBack.x + GUIM.YRES(4f), MenuServers.rBack.y + GUIM.YRES(4f), GUIM.YRES(40f), GUIM.YRES(24f)); GUI.DrawTexture(rect, MenuServers.tGray); GUIM.DrawText(rect, "#", TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false); rect.x = rect.x + GUIM.YRES(2f) + rect.width; rect.width = GUIM.YRES(120f); GUI.DrawTexture(rect, MenuServers.tGray); GUIM.DrawText(rect, Lang.Get("_MODE"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false); rect.x = rect.x + GUIM.YRES(2f) + rect.width; rect.width = GUIM.YRES(104f); GUI.DrawTexture(rect, MenuServers.tGray); GUIM.DrawText(rect, Lang.Get("_MAP"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false); rect.x = rect.x + GUIM.YRES(2f) + rect.width; rect.width = GUIM.YRES(60f); GUI.DrawTexture(rect, MenuServers.tGray); GUIM.DrawText(rect, Lang.Get("_RATE"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false); rect.x = rect.x + GUIM.YRES(2f) + rect.width; rect.width = GUIM.YRES(80f); GUI.DrawTexture(rect, MenuServers.tGray); GUIM.DrawText(rect, Lang.Get("_PLAYERS"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false); int num2 = 0; for (int i = 0; i < MenuServers.server.Count; i++) { if (MenuServers.server[i].channel == MenuServers.currChannel) { num2++; } } MenuServers.scroll = GUIM.BeginScrollView(new Rect(MenuServers.rBack.x + GUIM.YRES(4f), MenuServers.rBack.y + GUIM.YRES(32f), MenuServers.rBack.width - GUIM.YRES(8f), MenuServers.rBack.height - GUIM.YRES(40f)), MenuServers.scroll, new Rect(0f, 0f, 0f, (float)num2 * GUIM.YRES(26f))); int num3 = 0; for (int j = 16; j >= 0; j--) { for (int k = 0; k < MenuServers.server.Count; k++) { if (MenuServers.currMode != 0 || MenuServers.server[k].gamemode == 0) { if (MenuServers.currMode != 1 || MenuServers.server[k].gamemode == 1) { if (MenuServers.currMode != 2 || MenuServers.server[k].gamemode == 2) { if (MenuServers.currMode != 3 || MenuServers.server[k].gamemode == 3) { if (MenuServers.server[k].channel == MenuServers.currChannel) { if (MenuServers.server[k].players == j) { if (MenuServers.DrawButtonServer(MenuServers.server[k], num3)) { MenuServers.currServer = MenuServers.server[k]; } num3++; } } } } } } } } GUIM.EndScrollView(); MenuServers.rBackChannel = new Rect(MenuServers.rBack.x + MenuServers.rBack.width + GUIM.YRES(12f), MenuServers.rBack.y, GUIM.YRES(200f), GUIM.YRES(28f) * (float)(MenuServers.CServerData.maxchannel + 1) + GUIM.YRES(4f)); GUIM.DrawBox(MenuServers.rBackChannel, MenuServers.tBlack); GUIM.DrawBox(MenuServers.rBackPlay, MenuServers.tBlack); for (int l = 0; l < MenuServers.CServerData.maxchannel + 1; l++) { MenuServers.DrawButtonChannel(l, new Rect(MenuServers.rBackChannel.x + GUIM.YRES(4f), MenuServers.rBackChannel.y + GUIM.YRES(4f) + (float)l * GUIM.YRES(28f), MenuServers.rBackChannel.width - GUIM.YRES(8f), GUIM.YRES(24f)), Lang.Get("_CHANNEL") + " " + l.ToString("00")); } MenuServers.rBackMode = new Rect(MenuServers.rBackChannel.x, MenuServers.rBackChannel.y + MenuServers.rBackChannel.height + GUIM.YRES(28f), MenuServers.rBackChannel.width, GUIM.YRES(28f) * 4f + GUIM.YRES(4f)); MenuServers.rButtonMode[0] = new Rect(MenuServers.rBackChannel.x + GUIM.YRES(4f), MenuServers.rBackChannel.y + MenuServers.rBackChannel.height + GUIM.YRES(28f) + GUIM.YRES(4f), MenuServers.rBackChannel.width - GUIM.YRES(8f), GUIM.YRES(24f)); MenuServers.rButtonMode[1] = new Rect(MenuServers.rBackChannel.x + GUIM.YRES(4f), MenuServers.rBackChannel.y + MenuServers.rBackChannel.height + GUIM.YRES(28f) * 2f + GUIM.YRES(4f), MenuServers.rBackChannel.width - GUIM.YRES(8f), GUIM.YRES(24f)); MenuServers.rButtonMode[2] = new Rect(MenuServers.rBackChannel.x + GUIM.YRES(4f), MenuServers.rBackChannel.y + MenuServers.rBackChannel.height + GUIM.YRES(28f) * 3f + GUIM.YRES(4f), MenuServers.rBackChannel.width - GUIM.YRES(8f), GUIM.YRES(24f)); MenuServers.rButtonMode[3] = new Rect(MenuServers.rBackChannel.x + GUIM.YRES(4f), MenuServers.rBackChannel.y + MenuServers.rBackChannel.height + GUIM.YRES(28f) * 4f + GUIM.YRES(4f), MenuServers.rBackChannel.width - GUIM.YRES(8f), GUIM.YRES(24f)); GUIM.DrawBox(MenuServers.rBackMode, MenuServers.tBlack); MenuServers.DrawButtonMode(0, MenuServers.rButtonMode[0], Lang.Get("_DEATHMATCH")); MenuServers.DrawButtonMode(1, MenuServers.rButtonMode[1], Lang.Get("_CONFRONTATION")); MenuServers.DrawButtonMode(2, MenuServers.rButtonMode[2], Lang.Get("_DETONATION")); MenuServers.DrawButtonMode(3, MenuServers.rButtonMode[3], Lang.Get("_ZOMBIEMATCH")); GUI.DrawTexture(MenuServers.rButtonRefresh, MenuServers.tGray); float num4 = MenuServers.RefreshTime[MenuServers.currChannel] + 5f - Time.time; string str = string.Empty; if (num4 >= 0f) { str = " " + num4.ToString("0.00"); } if (GUIM.Button(MenuServers.rButtonRefresh, BaseColor.Gray, Lang.Get("_REFRESH") + str, TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false)) { MenuServers.Refresh(MenuServers.currChannel); } bool flag = false; if (MenuServers.currServer != null) { flag = GUIM.Button(MenuServers.rButtonPlay, BaseColor.Orange, Lang.Get("_CONNECT"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true); } else { GUIM.Button(MenuServers.rButtonPlay, BaseColor.Black, Lang.Get("_CONNECT"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true); } if (flag) { PlayerPrefs.SetInt("localplay", 0); PlayerPrefs.SetString("autostart", "connect " + MenuServers.currServer.ip + " " + MenuServers.currServer.port.ToString()); Application.LoadLevel("game"); } GUI.matrix = matrix; }
private static bool DrawButtonServer(MenuServers.CServerData s, int pos) { Texture2D image = MenuServers.tGray; BaseColor fontcolor = BaseColor.LightGray; if (s.players == 16) { fontcolor = BaseColor.Red; } else if (s.players > 0) { fontcolor = BaseColor.Yellow; } if (s == MenuServers.currServer) { image = MenuServers.tWhite; if (s.players != 16) { fontcolor = BaseColor.Blue; } } string name = GameMode.GetName(s.gamemode); string text = s.mapname; string clearName = s.mapname; if (text != null) { string[] array = text.Split(new char[] { 'v' }); clearName = array[0]; } text = MapData.GetName(clearName); Rect rect = new Rect(0f, GUIM.YRES((float)(1 * pos * 26)), GUIM.YRES(40f), GUIM.YRES(24f)); Color white = new Color(1f, 1f, 1f, 0.5f); if (pos % 2 == 0) { white = new Color(1f, 1f, 1f, 0.35f); } if (s == MenuServers.currServer) { white = Color.white; } GUI.color = white; GUI.DrawTexture(rect, image); GUI.color = Color.white; GUIM.DrawText(rect, (s.idx + 1).ToString(), TextAnchor.MiddleCenter, fontcolor, 1, 12, false); rect.x = rect.x + rect.width + GUIM.YRES(2f); rect.width = GUIM.YRES(120f); GUI.color = white; GUI.DrawTexture(rect, image); GUI.color = Color.white; GUIM.DrawText(rect, name, TextAnchor.MiddleCenter, fontcolor, 1, 12, false); rect.x = rect.x + rect.width + GUIM.YRES(2f); rect.width = GUIM.YRES(104f); GUI.color = white; GUI.DrawTexture(rect, image); GUI.color = Color.white; GUIM.DrawText(rect, text, TextAnchor.MiddleCenter, fontcolor, 1, 10, false); rect.x = rect.x + rect.width + GUIM.YRES(2f); rect.width = GUIM.YRES(60f); GUI.color = white; GUI.DrawTexture(rect, image); GUI.color = Color.white; GUIM.DrawText(rect, "x" + s.rate.ToString(), TextAnchor.MiddleCenter, fontcolor, 1, 12, false); rect.x = rect.x + rect.width + GUIM.YRES(2f); rect.width = GUIM.YRES(80f); GUI.color = white; GUI.DrawTexture(rect, image); GUI.color = Color.white; GUIM.DrawText(rect, s.players.ToString() + "/16", TextAnchor.MiddleCenter, fontcolor, 1, 12, false); rect.x = 0f; rect.width = GUIM.YRES(404f); return(GUIM.HideButton(rect)); }
public static void Draw() { if (!MenuGold.show) { return; } GUIM.DrawBox(MenuGold.rBack, MenuGold.tBlack); GUI.DrawTexture(MenuGold.rBackName, MenuGold.tOrange); GUIM.DrawText(MenuGold.rBackName, Lang.Get("_ADD_GOLD"), TextAnchor.MiddleCenter, BaseColor.White, 1, 16, false); if (GameData.gVK) { if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 0f, MenuGold.rBackName.width, GUIM.YRES(36f)), "1", "8", string.Empty)) { Application.ExternalCall("order", new object[] { "item0" }); } if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 1f, MenuGold.rBackName.width, GUIM.YRES(36f)), "5", "40", string.Empty)) { Application.ExternalCall("order", new object[] { "item1" }); } if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 2f, MenuGold.rBackName.width, GUIM.YRES(36f)), "10", "80", string.Empty)) { Application.ExternalCall("order", new object[] { "item2" }); } if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 3f, MenuGold.rBackName.width, GUIM.YRES(36f)), "50", "400", "+40")) { Application.ExternalCall("order", new object[] { "item3" }); } if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 4f, MenuGold.rBackName.width, GUIM.YRES(36f)), "100", "800", "+100")) { Application.ExternalCall("order", new object[] { "item4" }); } if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 5f, MenuGold.rBackName.width, GUIM.YRES(36f)), "200", "1600", "+240")) { Application.ExternalCall("order", new object[] { "item5" }); } } if (GameData.gFB) { if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 0f, MenuGold.rBackName.width, GUIM.YRES(36f)), "$0.16", "8", string.Empty)) { FBManager.BuyCoins(8); } if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 1f, MenuGold.rBackName.width, GUIM.YRES(36f)), "$0.80", "40", string.Empty)) { FBManager.BuyCoins(40); } if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 2f, MenuGold.rBackName.width, GUIM.YRES(36f)), "$1.60", "80", string.Empty)) { FBManager.BuyCoins(80); } if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 3f, MenuGold.rBackName.width, GUIM.YRES(36f)), "$8.00", "400", "+40")) { FBManager.BuyCoins(400); } if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 4f, MenuGold.rBackName.width, GUIM.YRES(36f)), "$16.00", "800", "+100")) { FBManager.BuyCoins(800); } if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 5f, MenuGold.rBackName.width, GUIM.YRES(36f)), "$32.00", "1600", "+240")) { FBManager.BuyCoins(1600); } } }
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); }