From 817ad05a4dc539f7a4bc0d2eaea35522ef1d0e17 Mon Sep 17 00:00:00 2001 From: Tom <31419184+TomGrobbe@users.noreply.github.com> Date: Sun, 26 Apr 2020 16:21:40 +0200 Subject: [PATCH 1/7] Create FUNDING.yml Experimental GitHub feature. --- .github/FUNDING.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..aecee909 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,4 @@ +# These are supported funding model platforms + +patreon: Vespura +custom: "https://www.paypal.me/tomgrobbe" From 8ce2d4b4b8cd780666e1dbe4790792f400ef339e Mon Sep 17 00:00:00 2001 From: Tom <31419184+TomGrobbe@users.noreply.github.com> Date: Sun, 26 Apr 2020 16:24:10 +0200 Subject: [PATCH 2/7] Update README.md --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index c9e8ab34..1ef97e70 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,6 @@ # vMenu vMenu is server sided menu for FiveM servers, including full\* permission support. -### Demo Screenshots - -|Main Menu|Player Options| -|:-:|:-:| -|![Main Menu](https://www.vespura.com/hi/i/fef17e5.png)|![Player Options](https://www.vespura.com/hi/i/458b6e4.png)| \*(Some features do not have permissions support as they are either harmless or it'd just be silly to deny them. However, they will be disabled if you deny access to the submenu that they are a part of (eg: unlimited stamina in Player Options will be disabled if you deny `vMenu.PlayerOptions.Menu`.)) @@ -81,7 +76,7 @@ vMenu v2.0.0 and earlier was [using a modified version of NativeUI](https://gith Tom Grobbe - https://www.vespura.com/ -Copyright © 2017-2019 +Copyright © 2017-2020 ---- From c2ccb76e7fa8e5c9cde73a556f52c8a0abba132b Mon Sep 17 00:00:00 2001 From: Vespura <31419184+TomGrobbe@users.noreply.github.com> Date: Sun, 26 Apr 2020 17:07:59 +0200 Subject: [PATCH 3/7] Update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5d2bad77..2a4375ce 100644 --- a/.gitignore +++ b/.gitignore @@ -264,3 +264,4 @@ dependencies/shared/vMenuShared\.net\.dll external/ *.cmd +*.cmd.bak \ No newline at end of file From 678961fd5d481d3c0ea2f9e52410fc79f32169f0 Mon Sep 17 00:00:00 2001 From: Vespura <31419184+TomGrobbe@users.noreply.github.com> Date: Sun, 26 Apr 2020 17:08:17 +0200 Subject: [PATCH 4/7] Update appveyor for new manifest file --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 02077d6e..66a06b75 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,7 +12,7 @@ build: after_build: - cmd: copy README.md ..\build\net452\README.md - cmd: copy LICENSE.md ..\build\net452\LICENSE.md - - ps: Invoke-WebRequest -OutFile '..\build\net452\__resource.lua' https://vespura.com/vmenu/__resource.lua + - ps: Invoke-WebRequest -OutFile '..\build\net452\fxmanifest.lua' https://vespura.com/vmenu/fxmanifest.lua - cmd: if %APPVEYOR_REPO_TAG%==true (appveyor SetVariable -Name VERSION_NAME -Value %APPVEYOR_REPO_TAG_NAME%) else (appveyor SetVariable -Name VERSION_NAME -Value beta-%APPVEYOR_BUILD_VERSION%) - cmd: cd ..\build\net452\ && 7z a "..\..\vMenu\vMenu-%VERSION_NAME%.zip" -r * && cd ..\..\vMenu\ - cmd: appveyor PushArtifact vMenu-%VERSION_NAME%.zip @@ -33,4 +33,4 @@ after_deploy: on_success: - cmd: if %APPVEYOR_REPO_TAG%==false curl -H "Content-Type:application/json" -X POST -d "{\"embeds\":[{\"title\":\"%APPVEYOR_PROJECT_NAME% (%VERSION_NAME%)\",\"description\":\"Build passed!\",\"color\":4502298,\"author\":{\"name\":\"Build triggered by %APPVEYOR_ACCOUNT_NAME%\",\"url\":\"https://github.com/%APPVEYOR_ACCOUNT_NAME%/\"},\"fields\":[{\"name\":\"AppVeyor Build\",\"value\":\"[Here](%APPVEYOR_URL%/project/%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_SLUG%/builds/%APPVEYOR_BUILD_ID%)\"},{\"name\":\"GitHub Commit (%APPVEYOR_REPO_COMMIT%)\",\"value\":\"[%APPVEYOR_REPO_COMMIT%](https://github.com/%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_NAME%/commit/%APPVEYOR_REPO_COMMIT%) - %APPVEYOR_REPO_COMMIT_MESSAGE%%APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED%\"},{\"name\":\"GitHub Branch\",\"value\":\"[%APPVEYOR_REPO_BRANCH%](https://github.com/%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_NAME%/tree/%APPVEYOR_REPO_BRANCH%)\"}]}]}" %WEBHOOK_URL% on_failure: - - cmd: curl -H "Content-Type:application/json" -X POST -d "{\"embeds\":[{\"title\":\"%APPVEYOR_PROJECT_NAME% (%VERSION_NAME%)\",\"description\":\"Build FAILED! Ouch.\",\"color\":13632027,\"author\":{\"name\":\"Build triggered by %APPVEYOR_ACCOUNT_NAME%\",\"url\":\"https://github.com/%APPVEYOR_ACCOUNT_NAME%/\"},\"fields\":[{\"name\":\"AppVeyor Build\",\"value\":\"[Here](%APPVEYOR_URL%/project/%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_SLUG%/builds/%APPVEYOR_BUILD_ID%)\"},{\"name\":\"GitHub Commit (%APPVEYOR_REPO_COMMIT%)\",\"value\":\"[%APPVEYOR_REPO_COMMIT%](https://github.com/%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_NAME%/commit/%APPVEYOR_REPO_COMMIT%) - %APPVEYOR_REPO_COMMIT_MESSAGE%%APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED%\"},{\"name\":\"GitHub Branch\",\"value\":\"[%APPVEYOR_REPO_BRANCH%](https://github.com/%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_NAME%/tree/%APPVEYOR_REPO_BRANCH%)\"}]}]}" %WEBHOOK_URL% \ No newline at end of file + - cmd: curl -H "Content-Type:application/json" -X POST -d "{\"embeds\":[{\"title\":\"%APPVEYOR_PROJECT_NAME% (%VERSION_NAME%)\",\"description\":\"Build FAILED! Ouch.\",\"color\":13632027,\"author\":{\"name\":\"Build triggered by %APPVEYOR_ACCOUNT_NAME%\",\"url\":\"https://github.com/%APPVEYOR_ACCOUNT_NAME%/\"},\"fields\":[{\"name\":\"AppVeyor Build\",\"value\":\"[Here](%APPVEYOR_URL%/project/%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_SLUG%/builds/%APPVEYOR_BUILD_ID%)\"},{\"name\":\"GitHub Commit (%APPVEYOR_REPO_COMMIT%)\",\"value\":\"[%APPVEYOR_REPO_COMMIT%](https://github.com/%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_NAME%/commit/%APPVEYOR_REPO_COMMIT%) - %APPVEYOR_REPO_COMMIT_MESSAGE%%APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED%\"},{\"name\":\"GitHub Branch\",\"value\":\"[%APPVEYOR_REPO_BRANCH%](https://github.com/%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_NAME%/tree/%APPVEYOR_REPO_BRANCH%)\"}]}]}" %WEBHOOK_URL% From 2573406188d1084ead675e5cdbfe59e411ed832d Mon Sep 17 00:00:00 2001 From: Vespura <31419184+TomGrobbe@users.noreply.github.com> Date: Sun, 26 Apr 2020 17:08:43 +0200 Subject: [PATCH 5/7] Update dependencies. --- vMenu/vMenuClient.csproj | 4 ++-- vMenuServer/vMenuServer.csproj | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/vMenu/vMenuClient.csproj b/vMenu/vMenuClient.csproj index 17e66850..6848d9e7 100644 --- a/vMenu/vMenuClient.csproj +++ b/vMenu/vMenuClient.csproj @@ -14,11 +14,11 @@ - + - + runtime diff --git a/vMenuServer/vMenuServer.csproj b/vMenuServer/vMenuServer.csproj index a8955236..16719a8e 100644 --- a/vMenuServer/vMenuServer.csproj +++ b/vMenuServer/vMenuServer.csproj @@ -8,6 +8,9 @@ ..\..\build\ SERVER + + x64 + @@ -16,7 +19,7 @@ - + runtime @@ -25,7 +28,7 @@ false - + From c4cb6ef7e3f703a4162f5e6c7d98bc1a6618ff4e Mon Sep 17 00:00:00 2001 From: Vespura <31419184+TomGrobbe@users.noreply.github.com> Date: Sun, 26 Apr 2020 17:12:04 +0200 Subject: [PATCH 6/7] Some minor cleanup --- vMenu/CommonFunctions.cs | 8 +++---- vMenu/FunctionsController.cs | 39 +++++++++++++---------------------- vMenu/menus/TimeOptions.cs | 8 +++---- vMenu/menus/VehicleOptions.cs | 4 ++-- vMenu/menus/VehicleSpawner.cs | 6 +++--- vMenu/menus/WeaponOptions.cs | 2 +- vMenuServer/BanManager.cs | 4 ++-- vMenuServer/MainServer.cs | 4 ++-- 8 files changed, 32 insertions(+), 43 deletions(-) diff --git a/vMenu/CommonFunctions.cs b/vMenu/CommonFunctions.cs index 74f4a8c1..6442c147 100644 --- a/vMenu/CommonFunctions.cs +++ b/vMenu/CommonFunctions.cs @@ -1585,7 +1585,7 @@ public static async Task GetUserInput(string windowTitle, string default { // Create the window title string. var spacer = "\t"; - AddTextEntry($"{GetCurrentResourceName().ToUpper()}_WINDOW_TITLE", $"{windowTitle ?? "Enter"}:{spacer}(MAX {maxInputLength.ToString()} Characters)"); + AddTextEntry($"{GetCurrentResourceName().ToUpper()}_WINDOW_TITLE", $"{windowTitle ?? "Enter"}:{spacer}(MAX {maxInputLength} Characters)"); // Display the input box. DisplayOnscreenKeyboard(1, $"{GetCurrentResourceName().ToUpper()}_WINDOW_TITLE", "", defaultText ?? "", "", "", "", maxInputLength); @@ -1671,11 +1671,11 @@ public static string ToProperString(string inputString) { if (prevUpper) { - outputString += $"{c.ToString()}"; + outputString += $"{c}"; } else { - outputString += $" {c.ToString()}"; + outputString += $" {c}"; } prevUpper = true; } @@ -2422,7 +2422,7 @@ public static async void SpawnCustomWeapon() } else { - Notify.Error($"This ({inputName.ToString()}) is not a valid weapon model name, or the model hash ({model.ToString()}) could not be found in the game files."); + Notify.Error($"This ({inputName}) is not a valid weapon model name, or the model hash ({model}) could not be found in the game files."); } } else diff --git a/vMenu/FunctionsController.cs b/vMenu/FunctionsController.cs index d2e0b26e..e7edb1e3 100644 --- a/vMenu/FunctionsController.cs +++ b/vMenu/FunctionsController.cs @@ -31,7 +31,6 @@ class FunctionsController : BaseScript // show location variables private Vector3 currentPos = Game.PlayerPed.Position; private Vector3 nodePos = Game.PlayerPed.Position; - private bool node = false; private float heading = 0f; private float safeZoneSizeX = (1 / GetSafeZoneSize() / 3.0f) - 0.358f; private uint crossing = 1; @@ -104,8 +103,7 @@ public FunctionsController() Tick += PersonalVehicleOptions; Tick += AnimalPedCameraChangeBlocker; Tick += SlowMiscTick; - - + Tick += SpectateHandling; //Tick += FlaresAndBombsTick; } @@ -190,11 +188,8 @@ private async Task PlayerOptions() if (MainMenu.PermissionsSetupComplete && MainMenu.PlayerOptionsMenu != null && IsAllowed(Permission.POMenu)) { // perms - bool ignorePlayerAllowed = IsAllowed(Permission.POIgnored); bool godmodeAllowed = IsAllowed(Permission.POGod); bool noRagdollAllowed = IsAllowed(Permission.PONoRagdoll); - bool vehicleGodModeAllowed = IsAllowed(Permission.VOGod); - bool playerFrozenAllowed = IsAllowed(Permission.POFreeze); if (MainMenu.MpPedCustomizationMenu != null && MainMenu.MpPedCustomizationMenu.appearanceMenu != null && MainMenu.MpPedCustomizationMenu.faceShapeMenu != null && MainMenu.MpPedCustomizationMenu.createCharacterMenu != null && MainMenu.MpPedCustomizationMenu.inheritanceMenu != null && MainMenu.MpPedCustomizationMenu.propsMenu != null && MainMenu.MpPedCustomizationMenu.clothesMenu != null && MainMenu.MpPedCustomizationMenu.tattoosMenu != null) { @@ -469,7 +464,7 @@ private async Task VehicleOptions() catch (Exception e) { Debug.WriteLine(@"[CRITICAL] A critical bug in one of your scripts was detected. vMenu is unable to set or register a decorator's value because another resource has already registered 1.5k or more decorators. vMenu will NOT work as long as this bug in your other scripts is unsolved. Please fix your other scripts. This is *NOT* caused by or fixable by vMenu!!!"); - Debug.WriteLine($"Error Location: {e.StackTrace}\nError info: {e.Message.ToString()}"); + Debug.WriteLine($"Error Location: {e.StackTrace}\nError info: {e.Message}"); await Delay(1000); } } @@ -750,7 +745,7 @@ private async Task UpdateLocation() // Get the nearest vehicle node. nodePos = currentPos; - node = GetNthClosestVehicleNode(currentPos.X, currentPos.Y, currentPos.Z, 0, ref nodePos, 0, 0, 0); + GetNthClosestVehicleNode(currentPos.X, currentPos.Y, currentPos.Z, 0, ref nodePos, 0, 0, 0); heading = Game.PlayerPed.Heading; // Get the safezone size for x and y to be able to move with the minimap. @@ -792,7 +787,7 @@ private void ShowLocation() prefix = "~m~Near ~s~"; } - string headingCharacter = ""; + string headingCharacter; // Heading Facing North if (heading > 320 || heading < 45) @@ -1162,12 +1157,10 @@ private async Task MiscRecordingKeybinds() if (notifOne != -1) { RemoveNotification(notifOne); - notifOne = -1; } if (notifTwo != -1) { RemoveNotification(notifTwo); - notifTwo = -1; } } } @@ -1653,10 +1646,6 @@ private async Task ManageCamera() } } - var menu = MainMenu.MpPedCustomizationMenu.GetMenu(); - - - if (IsMpCharEditorOpen()) { if (!HasAnimDictLoaded("anim@random@shop_clothes@watches")) @@ -2105,7 +2094,7 @@ private async Task PlayerClothingAnimationsController() catch (Exception e) { Debug.WriteLine(@"[CRITICAL] A critical bug in one of your scripts was detected. vMenu is unable to set or register a decorator's value because another resource has already registered 1.5k or more decorators. vMenu will NOT work as long as this bug in your other scripts is unsolved. Please fix your other scripts. This is *NOT* caused by or fixable by vMenu!!!"); - Debug.WriteLine($"Error Location: {e.StackTrace}\nError info: {e.Message.ToString()}"); + Debug.WriteLine($"Error Location: {e.StackTrace}\nError info: {e.Message}"); await Delay(1000); } while (!DecorIsRegisteredAsType(clothingAnimationDecor, 3)) @@ -2122,7 +2111,7 @@ private async Task PlayerClothingAnimationsController() catch (Exception e) { Debug.WriteLine(@"[CRITICAL] A critical bug in one of your scripts was detected. vMenu is unable to set or register a decorator's value because another resource has already registered 1.5k or more decorators. vMenu will NOT work as long as this bug in your other scripts is unsolved. Please fix your other scripts. This is *NOT* caused by or fixable by vMenu!!!"); - Debug.WriteLine($"Error Location: {e.StackTrace}\nError info: {e.Message.ToString()}"); + Debug.WriteLine($"Error Location: {e.StackTrace}\nError info: {e.Message}"); await Delay(1000); } foreach (Player player in Players) @@ -2200,7 +2189,7 @@ private async Task PlayerClothingAnimationsController() catch (Exception e) { Debug.WriteLine(@"[CRITICAL] A critical bug in one of your scripts was detected. vMenu is unable to set or register a decorator's value because another resource has already registered 1.5k or more decorators. vMenu will NOT work as long as this bug in your other scripts is unsolved. Please fix your other scripts. This is *NOT* caused by or fixable by vMenu!!!"); - Debug.WriteLine($"Error Location: {e.StackTrace}\nError info: {e.Message.ToString()}"); + Debug.WriteLine($"Error Location: {e.StackTrace}\nError info: {e.Message}"); await Delay(1000); } } @@ -2230,7 +2219,7 @@ private async Task PlayerBlipsControl() catch (Exception e) { Debug.WriteLine(@"[CRITICAL] A critical bug in one of your scripts was detected. vMenu is unable to set or register a decorator's value because another resource has already registered 1.5k or more decorators. vMenu will NOT work as long as this bug in your other scripts is unsolved. Please fix your other scripts. This is *NOT* caused by or fixable by vMenu!!!"); - Debug.WriteLine($"Error Location: {e.StackTrace}\nError info: {e.Message.ToString()}"); + Debug.WriteLine($"Error Location: {e.StackTrace}\nError info: {e.Message}"); await Delay(1000); } @@ -2348,7 +2337,7 @@ private async Task PlayerBlipsControl() catch (Exception e) { Debug.WriteLine(@"[CRITICAL] A critical bug in one of your scripts was detected. vMenu is unable to set or register a decorator's value because another resource has already registered 1.5k or more decorators. vMenu will NOT work as long as this bug in your other scripts is unsolved. Please fix your other scripts. This is *NOT* caused by or fixable by vMenu!!!"); - Debug.WriteLine($"Error Location: {e.StackTrace}\nError info: {e.Message.ToString()}"); + Debug.WriteLine($"Error Location: {e.StackTrace}\nError info: {e.Message}"); await Delay(1000); } while (!DecorIsRegisteredAsType("vmenu_player_blip_sprite_id", 3)) @@ -2364,7 +2353,7 @@ private async Task PlayerBlipsControl() #region player overhead names private Dictionary gamerTags = new Dictionary(); - private float distance = GetSettingsFloat(Setting.vmenu_player_names_distance) > 10f ? GetSettingsFloat(Setting.vmenu_player_names_distance) : 500f; // todo make this a convar. + private float playerNamesDistance = GetSettingsFloat(Setting.vmenu_player_names_distance) > 10f ? GetSettingsFloat(Setting.vmenu_player_names_distance) : 500f; /// @@ -2395,7 +2384,7 @@ private async Task PlayerOverheadNamesControl() { var dist = p.Character.Position.DistanceToSquared(Game.PlayerPed.Position); //Debug.WriteLine($"Dist: {dist}"); - bool closeEnough = dist < distance; + bool closeEnough = dist < playerNamesDistance; if (gamerTags.ContainsKey(p)) { if (!closeEnough) @@ -2736,7 +2725,7 @@ private async Task ModelDrawDimensions() SetDrawOrigin(v.Position.X, v.Position.Y, v.Position.Z - 0.3f, 0); int model = GetEntityModel(v.Handle); - string hashes = $"{model} / {(uint)model} / 0x{model.ToString("X8")}"; + string hashes = $"{model} / {(uint)model} / 0x{model:X8}"; DrawTextOnScreen($"Hash {hashes}", 0f, 0f, 0.3f, Alignment.Center, 0); ClearDrawOrigin(); @@ -2768,7 +2757,7 @@ private async Task ModelDrawDimensions() SetDrawOrigin(p.Position.X, p.Position.Y, p.Position.Z - 0.3f, 0); int model = GetEntityModel(p.Handle); - string hashes = $"{model} / {(uint)model} / 0x{model.ToString("X8")}"; + string hashes = $"{model} / {(uint)model} / 0x{model:X8}"; DrawTextOnScreen($"Hash {hashes}", 0f, 0f, 0.3f, Alignment.Center, 0); ClearDrawOrigin(); @@ -2800,7 +2789,7 @@ private async Task ModelDrawDimensions() SetDrawOrigin(p.Position.X, p.Position.Y, p.Position.Z - 0.3f, 0); int model = GetEntityModel(p.Handle); - string hashes = $"{model} / {(uint)model} / 0x{model.ToString("X8")}"; + string hashes = $"{model} / {(uint)model} / 0x{model:X8}"; DrawTextOnScreen($"Hash {hashes}", 0f, 0f, 0.3f, Alignment.Center, 0); ClearDrawOrigin(); diff --git a/vMenu/menus/TimeOptions.cs b/vMenu/menus/TimeOptions.cs index 6fd05dbb..b10783ff 100644 --- a/vMenu/menus/TimeOptions.cs +++ b/vMenu/menus/TimeOptions.cs @@ -119,8 +119,8 @@ private void CreateMenu() } var newMinute = 0; - Subtitle.Info($"Time set to ~y~{(newHour < 10 ? $"0{newHour.ToString()}" : newHour.ToString())}~s~:~y~" + - $"{(newMinute < 10 ? $"0{newMinute.ToString()}" : newMinute.ToString())}~s~.", prefix: "Info:"); + Subtitle.Info($"Time set to ~y~{(newHour < 10 ? $"0{newHour}" : newHour.ToString())}~s~:~y~" + + $"{(newMinute < 10 ? $"0{newMinute}" : newMinute.ToString())}~s~.", prefix: "Info:"); UpdateServerTime(newHour, newMinute, EventManager.freezeTime); } @@ -139,8 +139,8 @@ private void CreateMenu() newMinute = item.ListIndex; } - Subtitle.Info($"Time set to ~y~{(newHour < 10 ? $"0{newHour.ToString()}" : newHour.ToString())}~s~:~y~" + - $"{(newMinute < 10 ? $"0{newMinute.ToString()}" : newMinute.ToString())}~s~.", prefix: "Info:"); + Subtitle.Info($"Time set to ~y~{(newHour < 10 ? $"0{newHour}" : newHour.ToString())}~s~:~y~" + + $"{(newMinute < 10 ? $"0{newMinute}" : newMinute.ToString())}~s~.", prefix: "Info:"); UpdateServerTime(newHour, newMinute, EventManager.freezeTime); }; } diff --git a/vMenu/menus/VehicleOptions.cs b/vMenu/menus/VehicleOptions.cs index 14bc1358..681024a7 100644 --- a/vMenu/menus/VehicleOptions.cs +++ b/vMenu/menus/VehicleOptions.cs @@ -1420,7 +1420,7 @@ void HandleListIndexChanges(Menu sender, MenuListItem listItem, int oldIndex, in //extraIds.Add(extra); // Create a checkbox for it. - MenuCheckboxItem extraCheckbox = new MenuCheckboxItem($"Extra #{extra.ToString()}", extra.ToString(), veh.IsExtraOn(extra)); + MenuCheckboxItem extraCheckbox = new MenuCheckboxItem($"Extra #{extra}", extra.ToString(), veh.IsExtraOn(extra)); // Add the checkbox to the menu. VehicleComponentsMenu.AddMenuItem(extraCheckbox); @@ -1717,7 +1717,7 @@ public void UpdateMods(int selectedIndex = 0) currentItem = $"[{2 + x}/{ mod.ModCount + 1}]"; // Create the name (again, converting to proper case), then add the name. - name = mod.GetLocalizedModName(x) != "" ? $"{ToProperString(mod.GetLocalizedModName(x))} {currentItem}" : $"{typeName} #{x.ToString()} {currentItem}"; + name = mod.GetLocalizedModName(x) != "" ? $"{ToProperString(mod.GetLocalizedModName(x))} {currentItem}" : $"{typeName} #{x} {currentItem}"; modlist.Add(name); } diff --git a/vMenu/menus/VehicleSpawner.cs b/vMenu/menus/VehicleSpawner.cs index f323a949..79008e60 100644 --- a/vMenu/menus/VehicleSpawner.cs +++ b/vMenu/menus/VehicleSpawner.cs @@ -88,7 +88,7 @@ private void CreateMenu() MenuItem carBtn = new MenuItem(name, $"Click to spawn {name}.") { - Label = $"({veh.Key.ToString()})", + Label = $"({veh.Key})", ItemData = veh.Key // store the model name in the button data. }; @@ -165,7 +165,7 @@ private void CreateMenu() for (var vehClass = 0; vehClass < 22; vehClass++) { // Get the class name. - string className = GetLabelText($"VEH_CLASS_{vehClass.ToString()}"); + string className = GetLabelText($"VEH_CLASS_{vehClass}"); // Create a button & a menu for it, add the menu to the menu pool and add & bind the button to the menu. MenuItem btn = new MenuItem(className, $"Spawn a vehicle from the ~o~{className} ~s~class.") @@ -225,7 +225,7 @@ private void CreateMenu() } // The model name is a duplicate, so get the modelname and add the duplicate amount for this model name to the end of the vehicle name. - vehName += $" ({duplicateVehNames[vehName].ToString()})"; + vehName += $" ({duplicateVehNames[vehName]})"; // Then create and add a new button for this vehicle. diff --git a/vMenu/menus/WeaponOptions.cs b/vMenu/menus/WeaponOptions.cs index 4e7e2fd3..0c384ff2 100644 --- a/vMenu/menus/WeaponOptions.cs +++ b/vMenu/menus/WeaponOptions.cs @@ -369,7 +369,7 @@ async void IndexChangedEventHandler(Menu sender, MenuListItem item, int oldIndex 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~.") + MenuItem weaponItem = new MenuItem(weapon.Name, $"Open the options for ~y~{weapon.Name}~s~.") { Label = "→→→", LeftIcon = MenuItem.Icon.GUN, diff --git a/vMenuServer/BanManager.cs b/vMenuServer/BanManager.cs index 4368e077..47bd56f6 100644 --- a/vMenuServer/BanManager.cs +++ b/vMenuServer/BanManager.cs @@ -336,7 +336,7 @@ private async void CheckForBans([FromSource]Player source, string playerName, Ca { BanLog($"The player trying to join right now is on the banlist, their ban duration has expired bu for unknown reasons their" + $" ban could not be removed from the ban list. Please delete the ban record manually. " + - $"\nBan Record details:\n{JsonConvert.SerializeObject(ban).ToString()}\n"); + $"\nBan Record details:\n{JsonConvert.SerializeObject(ban)}\n"); } } break; @@ -726,7 +726,7 @@ public static async void BanCheater(Player source) if (await AddBan(ban)) { TriggerEvent("vMenu:BanCheaterSuccessful", JsonConvert.SerializeObject(ban).ToString()); - BanLog($"A cheater has been banned. {JsonConvert.SerializeObject(ban).ToString()}"); + BanLog($"A cheater has been banned. {JsonConvert.SerializeObject(ban)}"); } source.TriggerEvent("vMenu:GoodBye"); // this is much more fun than just kicking them. diff --git a/vMenuServer/MainServer.cs b/vMenuServer/MainServer.cs index a4ddead9..ffb7491a 100644 --- a/vMenuServer/MainServer.cs +++ b/vMenuServer/MainServer.cs @@ -200,12 +200,12 @@ public MainServer() { if (args.Count == 3 && !string.IsNullOrEmpty(args[2].ToString())) { - if ((args[2].ToString().ToLower() ?? $"{dynamicWeather.ToString()}") == "true") + if ((args[2].ToString().ToLower() ?? $"{dynamicWeather}") == "true") { TriggerEvent("vMenu:UpdateServerWeather", currentWeather, blackout, true); Debug.WriteLine("[vMenu] Dynamic weather is now turned on."); } - else if ((args[2].ToString().ToLower() ?? $"{dynamicWeather.ToString()}") == "false") + else if ((args[2].ToString().ToLower() ?? $"{dynamicWeather}") == "false") { TriggerEvent("vMenu:UpdateServerWeather", currentWeather, blackout, false); Debug.WriteLine("[vMenu] Dynamic weather is now turned off."); From e0d07bdde59eed3499f84f5264afce6921c4d526 Mon Sep 17 00:00:00 2001 From: Vespura <31419184+TomGrobbe@users.noreply.github.com> Date: Sun, 26 Apr 2020 17:12:22 +0200 Subject: [PATCH 7/7] Remove small feature that apparently caused sync issues. --- vMenu/FunctionsController.cs | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/vMenu/FunctionsController.cs b/vMenu/FunctionsController.cs index e7edb1e3..f1d35a1b 100644 --- a/vMenu/FunctionsController.cs +++ b/vMenu/FunctionsController.cs @@ -128,8 +128,6 @@ private async Task GcTick() #endregion #region General Tasks - int lastProp = -1; - int lastPropTexture = 0; /// /// All general tasks that run every 1 game ticks (and are not (sub)menu specific). /// @@ -147,30 +145,6 @@ 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 1 ms await Delay(1);