Skip to content

Commit

Permalink
fix bug that stopped the menu from working if experimental features w…
Browse files Browse the repository at this point in the history
…as not defined in __resource.lua file
  • Loading branch information
TomGrobbe committed May 16, 2018
1 parent 834be6f commit 6499072
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions vMenu/MainMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class MainMenu : BaseScript
private BarTimerBar bt = new BarTimerBar("Opening Menu");

public static bool DebugMode = GetResourceMetadata(GetCurrentResourceName(), "client_debug_mode", 0) == "true" ? true : false;
public static bool EnableExperimentalFeatures = (GetResourceMetadata(GetCurrentResourceName(), "experimental_features_enabled", 0) ?? "0") == "1";
public static bool DontOpenMenus { get; set; } = false;
public static string Version { get { return GetResourceMetadata(GetCurrentResourceName(), "version", 0); } }

Expand Down
4 changes: 1 addition & 3 deletions vMenu/menus/PlayerAppearance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ private void CreateMenu()
menu.AddItem(walkingStyle);

// Bind items to the submenus.
if (cf.IsAllowed(Permission.PACustomize) &&
// only enable it if experimental features are turned on
GetResourceMetadata(GetCurrentResourceName(), "experimental_features_enabled", 0).ToString() == "1")
if (cf.IsAllowed(Permission.PACustomize) && MainMenu.EnableExperimentalFeatures) // only enable it if experimental features are turned on
{
CreateMpPedMenu(mpCharMenu); // loads all menu items and adds event listeners.
menu.BindMenuToItem(mpCharMenu, mpCharMenuBtn);
Expand Down

0 comments on commit 6499072

Please sign in to comment.