diff --git a/LICENSE.md b/LICENSE.md index be02c9b9..d7e61768 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -2,23 +2,7 @@ Tom Grobbe - https://www.vespura.com/ Copyright © 2017-2019 ------ - -THIS PROJECT USES A CUSTOM LICENSE. MAKE SURE TO READ IT BEFORE THINKING ABOUT DOING ANYTHING WITH VMENU. - ------ - -- YOU ARE ALLOWED TO USE VMENU ON AS MANY SERVERS AS YOU WANT. -- _YOU ARE ALSO ALLOWED TO EDIT THIS RESOURCE TO ADD/CHANGE/REMOVE WHATEVER YOU WANT._ (see the exception to this rule in the "credits" section below) -- **YOU ARE HOWEVER _NOT_ ALLOWED TO RE-RELEASE (EDITED OR NON-EDITED) VERSIONS OF THIS RESOURCE WITHOUT WRITTEN PERMISSIONS BY MYSELF (TOM GROBBE / VESPURA). FOR ADDED FEATURES/CHANGES, FEEL FREE TO CREATE A FORK & CREATE A PULL REQUEST.** - ---- -**Credits** - -Never should you change the credits (for example in the in-game menu's about section) to claim this menu to be your own. 90% of the users will recognize this menu as being vMenu, so changing the name of it and removing the credits section, is just useless. You're just being extremely rude and nodoby likes you anymore if they find out you're a big fat liar. - ------ - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +You can use and edit this code to your liking. However don't ever claim it to be your own code and always provide proper credit. +I will, however, not help you if you want to modify my code. diff --git a/README.md b/README.md index 9d999cf0..c9e8ab34 100644 --- a/README.md +++ b/README.md @@ -83,20 +83,7 @@ Tom Grobbe - https://www.vespura.com/ Copyright © 2017-2019 +---- -THIS PROJECT USES A CUSTOM LICENSE. MAKE SURE TO READ IT BEFORE THINKING ABOUT DOING ANYTHING WITH VMENU. - - -- YOU ARE ALLOWED TO USE VMENU ON AS MANY SERVERS AS YOU WANT. -- _YOU ARE ALSO ALLOWED TO EDIT THIS RESOURCE TO ADD/CHANGE/REMOVE WHATEVER YOU WANT._ (see the exception to this rule in the "credits" section below) -- **YOU ARE HOWEVER _NOT_ ALLOWED TO RE-RELEASE (EDITED OR NON-EDITED) VERSIONS OF THIS RESOURCE WITHOUT WRITTEN PERMISSIONS BY MYSELF (TOM GROBBE / VESPURA). FOR ADDED FEATURES/CHANGES, FEEL FREE TO CREATE A FORK & CREATE A PULL REQUEST.** - - -**Credits** - -Never should you change the credits (for example in the in-game menu's about section) to claim this menu to be your own. 90% of the users will recognize this menu as being vMenu, so changing the name of it and removing the credits section, is just useless. You're just being extremely rude and nodoby likes you anymore if they find out you're a big fat liar. - - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - +You can use and edit this code to your liking. However don't ever claim it to be your own code and always provide proper credit. +I will, however, not help you if you want to modify my code. diff --git a/dependencies/client/MenuAPI.dll b/dependencies/client/MenuAPI.dll index 53e9919c..ea715a39 100644 Binary files a/dependencies/client/MenuAPI.dll and b/dependencies/client/MenuAPI.dll differ diff --git a/vMenu/CommonFunctions.cs b/vMenu/CommonFunctions.cs index bdc5c027..74f4a8c1 100644 --- a/vMenu/CommonFunctions.cs +++ b/vMenu/CommonFunctions.cs @@ -1982,11 +1982,19 @@ public static async Task SetPlayerSkin(uint modelHash, PedInfo pedCustomizationO Vehicle veh = Game.PlayerPed.CurrentVehicle; VehicleSeat seat = Game.PlayerPed.SeatIndex; - int lastArmorValue = Game.PlayerPed.Armor; + int maxHealth = Game.PlayerPed.MaxHealth; + int maxArmour = Game.Player.MaxArmor; + int health = Game.PlayerPed.Health; + int armour = Game.PlayerPed.Armor; // set the model SetPlayerModel(Game.Player.Handle, modelHash); + Game.Player.MaxArmor = maxArmour; + Game.PlayerPed.MaxHealth = maxHealth; + Game.PlayerPed.Health = health; + Game.PlayerPed.Armor = armour; + // warp ped into vehicle if the player was in a vehicle. if (wasInVehicle && veh != null && seat != VehicleSeat.None) { @@ -2005,9 +2013,6 @@ public static async Task SetPlayerSkin(uint modelHash, PedInfo pedCustomizationO } FreezeEntityPosition(Game.PlayerPed.Handle, false); } - - // restore armor. - Game.PlayerPed.Armor = lastArmorValue; } // Reset some stuff. @@ -2508,7 +2513,7 @@ public static async Task SpawnWeaponLoadoutAsync(string saveName, bool appendWea if (ignoreSettingsAndPerms || IsAllowed(w.Perm)) { // Give the weapon - GiveWeaponToPed(Game.PlayerPed.Handle, w.Hash, w.CurrentAmmo > 0 ? w.CurrentAmmo : w.GetMaxAmmo, false, true); + GiveWeaponToPed(Game.PlayerPed.Handle, w.Hash, w.CurrentAmmo > -1 ? w.CurrentAmmo: w.GetMaxAmmo, false, false); // Add components if (w.Components.Count > 0) @@ -2537,12 +2542,28 @@ public static async Task SpawnWeaponLoadoutAsync(string saveName, bool appendWea if (w.CurrentAmmo > 0) { - while (GetAmmoInPedWeapon(Game.PlayerPed.Handle, w.Hash) < 1) + int ammo = w.CurrentAmmo; + if (w.CurrentAmmo > w.GetMaxAmmo) { - await Delay(0); - AddAmmoToPed(Game.PlayerPed.Handle, w.Hash, w.CurrentAmmo); - SetAmmoInClip(Game.PlayerPed.Handle, w.Hash, w.AmmoInClip); + ammo = w.GetMaxAmmo; + } + var doIt = false; + while (GetAmmoInPedWeapon(Game.PlayerPed.Handle, w.Hash) != ammo && w.CurrentAmmo != -1) + { + if (doIt) + { + SetCurrentPedWeapon(Game.PlayerPed.Handle, w.Hash, true); + } + doIt = true; + int ammoInClip = GetMaxAmmoInClip(Game.PlayerPed.Handle, w.Hash, false); + if (ammoInClip > ammo) + { + ammoInClip = ammo; + } + SetAmmoInClip(Game.PlayerPed.Handle, w.Hash, ammoInClip); + SetPedAmmo(Game.PlayerPed.Handle, w.Hash, ammo > -1 ? ammo : w.GetMaxAmmo); Log($"waiting for ammo in {w.Name}"); + await Delay(0); } } } @@ -2588,9 +2609,6 @@ public static bool SaveWeaponLoadout(string saveName) }; weapon.CurrentAmmo = GetAmmoInPedWeapon(Game.PlayerPed.Handle, vw.Hash); - var ammoInClip = 0; - GetAmmoInClip(Game.PlayerPed.Handle, vw.Hash, ref ammoInClip); - weapon.AmmoInClip = ammoInClip; // Check for and add components if applicable. diff --git a/vMenu/EventManager.cs b/vMenu/EventManager.cs index d1edb556..e017006e 100644 --- a/vMenu/EventManager.cs +++ b/vMenu/EventManager.cs @@ -404,7 +404,6 @@ bool IsTimeDifferenceTooSmall() { if (!DontDoTimeSyncRightNow) { - bool frozen = freezeTime; DontDoTimeSyncRightNow = true; EventManager.freezeTime = false; diff --git a/vMenu/FunctionsController.cs b/vMenu/FunctionsController.cs index 60a18116..d2e0b26e 100644 --- a/vMenu/FunctionsController.cs +++ b/vMenu/FunctionsController.cs @@ -93,7 +93,7 @@ public FunctionsController() Tick += DeathNotifications; Tick += JoinQuitNotifications; Tick += UpdateLocation; - Tick += ManagePlayerAppearanceCamera; + Tick += ManageCamera; Tick += PlayerBlipsControl; Tick += PlayerOverheadNamesControl; Tick += RestorePlayerAfterBeingDead; @@ -130,8 +130,10 @@ private async Task GcTick() #endregion #region General Tasks + int lastProp = -1; + int lastPropTexture = 0; /// - /// All general tasks that run every 10 game ticks (and are not (sub)menu specific). + /// All general tasks that run every 1 game ticks (and are not (sub)menu specific). /// /// private async Task GeneralTasks() @@ -147,9 +149,33 @@ private async Task GeneralTasks() LastVehicle = tmpVehicle.Handle; SwitchedVehicle = true; } + if (lastProp > -1 && GetPedPropIndex(Game.PlayerPed.Handle, 0) != lastProp) + { + SetPedPropIndex(Game.PlayerPed.Handle, 0, lastProp, lastPropTexture, true); + lastProp = -1; + lastPropTexture = 0; + } + } + else + { + if (Game.PlayerPed.IsGettingIntoAVehicle && !Game.PlayerPed.IsInVehicle()) // if they are (attempting to) get into a vehicle but they're not in yet. + { + int prop = GetPedPropIndex(Game.PlayerPed.Handle, 0); + int propTexture = GetPedPropTextureIndex(Game.PlayerPed.Handle, 0); + if (prop > -1) + { + lastProp = prop; + lastPropTexture = propTexture; + } + else + { + lastProp = -1; + lastPropTexture = 0; + } + } } - // this can wait - await Delay(10); + // this can wait 1 ms + await Delay(1); } #endregion @@ -1512,11 +1538,75 @@ private async Task SpectateHandling() #endregion #region Player Appearance - /// - /// Manages the camera view for when the mp ped creator is open. - /// - /// - private async Task ManagePlayerAppearanceCamera() + + internal static bool reverseCamera = false; + private static Camera camera; + internal static float CameraFov { get; set; } = 45; + internal static int CurrentCam { get; set; } + internal static List> CameraOffsets { get; } = new List>() + { + // Full body + new KeyValuePair(new Vector3(0f, 2.8f, 0.3f), new Vector3(0f, 0f, 0f)), + + // Head level + new KeyValuePair(new Vector3(0f, 0.9f, 0.65f), new Vector3(0f, 0f, 0.6f)), + + // Upper Body + new KeyValuePair(new Vector3(0f, 1.4f, 0.5f), new Vector3(0f, 0f, 0.3f)), + + // Lower Body + new KeyValuePair(new Vector3(0f, 1.6f, -0.3f), new Vector3(0f, 0f, -0.45f)), + + // Shoes + new KeyValuePair(new Vector3(0f, 0.98f, -0.7f), new Vector3(0f, 0f, -0.90f)), + + // Lower Arms + new KeyValuePair(new Vector3(0f, 0.98f, 0.1f), new Vector3(0f, 0f, 0f)), + + // Full arms + new KeyValuePair(new Vector3(0f, 1.3f, 0.35f), new Vector3(0f, 0f, 0.15f)), + }; + + private async Task UpdateCamera(Camera oldCamera, Vector3 pos, Vector3 pointAt) + { + var newCam = CreateCam("DEFAULT_SCRIPTED_CAMERA", true); + var newCamera = new Camera(newCam) + { + Position = pos, + FieldOfView = CameraFov + }; + newCamera.PointAt(pointAt); + oldCamera.InterpTo(newCamera, 1000, true, true); + while (oldCamera.IsInterpolating || !newCamera.IsActive) + { + SetEntityCollision(Game.PlayerPed.Handle, false, false); + //Game.PlayerPed.IsInvincible = true; + Game.PlayerPed.IsPositionFrozen = true; + await Delay(0); + } + await Delay(50); + oldCamera.Delete(); + CurrentCam = newCam; + camera = newCamera; + } + + private bool IsMpCharEditorOpen() + { + if (MainMenu.MpPedCustomizationMenu != null) + { + return + MainMenu.MpPedCustomizationMenu.appearanceMenu.Visible || + MainMenu.MpPedCustomizationMenu.faceShapeMenu.Visible || + MainMenu.MpPedCustomizationMenu.createCharacterMenu.Visible || + MainMenu.MpPedCustomizationMenu.inheritanceMenu.Visible || + MainMenu.MpPedCustomizationMenu.propsMenu.Visible || + MainMenu.MpPedCustomizationMenu.clothesMenu.Visible || + MainMenu.MpPedCustomizationMenu.tattoosMenu.Visible; + } + return false; + } + + private async Task ManageCamera() { if (MainMenu.PermissionsSetupComplete && MainMenu.MpPedCustomizationMenu != null) { @@ -1565,528 +1655,367 @@ private async Task ManagePlayerAppearanceCamera() var menu = MainMenu.MpPedCustomizationMenu.GetMenu(); - bool IsOpen() - { - return - MainMenu.MpPedCustomizationMenu.appearanceMenu.Visible || - MainMenu.MpPedCustomizationMenu.faceShapeMenu.Visible || - MainMenu.MpPedCustomizationMenu.createCharacterMenu.Visible || - MainMenu.MpPedCustomizationMenu.inheritanceMenu.Visible || - MainMenu.MpPedCustomizationMenu.propsMenu.Visible || - MainMenu.MpPedCustomizationMenu.clothesMenu.Visible || - MainMenu.MpPedCustomizationMenu.tattoosMenu.Visible; - } - if (IsOpen()) + + if (IsMpCharEditorOpen()) { - List> camPositions = new List>() + if (!HasAnimDictLoaded("anim@random@shop_clothes@watches")) { - // normal variants - new KeyValuePair(Game.PlayerPed.GetOffsetPosition(new Vector3(0f, 1.8f, 0.2f)), Game.PlayerPed.Position + new Vector3(0f, 0f, 0.0f)), // default 0 - new KeyValuePair(Game.PlayerPed.GetOffsetPosition(new Vector3(0f, 0.5f, 0.65f)), Game.PlayerPed.Position + new Vector3(0f, 0f, 0.65f)), // head 1 - new KeyValuePair(Game.PlayerPed.GetOffsetPosition(new Vector3(0f, 1.2f, 0.40f)), Game.PlayerPed.Position + new Vector3(0f, 0f, 0.35f)), // upper body 2 - new KeyValuePair(Game.PlayerPed.GetOffsetPosition(new Vector3(0f, 1.3f, -0.2f)), Game.PlayerPed.Position + new Vector3(0f, 0f, -0.25f)), // lower body 3 - new KeyValuePair(Game.PlayerPed.GetOffsetPosition(new Vector3(0f, 0.7f, -0.5f)), Game.PlayerPed.Position + new Vector3(0f, 0f, -0.8f)), // shoes 4 - new KeyValuePair(Game.PlayerPed.GetOffsetPosition(new Vector3(0f, 0.8f, 0.5f)), Game.PlayerPed.Position + new Vector3(0f, 0f, 0.35f)), // left wrist 5 - new KeyValuePair(Game.PlayerPed.GetOffsetPosition(new Vector3(0f, 0.8f, 0.5f)), Game.PlayerPed.Position + new Vector3(0f, 0f, 0.35f)), // right wrist 6 - - // tattoo turn left variants - new KeyValuePair(Game.PlayerPed.GetOffsetPosition(new Vector3(-0.4f, 0.2f, 0.65f)), Game.PlayerPed.Position + new Vector3(0f, 0f, 0.65f)), // head 7 - new KeyValuePair(Game.PlayerPed.GetOffsetPosition(new Vector3(-0.7f, 1.2f, 0.40f)), Game.PlayerPed.Position + new Vector3(0f, 0f, 0.35f)), // head 8 - new KeyValuePair(Game.PlayerPed.GetOffsetPosition(new Vector3(-0.7f, 1.3f, -0.2f)), Game.PlayerPed.Position + new Vector3(0f, 0f, -0.25f)), // head 9 - - // tattoo turn right variants - new KeyValuePair(Game.PlayerPed.GetOffsetPosition(new Vector3(0.4f, 0.2f, 0.65f)), Game.PlayerPed.Position + new Vector3(0f, 0f, 0.65f)), // head 10 - new KeyValuePair(Game.PlayerPed.GetOffsetPosition(new Vector3(0.7f, 1.2f, 0.40f)), Game.PlayerPed.Position + new Vector3(0f, 0f, 0.35f)), // head 11 - new KeyValuePair(Game.PlayerPed.GetOffsetPosition(new Vector3(0.7f, 1.3f, -0.2f)), Game.PlayerPed.Position + new Vector3(0f, 0f, -0.25f)), // head 12 - }; - - int cam = CreateCam("DEFAULT_SCRIPTED_CAMERA", true); - Camera camera = new Camera(cam); - camera.Position = camPositions[0].Key; - camera.PointAt(camPositions[0].Value); - - Game.PlayerPed.Task.ClearAllImmediately(); - - /* - * Camera positions and PointAt locations. - - // head close up - camera.Position = Game.PlayerPed.GetOffsetPosition(new Vector3(0f, 0.5f, 0.65f)); - camera.PointAt(Game.PlayerPed.Position + new Vector3(0f, 0f, 0.65f)); - - // upper body close up - camera.Position = Game.PlayerPed.GetOffsetPosition(new Vector3(0f, 1.2f, 0.40f)); - camera.PointAt(Game.PlayerPed.Position + new Vector3(0f, 0f, 0.35f)); - - // lower body close up - camera.Position = Game.PlayerPed.GetOffsetPosition(new Vector3(0f, 1.3f, -0.2f)); - camera.PointAt(Game.PlayerPed.Position + new Vector3(0f, 0f, -0.25f)); - - // very low (feet level) very close up - camera.Position = Game.PlayerPed.GetOffsetPosition(new Vector3(0f, 0.7f, -0.5f)); - camera.PointAt(Game.PlayerPed.Position + new Vector3(0f, 0f, -0.8f)); - - // default normal height full character visible. - camera.Position = Game.PlayerPed.GetOffsetPosition(new Vector3(0f, 1.8f, 0.2f)); - camera.PointAt(Game.PlayerPed.Position + new Vector3(0f, 0f, 0.0f)); - - */ - - bool rearCamActive = false; - - async Task SetCameraPosition() + RequestAnimDict("anim@random@shop_clothes@watches"); + } + while (!HasAnimDictLoaded("anim@random@shop_clothes@watches")) { - if (MainMenu.MpPedCustomizationMenu.appearanceMenu.Visible) - { - Vector3 newPos; - Vector3 newPointAt; + await Delay(0); + } - int index = MainMenu.MpPedCustomizationMenu.appearanceMenu.CurrentIndex; - switch (index) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: - case 25: - case 26: - case 27: - case 33: - // close up head. - newPos = camPositions[1].Key; - newPointAt = camPositions[1].Value; - break; - case 28: - case 29: - case 30: - case 31: - case 32: - // torso - newPos = camPositions[2].Key; - newPointAt = camPositions[2].Value; - break; - default: - // normal position (full character visible) - newPos = camPositions[0].Key; - newPointAt = camPositions[0].Value; - break; - } + while (IsMpCharEditorOpen()) + { + await Delay(0); - if (camera.Position != newPos) - { - camera = await MoveCamToNewSpot(camera, newPos, newPointAt); - } - } - else if (MainMenu.MpPedCustomizationMenu.clothesMenu.Visible) + int index = GetCameraIndex(MenuController.GetCurrentMenu()); + if (MenuController.GetCurrentMenu() == MainMenu.MpPedCustomizationMenu.propsMenu && MenuController.GetCurrentMenu().CurrentIndex == 3 && !reverseCamera) { - Vector3 newPos; - Vector3 newPointAt; - - int index = MainMenu.MpPedCustomizationMenu.clothesMenu.CurrentIndex; - switch (index) - { - case 0: - // head level - newPos = camPositions[1].Key; - newPointAt = camPositions[1].Value; - break; - case 1: - case 3: - case 5: - case 6: - case 7: - case 9: - // upper body level - newPos = camPositions[2].Key; - newPointAt = camPositions[2].Value; - break; - case 2: - // lower body level - newPos = camPositions[3].Key; - newPointAt = camPositions[3].Value; - break; - case 4: - // feet (ground) level (close up) - newPos = camPositions[4].Key; - newPointAt = camPositions[4].Value; - break; - case 8: - default: - // normal position (full character visible) - newPos = camPositions[0].Key; - newPointAt = camPositions[0].Value; - break; - } - - if (camera.Position != newPos) - { - camera = await MoveCamToNewSpot(camera, newPos, newPointAt); - } + TaskPlayAnim(Game.PlayerPed.Handle, "anim@random@shop_clothes@watches", "BASE", 8f, -8f, -1, 1, 0, false, false, false); } - else if (MainMenu.MpPedCustomizationMenu.inheritanceMenu.Visible) + else { - Vector3 newPos; - Vector3 newPointAt; + Game.PlayerPed.Task.ClearAll(); + } - // head level - newPos = camPositions[1].Key; - newPointAt = camPositions[1].Value; + var xOffset = 0f; + var yOffset = 0f; - if (camera.Position != newPos) - { - camera = await MoveCamToNewSpot(camera, newPos, newPointAt); - } - } - else if (MainMenu.MpPedCustomizationMenu.propsMenu.Visible) + if ((Game.IsControlPressed(0, Control.ParachuteBrakeLeft) || Game.IsControlPressed(0, Control.ParachuteBrakeRight)) && !(Game.IsControlPressed(0, Control.ParachuteBrakeLeft) && Game.IsControlPressed(0, Control.ParachuteBrakeRight))) { - Vector3 newPos; - Vector3 newPointAt; - - int index = MainMenu.MpPedCustomizationMenu.propsMenu.CurrentIndex; switch (index) { case 0: + xOffset = 2.2f; + yOffset = -1f; + break; case 1: + xOffset = 0.7f; + yOffset = -0.45f; + break; case 2: - // head level - newPos = camPositions[1].Key; - newPointAt = camPositions[1].Value; + xOffset = 1.35f; + yOffset = -0.4f; break; case 3: - // left wrist - if (rearCamActive) - { - newPos = camPositions[6].Key; - newPointAt = camPositions[6].Value; - } - else - { - newPos = camPositions[5].Key; - newPointAt = camPositions[5].Value; - } + xOffset = 1.0f; + yOffset = -0.4f; break; case 4: - // right wrist - if (rearCamActive) - { - newPos = camPositions[5].Key; - newPointAt = camPositions[5].Value; - } - else - { - newPos = camPositions[6].Key; - newPointAt = camPositions[6].Value; - } + xOffset = 0.9f; + yOffset = -0.4f; + break; + case 5: + xOffset = 0.8f; + yOffset = -0.7f; + break; + case 6: + xOffset = 1.5f; + yOffset = -1.0f; break; default: - // normal position (full character visible) - newPos = camPositions[0].Key; - newPointAt = camPositions[0].Value; + xOffset = 0f; + yOffset = 0.2f; break; } - - if (camera.Position != newPos) + if (Game.IsControlPressed(0, Control.ParachuteBrakeRight)) { - camera = await MoveCamToNewSpot(camera, newPos, newPointAt); + xOffset *= -1f; } - } - // face shape - else if (MainMenu.MpPedCustomizationMenu.faceShapeMenu.Visible) - { - Vector3 newPos = camPositions[1].Key; - Vector3 newPointAt = camPositions[1].Value; - if (camera.Position != newPos) - { - camera = await MoveCamToNewSpot(camera, newPos, newPointAt); - } } - // tattoos - else if (MainMenu.MpPedCustomizationMenu.tattoosMenu.Visible) - { - Vector3 newPos; - Vector3 newPointAt; - int index = MainMenu.MpPedCustomizationMenu.tattoosMenu.CurrentIndex; - switch (index) - { - case 0: - // head level - if (Game.IsControlPressed(0, Control.ParachuteBrakeRight)) // turn camera to the right - { - newPos = camPositions[7].Key; - newPointAt = camPositions[7].Value; - } - else if (Game.IsControlPressed(0, Control.ParachuteBrakeLeft)) // turn camera to the left - { - newPos = camPositions[10].Key; - newPointAt = camPositions[10].Value; - } - else // normal - { - newPos = camPositions[1].Key; - newPointAt = camPositions[1].Value; - } - break; - case 1: - case 2: - case 3: - case 6: - // upper body level - if (Game.IsControlPressed(0, Control.ParachuteBrakeRight)) // turn camera to the right - { - newPos = camPositions[8].Key; - newPointAt = camPositions[8].Value; - } - else if (Game.IsControlPressed(0, Control.ParachuteBrakeLeft)) // turn camera to the left - { - newPos = camPositions[11].Key; - newPointAt = camPositions[11].Value; - } - else // normal - { - newPos = camPositions[2].Key; - newPointAt = camPositions[2].Value; - } - break; - case 4: - case 5: - // lower body level - if (Game.IsControlPressed(0, Control.ParachuteBrakeRight)) // turn camera to the right - { - newPos = camPositions[9].Key; - newPointAt = camPositions[9].Value; - } - else if (Game.IsControlPressed(0, Control.ParachuteBrakeLeft)) // turn camera to the left - { - newPos = camPositions[12].Key; - newPointAt = camPositions[12].Value; - } - else // normal - { - newPos = camPositions[3].Key; - newPointAt = camPositions[3].Value; - } - break; - default: - // normal position (full character visible) - newPos = camPositions[0].Key; - newPointAt = camPositions[0].Value; - break; - } + Vector3 pos; + if (reverseCamera) + pos = GetOffsetFromEntityInWorldCoords(Game.PlayerPed.Handle, (CameraOffsets[index].Key.X + xOffset) * -1f, (CameraOffsets[index].Key.Y + yOffset) * -1f, CameraOffsets[index].Key.Z); + else + pos = GetOffsetFromEntityInWorldCoords(Game.PlayerPed.Handle, (CameraOffsets[index].Key.X + xOffset), (CameraOffsets[index].Key.Y + yOffset), CameraOffsets[index].Key.Z); + Vector3 pointAt = GetOffsetFromEntityInWorldCoords(Game.PlayerPed.Handle, CameraOffsets[index].Value.X, CameraOffsets[index].Value.Y, CameraOffsets[index].Value.Z); - if (camera.Position != newPos) - { - camera = await MoveCamToNewSpot(camera, newPos, newPointAt); - } + if (Game.IsControlPressed(0, Control.MoveLeftOnly)) + { + Game.PlayerPed.Task.LookAt(GetOffsetFromEntityInWorldCoords(Game.PlayerPed.Handle, 1.2f, .5f, .7f), 1100); + } + else if (Game.IsControlPressed(0, Control.MoveRightOnly)) + { + Game.PlayerPed.Task.LookAt(GetOffsetFromEntityInWorldCoords(Game.PlayerPed.Handle, -1.2f, .5f, .7f), 1100); } else { - Vector3 newPos; - Vector3 newPointAt; - - if (MainMenu.MpPedCustomizationMenu.createCharacterMenu.Visible && MainMenu.MpPedCustomizationMenu.createCharacterMenu.CurrentIndex == 6) - { - // head level - newPos = camPositions[1].Key; - newPointAt = camPositions[1].Value; - } - else - { - newPos = camPositions[0].Key; - newPointAt = camPositions[0].Value; - } - - if (camera.Position != newPos) - { - camera = await MoveCamToNewSpot(camera, newPos, newPointAt); - } + Game.PlayerPed.Task.LookAt(GetOffsetFromEntityInWorldCoords(Game.PlayerPed.Handle, 0f, .5f, .7f), 1100); } - } - - float heading = Game.PlayerPed.Heading; - if (!HasAnimDictLoaded("anim@random@shop_clothes@watches")) - { - RequestAnimDict("anim@random@shop_clothes@watches"); - } - while (!HasAnimDictLoaded("anim@random@shop_clothes@watches")) - { - await Delay(0); - } - - while (IsOpen()) - { - await Delay(0); - DisplayRadar(false); - SetEntityInvincible(Game.PlayerPed.Handle, true); - SetEntityCollision(Game.PlayerPed.Handle, false, false); - - RenderScriptCams(true, false, 0, true, false); - if (Game.IsControlJustReleased(0, Control.PhoneExtraOption)) + if (Game.IsControlJustReleased(0, Control.Jump)) { var Pos = Game.PlayerPed.Position; - if (rearCamActive) + SetEntityCollision(Game.PlayerPed.Handle, true, true); + FreezeEntityPosition(Game.PlayerPed.Handle, false); + TaskGoStraightToCoord(Game.PlayerPed.Handle, Pos.X, Pos.Y, Pos.Z, 8f, 1600, Game.PlayerPed.Heading + 180f, 0.1f); + int timer = GetGameTimer(); + while (true) { - SetEntityCollision(Game.PlayerPed.Handle, true, true); - FreezeEntityPosition(Game.PlayerPed.Handle, false); - TaskGoStraightToCoord(Game.PlayerPed.Handle, Pos.X, Pos.Y, Pos.Z, 8f, 1600, heading, 0.1f); - int timer = GetGameTimer(); - while (true) - { - await Delay(0); - DisplayRadar(false); - //CommonFunctions.DisableMovementControlsThisFrame(true, true); - Game.DisableAllControlsThisFrame(0); - if (GetGameTimer() - timer > 1600) - { - break; - } - } - ClearPedTasks(Game.PlayerPed.Handle); - Game.PlayerPed.PositionNoOffset = Pos; - FreezeEntityPosition(Game.PlayerPed.Handle, true); - SetEntityCollision(Game.PlayerPed.Handle, false, false); - } - else - { - SetEntityCollision(Game.PlayerPed.Handle, true, true); - FreezeEntityPosition(Game.PlayerPed.Handle, false); - TaskGoStraightToCoord(Game.PlayerPed.Handle, Pos.X, Pos.Y, Pos.Z, 8f, 1600, heading - 180f, 0.1f); - int timer = GetGameTimer(); - while (true) + await Delay(0); + //DisplayRadar(false); + Game.DisableAllControlsThisFrame(0); + if (GetGameTimer() - timer > 1600) { - await Delay(0); - DisplayRadar(false); - Game.DisableAllControlsThisFrame(0); - if (GetGameTimer() - timer > 1600) - { - break; - } + break; } - ClearPedTasks(Game.PlayerPed.Handle); - Game.PlayerPed.PositionNoOffset = Pos; - FreezeEntityPosition(Game.PlayerPed.Handle, true); - SetEntityCollision(Game.PlayerPed.Handle, false, false); } - rearCamActive = !rearCamActive; + ClearPedTasks(Game.PlayerPed.Handle); + Game.PlayerPed.PositionNoOffset = Pos; + FreezeEntityPosition(Game.PlayerPed.Handle, true); + SetEntityCollision(Game.PlayerPed.Handle, false, false); + reverseCamera = !reverseCamera; } - FreezeEntityPosition(Game.PlayerPed.Handle, true); - - DisableMovementControlsThisFrame(true, true); + SetEntityCollision(Game.PlayerPed.Handle, false, false); + //Game.PlayerPed.IsInvincible = true; + Game.PlayerPed.IsPositionFrozen = true; - if (MainMenu.MpPedCustomizationMenu.propsMenu.Visible && !rearCamActive && MainMenu.MpPedCustomizationMenu.propsMenu.CurrentIndex == 3) + if (!DoesCamExist(CurrentCam)) { - TaskPlayAnim(Game.PlayerPed.Handle, "anim@random@shop_clothes@watches", "BASE", 8f, -8f, -1, 1, 0, false, false, false); + CurrentCam = CreateCam("DEFAULT_SCRIPTED_CAMERA", true); + camera = new Camera(CurrentCam) + { + Position = pos, + FieldOfView = CameraFov + }; + camera.PointAt(pointAt); + RenderScriptCams(true, false, 0, false, false); + camera.IsActive = true; } else { - Game.PlayerPed.Task.ClearAll(); + if (camera.Position != pos) + { + await UpdateCamera(camera, pos, pointAt); + } } + } - await SetCameraPosition(); + SetEntityCollision(Game.PlayerPed.Handle, true, true); - FreezeEntityPosition(Game.PlayerPed.Handle, true); + Game.PlayerPed.IsPositionFrozen = false; - DisableMovementControlsThisFrame(true, true); + DisplayHud(true); + DisplayRadar(true); - var offsetRight = GetOffsetFromEntityInWorldCoords(Game.PlayerPed.Handle, -2f, 0.05f, 0.7f); - var offsetLeft = GetOffsetFromEntityInWorldCoords(Game.PlayerPed.Handle, 2f, 0.05f, 0.7f); + if (HasAnimDictLoaded("anim@random@shop_clothes@watches")) + { + RemoveAnimDict("anim@random@shop_clothes@watches"); + } - if (Game.IsDisabledControlPressed(0, Control.MoveRight)) - { - Game.PlayerPed.Task.LookAt(offsetRight, 100); - } - else if (Game.IsDisabledControlPressed(0, Control.MoveLeftOnly)) - { - Game.PlayerPed.Task.LookAt(offsetLeft, 100); - } - else - { - float input = GetDisabledControlNormal(0, 1); + reverseCamera = false; + } + else + { + if (camera != null) + { + ClearCamera(); + camera = null; + } + } + } + } - if (input > 0.5f) - { - Game.PlayerPed.Task.LookAt(offsetRight, 100); - } - else if (input < -0.5f) - { - Game.PlayerPed.Task.LookAt(offsetLeft, 100); - } - else - { - if (MainMenu.MpPedCustomizationMenu.tattoosMenu.Visible) - { - Game.PlayerPed.Task.LookAt(Game.PlayerPed.GetOffsetPosition(new Vector3(0f, -3f, 0f)), 100); - } - else - { - Game.PlayerPed.Task.LookAt(camera.Position, 100); - } - } + private int GetCameraIndex(Menu menu) + { + if (menu != null) + { + if (menu == MainMenu.MpPedCustomizationMenu.inheritanceMenu) + { + return 1; + } + else if (menu == MainMenu.MpPedCustomizationMenu.clothesMenu) + { + switch (menu.CurrentIndex) + { + case 0: // masks + return 1; + case 1: // upper body + return 2; + case 2: // lower body + return 3; + case 3: // bags & parachutes + return 2; + case 4: // shoes + return 4; + case 5: // scarfs & chains + return 2; + case 6: // shirt & accessory + return 2; + case 7: // body armor & accessory + return 2; + case 8: // badges & logos + return 0; + case 9: // shirt overlay & jackets + return 2; + default: + return 0; + } + } + else if (menu == MainMenu.MpPedCustomizationMenu.propsMenu) + { + switch (menu.CurrentIndex) + { + case 0: // hats & helmets + case 1: // glasses + case 2: // misc props + return 1; + case 3: // watches + return reverseCamera ? 5 : 6; + case 4: // bracelets + return 5; + default: + return 0; + } + } + else if (menu == MainMenu.MpPedCustomizationMenu.appearanceMenu) + { + switch (menu.CurrentIndex) + { + case 0: // hair style + case 1: // hair color + case 2: // hair highlight color + case 3: // blemishes + case 4: // blemishes opacity + case 5: // beard style + case 6: // beard opacity + case 7: // beard color + case 8: // eyebrows style + case 9: // eyebrows opacity + case 10: // eyebrows color + case 11: // ageing style + case 12: // ageing opacity + case 13: // makeup style + case 14: // makeup opacity + case 15: // makeup color + case 16: // blush style + case 17: // blush opacity + case 18: // blush color + case 19: // complexion style + case 20: // complexion opacity + case 21: // sun damage style + case 22: // sun damage opacity + case 23: // lipstick style + case 24: // lipstick opacity + case 25: // lipstick color + case 26: // moles and freckles style + case 27: // moles and freckles opacity + return 1; + case 28: // chest hair style + case 29: // chest hair opacity + case 30: // chest hair color + case 31: // body blemishes style + case 32: // body blemishes opacity + return 2; + case 33: // eye colors + return 1; + default: + return 0; + } + } + else if (menu == MainMenu.MpPedCustomizationMenu.tattoosMenu) + { + switch (menu.CurrentIndex) + { + case 0: // head + return 1; + case 1: // torso + return 2; + case 2: // left arm + case 3: // right arm + return 6; + case 4: // left leg + case 5: // right leg + return 3; + case 6: // badges + return 2; + default: + return 0; + } + } + else if (menu == MainMenu.MpPedCustomizationMenu.faceShapeMenu) + { + MenuItem item = menu.GetCurrentMenuItem(); + if (item != null) + { + if (item.GetType() == typeof(MenuSliderItem)) + { + return 1; } } - DisplayRadar(IsRadarPreferenceSwitchedOn()); - RenderScriptCams(false, false, 0, false, false); - camera.Delete(); - DestroyAllCams(true); - ClearPedTasksImmediately(Game.PlayerPed.Handle); - SetEntityCollision(Game.PlayerPed.Handle, true, true); - FreezeEntityPosition(Game.PlayerPed.Handle, false); - SetEntityInvincible(Game.PlayerPed.Handle, false); - RemoveAnimDict("anim@random@shop_clothes@watches"); + return 0; } } + return 0; + } + + internal static void ClearCamera() + { + camera.IsActive = false; + RenderScriptCams(false, false, 0, false, false); + DestroyCam(CurrentCam, false); + CurrentCam = -1; + camera.Delete(); } /// - /// Moves camera to a new spot + /// Disables movement while the mp character creator is open. /// - /// - /// - /// /// - private async Task MoveCamToNewSpot(Camera camera, Vector3 newPos, Vector3 newPointAt) + [Tick] + private async Task DisableMovement() { - var newCam = CreateCam("DEFAULT_SCRIPTED_CAMERA", true); - Camera newCamera = new Camera(newCam) + if (IsMpCharEditorOpen()) { - Position = newPos - }; - newCamera.PointAt(newPointAt); - camera.InterpTo(newCamera, 800, 4000, 4000); - int timer = GetGameTimer(); - while (camera.IsInterpolating || GetGameTimer() - timer < 900) + Game.DisableControlThisFrame(0, Control.MoveDown); + Game.DisableControlThisFrame(0, Control.MoveDownOnly); + Game.DisableControlThisFrame(0, Control.MoveLeft); + Game.DisableControlThisFrame(0, Control.MoveLeftOnly); + Game.DisableControlThisFrame(0, Control.MoveLeftRight); + Game.DisableControlThisFrame(0, Control.MoveRight); + Game.DisableControlThisFrame(0, Control.MoveRightOnly); + Game.DisableControlThisFrame(0, Control.MoveUp); + Game.DisableControlThisFrame(0, Control.MoveUpDown); + Game.DisableControlThisFrame(0, Control.MoveUpOnly); + Game.DisableControlThisFrame(0, Control.NextCamera); + Game.DisableControlThisFrame(0, Control.LookBehind); + Game.DisableControlThisFrame(0, Control.LookDown); + Game.DisableControlThisFrame(0, Control.LookDownOnly); + Game.DisableControlThisFrame(0, Control.LookLeft); + Game.DisableControlThisFrame(0, Control.LookLeftOnly); + Game.DisableControlThisFrame(0, Control.LookLeftRight); + Game.DisableControlThisFrame(0, Control.LookRight); + Game.DisableControlThisFrame(0, Control.LookRightOnly); + Game.DisableControlThisFrame(0, Control.LookUp); + Game.DisableControlThisFrame(0, Control.LookUpDown); + Game.DisableControlThisFrame(0, Control.LookUpOnly); + Game.DisableControlThisFrame(0, Control.Aim); + Game.DisableControlThisFrame(0, Control.AccurateAim); + Game.DisableControlThisFrame(0, Control.Cover); + Game.DisableControlThisFrame(0, Control.Duck); + Game.DisableControlThisFrame(0, Control.Jump); + Game.DisableControlThisFrame(0, Control.SelectNextWeapon); + Game.DisableControlThisFrame(0, Control.PrevWeapon); + Game.DisableControlThisFrame(0, Control.WeaponSpecial); + Game.DisableControlThisFrame(0, Control.WeaponSpecial2); + Game.DisableControlThisFrame(0, Control.WeaponWheelLeftRight); + Game.DisableControlThisFrame(0, Control.WeaponWheelNext); + Game.DisableControlThisFrame(0, Control.WeaponWheelPrev); + Game.DisableControlThisFrame(0, Control.WeaponWheelUpDown); + Game.DisableControlThisFrame(0, Control.VehicleExit); + Game.DisableControlThisFrame(0, Control.Enter); + } + else { - FreezeEntityPosition(Game.PlayerPed.Handle, true); - DisableMovementControlsThisFrame(true, true); await Delay(0); } - camera.Delete(); - return newCamera; } #endregion @@ -2448,7 +2377,7 @@ private async Task PlayerOverheadNamesControl() if (MainMenu.PermissionsSetupComplete && MainMenu.ConfigOptionsSetupComplete && MainMenu.MiscSettingsMenu != null) { - bool enabled = MainMenu.MiscSettingsMenu.MiscShowOverheadNames; + bool enabled = MainMenu.MiscSettingsMenu.MiscShowOverheadNames && IsAllowed(Permission.MSOverheadNames); if (!enabled) { for (var i = 0; i < 255; i++) diff --git a/vMenu/MainMenu.cs b/vMenu/MainMenu.cs index cf258500..d28c277c 100644 --- a/vMenu/MainMenu.cs +++ b/vMenu/MainMenu.cs @@ -47,8 +47,7 @@ public class MainMenu : BaseScript public static MiscSettings MiscSettingsMenu { get; private set; } public static VoiceChat VoiceChatSettingsMenu { get; private set; } public static About AboutMenu { get; private set; } - public static Menu NoClipMenu { get; } = new NoclipMenu().GetMenu(); - public static bool NoClipEnabled { get; set; } = false; + public static bool NoClipEnabled { get { return NoClip.IsNoclipActive(); } set { NoClip.SetNoclipActive(value); } } public static PlayerList PlayersList; // Only used when debugging is enabled: @@ -477,46 +476,28 @@ bool IsOpen() if (Game.CurrentInputMode == InputMode.MouseAndKeyboard) { - if (!MenuController.IsAnyMenuOpen() || NoClipEnabled) + if (Game.IsControlJustPressed(0, (Control)NoClipKey) && IsAllowed(Permission.NoClip) && UpdateOnscreenKeyboard() != 0) { - if (Game.IsControlJustPressed(0, (Control)NoClipKey) && IsAllowed(Permission.NoClip) && UpdateOnscreenKeyboard() != 0) + if (Game.PlayerPed.IsInVehicle()) { - if (MenuController.IsAnyMenuOpen()) + Vehicle veh = GetVehicle(); + if (veh != null && veh.Exists() && veh.Driver == Game.PlayerPed) { - if (MenuController.GetCurrentMenu() != null && MenuController.GetCurrentMenu() != NoClipMenu) - { - MenuController.CloseAllMenus(); - } - } - if (Game.PlayerPed.IsInVehicle()) - { - Vehicle veh = GetVehicle(); - if (veh != null && veh.Exists() && veh.Driver == Game.PlayerPed) - { - NoClipEnabled = !NoClipEnabled; - MenuController.DontOpenAnyMenu = NoClipEnabled; - } - else - { - NoClipEnabled = false; - MenuController.DontOpenAnyMenu = NoClipEnabled; - Notify.Error("This vehicle does not exist (somehow) or you need to be the driver of this vehicle to enable noclip!"); - } + NoClipEnabled = !NoClipEnabled; } else { - NoClipEnabled = !NoClipEnabled; - MenuController.DontOpenAnyMenu = NoClipEnabled; + NoClipEnabled = false; + Notify.Error("This vehicle does not exist (somehow) or you need to be the driver of this vehicle to enable noclip!"); } } + else + { + NoClipEnabled = !NoClipEnabled; + } } } - if (NoClipEnabled) - { - MenuController.DontOpenAnyMenu = true; - } - #endregion // Menu toggle button. @@ -676,7 +657,6 @@ private void CreateSubmenus() AddMenu(PlayerSubmenu, menu2, button2); } - MenuItem worldSubmenuBtn = new MenuItem("World Related Options", "Open this submenu for world related subcategories.") { Label = "→→→" }; Menu.AddMenuItem(worldSubmenuBtn); @@ -730,6 +710,19 @@ private void CreateSubmenus() AddMenu(PlayerSubmenu, menu, button); } + if (IsAllowed(Permission.NoClip)) + { + MenuItem toggleNoclip = new MenuItem("Toggle NoClip", "Toggle NoClip on or off."); + PlayerSubmenu.AddMenuItem(toggleNoclip); + PlayerSubmenu.OnItemSelect += (sender, item, index) => + { + if (item == toggleNoclip) + { + NoClipEnabled = !NoClipEnabled; + } + }; + } + // Add Voice Chat Menu. if (IsAllowed(Permission.VCMenu)) { diff --git a/vMenu/Noclip.cs b/vMenu/Noclip.cs new file mode 100644 index 00000000..7b04b2f8 --- /dev/null +++ b/vMenu/Noclip.cs @@ -0,0 +1,421 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using MenuAPI; +using Newtonsoft.Json; +using CitizenFX.Core; +using static CitizenFX.Core.UI.Screen; +using static CitizenFX.Core.Native.API; +using static vMenuClient.CommonFunctions; +using static vMenuShared.PermissionsManager; + +namespace vMenuClient +{ + public class NoClip : BaseScript + { + private static bool NoclipActive { get; set; } = false; + private static int MovingSpeed { get; set; } = 0; + private static int Scale { get; set; } = -1; + private static bool FollowCamMode { get; set; } = false; + + + private List speeds = new List() + { + "Very Slow", + "Slow", + "Normal", + "Fast", + "Very Fast", + "Extremely Fast", + "Extremely Fast v2.0", + "Max Speed" + }; + + public NoClip() + { +#if DEBUG + RegisterCommand("noclip", new Action(() => + { + NoclipActive = !NoclipActive; + }), true); + +#endif + //EventHandlers.Add("SetNoclipActive", new Action(SetNoclipActive)); + //EventHandlers.Add("ToggleNoclip", new Action(() => SetNoclipActive(!NoclipActive))); + //Exports.Add("SetNoclipActive", new Action(SetNoclipActive)); + //Exports.Add("IsNoclipActive", new Func(IsNoclipActive)); + + Tick += NoClipHandler; + } + + internal static void SetNoclipActive(bool active) + { + NoclipActive = active; + } + + internal static bool IsNoclipActive() + { + return NoclipActive; + } + + private async Task NoClipHandler() + { + if (NoclipActive) + { + Scale = RequestScaleformMovie("INSTRUCTIONAL_BUTTONS"); + while (!HasScaleformMovieLoaded(Scale)) + { + await Delay(0); + } + } + while (NoclipActive) + { + if (!IsHudHidden()) + { + BeginScaleformMovieMethod(Scale, "CLEAR_ALL"); + EndScaleformMovieMethod(); + + BeginScaleformMovieMethod(Scale, "SET_DATA_SLOT"); + ScaleformMovieMethodAddParamInt(0); + PushScaleformMovieMethodParameterString("~INPUT_SPRINT~"); + PushScaleformMovieMethodParameterString($"Change Speed ({speeds[MovingSpeed]})"); + EndScaleformMovieMethod(); + + BeginScaleformMovieMethod(Scale, "SET_DATA_SLOT"); + ScaleformMovieMethodAddParamInt(1); + PushScaleformMovieMethodParameterString("~INPUT_MOVE_LR~"); + PushScaleformMovieMethodParameterString($"Turn Left/Right"); + EndScaleformMovieMethod(); + + BeginScaleformMovieMethod(Scale, "SET_DATA_SLOT"); + ScaleformMovieMethodAddParamInt(2); + PushScaleformMovieMethodParameterString("~INPUT_MOVE_UD~"); + PushScaleformMovieMethodParameterString($"Move"); + EndScaleformMovieMethod(); + + BeginScaleformMovieMethod(Scale, "SET_DATA_SLOT"); + ScaleformMovieMethodAddParamInt(3); + PushScaleformMovieMethodParameterString("~INPUT_MULTIPLAYER_INFO~"); + PushScaleformMovieMethodParameterString($"Down"); + EndScaleformMovieMethod(); + + BeginScaleformMovieMethod(Scale, "SET_DATA_SLOT"); + ScaleformMovieMethodAddParamInt(4); + PushScaleformMovieMethodParameterString("~INPUT_COVER~"); + PushScaleformMovieMethodParameterString($"Up"); + EndScaleformMovieMethod(); + + BeginScaleformMovieMethod(Scale, "SET_DATA_SLOT"); + ScaleformMovieMethodAddParamInt(5); + PushScaleformMovieMethodParameterString("~INPUT_VEH_HEADLIGHT~"); + PushScaleformMovieMethodParameterString($"Cam Mode"); + EndScaleformMovieMethod(); + + BeginScaleformMovieMethod(Scale, "SET_DATA_SLOT"); + ScaleformMovieMethodAddParamInt(6); + PushScaleformMovieMethodParameterString(GetControlInstructionalButton(0, (int)MainMenu.NoClipKey, 1)); + PushScaleformMovieMethodParameterString($"Toggle NoClip"); + EndScaleformMovieMethod(); + + BeginScaleformMovieMethod(Scale, "DRAW_INSTRUCTIONAL_BUTTONS"); + ScaleformMovieMethodAddParamInt(0); + EndScaleformMovieMethod(); + + DrawScaleformMovieFullscreen(Scale, 255, 255, 255, 255, 0); + } + + var noclipEntity = Game.PlayerPed.IsInVehicle() ? Game.PlayerPed.CurrentVehicle.Handle : Game.PlayerPed.Handle; + + FreezeEntityPosition(noclipEntity, true); + SetEntityInvincible(noclipEntity, true); + + Vector3 newPos; + Game.DisableControlThisFrame(0, Control.MoveUpOnly); + Game.DisableControlThisFrame(0, Control.MoveUp); + Game.DisableControlThisFrame(0, Control.MoveUpDown); + Game.DisableControlThisFrame(0, Control.MoveDown); + Game.DisableControlThisFrame(0, Control.MoveDownOnly); + Game.DisableControlThisFrame(0, Control.MoveLeft); + Game.DisableControlThisFrame(0, Control.MoveLeftOnly); + Game.DisableControlThisFrame(0, Control.MoveLeftRight); + Game.DisableControlThisFrame(0, Control.MoveRight); + Game.DisableControlThisFrame(0, Control.MoveRightOnly); + Game.DisableControlThisFrame(0, Control.Cover); + Game.DisableControlThisFrame(0, Control.MultiplayerInfo); + Game.DisableControlThisFrame(0, Control.VehicleHeadlight); + if (Game.PlayerPed.IsInVehicle()) + Game.DisableControlThisFrame(0, Control.VehicleRadioWheel); + + var yoff = 0.0f; + var zoff = 0.0f; + + if (Game.CurrentInputMode == InputMode.MouseAndKeyboard && UpdateOnscreenKeyboard() != 0 && !Game.IsPaused) + { + if (Game.IsControlJustPressed(0, Control.Sprint)) + { + MovingSpeed++; + if (MovingSpeed == speeds.Count) + { + MovingSpeed = 0; + } + } + + if (Game.IsDisabledControlPressed(0, Control.MoveUpOnly)) + { + yoff = 0.5f; + } + if (Game.IsDisabledControlPressed(0, Control.MoveDownOnly)) + { + yoff = -0.5f; + } + if (Game.IsDisabledControlPressed(0, Control.MoveLeftOnly)) + { + SetEntityHeading(Game.PlayerPed.Handle, GetEntityHeading(Game.PlayerPed.Handle) + 3f); + } + if (Game.IsDisabledControlPressed(0, Control.MoveRightOnly)) + { + SetEntityHeading(Game.PlayerPed.Handle, GetEntityHeading(Game.PlayerPed.Handle) - 3f); + } + if (Game.IsDisabledControlPressed(0, Control.Cover)) + { + zoff = 0.21f; + } + if (Game.IsDisabledControlPressed(0, Control.MultiplayerInfo)) + { + zoff = -0.21f; + } + if (Game.IsDisabledControlJustPressed(0, Control.VehicleHeadlight)) + { + FollowCamMode = !FollowCamMode; + } + } + float moveSpeed = (float)MovingSpeed; + if (MovingSpeed > speeds.Count / 2) + { + moveSpeed *= 1.8f; + } + newPos = GetOffsetFromEntityInWorldCoords(noclipEntity, 0f, yoff * (moveSpeed + 0.3f), zoff * (moveSpeed + 0.3f)); + + var heading = GetEntityHeading(noclipEntity); + SetEntityVelocity(noclipEntity, 0f, 0f, 0f); + SetEntityRotation(noclipEntity, 0f, 0f, 0f, 0, false); + SetEntityHeading(noclipEntity, FollowCamMode ? GetGameplayCamRelativeHeading() : heading); + + SetEntityCollision(noclipEntity, false, false); + SetEntityCoordsNoOffset(noclipEntity, newPos.X, newPos.Y, newPos.Z, true, true, true); + + SetEntityVisible(noclipEntity, false, false); + SetLocalPlayerVisibleLocally(true); + SetEntityAlpha(noclipEntity, (int)(255 * 0.2), 0); + + SetEveryoneIgnorePlayer(Game.PlayerPed.Handle, true); + SetPoliceIgnorePlayer(Game.PlayerPed.Handle, true); + + // After the next game tick, reset the entity properties. + await Delay(0); + FreezeEntityPosition(noclipEntity, false); + SetEntityInvincible(noclipEntity, false); + SetEntityCollision(noclipEntity, true, true); + + SetEntityVisible(noclipEntity, true, false); + SetLocalPlayerVisibleLocally(true); + SetEntityAlpha(noclipEntity, 255, 0); + + SetEveryoneIgnorePlayer(Game.PlayerPed.Handle, false); + SetPoliceIgnorePlayer(Game.PlayerPed.Handle, false); + } + + await Task.FromResult(0); + } + //private bool setupDone = false; + //private Menu noclipMenu = null; + //private int currentSpeed = 0; + + //private List speeds = new List() + //{ + // "Very Slow", + // "Slow", + // "Normal", + // "Fast", + // "Very Fast", + // "Extremely Fast", + // "Extremely Fast v2.0", + // "Max Speed" + //}; + + ///// + ///// Constructor + ///// + //public NoclipMenu() + //{ + // Tick += OnTick; + //} + + ///// + ///// OnTick to run the menu functions. + ///// + ///// + //private async Task OnTick() + //{ + // // Setup is not done or cf is null. + // if (!setupDone) + // { + // Setup(); + + // // wait for setup in MainMenu (permissions and addons) to be done before adding the noclip menu. + // while (!MainMenu.ConfigOptionsSetupComplete || !MainMenu.PermissionsSetupComplete) + // { + // await Delay(0); + // } + // // Add the noclip menu + // MenuController.AddMenu(noclipMenu); + // } + // // Setup is done. + // else + // { + // if (noclipMenu == null) + // { + // await Delay(0); + // } + // else + // { + // while (MainMenu.NoClipEnabled) + // { + // noclipMenu.InstructionalButtons[Control.Sprint] = $"Change speed ({speeds[currentSpeed]})"; + // var noclipEntity = Game.PlayerPed.IsInVehicle() ? GetVehicle().Handle : Game.PlayerPed.Handle; + + // if (noclipMenu.Visible == false) + // { + // noclipMenu.OpenMenu(); + // } + // FreezeEntityPosition(noclipEntity, true); + // SetEntityInvincible(noclipEntity, true); + + // Vector3 newPos = GetEntityCoords(noclipEntity, true); + // Game.DisableControlThisFrame(0, Control.MoveUpOnly); + // Game.DisableControlThisFrame(0, Control.MoveUp); + // Game.DisableControlThisFrame(0, Control.MoveUpDown); + // Game.DisableControlThisFrame(0, Control.MoveDown); + // Game.DisableControlThisFrame(0, Control.MoveDownOnly); + // Game.DisableControlThisFrame(0, Control.MoveLeft); + // Game.DisableControlThisFrame(0, Control.MoveLeftOnly); + // Game.DisableControlThisFrame(0, Control.MoveLeftRight); + // Game.DisableControlThisFrame(0, Control.MoveRight); + // Game.DisableControlThisFrame(0, Control.MoveRightOnly); + // Game.DisableControlThisFrame(0, Control.Cover); + // Game.DisableControlThisFrame(0, Control.MultiplayerInfo); + + // //var xoff = 0.0f; + // var yoff = 0.0f; + // var zoff = 0.0f; + + // if (Game.CurrentInputMode == InputMode.MouseAndKeyboard && UpdateOnscreenKeyboard() != 0) + // { + // if (Game.IsControlJustPressed(0, Control.Sprint)) + // { + // currentSpeed++; + // if (currentSpeed == speeds.Count) + // { + // currentSpeed = 0; + // } + // noclipMenu.GetMenuItems()[0].Label = speeds[currentSpeed]; + // } + + // if (Game.IsDisabledControlPressed(0, Control.MoveUpOnly)) + // { + // yoff = 0.5f; + // } + // if (Game.IsDisabledControlPressed(0, Control.MoveDownOnly)) + // { + // yoff = -0.5f; + // } + // if (Game.IsDisabledControlPressed(0, Control.MoveLeftOnly)) + // { + // SetEntityHeading(Game.PlayerPed.Handle, GetEntityHeading(Game.PlayerPed.Handle) + 3f); + // } + // if (Game.IsDisabledControlPressed(0, Control.MoveRightOnly)) + // { + // SetEntityHeading(Game.PlayerPed.Handle, GetEntityHeading(Game.PlayerPed.Handle) - 3f); + // } + // if (Game.IsDisabledControlPressed(0, Control.Cover)) + // { + // zoff = 0.21f; + // } + // if (Game.IsDisabledControlPressed(0, Control.MultiplayerInfo)) + // { + // zoff = -0.21f; + // } + // } + // float moveSpeed = (float)currentSpeed; + // if (currentSpeed > speeds.Count / 2) + // { + // moveSpeed *= 1.8f; + // } + // newPos = GetOffsetFromEntityInWorldCoords(noclipEntity, 0f, yoff * (moveSpeed + 0.3f), zoff * (moveSpeed + 0.3f)); + + // var heading = GetEntityHeading(noclipEntity); + // SetEntityVelocity(noclipEntity, 0f, 0f, 0f); + // SetEntityRotation(noclipEntity, 0f, 0f, 0f, 0, false); + // SetEntityHeading(noclipEntity, heading); + + // //if (!((yoff > -0.01f && yoff < 0.01f) && (zoff > -0.01f && zoff < 0.01f))) + // { + // SetEntityCollision(noclipEntity, false, false); + // SetEntityCoordsNoOffset(noclipEntity, newPos.X, newPos.Y, newPos.Z, true, true, true); + // } + + // // After the next game tick, reset the entity properties. + // await Delay(0); + // FreezeEntityPosition(noclipEntity, false); + // SetEntityInvincible(noclipEntity, false); + // SetEntityCollision(noclipEntity, true, true); + // } + + // if (noclipMenu.Visible && !MainMenu.NoClipEnabled) + // { + // noclipMenu.CloseMenu(); + // } + + // } + // } + //} + + ///// + ///// Setting up the menu. + ///// + //private void Setup() + //{ + // noclipMenu = new Menu("No Clip", "Controls") { IgnoreDontOpenMenus = true }; + + // MenuItem speed = new MenuItem("Current Moving Speed", "This is your current moving speed.") + // { + // Label = speeds[currentSpeed] + // }; + + // noclipMenu.OnMenuOpen += (m) => + // { + // if (MainMenu.NoClipEnabled) + // HelpMessage.Custom("NoClip is now active. Look at the instructional buttons for all the keybinds. You can view your current moving speed all the way on the bottom right instructional button."); + // }; + + // noclipMenu.AddMenuItem(speed); + + // noclipMenu.InstructionalButtons.Clear(); + // noclipMenu.InstructionalButtons.Add(Control.Sprint, $"Change speed ({speeds[currentSpeed]})"); + // noclipMenu.InstructionalButtons.Add(Control.MoveUpDown, "Go Forwards/Backwards"); + // noclipMenu.InstructionalButtons.Add(Control.MoveLeftRight, "Turn Left/Right"); + // noclipMenu.InstructionalButtons.Add(Control.MultiplayerInfo, "Go Down"); + // noclipMenu.InstructionalButtons.Add(Control.Cover, "Go Up"); + // noclipMenu.InstructionalButtons.Add((Control)MainMenu.NoClipKey, "Disable Noclip"); + + // setupDone = true; + //} + + //public Menu GetMenu() + //{ + // return noclipMenu; + //} + } +} diff --git a/vMenu/Properties/AssemblyInfo.cs b/vMenu/Properties/AssemblyInfo.cs index 9668762a..ae844a58 100644 --- a/vMenu/Properties/AssemblyInfo.cs +++ b/vMenu/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.0.0.0")] +[assembly: AssemblyVersion("3.0.4.0")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/vMenu/data/ValidWeapon.cs b/vMenu/data/ValidWeapon.cs index 8f9625bd..d7ac7202 100644 --- a/vMenu/data/ValidWeapon.cs +++ b/vMenu/data/ValidWeapon.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -23,7 +23,11 @@ public struct ValidWeapon public int GetMaxAmmo { get { int ammo = 0; GetMaxAmmo(Game.PlayerPed.Handle, this.Hash, ref ammo); return ammo; } } public int CurrentAmmo; public int CurrentTint; - public int AmmoInClip; + public float Accuracy { get { Game.WeaponHudStats stats = new Game.WeaponHudStats(); Game.GetWeaponHudStats(Hash, ref stats); return stats.hudAccuracy; } } + public float Damage { get { Game.WeaponHudStats stats = new Game.WeaponHudStats(); Game.GetWeaponHudStats(Hash, ref stats); return stats.hudDamage; } } + public float Range { get { Game.WeaponHudStats stats = new Game.WeaponHudStats(); Game.GetWeaponHudStats(Hash, ref stats); return stats.hudRange; } } + public float Speed { get { Game.WeaponHudStats stats = new Game.WeaponHudStats(); Game.GetWeaponHudStats(Hash, ref stats); return stats.hudSpeed; } } + } public static class ValidWeapons @@ -372,63 +376,15 @@ private static void CreateWeaponsList() #region weapon component names public static readonly Dictionary weaponComponentNames = new Dictionary() { - ["COMPONENT_PISTOL_CLIP_01"] = GetLabelText("WCT_CLIP1"), - ["COMPONENT_PISTOL_CLIP_02"] = GetLabelText("WCT_CLIP2"), - ["COMPONENT_PISTOL_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"), - ["COMPONENT_PISTOL50_CLIP_01"] = GetLabelText("WCT_CLIP1"), - ["COMPONENT_PISTOL50_CLIP_02"] = GetLabelText("WCT_CLIP2"), - ["COMPONENT_PISTOL50_VARMOD_LUXE"] = GetLabelText("WCT_VAR_SIL"), - ["COMPONENT_COMBATPISTOL_CLIP_01"] = GetLabelText("WCT_CLIP1"), - ["COMPONENT_COMBATPISTOL_CLIP_02"] = GetLabelText("WCT_CLIP2"), - ["COMPONENT_COMBATPISTOL_VARMOD_LOWRIDER"] = GetLabelText("WCT_VAR_GOLD"), + ["COMPONENT_ADVANCEDRIFLE_CLIP_01"] = GetLabelText("WCT_CLIP1"), + ["COMPONENT_ADVANCEDRIFLE_CLIP_02"] = GetLabelText("WCT_CLIP2"), + ["COMPONENT_ADVANCEDRIFLE_VARMOD_LUXE"] = GetLabelText("WCT_VAR_METAL"), ["COMPONENT_APPISTOL_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_APPISTOL_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_APPISTOL_VARMOD_LUXE"] = GetLabelText("WCT_VAR_METAL"), - ["COMPONENT_SMG_CLIP_01"] = GetLabelText("WCT_CLIP1"), - ["COMPONENT_SMG_CLIP_02"] = GetLabelText("WCT_CLIP2"), - ["COMPONENT_SMG_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"), - ["COMPONENT_AT_SCOPE_MACRO_02"] = GetLabelText("WCT_SCOPE_MAC"), - ["COMPONENT_SMG_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"), - ["COMPONENT_MICROSMG_CLIP_01"] = GetLabelText("WCT_CLIP1"), - ["COMPONENT_MICROSMG_CLIP_02"] = GetLabelText("WCT_CLIP2"), - ["COMPONENT_AT_SCOPE_MACRO"] = GetLabelText("WCT_SCOPE_MAC"), - ["COMPONENT_MICROSMG_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"), - ["COMPONENT_ASSAULTSMG_CLIP_01"] = GetLabelText("WCT_CLIP1"), - ["COMPONENT_ASSAULTSMG_CLIP_02"] = GetLabelText("WCT_CLIP2"), - ["COMPONENT_AT_SCOPE_MACRO"] = GetLabelText("WCT_SCOPE_MAC"), - ["COMPONENT_ASSAULTSMG_VARMOD_LOWRIDER"] = GetLabelText("WCT_VAR_GOLD"), - ["COMPONENT_MG_CLIP_01"] = GetLabelText("WCT_CLIP1"), - ["COMPONENT_MG_CLIP_02"] = GetLabelText("WCT_CLIP2"), - ["COMPONENT_AT_SCOPE_SMALL_02"] = GetLabelText("WCT_SCOPE_SML"), - ["COMPONENT_MG_VARMOD_LOWRIDER"] = GetLabelText("WCT_VAR_GOLD"), - ["COMPONENT_COMBATMG_CLIP_01"] = GetLabelText("WCT_CLIP1"), - ["COMPONENT_COMBATMG_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_ASSAULTRIFLE_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_ASSAULTRIFLE_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_ASSAULTRIFLE_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"), - ["COMPONENT_AT_SCOPE_MACRO"] = GetLabelText("WCT_SCOPE_MAC"), - ["COMPONENT_ASSAULTRIFLE_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"), - ["COMPONENT_CARBINERIFLE_CLIP_01"] = GetLabelText("WCT_CLIP1"), - ["COMPONENT_CARBINERIFLE_CLIP_02"] = GetLabelText("WCT_CLIP2"), - ["COMPONENT_CARBINERIFLE_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"), - ["COMPONENT_CARBINERIFLE_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"), - ["COMPONENT_ADVANCEDRIFLE_CLIP_01"] = GetLabelText("WCT_CLIP1"), - ["COMPONENT_ADVANCEDRIFLE_CLIP_02"] = GetLabelText("WCT_CLIP2"), - ["COMPONENT_ADVANCEDRIFLE_VARMOD_LUXE"] = GetLabelText("WCT_VAR_METAL"), - ["COMPONENT_ASSAULTSHOTGUN_CLIP_01"] = GetLabelText("WCT_CLIP1"), - ["COMPONENT_ASSAULTSHOTGUN_CLIP_02"] = GetLabelText("WCT_CLIP2"), - ["COMPONENT_SAWNOFFSHOTGUN_VARMOD_LUXE"] = GetLabelText("WCT_VAR_METAL"), - ["COMPONENT_AT_SR_SUPP"] = GetLabelText("WCT_SUPP"), - ["COMPONENT_PUMPSHOTGUN_VARMOD_LOWRIDER"] = GetLabelText("WCT_VAR_GOLD"), - ["COMPONENT_AT_SCOPE_LARGE"] = GetLabelText("WCT_SCOPE_LRG"), - ["COMPONENT_SNIPERRIFLE_VARMOD_LUXE"] = GetLabelText("WCT_VAR_WOOD"), - ["COMPONENT_AT_SCOPE_LARGE"] = GetLabelText("WCT_SCOPE_LRG"), - ["COMPONENT_AT_SCOPE_MACRO"] = GetLabelText("WCT_SCOPE_MAC"), - ["COMPONENT_AT_SCOPE_MACRO_02"] = GetLabelText("WCT_SCOPE_MAC"), - ["COMPONENT_AT_SCOPE_SMALL_02"] = GetLabelText("WCT_SCOPE_SML"), - ["COMPONENT_AT_SCOPE_LARGE"] = GetLabelText("WCT_SCOPE_LRG"), - ["COMPONENT_AT_SR_SUPP"] = GetLabelText("WCT_SUPP"), - ["COMPONENT_ASSAULTRIFLE_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"), ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"), ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"), @@ -439,19 +395,26 @@ private static void CreateWeaponsList() ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"), ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"), ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"), + ["COMPONENT_ASSAULTRIFLE_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_ASSAULTRIFLE_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_ASSAULTRIFLE_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_ASSAULTRIFLE_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_CLIP_AP"), ["COMPONENT_ASSAULTRIFLE_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"), ["COMPONENT_ASSAULTRIFLE_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"), ["COMPONENT_ASSAULTRIFLE_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"), - ["COMPONENT_AT_AR_AFGRIP"] = GetLabelText("WCT_GRIP"), + ["COMPONENT_ASSAULTRIFLE_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"), + ["COMPONENT_ASSAULTSHOTGUN_CLIP_01"] = GetLabelText("WCT_CLIP1"), + ["COMPONENT_ASSAULTSHOTGUN_CLIP_02"] = GetLabelText("WCT_CLIP2"), + ["COMPONENT_ASSAULTSMG_CLIP_01"] = GetLabelText("WCT_CLIP1"), + ["COMPONENT_ASSAULTSMG_CLIP_02"] = GetLabelText("WCT_CLIP2"), + ["COMPONENT_ASSAULTSMG_VARMOD_LOWRIDER"] = GetLabelText("WCT_VAR_GOLD"), ["COMPONENT_AT_AR_AFGRIP_02"] = GetLabelText("WCT_GRIP"), + ["COMPONENT_AT_AR_AFGRIP"] = GetLabelText("WCT_GRIP"), ["COMPONENT_AT_AR_BARREL_01"] = GetLabelText("WCT_BARR"), ["COMPONENT_AT_AR_BARREL_02"] = GetLabelText("WCT_BARR2"), ["COMPONENT_AT_AR_FLSH"] = GetLabelText("WCT_FLASH"), - ["COMPONENT_AT_AR_SUPP"] = GetLabelText("WCT_SUPP"), ["COMPONENT_AT_AR_SUPP_02"] = GetLabelText("WCT_SUPP"), + ["COMPONENT_AT_AR_SUPP"] = GetLabelText("WCT_SUPP"), ["COMPONENT_AT_BP_BARREL_01"] = GetLabelText("WCT_BARR"), ["COMPONENT_AT_BP_BARREL_02"] = GetLabelText("WCT_BARR2"), ["COMPONENT_AT_CR_BARREL_01"] = GetLabelText("WCT_BARR"), @@ -469,42 +432,46 @@ private static void CreateWeaponsList() ["COMPONENT_AT_MUZZLE_07"] = GetLabelText("WCT_MUZZ7"), ["COMPONENT_AT_MUZZLE_08"] = GetLabelText("WCT_MUZZ"), ["COMPONENT_AT_MUZZLE_09"] = GetLabelText("WCT_MUZZ9"), - ["COMPONENT_AT_PI_COMP"] = GetLabelText("WCT_COMP"), ["COMPONENT_AT_PI_COMP_02"] = GetLabelText("WCT_COMP"), ["COMPONENT_AT_PI_COMP_03"] = GetLabelText("WCT_COMP"), - ["COMPONENT_AT_PI_FLSH"] = GetLabelText("WCT_FLASH"), + ["COMPONENT_AT_PI_COMP"] = GetLabelText("WCT_COMP"), ["COMPONENT_AT_PI_FLSH_02"] = GetLabelText("WCT_FLASH"), ["COMPONENT_AT_PI_FLSH_03"] = GetLabelText("WCT_FLASH"), - ["COMPONENT_AT_PI_RAIL"] = GetLabelText("WCT_SCOPE_PI"), + ["COMPONENT_AT_PI_FLSH"] = GetLabelText("WCT_FLASH"), ["COMPONENT_AT_PI_RAIL_02"] = GetLabelText("WCT_SCOPE_PI"), - ["COMPONENT_AT_PI_SUPP"] = GetLabelText("WCT_SUPP"), + ["COMPONENT_AT_PI_RAIL"] = GetLabelText("WCT_SCOPE_PI"), ["COMPONENT_AT_PI_SUPP_02"] = GetLabelText("WCT_SUPP"), + ["COMPONENT_AT_PI_SUPP"] = GetLabelText("WCT_SUPP"), ["COMPONENT_AT_SB_BARREL_01"] = GetLabelText("WCT_BARR"), ["COMPONENT_AT_SB_BARREL_02"] = GetLabelText("WCT_BARR2"), - ["COMPONENT_AT_SCOPE_LARGE_FIXED_ZOOM"] = GetLabelText("WCT_SCOPE_LRG"), + ["COMPONENT_AT_SC_BARREL_01"] = GetLabelText("WCT_BARR"), + ["COMPONENT_AT_SC_BARREL_02"] = GetLabelText("WCT_BARR2"), ["COMPONENT_AT_SCOPE_LARGE_FIXED_ZOOM_MK2"] = GetLabelText("WCT_SCOPE_LRG2"), + ["COMPONENT_AT_SCOPE_LARGE_FIXED_ZOOM"] = GetLabelText("WCT_SCOPE_LRG"), ["COMPONENT_AT_SCOPE_LARGE_MK2"] = GetLabelText("WCT_SCOPE_LRG2"), + ["COMPONENT_AT_SCOPE_LARGE"] = GetLabelText("WCT_SCOPE_LRG"), ["COMPONENT_AT_SCOPE_MACRO_02_MK2"] = GetLabelText("WCT_SCOPE_MAC2"), ["COMPONENT_AT_SCOPE_MACRO_02_SMG_MK2"] = GetLabelText("WCT_SCOPE_MAC2"), + ["COMPONENT_AT_SCOPE_MACRO_02"] = GetLabelText("WCT_SCOPE_MAC"), ["COMPONENT_AT_SCOPE_MACRO_MK2"] = GetLabelText("WCT_SCOPE_MAC2"), + ["COMPONENT_AT_SCOPE_MACRO"] = GetLabelText("WCT_SCOPE_MAC"), ["COMPONENT_AT_SCOPE_MAX"] = GetLabelText("WCT_SCOPE_MAX"), - ["COMPONENT_AT_SCOPE_MEDIUM"] = GetLabelText("WCT_SCOPE_LRG"), ["COMPONENT_AT_SCOPE_MEDIUM_MK2"] = GetLabelText("WCT_SCOPE_MED2"), + ["COMPONENT_AT_SCOPE_MEDIUM"] = GetLabelText("WCT_SCOPE_LRG"), ["COMPONENT_AT_SCOPE_NV"] = GetLabelText("WCT_SCOPE_NV"), - ["COMPONENT_AT_SCOPE_SMALL"] = GetLabelText("WCT_SCOPE_SML"), + ["COMPONENT_AT_SCOPE_SMALL_02"] = GetLabelText("WCT_SCOPE_SML"), ["COMPONENT_AT_SCOPE_SMALL_MK2"] = GetLabelText("WCT_SCOPE_SML2"), ["COMPONENT_AT_SCOPE_SMALL_SMG_MK2"] = GetLabelText("WCT_SCOPE_SML2"), + ["COMPONENT_AT_SCOPE_SMALL"] = GetLabelText("WCT_SCOPE_SML"), ["COMPONENT_AT_SCOPE_THERMAL"] = GetLabelText("WCT_SCOPE_TH"), - ["COMPONENT_AT_SC_BARREL_01"] = GetLabelText("WCT_BARR"), - ["COMPONENT_AT_SC_BARREL_02"] = GetLabelText("WCT_BARR2"), - ["COMPONENT_AT_SIGHTS"] = GetLabelText("WCT_HOLO"), ["COMPONENT_AT_SIGHTS_SMG"] = GetLabelText("WCT_HOLO"), + ["COMPONENT_AT_SIGHTS"] = GetLabelText("WCT_HOLO"), ["COMPONENT_AT_SR_BARREL_01"] = GetLabelText("WCT_BARR"), ["COMPONENT_AT_SR_BARREL_02"] = GetLabelText("WCT_BARR2"), ["COMPONENT_AT_SR_SUPP_03"] = GetLabelText("WCT_SUPP"), + ["COMPONENT_AT_SR_SUPP"] = GetLabelText("WCT_SUPP"), ["COMPONENT_BULLPUPRIFLE_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_BULLPUPRIFLE_CLIP_02"] = GetLabelText("WCT_CLIP2"), - ["COMPONENT_BULLPUPRIFLE_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"), ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"), ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"), @@ -515,6 +482,7 @@ private static void CreateWeaponsList() ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"), ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"), ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"), + ["COMPONENT_BULLPUPRIFLE_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_BULLPUPRIFLE_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_BULLPUPRIFLE_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_BULLPUPRIFLE_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_CLIP_AP"), @@ -522,7 +490,9 @@ private static void CreateWeaponsList() ["COMPONENT_BULLPUPRIFLE_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"), ["COMPONENT_BULLPUPRIFLE_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"), ["COMPONENT_BULLPUPRIFLE_VARMOD_LOW"] = GetLabelText("WCT_VAR_METAL"), - ["COMPONENT_CARBINERIFLE_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), + ["COMPONENT_CARBINERIFLE_CLIP_01"] = GetLabelText("WCT_CLIP1"), + ["COMPONENT_CARBINERIFLE_CLIP_02"] = GetLabelText("WCT_CLIP2"), + ["COMPONENT_CARBINERIFLE_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"), ["COMPONENT_CARBINERIFLE_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"), ["COMPONENT_CARBINERIFLE_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"), ["COMPONENT_CARBINERIFLE_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"), @@ -533,13 +503,16 @@ private static void CreateWeaponsList() ["COMPONENT_CARBINERIFLE_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"), ["COMPONENT_CARBINERIFLE_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"), ["COMPONENT_CARBINERIFLE_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"), + ["COMPONENT_CARBINERIFLE_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_CARBINERIFLE_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_CARBINERIFLE_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_CARBINERIFLE_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_CLIP_AP"), ["COMPONENT_CARBINERIFLE_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"), ["COMPONENT_CARBINERIFLE_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"), ["COMPONENT_CARBINERIFLE_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"), - ["COMPONENT_COMBATMG_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), + ["COMPONENT_CARBINERIFLE_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"), + ["COMPONENT_COMBATMG_CLIP_01"] = GetLabelText("WCT_CLIP1"), + ["COMPONENT_COMBATMG_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_COMBATMG_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"), ["COMPONENT_COMBATMG_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"), ["COMPONENT_COMBATMG_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"), @@ -550,6 +523,7 @@ private static void CreateWeaponsList() ["COMPONENT_COMBATMG_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"), ["COMPONENT_COMBATMG_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"), ["COMPONENT_COMBATMG_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"), + ["COMPONENT_COMBATMG_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_COMBATMG_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_COMBATMG_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_COMBATMG_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_CLIP_AP"), @@ -559,6 +533,9 @@ private static void CreateWeaponsList() ["COMPONENT_COMBATPDW_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_COMBATPDW_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_COMBATPDW_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"), + ["COMPONENT_COMBATPISTOL_CLIP_01"] = GetLabelText("WCT_CLIP1"), + ["COMPONENT_COMBATPISTOL_CLIP_02"] = GetLabelText("WCT_CLIP2"), + ["COMPONENT_COMBATPISTOL_VARMOD_LOWRIDER"] = GetLabelText("WCT_VAR_GOLD"), ["COMPONENT_COMPACTRIFLE_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_COMPACTRIFLE_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_COMPACTRIFLE_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"), @@ -570,7 +547,6 @@ private static void CreateWeaponsList() ["COMPONENT_HEAVYSHOTGUN_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_HEAVYSHOTGUN_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_HEAVYSHOTGUN_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"), - ["COMPONENT_HEAVYSNIPER_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_HEAVYSNIPER_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"), ["COMPONENT_HEAVYSNIPER_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"), ["COMPONENT_HEAVYSNIPER_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"), @@ -581,6 +557,7 @@ private static void CreateWeaponsList() ["COMPONENT_HEAVYSNIPER_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"), ["COMPONENT_HEAVYSNIPER_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"), ["COMPONENT_HEAVYSNIPER_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"), + ["COMPONENT_HEAVYSNIPER_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_HEAVYSNIPER_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_HEAVYSNIPER_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_HEAVYSNIPER_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_CLIP_AP"), @@ -602,7 +579,6 @@ private static void CreateWeaponsList() ["COMPONENT_MACHINEPISTOL_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"), ["COMPONENT_MARKSMANRIFLE_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_MARKSMANRIFLE_CLIP_02"] = GetLabelText("WCT_CLIP2"), - ["COMPONENT_MARKSMANRIFLE_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"), ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"), ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"), @@ -613,6 +589,7 @@ private static void CreateWeaponsList() ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"), ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"), ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_10"), + ["COMPONENT_MARKSMANRIFLE_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_MARKSMANRIFLE_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_MARKSMANRIFLE_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_MARKSMANRIFLE_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_CLIP_AP"), @@ -620,9 +597,16 @@ private static void CreateWeaponsList() ["COMPONENT_MARKSMANRIFLE_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"), ["COMPONENT_MARKSMANRIFLE_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"), ["COMPONENT_MARKSMANRIFLE_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"), + ["COMPONENT_MG_CLIP_01"] = GetLabelText("WCT_CLIP1"), + ["COMPONENT_MG_CLIP_02"] = GetLabelText("WCT_CLIP2"), + ["COMPONENT_MG_VARMOD_LOWRIDER"] = GetLabelText("WCT_VAR_GOLD"), + ["COMPONENT_MICROSMG_CLIP_01"] = GetLabelText("WCT_CLIP1"), + ["COMPONENT_MICROSMG_CLIP_02"] = GetLabelText("WCT_CLIP2"), + ["COMPONENT_MICROSMG_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"), ["COMPONENT_MINISMG_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_MINISMG_CLIP_02"] = GetLabelText("WCT_CLIP2"), - ["COMPONENT_PISTOL_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), + ["COMPONENT_PISTOL_CLIP_01"] = GetLabelText("WCT_CLIP1"), + ["COMPONENT_PISTOL_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_PISTOL_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"), ["COMPONENT_PISTOL_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"), ["COMPONENT_PISTOL_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"), @@ -633,13 +617,17 @@ private static void CreateWeaponsList() ["COMPONENT_PISTOL_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"), ["COMPONENT_PISTOL_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"), ["COMPONENT_PISTOL_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"), + ["COMPONENT_PISTOL_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_PISTOL_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_PISTOL_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_PISTOL_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"), ["COMPONENT_PISTOL_MK2_CLIP_HOLLOWPOINT"] = GetLabelText("WCT_CLIP_HP"), ["COMPONENT_PISTOL_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"), ["COMPONENT_PISTOL_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"), - ["COMPONENT_PUMPSHOTGUN_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), + ["COMPONENT_PISTOL_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"), + ["COMPONENT_PISTOL50_CLIP_01"] = GetLabelText("WCT_CLIP1"), + ["COMPONENT_PISTOL50_CLIP_02"] = GetLabelText("WCT_CLIP2"), + ["COMPONENT_PISTOL50_VARMOD_LUXE"] = GetLabelText("WCT_VAR_SIL"), ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"), ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"), ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"), @@ -650,12 +638,13 @@ private static void CreateWeaponsList() ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"), ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"), ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"), + ["COMPONENT_PUMPSHOTGUN_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_PUMPSHOTGUN_MK2_CLIP_01"] = GetLabelText("WCT_SHELL"), ["COMPONENT_PUMPSHOTGUN_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_SHELL_AP"), ["COMPONENT_PUMPSHOTGUN_MK2_CLIP_EXPLOSIVE"] = GetLabelText("WCT_SHELL_EX"), ["COMPONENT_PUMPSHOTGUN_MK2_CLIP_HOLLOWPOINT"] = GetLabelText("WCT_SHELL_HP"), ["COMPONENT_PUMPSHOTGUN_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_SHELL_INC"), - ["COMPONENT_REVOLVER_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), + ["COMPONENT_PUMPSHOTGUN_VARMOD_LOWRIDER"] = GetLabelText("WCT_VAR_GOLD"), ["COMPONENT_REVOLVER_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"), ["COMPONENT_REVOLVER_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"), ["COMPONENT_REVOLVER_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"), @@ -666,6 +655,7 @@ private static void CreateWeaponsList() ["COMPONENT_REVOLVER_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"), ["COMPONENT_REVOLVER_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"), ["COMPONENT_REVOLVER_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"), + ["COMPONENT_REVOLVER_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_REVOLVER_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1_RV"), ["COMPONENT_REVOLVER_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"), ["COMPONENT_REVOLVER_MK2_CLIP_HOLLOWPOINT"] = GetLabelText("WCT_CLIP_HP"), @@ -673,7 +663,10 @@ private static void CreateWeaponsList() ["COMPONENT_REVOLVER_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"), ["COMPONENT_REVOLVER_VARMOD_BOSS"] = GetLabelText("WCT_REV_VARB"), ["COMPONENT_REVOLVER_VARMOD_GOON"] = GetLabelText("WCT_REV_VARG"), - ["COMPONENT_SMG_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), + ["COMPONENT_SAWNOFFSHOTGUN_VARMOD_LUXE"] = GetLabelText("WCT_VAR_METAL"), + ["COMPONENT_SMG_CLIP_01"] = GetLabelText("WCT_CLIP1"), + ["COMPONENT_SMG_CLIP_02"] = GetLabelText("WCT_CLIP2"), + ["COMPONENT_SMG_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"), ["COMPONENT_SMG_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"), ["COMPONENT_SMG_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"), ["COMPONENT_SMG_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"), @@ -684,15 +677,17 @@ private static void CreateWeaponsList() ["COMPONENT_SMG_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"), ["COMPONENT_SMG_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"), ["COMPONENT_SMG_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"), + ["COMPONENT_SMG_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_SMG_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_SMG_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_SMG_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"), ["COMPONENT_SMG_MK2_CLIP_HOLLOWPOINT"] = GetLabelText("WCT_CLIP_HP"), ["COMPONENT_SMG_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"), ["COMPONENT_SMG_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"), + ["COMPONENT_SMG_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"), + ["COMPONENT_SNIPERRIFLE_VARMOD_LUXE"] = GetLabelText("WCT_VAR_WOOD"), ["COMPONENT_SNSPISTOL_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_SNSPISTOL_CLIP_02"] = GetLabelText("WCT_CLIP2"), - ["COMPONENT_SNSPISTOL_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_SNSPISTOL_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"), ["COMPONENT_SNSPISTOL_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"), ["COMPONENT_SNSPISTOL_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"), @@ -703,6 +698,7 @@ private static void CreateWeaponsList() ["COMPONENT_SNSPISTOL_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"), ["COMPONENT_SNSPISTOL_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"), ["COMPONENT_SNSPISTOL_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_10"), + ["COMPONENT_SNSPISTOL_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_SNSPISTOL_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_SNSPISTOL_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_SNSPISTOL_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"), @@ -713,7 +709,6 @@ private static void CreateWeaponsList() ["COMPONENT_SPECIALCARBINE_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_SPECIALCARBINE_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_SPECIALCARBINE_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"), - ["COMPONENT_SPECIALCARBINE_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_SPECIALCARBINE_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"), ["COMPONENT_SPECIALCARBINE_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"), ["COMPONENT_SPECIALCARBINE_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"), @@ -724,6 +719,7 @@ private static void CreateWeaponsList() ["COMPONENT_SPECIALCARBINE_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"), ["COMPONENT_SPECIALCARBINE_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"), ["COMPONENT_SPECIALCARBINE_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"), + ["COMPONENT_SPECIALCARBINE_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"), ["COMPONENT_SPECIALCARBINE_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"), ["COMPONENT_SPECIALCARBINE_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"), ["COMPONENT_SPECIALCARBINE_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_CLIP_AP"), diff --git a/vMenu/data/VehicleData.cs b/vMenu/data/VehicleData.cs index 760b9ce7..7fed4042 100644 --- a/vMenu/data/VehicleData.cs +++ b/vMenu/data/VehicleData.cs @@ -520,6 +520,7 @@ public static class Vehicles "LYNX", "MASSACRO", "MASSACRO2", + "NEON", // Doomsday Heist Update "NINEF", "NINEF2", "OMNIS", diff --git a/vMenu/menus/MiscSettings.cs b/vMenu/menus/MiscSettings.cs index 9fead272..2eee074d 100644 --- a/vMenu/menus/MiscSettings.cs +++ b/vMenu/menus/MiscSettings.cs @@ -68,13 +68,11 @@ public class MiscSettings /// private void CreateMenu() { - try - { - MenuController.MenuAlignment = MiscRightAlignMenu ? MenuController.MenuAlignmentOption.Right : MenuController.MenuAlignmentOption.Left; - } - catch (AspectRatioException) + MenuController.MenuAlignment = MiscRightAlignMenu ? MenuController.MenuAlignmentOption.Right : MenuController.MenuAlignmentOption.Left; + if (MenuController.MenuAlignment != (MiscRightAlignMenu ? MenuController.MenuAlignmentOption.Right : MenuController.MenuAlignmentOption.Left)) { Notify.Error(CommonErrors.RightAlignedNotSupported); + // (re)set the default to left just in case so they don't get this error again in the future. MenuController.MenuAlignment = MenuController.MenuAlignmentOption.Left; MiscRightAlignMenu = false; @@ -584,13 +582,12 @@ private void CreateMenu() { if (item == rightAlignMenu) { - try - { - MenuController.MenuAlignment = _checked ? MenuController.MenuAlignmentOption.Right : MenuController.MenuAlignmentOption.Left; - MiscRightAlignMenu = _checked; - UserDefaults.MiscRightAlignMenu = MiscRightAlignMenu; - } - catch (AspectRatioException) + + MenuController.MenuAlignment = _checked ? MenuController.MenuAlignmentOption.Right : MenuController.MenuAlignmentOption.Left; + MiscRightAlignMenu = _checked; + UserDefaults.MiscRightAlignMenu = MiscRightAlignMenu; + + if (MenuController.MenuAlignment != (_checked ? MenuController.MenuAlignmentOption.Right : MenuController.MenuAlignmentOption.Left)) { Notify.Error(CommonErrors.RightAlignedNotSupported); // (re)set the default to left just in case so they don't get this error again in the future. @@ -598,6 +595,7 @@ private void CreateMenu() MiscRightAlignMenu = false; UserDefaults.MiscRightAlignMenu = false; } + } else if (item == disablePms) { diff --git a/vMenu/menus/MpPedCustomization.cs b/vMenu/menus/MpPedCustomization.cs index 3ed800b4..f6090008 100644 --- a/vMenu/menus/MpPedCustomization.cs +++ b/vMenu/menus/MpPedCustomization.cs @@ -105,12 +105,17 @@ private void MakeCreateCharacterMenu(bool male, bool editPed = false) overlayColorsList.Add($"Color #{i + 1}"); } + int maxHairStyles = GetNumberOfPedDrawableVariations(Game.PlayerPed.Handle, 2); + //if (currentCharacter.ModelHash == (uint)PedHash.FreemodeFemale01) + //{ + // maxHairStyles /= 2; + //} List hairStylesList = new List(); - for (int i = 0; i < GetNumberOfPedDrawableVariations(Game.PlayerPed.Handle, 2); i++) + for (int i = 0; i < maxHairStyles; i++) { hairStylesList.Add($"Style #{i + 1}"); } - hairStylesList.Add($"Style #{GetNumberOfPedDrawableVariations(Game.PlayerPed.Handle, 2)}"); + hairStylesList.Add($"Style #{maxHairStyles + 1}"); List blemishesStyleList = new List(); for (int i = 0; i < GetNumHeadOverlayValues(0); i++) @@ -770,16 +775,12 @@ private void CreateMenu() menu.AddMenuItem(createMaleBtn); MenuController.BindMenuItem(menu, createCharacterMenu, createMaleBtn); - //menu.BindMenuToItem(createCharacterMenu, createMale); menu.AddMenuItem(createFemaleBtn); MenuController.BindMenuItem(menu, createCharacterMenu, createFemaleBtn); - //menu.BindMenuToItem(createCharacterMenu, createFemale); menu.AddMenuItem(savedCharacters); MenuController.BindMenuItem(menu, savedCharactersMenu, savedCharacters); - //menu.BindMenuToItem(savedCharactersMenu, savedCharacters); menu.RefreshIndex(); - //menu.UpdateScaleform(); createCharacterMenu.InstructionalButtons.Add(Control.MoveLeftRight, "Turn Head"); inheritanceMenu.InstructionalButtons.Add(Control.MoveLeftRight, "Turn Head"); @@ -788,6 +789,7 @@ private void CreateMenu() tattoosMenu.InstructionalButtons.Add(Control.MoveLeftRight, "Turn Head"); clothesMenu.InstructionalButtons.Add(Control.MoveLeftRight, "Turn Head"); propsMenu.InstructionalButtons.Add(Control.MoveLeftRight, "Turn Head"); + createCharacterMenu.InstructionalButtons.Add(Control.PhoneExtraOption, "Turn Character"); inheritanceMenu.InstructionalButtons.Add(Control.PhoneExtraOption, "Turn Character"); appearanceMenu.InstructionalButtons.Add(Control.PhoneExtraOption, "Turn Character"); @@ -795,8 +797,23 @@ private void CreateMenu() tattoosMenu.InstructionalButtons.Add(Control.PhoneExtraOption, "Turn Character"); clothesMenu.InstructionalButtons.Add(Control.PhoneExtraOption, "Turn Character"); propsMenu.InstructionalButtons.Add(Control.PhoneExtraOption, "Turn Character"); + + createCharacterMenu.InstructionalButtons.Add(Control.ParachuteBrakeRight, "Turn Camera Right"); + inheritanceMenu.InstructionalButtons.Add(Control.ParachuteBrakeRight, "Turn Camera Right"); + appearanceMenu.InstructionalButtons.Add(Control.ParachuteBrakeRight, "Turn Camera Right"); + faceShapeMenu.InstructionalButtons.Add(Control.ParachuteBrakeRight, "Turn Camera Right"); tattoosMenu.InstructionalButtons.Add(Control.ParachuteBrakeRight, "Turn Camera Right"); + clothesMenu.InstructionalButtons.Add(Control.ParachuteBrakeRight, "Turn Camera Right"); + propsMenu.InstructionalButtons.Add(Control.ParachuteBrakeRight, "Turn Camera Right"); + + createCharacterMenu.InstructionalButtons.Add(Control.ParachuteBrakeLeft, "Turn Camera Left"); + inheritanceMenu.InstructionalButtons.Add(Control.ParachuteBrakeLeft, "Turn Camera Left"); + appearanceMenu.InstructionalButtons.Add(Control.ParachuteBrakeLeft, "Turn Camera Left"); + faceShapeMenu.InstructionalButtons.Add(Control.ParachuteBrakeLeft, "Turn Camera Left"); tattoosMenu.InstructionalButtons.Add(Control.ParachuteBrakeLeft, "Turn Camera Left"); + clothesMenu.InstructionalButtons.Add(Control.ParachuteBrakeLeft, "Turn Camera Left"); + propsMenu.InstructionalButtons.Add(Control.ParachuteBrakeLeft, "Turn Camera Left"); + MenuItem inheritanceButton = new MenuItem("Character Inheritance", "Character inheritance options."); MenuItem appearanceButton = new MenuItem("Character Appearance", "Character appearance options."); @@ -1629,8 +1646,6 @@ void ApplySavedTattoos() ClearPedDecorations(Game.PlayerPed.Handle); }; - // eventhandler for when the tattoos menu is openend. - tattoosMenu.OnMenuOpen += (sender) => { Notify.Info("TIP, take a look at the instructional buttons! If you can't see a specific tattoo, try turning the camera using those buttons (Q & E)."); }; #endregion #endregion @@ -1718,9 +1733,31 @@ void ApplySavedTattoos() { if (item == createMaleBtn) { - await SetPlayerSkin("mp_m_freemode_01", new PedInfo() { version = -1 }); + uint model = (uint)GetHashKey("mp_m_freemode_01"); + + if (!HasModelLoaded(model)) + { + RequestModel(model); + while (!HasModelLoaded(model)) + { + await BaseScript.Delay(0); + } + } + + int maxHealth = Game.PlayerPed.MaxHealth; + int maxArmour = Game.Player.MaxArmor; + int health = Game.PlayerPed.Health; + int armour = Game.PlayerPed.Armor; + + SaveWeaponLoadout("vmenu_temp_weapons_loadout_before_respawn"); + SetPlayerModel(Game.Player.Handle, model); + await SpawnWeaponLoadoutAsync("vmenu_temp_weapons_loadout_before_respawn", false, true, true); + + Game.Player.MaxArmor = maxArmour; + Game.PlayerPed.MaxHealth = maxHealth; + Game.PlayerPed.Health = health; + Game.PlayerPed.Armor = armour; - //SetPlayerModel(Game.PlayerPed.Handle, currentCharacter.ModelHash); ClearPedDecorations(Game.PlayerPed.Handle); ClearPedFacialDecorations(Game.PlayerPed.Handle); SetPedDefaultComponentVariation(Game.PlayerPed.Handle); @@ -1732,9 +1769,31 @@ void ApplySavedTattoos() } else if (item == createFemaleBtn) { - await SetPlayerSkin("mp_f_freemode_01", new PedInfo() { version = -1 }); + uint model = (uint)GetHashKey("mp_f_freemode_01"); + + if (!HasModelLoaded(model)) + { + RequestModel(model); + while (!HasModelLoaded(model)) + { + await BaseScript.Delay(0); + } + } + + int maxHealth = Game.PlayerPed.MaxHealth; + int maxArmour = Game.Player.MaxArmor; + int health = Game.PlayerPed.Health; + int armour = Game.PlayerPed.Armor; + + SaveWeaponLoadout("vmenu_temp_weapons_loadout_before_respawn"); + SetPlayerModel(Game.Player.Handle, model); + await SpawnWeaponLoadoutAsync("vmenu_temp_weapons_loadout_before_respawn", false, true, true); + + Game.Player.MaxArmor = maxArmour; + Game.PlayerPed.MaxHealth = maxHealth; + Game.PlayerPed.Health = health; + Game.PlayerPed.Armor = armour; - //SetPlayerModel(Game.PlayerPed.Handle, currentCharacter.ModelHash); ClearPedDecorations(Game.PlayerPed.Handle); ClearPedFacialDecorations(Game.PlayerPed.Handle); SetPedDefaultComponentVariation(Game.PlayerPed.Handle); @@ -1782,12 +1841,19 @@ private async Task SpawnSavedPed(bool restoreWeapons) await BaseScript.Delay(0); } } + int maxHealth = Game.PlayerPed.MaxHealth; + int maxArmour = Game.Player.MaxArmor; + int health = Game.PlayerPed.Health; + int armour = Game.PlayerPed.Armor; + + SaveWeaponLoadout("vmenu_temp_weapons_loadout_before_respawn"); + SetPlayerModel(Game.Player.Handle, currentCharacter.ModelHash); + await SpawnWeaponLoadoutAsync("vmenu_temp_weapons_loadout_before_respawn", false, true, true); - // for some weird reason, using SetPlayerModel here does not work, it glitches out and makes the player have what seems to be both male - // and female ped at the same time.. really fucking weird. Only the CommonFunctions.SetPlayerSkin function seems to work some how. I really have no clue. - await SetPlayerSkin(currentCharacter.ModelHash, new PedInfo() { version = -1 }, restoreWeapons); - // SetPlayerModel(Game.PlayerPed.Handle, currentCharacter.IsMale ? (uint)GetHashKey("mp_m_freemode_01") : (uint)GetHashKey("mp_f_freemode_01")); - // SetPlayerModel(Game.PlayerPed.Handle, currentCharacter.ModelHash); + Game.Player.MaxArmor = maxArmour; + Game.PlayerPed.MaxHealth = maxHealth; + Game.PlayerPed.Health = health; + Game.PlayerPed.Armor = armour; ClearPedDecorations(Game.PlayerPed.Handle); ClearPedFacialDecorations(Game.PlayerPed.Handle); diff --git a/vMenu/menus/NoclipMenu.cs b/vMenu/menus/NoclipMenu.cs deleted file mode 100644 index a0ba8a32..00000000 --- a/vMenu/menus/NoclipMenu.cs +++ /dev/null @@ -1,207 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using MenuAPI; -using Newtonsoft.Json; -using CitizenFX.Core; -using static CitizenFX.Core.UI.Screen; -using static CitizenFX.Core.Native.API; -using static vMenuClient.CommonFunctions; -using static vMenuShared.PermissionsManager; - -namespace vMenuClient -{ - public class NoclipMenu : BaseScript - { - private bool setupDone = false; - private Menu noclipMenu = null; - private int currentSpeed = 0; - - private List speeds = new List() - { - "Very Slow", - "Slow", - "Normal", - "Fast", - "Very Fast", - "Extremely Fast", - "Extremely Fast v2.0", - "Max Speed" - }; - - /// - /// Constructor - /// - public NoclipMenu() - { - Tick += OnTick; - } - - /// - /// OnTick to run the menu functions. - /// - /// - private async Task OnTick() - { - // Setup is not done or cf is null. - if (!setupDone) - { - Setup(); - - // wait for setup in MainMenu (permissions and addons) to be done before adding the noclip menu. - while (!MainMenu.ConfigOptionsSetupComplete || !MainMenu.PermissionsSetupComplete) - { - await Delay(0); - } - // Add the noclip menu - MenuController.AddMenu(noclipMenu); - } - // Setup is done. - else - { - if (noclipMenu == null) - { - await Delay(0); - } - else - { - while (MainMenu.NoClipEnabled) - { - noclipMenu.InstructionalButtons[Control.Sprint] = $"Change speed ({speeds[currentSpeed]})"; - var noclipEntity = Game.PlayerPed.IsInVehicle() ? GetVehicle().Handle : Game.PlayerPed.Handle; - - if (noclipMenu.Visible == false) - { - noclipMenu.OpenMenu(); - } - FreezeEntityPosition(noclipEntity, true); - SetEntityInvincible(noclipEntity, true); - - Vector3 newPos = GetEntityCoords(noclipEntity, true); - Game.DisableControlThisFrame(0, Control.MoveUpOnly); - Game.DisableControlThisFrame(0, Control.MoveUp); - Game.DisableControlThisFrame(0, Control.MoveUpDown); - Game.DisableControlThisFrame(0, Control.MoveDown); - Game.DisableControlThisFrame(0, Control.MoveDownOnly); - Game.DisableControlThisFrame(0, Control.MoveLeft); - Game.DisableControlThisFrame(0, Control.MoveLeftOnly); - Game.DisableControlThisFrame(0, Control.MoveLeftRight); - Game.DisableControlThisFrame(0, Control.MoveRight); - Game.DisableControlThisFrame(0, Control.MoveRightOnly); - Game.DisableControlThisFrame(0, Control.Cover); - Game.DisableControlThisFrame(0, Control.MultiplayerInfo); - - //var xoff = 0.0f; - var yoff = 0.0f; - var zoff = 0.0f; - - if (Game.CurrentInputMode == InputMode.MouseAndKeyboard && UpdateOnscreenKeyboard() != 0) - { - if (Game.IsControlJustPressed(0, Control.Sprint)) - { - currentSpeed++; - if (currentSpeed == speeds.Count) - { - currentSpeed = 0; - } - noclipMenu.GetMenuItems()[0].Label = speeds[currentSpeed]; - } - - if (Game.IsDisabledControlPressed(0, Control.MoveUpOnly)) - { - yoff = 0.5f; - } - if (Game.IsDisabledControlPressed(0, Control.MoveDownOnly)) - { - yoff = -0.5f; - } - if (Game.IsDisabledControlPressed(0, Control.MoveLeftOnly)) - { - SetEntityHeading(Game.PlayerPed.Handle, GetEntityHeading(Game.PlayerPed.Handle) + 3f); - } - if (Game.IsDisabledControlPressed(0, Control.MoveRightOnly)) - { - SetEntityHeading(Game.PlayerPed.Handle, GetEntityHeading(Game.PlayerPed.Handle) - 3f); - } - if (Game.IsDisabledControlPressed(0, Control.Cover)) - { - zoff = 0.21f; - } - if (Game.IsDisabledControlPressed(0, Control.MultiplayerInfo)) - { - zoff = -0.21f; - } - } - float moveSpeed = (float)currentSpeed; - if (currentSpeed > speeds.Count / 2) - { - moveSpeed *= 1.8f; - } - newPos = GetOffsetFromEntityInWorldCoords(noclipEntity, 0f, yoff * (moveSpeed + 0.3f), zoff * (moveSpeed + 0.3f)); - - var heading = GetEntityHeading(noclipEntity); - SetEntityVelocity(noclipEntity, 0f, 0f, 0f); - SetEntityRotation(noclipEntity, 0f, 0f, 0f, 0, false); - SetEntityHeading(noclipEntity, heading); - - //if (!((yoff > -0.01f && yoff < 0.01f) && (zoff > -0.01f && zoff < 0.01f))) - { - SetEntityCollision(noclipEntity, false, false); - SetEntityCoordsNoOffset(noclipEntity, newPos.X, newPos.Y, newPos.Z, true, true, true); - } - - // After the next game tick, reset the entity properties. - await Delay(0); - FreezeEntityPosition(noclipEntity, false); - SetEntityInvincible(noclipEntity, false); - SetEntityCollision(noclipEntity, true, true); - } - - if (noclipMenu.Visible && !MainMenu.NoClipEnabled) - { - noclipMenu.CloseMenu(); - } - - } - } - } - - /// - /// Setting up the menu. - /// - private void Setup() - { - noclipMenu = new Menu("No Clip", "Controls") { IgnoreDontOpenMenus = true }; - - MenuItem speed = new MenuItem("Current Moving Speed", "This is your current moving speed.") - { - Label = speeds[currentSpeed] - }; - - noclipMenu.OnMenuOpen += (m) => - { - if (MainMenu.NoClipEnabled) - HelpMessage.Custom("NoClip is now active. Look at the instructional buttons for all the keybinds. You can view your current moving speed all the way on the bottom right instructional button."); - }; - - noclipMenu.AddMenuItem(speed); - - noclipMenu.InstructionalButtons.Clear(); - noclipMenu.InstructionalButtons.Add(Control.Sprint, $"Change speed ({speeds[currentSpeed]})"); - noclipMenu.InstructionalButtons.Add(Control.MoveUpDown, "Go Forwards/Backwards"); - noclipMenu.InstructionalButtons.Add(Control.MoveLeftRight, "Turn Left/Right"); - noclipMenu.InstructionalButtons.Add(Control.MultiplayerInfo, "Go Down"); - noclipMenu.InstructionalButtons.Add(Control.Cover, "Go Up"); - noclipMenu.InstructionalButtons.Add((Control)MainMenu.NoClipKey, "Disable Noclip"); - - setupDone = true; - } - - public Menu GetMenu() - { - return noclipMenu; - } - } -} diff --git a/vMenu/menus/PlayerOptions.cs b/vMenu/menus/PlayerOptions.cs index 2d3322bc..cdf83772 100644 --- a/vMenu/menus/PlayerOptions.cs +++ b/vMenu/menus/PlayerOptions.cs @@ -398,7 +398,7 @@ private void CreateMenu() { PlayerFrozen = _checked; - if (MainMenu.NoClipMenu != null && !MainMenu.NoClipEnabled) + if (!MainMenu.NoClipEnabled) { FreezeEntityPosition(Game.PlayerPed.Handle, PlayerFrozen); } @@ -492,7 +492,7 @@ private int GetCustomDrivingStyle() private int GetStyleFromIndex(int index) { - int style = 0; + int style; switch (index) { case 0: diff --git a/vMenu/menus/WeaponOptions.cs b/vMenu/menus/WeaponOptions.cs index 42c1b2fd..4e7e2fd3 100644 --- a/vMenu/menus/WeaponOptions.cs +++ b/vMenu/menus/WeaponOptions.cs @@ -25,8 +25,8 @@ public class WeaponOptions public static Dictionary AddonWeapons = new Dictionary(); - private Dictionary weaponInfo = new Dictionary(); - private Dictionary weaponComponents = new Dictionary(); + private Dictionary weaponInfo; + private Dictionary weaponComponents; #region Create Menu /// @@ -34,6 +34,10 @@ public class WeaponOptions /// private void CreateMenu() { + // Setup weapon dictionaries. + weaponInfo = new Dictionary(); + weaponComponents = new Dictionary(); + #region create main weapon options menu and add items // Create the menu. menu = new Menu(Game.Player.Name, "Weapon Options"); @@ -354,15 +358,22 @@ async void IndexChangedEventHandler(Menu sender, MenuListItem item, int oldIndex foreach (ValidWeapon weapon in ValidWeapons.WeaponList) { uint cat = (uint)GetWeapontypeGroup(weapon.Hash); - if (!string.IsNullOrEmpty(weapon.Name) && (IsAllowed(weapon.Perm) || IsAllowed(Permission.WPGetAll))) + if (!string.IsNullOrEmpty(weapon.Name) && IsAllowed(weapon.Perm)) { //Log($"[DEBUG LOG] [WEAPON-BUG] {weapon.Name} - {weapon.Perm} = {IsAllowed(weapon.Perm)} & All = {IsAllowed(Permission.WPGetAll)}"); #region Create menu for this weapon and add buttons - Menu weaponMenu = new Menu("Weapon Options", weapon.Name); + Menu weaponMenu = new Menu("Weapon Options", weapon.Name) + { + ShowWeaponStatsPanel = true + }; + var stats = new Game.WeaponHudStats(); + Game.GetWeaponHudStats(weapon.Hash, ref stats); + weaponMenu.SetWeaponStats((float)stats.hudDamage / 100f, (float)stats.hudSpeed / 100f, (float)stats.hudAccuracy / 100f, (float)stats.hudRange / 100f); MenuItem weaponItem = new MenuItem(weapon.Name, $"Open the options for ~y~{weapon.Name.ToString()}~s~.") { Label = "→→→", - LeftIcon = MenuItem.Icon.GUN + LeftIcon = MenuItem.Icon.GUN, + ItemData = stats }; weaponInfo.Add(weaponMenu, weapon); @@ -688,6 +699,37 @@ async void IndexChangedEventHandler(Menu sender, MenuListItem item, int oldIndex } }; #endregion + + void OnIndexChange(Menu m, MenuItem i) + { + if (i.ItemData is Game.WeaponHudStats stats) + { + m.SetWeaponStats((float)stats.hudDamage / 100f, (float)stats.hudSpeed / 100f, (float)stats.hudAccuracy / 100f, (float)stats.hudRange / 100f); + m.ShowWeaponStatsPanel = true; + } + else + { + m.ShowWeaponStatsPanel = false; + } + } + + handGuns.OnIndexChange += (sender, oldItem, newItem, oldIndex, newIndex) => { OnIndexChange(sender, newItem); }; + rifles.OnIndexChange += (sender, oldItem, newItem, oldIndex, newIndex) => { OnIndexChange(sender, newItem); }; + shotguns.OnIndexChange += (sender, oldItem, newItem, oldIndex, newIndex) => { OnIndexChange(sender, newItem); }; + smgs.OnIndexChange += (sender, oldItem, newItem, oldIndex, newIndex) => { OnIndexChange(sender, newItem); }; + throwables.OnIndexChange += (sender, oldItem, newItem, oldIndex, newIndex) => { OnIndexChange(sender, newItem); }; + melee.OnIndexChange += (sender, oldItem, newItem, oldIndex, newIndex) => { OnIndexChange(sender, newItem); }; + heavy.OnIndexChange += (sender, oldItem, newItem, oldIndex, newIndex) => { OnIndexChange(sender, newItem); }; + snipers.OnIndexChange += (sender, oldItem, newItem, oldIndex, newIndex) => { OnIndexChange(sender, newItem); }; + + handGuns.OnMenuOpen += (sender) => { OnIndexChange(sender, sender.GetCurrentMenuItem()); }; + rifles.OnMenuOpen += (sender) => { OnIndexChange(sender, sender.GetCurrentMenuItem()); }; + shotguns.OnMenuOpen += (sender) => { OnIndexChange(sender, sender.GetCurrentMenuItem()); }; + smgs.OnMenuOpen += (sender) => { OnIndexChange(sender, sender.GetCurrentMenuItem()); }; + throwables.OnMenuOpen += (sender) => { OnIndexChange(sender, sender.GetCurrentMenuItem()); }; + melee.OnMenuOpen += (sender) => { OnIndexChange(sender, sender.GetCurrentMenuItem()); }; + heavy.OnMenuOpen += (sender) => { OnIndexChange(sender, sender.GetCurrentMenuItem()); }; + snipers.OnMenuOpen += (sender) => { OnIndexChange(sender, sender.GetCurrentMenuItem()); }; } diff --git a/vMenu/vMenuClient.csproj b/vMenu/vMenuClient.csproj index ffbf29b7..378ce148 100644 --- a/vMenu/vMenuClient.csproj +++ b/vMenu/vMenuClient.csproj @@ -78,7 +78,7 @@ - + @@ -106,7 +106,7 @@ - 1.0.1159 + 1.0.1360 runtime diff --git a/vMenuServer/MainServer.cs b/vMenuServer/MainServer.cs index 3472f251..2350e12f 100644 --- a/vMenuServer/MainServer.cs +++ b/vMenuServer/MainServer.cs @@ -564,7 +564,7 @@ private async Task WeatherLoop() if (dynamicWeather) { // Disable dynamic weather because these weather types shouldn't randomly change. - if (currentWeather == "XMAS" || currentWeather == "HALLOWHEEN" || currentWeather == "NEUTRAL") + if (currentWeather == "XMAS" || currentWeather == "HALLOWEEN" || currentWeather == "NEUTRAL") { dynamicWeather = false; return; diff --git a/vMenuServer/Properties/AssemblyInfo.cs b/vMenuServer/Properties/AssemblyInfo.cs index f3db73a9..8bd9b0f0 100644 --- a/vMenuServer/Properties/AssemblyInfo.cs +++ b/vMenuServer/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.0.0.0")] +[assembly: AssemblyVersion("3.0.4.0")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/vMenuServer/vMenuServer.csproj b/vMenuServer/vMenuServer.csproj index 818689e0..7c65a2e4 100644 --- a/vMenuServer/vMenuServer.csproj +++ b/vMenuServer/vMenuServer.csproj @@ -94,7 +94,7 @@ - 1.0.1159 + 1.0.1360 runtime