Skip to content

Commit

Permalink
Merge pull request #53 from ProjectFairnessLabs/PF-vMenu-v1.1.4
Browse files Browse the repository at this point in the history
Pf v menu v1.1.3
  • Loading branch information
RickyB505 authored Sep 8, 2023
2 parents f8f2783 + b4dc4c1 commit c4b2586
Show file tree
Hide file tree
Showing 29 changed files with 1,781 additions and 87 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,34 @@ The vMenu for Project Fairness and other affiliated servers. All actions are sub
# Description
The original vMenu was lacking on options and new content. I made this version as a way for people to still get the latest updates, while of course, adding new things so it feels more like the vMenu on other servers (such as RSM, Impulse99, etc) while also improving upon the original.

# DISCLAIMER
- If you are going to use this version of PF-vMenu, make sure you set "vmenu_individual_server_id" in your permission.cfg file. Otherwise, vMenu will fail to start. This value can be any ASCII character and no spaces (ie. the name of the server, random string of letters and numbers).
- Make sure you also update your "vmenu_menu_toggle_key" and "vmenu_noclip_toggle_key". If you're an existing vMenu/PF-vMenu user, these have been changed to use [Keyboard Controls](https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/)
- This release is also based on the v3.6.0 release of vMenu. We had to do a whole bunch of porting from our v3.5.1 pre-release into this.

# What's New
- Chameleon Color by Wildbrick142 - [Download Chameleon Colors here](https://cdn.discordapp.com/attachments/1099903046701559828/1102708906234478712/pzn_chameleoncolor.7z), [Source](https://www.gta5-mods.com/misc/chameleon-paint-add-on)
- Content Updated up to v2802
- Content Updated up to v2802 & v2944
- Mosh_Notify embedded Support for vMenu's NoClip - [Download Mosh_Notify here](https://forum.cfx.re/t/release-free-mosh-notify-fivem-custom-notifications-with-loadbar/2614951)
- Los Santos Tuners goodies such as Vehicle Stance and Drift Tires (it's useless since we have vStancer and Handling Editor, but hey, it works)
- Moved Teleport Options to the front (Now, you no longer have to go to Misc Settings to teleport to your favorite place!)
- PMA-Voice Support
- Custom language support (22/06/2023)
- (WIP) Local Time & Weather Options
- (WIP) Car Brands on Addon Vehicles menu
- Multi-Language Support [(Looking for contributors!)](https://github.com/ProjectFairnessLabs/GroupTranslationDB)
- Labels for Vehicle Extras
- Plugins menu created, added Wheelie Manager and Easy Drift Plus as default plugins
- Enhanced Camera Menu added (thank you Shrimpy)
- Enhanced version of the add-on vehicle spawner, the old version was deprecated. No need to add extra categories!
- Default vehicle blacklist was added and located within addons.json (for those RP server players... 😉)
- Allowed all non-bike vehicles to use Open-Wheel tires (now make a ridiculous car!)
- Noclip lets you go up and down by looking with your camera! Look up to go up!

# What's been changed
- Changed "vmenu_enable_animals_spawn_menu" to a new ace permission "vMenu.PlayerAppearance.AnimalPeds"
- Changed "vmenu_disable_spawning_as_default_character" to a new ace permission "vMenu.PlayerAppearance.SpawnAsDefault"
- Changed vMenu toggle and noclip to RegisterKeyMapping so it can now be changed within key binds in settings

--------
# Translations
If you want to help out provide translations to vMenu, you can [click here](https://github.com/ProjectFairnessLabs/GroupTranslationDB) and do a pull request!
Expand Down
13 changes: 13 additions & 0 deletions SharedClasses/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ public enum Setting
vmenu_current_hour,
vmenu_current_minute,
vmenu_sync_to_machine_time,

// Discord Rich Presence
vmenu_discord_appid,
vmenu_disable_richpresence,
vmenu_discord_link_two,
vmenu_discord_link_two_text,
vmenu_discord_link_one_text,
vmenu_discord_link_one,
vmenu_discord_text,
vmenu_discord_large_image,
vmenu_discord_small_image,
vmenu_discord_small_image_text,
vmenu_discord_large_image_text,
}

/// <summary>
Expand Down
6 changes: 6 additions & 0 deletions SharedClasses/PermissionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,12 @@ public enum Permission
#region bug prevention
BPCarlaunch,
#endregion

#region reset index
// ResetIndex Permission
ResetIndex,
#endregion

}
public static Dictionary<Permission, bool> Permissions { get; private set; } = new Dictionary<Permission, bool>();
public static bool ArePermissionsSetup { get; set; } = false;
Expand Down
Binary file added dependencies/client/MenuAPI.dll
Binary file not shown.
86 changes: 85 additions & 1 deletion vMenu/CommonFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1438,8 +1438,35 @@ private static async void ApplyVehicleModsDelayed(Vehicle vehicle, VehicleInfo v
ToggleVehicleMod(vehicle.Handle, 20, vehicleInfo.tyreSmoke);
ToggleVehicleMod(vehicle.Handle, 22, vehicleInfo.xenonHeadlights);
SetVehicleLivery(vehicle.Handle, vehicleInfo.livery);


if (!(vehicleInfo.colors["primary"] == 1100110))
{
if (vehicleInfo.colors["secondary"] == 1100110)
{
SetVehicleColours(vehicle.Handle, vehicleInfo.colors["primary"], 0);
SetVehicleCustomSecondaryColour(vehicle.Handle, vehicleInfo.colors["secondaryr"], vehicleInfo.colors["secondaryg"] , vehicleInfo.colors["secondaryb"]);
SetMaterial.SetSecondaryMaterial(vehicle.Handle, vehicleInfo.colors["secondaryf"]);
}
else
SetVehicleColours(vehicle.Handle, vehicleInfo.colors["primary"], vehicleInfo.colors["secondary"]);
}
else
{
if (vehicleInfo.colors["secondary"] == 1100110)
{
SetVehicleColours(vehicle.Handle, 0, 0);
SetVehicleCustomSecondaryColour(vehicle.Handle, vehicleInfo.colors["secondaryr"], vehicleInfo.colors["secondaryg"] , vehicleInfo.colors["secondaryb"]);
SetMaterial.SetSecondaryMaterial(vehicle.Handle, vehicleInfo.colors["secondaryf"]);

}
else
SetVehicleColours(vehicle.Handle, 0, vehicleInfo.colors["secondary"]);

SetMaterial.SetPrimaryMaterial(vehicle.Handle, vehicleInfo.colors["primaryf"]);

SetVehicleCustomPrimaryColour(vehicle.Handle, vehicleInfo.colors["primaryr"], vehicleInfo.colors["primaryg"] , vehicleInfo.colors["primaryb"]);
}

SetVehicleInteriorColour(vehicle.Handle, vehicleInfo.colors["trim"]);
SetVehicleDashboardColour(vehicle.Handle, vehicleInfo.colors["dash"]);

Expand Down Expand Up @@ -1541,17 +1568,74 @@ public static async void SaveVehicle(string updateExistingSavedVehicleName = nul
#region colors
var colors = new Dictionary<string, int>();
var primaryColor = 0;
var primaryColorred = 0;
var primaryColorgreen = 0;
var primaryColorblue = 0;
var primaryFinish = await GetMaterial.GetPrimaryMaterialAsync(veh.Handle);

var secondaryColor = 0;
var secondaryColorred = 0;
var secondaryColorgreen = 0;
var secondaryColorblue = 0;
var secondaryFinish = await GetMaterial.GetSecondaryMaterialAsync(veh.Handle);


var pearlescentColor = 0;
var wheelColor = 0;
var dashColor = 0;
var trimColor = 0;

GetVehicleExtraColours(veh.Handle, ref pearlescentColor, ref wheelColor);
GetVehicleCustomPrimaryColour(veh.Handle, ref primaryColorred, ref primaryColorgreen, ref primaryColorblue);


if (!(!((primaryColorred +primaryColorgreen + primaryColorblue ) == 0 ) || !(primaryFinish == 0)))
{
GetVehicleColours(veh.Handle, ref primaryColor, ref secondaryColor);
}
else
{
GetVehicleColours(veh.Handle, ref primaryColor, ref secondaryColor);
primaryColor = 1100110;
}

GetVehicleCustomSecondaryColour(veh.Handle, ref secondaryColorred, ref secondaryColorgreen, ref secondaryColorblue);


if (!(!((secondaryColorred +secondaryColorgreen + secondaryColorblue ) == 0 ) || !(secondaryFinish == 0)))
{
GetVehicleColours(veh.Handle, ref secondaryColor, ref secondaryColor);
}
else
{
if (primaryColor == 1100110)
{
secondaryColor = 1100110;
primaryColor = 1100110;
}
else
{
GetVehicleColours(veh.Handle, ref secondaryColor, ref secondaryColor);
secondaryColor = 1100110;
}
}



GetVehicleDashboardColour(veh.Handle, ref dashColor);
GetVehicleInteriorColour(veh.Handle, ref trimColor);
colors.Add("primary", primaryColor);
colors.Add("primaryr", primaryColorred);
colors.Add("primaryg", primaryColorgreen);
colors.Add("primaryb", primaryColorblue);
colors.Add("primaryf", primaryFinish);

colors.Add("secondary", secondaryColor);
colors.Add("secondaryr", secondaryColorred);
colors.Add("secondaryg", secondaryColorgreen);
colors.Add("secondaryb", secondaryColorblue);
colors.Add("secondaryf", secondaryFinish);

colors.Add("pearlescent", pearlescentColor);
colors.Add("wheels", wheelColor);
colors.Add("dash", dashColor);
Expand Down
49 changes: 31 additions & 18 deletions vMenu/EventManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ public EventManager()
EventHandlers.Add("vMenu:PrivateMessage", new Action<string, string>(PrivateMessage));
EventHandlers.Add("vMenu:UpdateTeleportLocations", new Action<string>(UpdateTeleportLocations));

if (GetSettingsBool(Setting.vmenu_enable_weather_sync))
if (!((!GetSettingsBool(Setting.vmenu_enable_weather_sync))||( false )))
{
Tick += WeatherSync;
}

if (GetSettingsBool(Setting.vmenu_enable_time_sync))
if (!((!GetSettingsBool(Setting.vmenu_enable_time_sync))||( false )))
{
Tick += TimeSync;
}
Expand Down Expand Up @@ -91,7 +91,7 @@ private async void SetAppearanceOnFirstSpawn()
if (firstSpawn)
{
firstSpawn = false;
if (MainMenu.MiscSettingsMenu != null && MainMenu.MpPedCustomizationMenu != null && MainMenu.MiscSettingsMenu.MiscRespawnDefaultCharacter && !string.IsNullOrEmpty(GetResourceKvpString("vmenu_default_character")) && !IsAllowed(Permission.PASpawnAsDefault))
if (MainMenu.MiscSettingsMenu != null && MainMenu.MpPedCustomizationMenu != null && MainMenu.MiscSettingsMenu.MiscRespawnDefaultCharacter && !string.IsNullOrEmpty(GetResourceKvpString("vmenu_default_character")) && IsAllowed(Permission.PASpawnAsDefault))
{
await MainMenu.MpPedCustomizationMenu.SpawnThisCharacter(GetResourceKvpString("vmenu_default_character"), false);
}
Expand Down Expand Up @@ -275,15 +275,22 @@ private async Task UpdateWeatherParticles()
/// <returns></returns>
private async Task WeatherSync()
{
await UpdateWeatherParticles();
SetArtificialLightsState(IsBlackoutEnabled);
SetArtificialLightsStateAffectsVehicles(false);
if (GetNextWeatherType() != GetHashKey(GetServerWeather))
{
SetWeatherTypeOvertimePersist(GetServerWeather, (float)WeatherChangeTime);
await Delay((WeatherChangeTime * 1000) + 2000);

TriggerEvent("vMenu:WeatherChangeComplete", GetServerWeather);
if (MainMenu.PlayerTimeWeatherOptionsMenu != null)
{
if (!MainMenu.PlayerTimeWeatherOptionsMenu.ClientWeatherTimeBool)
{
await UpdateWeatherParticles();
SetArtificialLightsState(IsBlackoutEnabled);
SetArtificialLightsStateAffectsVehicles(false);
if (GetNextWeatherType() != GetHashKey(GetServerWeather))
{
SetWeatherTypeOvertimePersist(GetServerWeather, (float)WeatherChangeTime);
await Delay((WeatherChangeTime * 1000) + 2000);

TriggerEvent("vMenu:WeatherChangeComplete", GetServerWeather);
}
}
}
await Delay(1000);
}
Expand All @@ -294,14 +301,20 @@ private async Task WeatherSync()
/// <returns></returns>
private async Task TimeSync()
{
NetworkOverrideClockTime(GetServerHours, GetServerMinutes, 0);
if (IsServerTimeFrozen || IsServerTimeSyncedWithMachineTime)
if (MainMenu.PlayerTimeWeatherOptionsMenu != null)
{
await Delay(5);
}
else
{
await Delay(MathUtil.Clamp(GetServerMinuteDuration, 100, 2000));
if (!MainMenu.PlayerTimeWeatherOptionsMenu.ClientWeatherTimeBool)
{
NetworkOverrideClockTime(GetServerHours, GetServerMinutes, 0);
if (IsServerTimeFrozen || IsServerTimeSyncedWithMachineTime)
{
await Delay(5);
}
else
{
await Delay(MathUtil.Clamp(GetServerMinuteDuration, 100, 2000));
}
}
}
}

Expand Down
Loading

0 comments on commit c4b2586

Please sign in to comment.