Skip to content

Commit 5390f56

Browse files
committed
v1.2.1 Shortcut Displayed
- Reports the number of mods loaded more accurately - Displays what the current keyboard shortcut is for keyboard shortcut settings - No longer prints an error every frame when a level changes in a multiplayer server while you are viewing a mod's settings (It does not fix the problem that happens)
1 parent 7da37b6 commit 5390f56

4 files changed

Lines changed: 38 additions & 26 deletions

File tree

DistanceModConfigurationManager/DistanceGUI/Menu/ModdingMenu.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,10 @@ void destroyObject(GameObject obj)
187187

188188
public override void Update()
189189
{
190-
bool flag = true;
190+
if (PanelObject_ == null) return;
191+
if (PanelObject_?.activeInHierarchy is false) return;
191192

192-
flag &= PanelObject_ != null;
193-
flag &= PanelObject_?.activeInHierarchy is true;
194-
195-
if (flag)
196-
{
197-
UpdateVirtual();
198-
}
193+
UpdateVirtual();
199194
}
200195

201196
public override void UpdateVirtual()

DistanceModConfigurationManager/DistanceModConfigurationManager.csproj

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,27 @@
3232
<WarningLevel>4</WarningLevel>
3333
</PropertyGroup>
3434
<ItemGroup>
35-
<Reference Include="0Harmony">
36-
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Distance\BepInEx\core\0Harmony.dll</HintPath>
35+
<Reference Include="0Harmony, Version=2.9.0.0, Culture=neutral, processorArchitecture=MSIL">
36+
<SpecificVersion>False</SpecificVersion>
37+
<HintPath>..\..\..\AppData\Roaming\r2modmanPlus-local\Distance\profiles\Alt\BepInEx\core\0Harmony.dll</HintPath>
3738
</Reference>
38-
<Reference Include="Assembly-CSharp">
39-
<HintPath>..\..\..\..\Desktop\publicized_assemblies\Assembly-CSharp.dll</HintPath>
39+
<Reference Include="Assembly-CSharp, Version=9.0.0.0, Culture=neutral, processorArchitecture=MSIL">
40+
<SpecificVersion>False</SpecificVersion>
41+
<HintPath>..\..\publicized_assemblies\Assembly-CSharp.dll</HintPath>
4042
</Reference>
41-
<Reference Include="BepInEx">
42-
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Distance\BepInEx\core\BepInEx.dll</HintPath>
43+
<Reference Include="BepInEx, Version=5.4.23.2, Culture=neutral, processorArchitecture=MSIL">
44+
<SpecificVersion>False</SpecificVersion>
45+
<HintPath>..\..\..\AppData\Roaming\r2modmanPlus-local\Distance\profiles\Alt\BepInEx\core\BepInEx.dll</HintPath>
4346
</Reference>
4447
<Reference Include="System" />
4548
<Reference Include="System.Core" />
4649
<Reference Include="System.Xml.Linq" />
4750
<Reference Include="System.Data.DataSetExtensions" />
4851
<Reference Include="System.Data" />
4952
<Reference Include="System.Xml" />
50-
<Reference Include="UnityEngine">
51-
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Distance\Distance_Data\Managed\UnityEngine.dll</HintPath>
53+
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
54+
<SpecificVersion>False</SpecificVersion>
55+
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Distance\Distance_Data\Managed\UnityEngine.dll</HintPath>
5256
</Reference>
5357
</ItemGroup>
5458
<ItemGroup>

DistanceModConfigurationManager/Plugin.cs

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,20 @@
1515

1616
namespace DistanceModConfigurationManager
1717
{
18+
/*
19+
* Added:
20+
* Displays current value of keyboard shortcuts in menus
21+
* Menu no longer becomes inaccessible if you display the settings of a mod while a level begins to load in multiplayer
22+
*
23+
*/
24+
1825
[BepInPlugin(modGUID, modName, modVersion)]
1926
public sealed class Mod : BaseUnityPlugin
2027
{
2128
//Mod Details
2229
private const string modGUID = "Distance.DistanceModConfigurationManager";
2330
private const string modName = "Distance Mod Configuration Manager";
24-
public const string modVersion = "1.3.0";
31+
public const string modVersion = "1.2.1";
2532

2633
//Config Entry Settings
2734
public static string ShowVersionKey = "Show Version Info";
@@ -166,7 +173,8 @@ private void AddFilteredSettingsToMenu()
166173
}
167174
}
168175

169-
if (_categories.Count >= 2)
176+
//Setting it to 900 so it literally never does this
177+
if (_categories.Count >= 900)
170178
{
171179
//An attempt to make submenus for categories of a plugin's settings. IT DISPLAYS BAD! IDK WHY! D:
172180
foreach (string category in _categories)
@@ -181,12 +189,16 @@ private void AddFilteredSettingsToMenu()
181189
}
182190
}
183191

184-
SubMenu subMenu = settingsMenu.SubmenuButton(
185-
MenuDisplayMode.Both,
186-
$"submenu:{category.ToLower()}",
187-
category.ToUpper(),
188-
menuTree,
189-
$"{Regex.Replace(plugin.Info.Name, @"\s+", "")} settings related to {category}");
192+
settingsMenu.Add(new SubMenu(MenuDisplayMode.Both, $"submenu:{category.ToLower()}", category.ToUpper())
193+
.NavigatesTo(menuTree)
194+
.WithDescription($"{Regex.Replace(plugin.Info.Name, @"\s+", "")} settings related to {category}"));
195+
196+
//SubMenu subMenu = settingsMenu.SubmenuButton(
197+
// MenuDisplayMode.Both,
198+
// $"submenu:{category.ToLower()}",
199+
// category.ToUpper(),
200+
// menuTree,
201+
// $"{Regex.Replace(plugin.Info.Name, @"\s+", "")} settings related to {category}");
190202
}
191203
}
192204
else
@@ -292,10 +304,11 @@ private MenuItemBase CreateUIForSetting(SettingEntryBase setting)
292304
.WithDescription($"{setting.Description}");
293305
}*/
294306

295-
if (typeof(KeyboardShortcut) == setting.SettingType)
307+
if (typeof(KeyboardShortcut) == setting.SettingType)
296308
{
297309
return new InputPrompt(MenuDisplayMode.Both, $"settings:{Regex.Replace(setting.DispName, @"\s+", "_").ToLower()}", setting.DispName.ToUpper())
298310
.WithDefaultValue(setting.DefaultValue.ToString())
311+
.WithCurrentValue(setting.Get().ToString())
299312
.WithTitle(setting.DispName)
300313
.WithSubmitAction((x) => setting.Set(KeyboardShortcut.Deserialize(x)))
301314
.WithDescription($"{setting.Description}");

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ This mod will allow you to change the settings of other mods from within the Dis
44
With this you won't need to close and re-open the game to change most settings of a mod!
55

66
<h3>KNOWN ISSUES:</h3>
7-
- Hotkey configurations do not display in-game. <br>
7+
- If you open up a mod's settings when a level gets changed in multiplayer you will no longer be able to change settings until you re-open the game. <br>
88
- Mods with setting names that are too big will display awkwardly in the menu. <br>

0 commit comments

Comments
 (0)