@@ -20,7 +20,7 @@ public sealed class Mod : BaseUnityPlugin
2020 //Mod Details
2121 private const string modGUID = "Distance.DistanceModConfigurationManager" ;
2222 private const string modName = "Distance Mod Configuration Manager" ;
23- public const string modVersion = "1.1.1 " ;
23+ public const string modVersion = "1.2.0 " ;
2424
2525 //Config Entry Settings
2626 public static string ShowVersionKey = "Show Version Info" ;
@@ -149,10 +149,10 @@ private void AddFilteredSettingsToMenu()
149149 foreach ( var setting in plugin . Settings )
150150 {
151151 //For now, just skipping keyboard shortcuts entirely
152- if ( typeof ( KeyboardShortcut ) != setting . SettingType )
153- {
152+ // if (typeof(KeyboardShortcut) != setting.SettingType)
153+ // {
154154 settingsMenu . Add ( CreateUIForSetting ( setting ) ) ;
155- }
155+ // }
156156 }
157157
158158 Menus . AddNew ( MenuDisplayMode . Both , settingsMenu , plugin . Info . Name . ToUpper ( ) , $ "Settings for the { plugin . Info . Name } mod") ;
@@ -234,6 +234,15 @@ private MenuItemBase CreateUIForSetting(SettingEntryBase setting)
234234 . WithDescription ( $ "{ setting . Description } ") ;
235235 }
236236
237+ if ( typeof ( KeyboardShortcut ) == setting . SettingType )
238+ {
239+ return new InputPrompt ( MenuDisplayMode . Both , $ "settings:{ Regex . Replace ( setting . DispName , @"\s+" , "_" ) . ToLower ( ) } ", setting . DispName . ToUpper ( ) )
240+ . WithDefaultValue ( setting . DefaultValue . ToString ( ) )
241+ . WithTitle ( setting . DispName )
242+ . WithSubmitAction ( ( x ) => setting . Set ( KeyboardShortcut . Deserialize ( x ) ) )
243+ . WithDescription ( $ "{ setting . Description } ") ;
244+ }
245+
237246 Logger . LogInfo ( $ "Could not properly display { setting . DispName } in the menu") ;
238247 //This doesn't even display lmao
239248 return new EmptyElement ( MenuDisplayMode . Both , $ "settings:{ Regex . Replace ( setting . DispName , @"\s+" , "_" ) . ToLower ( ) } ", setting . DispName . ToUpper ( ) )
0 commit comments