Skip to content

Commit 02148ef

Browse files
Merge pull request #492 from TomGrobbe/development
v3.7.0-pre release
2 parents f2391ac + e4cd260 commit 02148ef

File tree

10 files changed

+406
-30
lines changed

10 files changed

+406
-30
lines changed

SharedClasses/ConfigManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public enum Setting
5454
vmenu_dynamic_weather_timer,
5555
vmenu_current_weather,
5656
vmenu_blackout_enabled,
57+
vmenu_vehicle_blackout_enabled,
5758
vmenu_weather_change_duration,
5859
vmenu_enable_snow,
5960

SharedClasses/PermissionsManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ public enum Permission
186186
WOAll,
187187
WODynamic,
188188
WOBlackout,
189+
WOVehBlackout,
189190
WOSetWeather,
190191
WORemoveClouds,
191192
WORandomizeClouds,

vMenu/EventManager.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace vMenuClient
1818
{
1919
public class EventManager : BaseScript
2020
{
21+
public static WeatherOptions WeatherOptionsMenu { get; private set; }
2122
public static bool IsSnowEnabled => GetSettingsBool(Setting.vmenu_enable_snow);
2223
public static int GetServerMinutes => MathUtil.Clamp(GetSettingsInt(Setting.vmenu_current_minute), 0, 59);
2324
public static int GetServerHours => MathUtil.Clamp(GetSettingsInt(Setting.vmenu_current_hour), 0, 23);
@@ -27,6 +28,7 @@ public class EventManager : BaseScript
2728
public static string GetServerWeather => GetSettingsString(Setting.vmenu_current_weather, "CLEAR");
2829
public static bool DynamicWeatherEnabled => GetSettingsBool(Setting.vmenu_enable_dynamic_weather);
2930
public static bool IsBlackoutEnabled => GetSettingsBool(Setting.vmenu_blackout_enabled);
31+
public static bool IsVehicleLightsEnabled { get; set; } = GetSettingsBool(Setting.vmenu_vehicle_blackout_enabled);
3032
public static int WeatherChangeTime => MathUtil.Clamp(GetSettingsInt(Setting.vmenu_weather_change_duration), 0, 45);
3133

3234
/// <summary>
@@ -282,18 +284,27 @@ private async Task UpdateWeatherParticles()
282284
/// <returns></returns>
283285
private async Task WeatherSync()
284286
{
287+
if (MainMenu.WeatherOptionsMenu == null)
288+
{
289+
return;
290+
}
291+
285292
await UpdateWeatherParticles();
286293
SetArtificialLightsState(IsBlackoutEnabled);
294+
SetArtificialLightsStateAffectsVehicles(!IsVehicleLightsEnabled);
295+
287296
if (GetNextWeatherType() != GetHashKey(GetServerWeather))
288297
{
289298
SetWeatherTypeOvertimePersist(GetServerWeather, (float)WeatherChangeTime);
290299
await Delay((WeatherChangeTime * 1000) + 2000);
291300

292301
TriggerEvent("vMenu:WeatherChangeComplete", GetServerWeather);
293302
}
303+
294304
await Delay(1000);
295305
}
296306

307+
297308
/// <summary>
298309
/// This function will take care of time sync. It'll be called once, and never stop.
299310
/// </summary>

vMenu/data/PedModels.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public static class PedModels
4343
(uint)GetHashKey("a_c_retriever"),
4444
(uint)GetHashKey("a_c_rhesus"),
4545
(uint)GetHashKey("a_c_rottweiler"),
46+
(uint)GetHashKey("a_c_rottweiler_02"), // mp2025_01
4647
(uint)GetHashKey("a_c_seagull"),
4748
(uint)GetHashKey("a_c_sharkhammer"),
4849
(uint)GetHashKey("a_c_sharktiger"),

vMenu/data/VehicleData.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,17 +384,21 @@ public static class Vehicles
384384
"COGNOSCENTI",
385385
"COGNOSCENTI2",
386386
"DEITY", // THE CONTRACT (MPSECURITY) DLC - Requires b2545
387+
"DRIFTCHAVOSV6", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
388+
"DRIFTHARDY", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
387389
"DRIFTVORSCHLAG", // BOTTOM DOLLAR BOUNTIES (MP2024_01) DLC - Requires b3258
388390
"EMPEROR",
389391
"EMPEROR2",
390392
"EMPEROR3",
391393
"FUGITIVE",
392394
"GLENDALE",
393395
"GLENDALE2", // SUMMER SPECIAL (MPSUM) DLC - Requires b2060
396+
"HARDY", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
394397
"IMPALER5", // CHOP SHOP (MP2023_02) DLC - Requires b3095
395398
"INGOT",
396399
"INTRUDER",
397400
"LIMO2",
401+
"MINIMUS", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
398402
"PREMIER",
399403
"PRIMO",
400404
"PRIMO2",
@@ -440,6 +444,7 @@ public static class Vehicles
440444
"DORADO", // CHOP SHOP (MP2023_02) DLC - Requires b3095
441445
"DUBSTA",
442446
"DUBSTA2",
447+
"EVERON3", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
443448
"FQ2",
444449
"GRANGER",
445450
"GRANGER2", // THE CONTRACT (MPSECURITY) DLC - Requires b2545
@@ -465,6 +470,7 @@ public static class Vehicles
465470
"SQUADDIE", // CAYO PERICO (MPHEIST4) DLC - Requires b2189
466471
"TOROS",
467472
"VIVANITE", // CHOP SHOP (MP2023_02) DLC - Requires b3095
473+
"WOODLANDER", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
468474
"XLS",
469475
"XLS2",
470476
};
@@ -520,6 +526,8 @@ public static class Vehicles
520526
"DOMINATOR7", // LS TUNERS (MPTUNER) DLC - Requires b2372
521527
"DOMINATOR8", // LS TUNERS (MPTUNER) DLC - Requires b2372
522528
"DOMINATOR9", // CHOP SHOP (MP2023_02) DLC - Requires b3095
529+
"DRIFTDOMINATOR10", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
530+
"DRIFTGAUNTLET4", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
523531
"DRIFTYOSEMITE", // CHOP SHOP (MP2023_02) DLC - Requires b3095
524532
"DUKES",
525533
"DUKES2",
@@ -573,6 +581,7 @@ public static class Vehicles
573581
"TAHOMA", // DRUG WARS (MPCHRISTMAS3) DLC - Requires b2802
574582
"TAMPA",
575583
"TAMPA3",
584+
"TAMPA4", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
576585
"TULIP",
577586
"TULIP2", // DRUG WARS (MPCHRISTMAS3) DLC - Requires b2802
578587
"VAMOS",
@@ -599,6 +608,7 @@ public static class Vehicles
599608
"CASCO",
600609
"CHEBUREK",
601610
"CHEETAH2",
611+
"CHEETAH3", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
602612
"COQUETTE2",
603613
"COQUETTE5", // BOTTOM DOLLAR BOUNTIES (MP2024_01) DLC - Requires b3258
604614
"DELUXO",
@@ -731,6 +741,7 @@ public static class Vehicles
731741
"RAIDEN",
732742
"RAPIDGT",
733743
"RAPIDGT2",
744+
"RAPIDGT4", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
734745
"RAPTOR",
735746
"REMUS", // LS TUNERS (MPTUNER) DLC - Requires b2372
736747
"REVOLTER",
@@ -744,6 +755,7 @@ public static class Vehicles
744755
"SCHWARZER",
745756
"SENTINEL3",
746757
"SENTINEL4", // CRIMINAL ENTERPRISES (MPSUM2) DLC - Requires b2699
758+
"SENTINEL5", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
747759
"SEVEN70",
748760
"SM722", // CRIMINAL ENTERPRISES (MPSUM2) DLC - Requires b2699
749761
"SPECTER",
@@ -807,6 +819,7 @@ public static class Vehicles
807819
"SCRAMJET",
808820
"SHEAVA", // ETR1
809821
"SULTANRS",
822+
"SUZUME", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
810823
"T20",
811824
"TAIPAN",
812825
"TEMPESTA",
@@ -918,6 +931,7 @@ public static class Vehicles
918931
"CARACARA2", // CASINO AND RESORT (MPVINEWOOD) DLC - Requires b2060
919932
"DLOADER",
920933
"DRAUGUR", // CRIMINAL ENTERPRISES (MPSUM2) DLC - Requires b2699
934+
"DRIFTL352", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
921935
"DUBSTA3",
922936
"DUNE",
923937
"DUNE2",
@@ -934,6 +948,7 @@ public static class Vehicles
934948
"INSURGENT3",
935949
"KALAHARI",
936950
"KAMACHO",
951+
"L352", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
937952
"MARSHALL",
938953
"MENACER",
939954
"MESA3",
@@ -975,6 +990,7 @@ public static class Vehicles
975990
"CUTTER",
976991
"DUMP",
977992
"FLATBED",
993+
"FLATBED2", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
978994
"GUARDIAN",
979995
"HANDLER",
980996
"MIXER",
@@ -1162,6 +1178,7 @@ public static class Vehicles
11621178
"HAVOK",
11631179
"HUNTER",
11641180
"MAVERICK",
1181+
"MAVERICK2", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
11651182
"POLMAV",
11661183
"SAVAGE",
11671184
"SEASPARROW",
@@ -1268,6 +1285,7 @@ public static class Vehicles
12681285
"POLICE4",
12691286
"POLICE5", // CHOP SHOP (MP2023_02) DLC - Requires b3095
12701287
"POLICEB",
1288+
"POLICEB2", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
12711289
"POLICEOLD1",
12721290
"POLICEOLD2",
12731291
"POLICET",
@@ -1331,6 +1349,7 @@ public static class Vehicles
13311349
"POUNDER2",
13321350
"STOCKADE",
13331351
"STOCKADE3",
1352+
"STOCKADE4", // MONEY FRONTS (MP2025_01) DLC - Requires b3570
13341353
"TERBYTE",
13351354
};
13361355
#endregion

vMenu/menus/MpPedCustomization.cs

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2194,6 +2194,10 @@ private void CreateSavedPedsMenu()
21942194
var clonePed = new MenuItem("Clone Saved Character", "This will make a clone of your saved character. It will ask you to provide a name for that character. If that name is already taken the action will be canceled.");
21952195
var setAsDefaultPed = new MenuItem("Set As Default Character", "If you set this character as your default character, and you enable the 'Respawn As Default MP Character' option in the Misc Settings menu, then you will be set as this character whenever you (re)spawn.");
21962196
var renameCharacter = new MenuItem("Rename Saved Character", "You can rename this saved character. If the name is already taken then the action will be canceled.");
2197+
var saveCurrentPedAsCharacter = new MenuItem("Update Character Clothing", "This applies your current clothing to this saved ped. ~r~This will overwrite this saved ped's clothing.~w~ Only clothing is updated, no other appearance features.")
2198+
{
2199+
LeftIcon = MenuItem.Icon.WARNING
2200+
};
21972201
var delPed = new MenuItem("Delete Saved Character", "Deletes the selected saved character. This can not be undone!")
21982202
{
21992203
LeftIcon = MenuItem.Icon.WARNING
@@ -2204,6 +2208,7 @@ private void CreateSavedPedsMenu()
22042208
manageSavedCharacterMenu.AddMenuItem(setCategoryBtn);
22052209
manageSavedCharacterMenu.AddMenuItem(setAsDefaultPed);
22062210
manageSavedCharacterMenu.AddMenuItem(renameCharacter);
2211+
manageSavedCharacterMenu.AddMenuItem(saveCurrentPedAsCharacter);
22072212
manageSavedCharacterMenu.AddMenuItem(delPed);
22082213

22092214
MenuController.BindMenuItem(manageSavedCharacterMenu, createCharacterMenu, editPedBtn);
@@ -2290,6 +2295,30 @@ private void CreateSavedPedsMenu()
22902295
}
22912296
}
22922297
}
2298+
else if (item == saveCurrentPedAsCharacter)
2299+
{
2300+
if (saveCurrentPedAsCharacter.Label == "Are you sure?")
2301+
{
2302+
saveCurrentPedAsCharacter.Label = "";
2303+
var tmpCharacter = StorageManager.GetSavedMpCharacterData("mp_ped_" + selectedSavedCharacterManageName);
2304+
2305+
tmpCharacter = ReplacePedDataClothing(tmpCharacter);
2306+
2307+
if (StorageManager.SaveJsonData(tmpCharacter.SaveName, JsonConvert.SerializeObject(tmpCharacter), true))
2308+
{
2309+
Notify.Success($"This character's clothing has been updated!");
2310+
UpdateSavedPedsMenu();
2311+
}
2312+
else
2313+
{
2314+
Notify.Error("Unable to update this character's clothing. The reason is unknown.");
2315+
}
2316+
}
2317+
else
2318+
{
2319+
saveCurrentPedAsCharacter.Label = "Are you sure?";
2320+
}
2321+
}
22932322
else if (item == delPed)
22942323
{
22952324
if (delPed.Label == "Are you sure?")
@@ -2319,6 +2348,14 @@ private void CreateSavedPedsMenu()
23192348
delPed.Label = "";
23202349
}
23212350
}
2351+
2352+
if (item != saveCurrentPedAsCharacter)
2353+
{
2354+
if (saveCurrentPedAsCharacter.Label == "Are you sure?")
2355+
{
2356+
saveCurrentPedAsCharacter.Label = "";
2357+
}
2358+
}
23222359
};
23232360

23242361
// Update category preview icon
@@ -2387,7 +2424,13 @@ private void CreateSavedPedsMenu()
23872424
// reset the "are you sure" state.
23882425
manageSavedCharacterMenu.OnMenuClose += (sender) =>
23892426
{
2390-
manageSavedCharacterMenu.GetMenuItems().Last().Label = "";
2427+
foreach (MenuItem item in manageSavedCharacterMenu.GetMenuItems())
2428+
{
2429+
if (item.Label == "Are you sure?")
2430+
{
2431+
item.Label = "";
2432+
}
2433+
}
23912434
};
23922435

23932436
// Load selected category
@@ -2930,6 +2973,28 @@ private List<string> GetAllMpCharacterNames()
29302973
return names;
29312974
}
29322975

2976+
private MultiplayerPedData ReplacePedDataClothing(MultiplayerPedData character)
2977+
{
2978+
int handle = Game.PlayerPed.Handle;
2979+
2980+
// Drawables
2981+
for (int i = 0; i < 12; i++)
2982+
{
2983+
int drawable = GetPedDrawableVariation(handle, i);
2984+
int texture = GetPedTextureVariation(handle, i);
2985+
character.DrawableVariations.clothes[i] = new KeyValuePair<int, int>(drawable, texture);
2986+
}
2987+
2988+
for (int i = 0; i < 8; i++)
2989+
{
2990+
int prop = GetPedPropIndex(handle, i);
2991+
int texture = GetPedPropTextureIndex(handle, i);
2992+
character.PropVariations.props[i] = new KeyValuePair<int, int>(prop, texture);
2993+
}
2994+
2995+
return character;
2996+
}
2997+
29332998
internal void SetHeadBlend()
29342999
{
29353000
SetPedHeadBlendData(Game.PlayerPed.Handle, _dadSelection, _mumSelection, 0, _dadSelection, _mumSelection, 0, _shapeMixValue, _skinMixValue, 0f, false);

0 commit comments

Comments
 (0)