Skip to content

Commit da0677e

Browse files
Merge pull request #370 from MichaelCoding25/code-cleanup
Preform code cleanup
2 parents f7d98e2 + ec83af1 commit da0677e

File tree

5 files changed

+25
-27
lines changed

5 files changed

+25
-27
lines changed

vMenu/MainMenu.cs

+13-13
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ public MainMenu()
120120
}
121121
#endregion
122122
#region keymapping
123-
string KeyMappingID = String.IsNullOrWhiteSpace(GetSettingsString(Setting.vmenu_keymapping_id)) ? "Default" : GetSettingsString(Setting.vmenu_keymapping_id);
123+
string KeyMappingID = String.IsNullOrWhiteSpace(GetSettingsString(Setting.vmenu_keymapping_id)) ? "Default" : GetSettingsString(Setting.vmenu_keymapping_id);
124124
RegisterCommand($"vMenu:{KeyMappingID}:NoClip", new Action<dynamic, List<dynamic>, string>((dynamic source, List<dynamic> args, string rawCommand) =>
125125
{
126-
if ( IsAllowed(Permission.NoClip) )
126+
if (IsAllowed(Permission.NoClip))
127127
{
128128
if (Game.PlayerPed.IsInVehicle())
129129
{
@@ -146,17 +146,17 @@ public MainMenu()
146146
}), false);
147147
RegisterCommand($"vMenu:{KeyMappingID}:MenuToggle", new Action<dynamic, List<dynamic>, string>((dynamic source, List<dynamic> args, string rawCommand) =>
148148
{
149-
if (MenuEnabled)
150-
{
151-
if (!MenuController.IsAnyMenuOpen())
152-
{
153-
Menu.OpenMenu();
154-
}
155-
else
156-
{
157-
MenuController.CloseAllMenus();
158-
}
159-
}
149+
if (MenuEnabled)
150+
{
151+
if (!MenuController.IsAnyMenuOpen())
152+
{
153+
Menu.OpenMenu();
154+
}
155+
else
156+
{
157+
MenuController.CloseAllMenus();
158+
}
159+
}
160160
}), false);
161161

162162
if (!(GetSettingsString(Setting.vmenu_noclip_toggle_key) == null))

vMenu/Noclip.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private async Task NoClipHandler()
137137

138138
BeginScaleformMovieMethod(Scale, "SET_DATA_SLOT");
139139
ScaleformMovieMethodAddParamInt(6);
140-
string KeyMappingID = String.IsNullOrWhiteSpace(GetSettingsString(Setting.vmenu_keymapping_id)) ? "Default" : GetSettingsString(Setting.vmenu_keymapping_id);
140+
string KeyMappingID = String.IsNullOrWhiteSpace(GetSettingsString(Setting.vmenu_keymapping_id)) ? "Default" : GetSettingsString(Setting.vmenu_keymapping_id);
141141
PushScaleformMovieMethodParameterString($"~INPUT_{JOAAT($"vMenu:{KeyMappingID}:NoClip")}~");
142142
PushScaleformMovieMethodParameterString($"Toggle NoClip");
143143
EndScaleformMovieMethod();

vMenu/menus/MpPedCustomization.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public class MpPedCustomization
3838
internal MenuItem editPedBtn = new("Edit Saved Character", "This allows you to edit everything about your saved character. The changes will be saved to this character's save file entry once you hit the save button.");
3939

4040
// Need to be editable from other functions
41-
private readonly MenuListItem setCategoryBtn = new("Set Character Category", new List<string> {}, 0, "Sets this character's category. Select to save.");
42-
private readonly MenuListItem categoryBtn = new("Character Category", new List<string> {}, 0, "Sets this character's category.");
41+
private readonly MenuListItem setCategoryBtn = new("Set Character Category", new List<string> { }, 0, "Sets this character's category. Select to save.");
42+
private readonly MenuListItem categoryBtn = new("Character Category", new List<string> { }, 0, "Sets this character's category.");
4343

4444
public static bool DontCloseMenus { get { return MenuController.PreventExitingMenu; } set { MenuController.PreventExitingMenu = value; } }
4545
public static bool DisableBackButton { get { return MenuController.DisableBackButton; } set { MenuController.DisableBackButton = value; } }
@@ -2605,7 +2605,7 @@ string ChangeCallback(MenuDynamicListItem item, bool left)
26052605
}
26062606
}
26072607
}
2608-
}
2608+
}
26092609

26102610
Notify.Success($"Your saved category has been deleted. {updatedCount}/{totalCount} characters {(deletePeds ? "deleted" : "updated")}.");
26112611
MenuController.CloseAllMenus();
@@ -2737,7 +2737,7 @@ private List<string> GetAllCategoryNames()
27372737

27382738
private List<MenuItem.Icon> GetCategoryIcons(List<string> categoryNames)
27392739
{
2740-
List<MenuItem.Icon> icons = new List<MenuItem.Icon> {};
2740+
List<MenuItem.Icon> icons = new List<MenuItem.Icon> { };
27412741

27422742
foreach (var name in categoryNames)
27432743
{

vMenu/menus/SavedVehicles.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class SavedVehicles
3131
private SavedVehicleCategory currentCategory;
3232

3333
// Need to be editable from other functions
34-
private readonly MenuListItem setCategoryBtn = new("Set Vehicle Category", new List<string> {}, 0, "Sets this Vehicle's category. Select to save.");
34+
private readonly MenuListItem setCategoryBtn = new("Set Vehicle Category", new List<string> { }, 0, "Sets this Vehicle's category. Select to save.");
3535

3636
/// <summary>
3737
/// Creates the menu.
@@ -185,7 +185,7 @@ string ChangeCallback(MenuDynamicListItem item, bool left)
185185

186186
var spacer = GetSpacerMenuItem("↓ Vehicles ↓");
187187
savedVehiclesCategoryMenu.AddMenuItem(spacer);
188-
188+
189189
if (savedVehicles.Count > 0)
190190
{
191191
foreach (var kvp in savedVehicles)
@@ -901,7 +901,7 @@ private List<string> GetAllCategoryNames()
901901

902902
private List<MenuItem.Icon> GetCategoryIcons(List<string> categoryNames)
903903
{
904-
List<MenuItem.Icon> icons = new List<MenuItem.Icon> {};
904+
List<MenuItem.Icon> icons = new List<MenuItem.Icon> { };
905905

906906
foreach (var name in categoryNames)
907907
{

vMenu/menus/VoiceChat.cs

+4-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
using MenuAPI;
66

77
using static vMenuClient.CommonFunctions;
8-
9-
using static vMenuShared.PermissionsManager;
10-
118
using static vMenuShared.ConfigManager;
9+
using static vMenuShared.PermissionsManager;
1210

1311
namespace vMenuClient.menus
1412
{
@@ -69,7 +67,7 @@ private void CreateMenu()
6967
"2 km",
7068
"Global",
7169
};
72-
var voiceChatProximity = new MenuItem("Voice Chat Proximity (" + ConvertToMetric(currentProximity) + ")" , "Set the voice chat receiving proximity in meters. Set to 0 for global.");
70+
var voiceChatProximity = new MenuItem("Voice Chat Proximity (" + ConvertToMetric(currentProximity) + ")", "Set the voice chat receiving proximity in meters. Set to 0 for global.");
7371
var voiceChatChannel = new MenuListItem("Voice Chat Channel", channels, channels.IndexOf(currentChannel), "Set the voice chat channel.");
7472

7573
if (IsAllowed(Permission.VCEnable))
@@ -121,7 +119,7 @@ private void CreateMenu()
121119
{
122120
currentProximity = resultfloat;
123121
Subtitle.Custom($"New voice chat proximity set to: ~b~{ConvertToMetric(currentProximity)}~s~.");
124-
voiceChatProximity.Text = ("Voice Chat Proximity (" + ConvertToMetric(currentProximity) + ")" );
122+
voiceChatProximity.Text = ("Voice Chat Proximity (" + ConvertToMetric(currentProximity) + ")");
125123
}
126124
}
127125
};
@@ -145,7 +143,7 @@ static string ConvertToMetric(float input)
145143
val = (input / 1000) + "km";
146144
}
147145
}
148-
if (input==0)
146+
if (input == 0)
149147
{
150148
val = "global";
151149
}

0 commit comments

Comments
 (0)