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 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; }
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); }
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; }
public static void Draw() { if (!MenuPreview.show) { return; } GUIM.DrawBox(MenuPreview.rBackSave, MenuPreview.tBlack); if (GUIM.Button(MenuPreview.rButtonSave, BaseColor.Blue, Lang.Get("_BACK"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true)) { MenuShop.CShopData cShopData = MenuPreview.currData; Main.HideAll(); MenuShop.SetActive(true); MenuShop.currData = cShopData; } }
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); } }
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 (!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 void Draw() { if (!MenuInventory.show) { return; } float num = Time.time - MenuInventory.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(MenuInventory.rBack.center.x - MenuInventory.rBack.center.x * num, MenuInventory.rBack.center.y - MenuInventory.rBack.center.y * num, 1f); GUI.matrix = Matrix4x4.TRS(pos, Quaternion.identity, s); GUIM.DrawBox(MenuInventory.rBack, MenuInventory.tBlack); MenuInventory.DrawButtonCategory(0, new Rect(MenuInventory.rBackBody.x + GUIM.YRES(4f) + GUIM.YRES(84f) * 0f, MenuInventory.rBackBody.y + GUIM.YRES(4f), GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_ALL"), false); MenuInventory.DrawButtonCategory(1, new Rect(MenuInventory.rBackBody.x + GUIM.YRES(4f) + GUIM.YRES(84f) * 1f, MenuInventory.rBackBody.y + GUIM.YRES(4f), GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_STOCK"), false); MenuInventory.DrawButtonCategory(2, new Rect(MenuInventory.rBackBody.x + GUIM.YRES(4f) + GUIM.YRES(84f) * 2f, MenuInventory.rBackBody.y + GUIM.YRES(4f), GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_BADGES"), false); MenuInventory.DrawButtonCategory(3, new Rect(MenuInventory.rBackBody.x + GUIM.YRES(4f) + GUIM.YRES(84f) * 3f, MenuInventory.rBackBody.y + GUIM.YRES(4f), GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_MASKS"), false); MenuInventory.DrawButtonCategory(4, new Rect(MenuInventory.rBackBody.x + GUIM.YRES(4f) + GUIM.YRES(84f) * 4f, MenuInventory.rBackBody.y + GUIM.YRES(4f), GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_WEAPONS"), false); MenuInventory.scroll = GUIM.BeginScrollView(new Rect(MenuInventory.rBackBody.x + GUIM.YRES(4f), MenuInventory.rBackBody.y + GUIM.YRES(32f), MenuInventory.rBackBody.width - GUIM.YRES(8f), MenuInventory.rBackBody.height - GUIM.YRES(40f)), MenuInventory.scroll, new Rect(0f, 0f, 0f, (float)MenuInventory.hcount * GUIM.YRES(100f) - GUIM.YRES(4f))); int num2 = 0; int num3 = 0; for (int i = 0; i < 1024; i++) { if (BaseData.item[i] != 0 || i <= 127) { if (MenuShop.shopdata[i] != null) { if (MenuInventory.currCat != 0) { if (MenuInventory.currCat == 1 && MenuShop.shopdata[i].section != 0) { goto IL_602; } if (MenuInventory.currCat == 2 && MenuShop.shopdata[i].section != 1 && MenuShop.shopdata[i].section != 2) { goto IL_602; } if (MenuInventory.currCat == 3 && MenuShop.shopdata[i].section != 3 && MenuShop.shopdata[i].section != 4) { goto IL_602; } if (MenuInventory.currCat == 4 && MenuShop.shopdata[i].section != 5) { goto IL_602; } } if (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])) { if (MenuShop.shopdata[i].section == 1) { BaseData.badge_back = i; PlayerPrefs.SetInt(BaseData.uid + "_badge_back", i); } else if (MenuShop.shopdata[i].section == 2) { BaseData.badge_icon = i; PlayerPrefs.SetInt(BaseData.uid + "_badge_icon", i); } else if (MenuShop.shopdata[i].section == 3) { BaseData.mask_merc = i; PlayerPrefs.SetInt(BaseData.uid + "_mask_merc", i); } else if (MenuShop.shopdata[i].section == 4) { BaseData.mask_warcorp = i; PlayerPrefs.SetInt(BaseData.uid + "_mask_warcorp", i); } else if (MenuShop.shopdata[i].section == 5) { int id = WeaponData.GetId(MenuShop.shopdata[i].name2); if (id > 0) { BaseData.profileWeapon[id] = i; BaseData.currentWeapon[id] = i; PlayerPrefs.SetInt(BaseData.uid + "_custom_" + MenuShop.shopdata[i].name2, i); } } } num2++; if (num2 >= 6) { num2 = 0; num3++; } } } IL_602 :; } MenuInventory.hcount = num3 + 1; GUIM.EndScrollView(); GUI.matrix = matrix; }
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 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 (!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; }