Changes

Jump to navigation Jump to search
Line 100: Line 100:  
Note that '''SaveSetting''' and '''LoadSetting''' are generic and will call '''ToString()''' and try to convert the saved string back to the data type you specify when loading, so this will only work for simple types, like integers, floats, doubles, bools, strings, etc.
 
Note that '''SaveSetting''' and '''LoadSetting''' are generic and will call '''ToString()''' and try to convert the saved string back to the data type you specify when loading, so this will only work for simple types, like integers, floats, doubles, bools, strings, etc.
   −
To load something back, use '''LoadSetting<type>("Key", defaultvalue)''', e.g. '''LoadSetting<bool>("Notifications", false)''' or '''LoadSetting("Notifications", false)''', since '''bool''' is implicit from using '''false'''.
+
To load something back, use <code>LoadSetting<type>("Key", defaultvalue)</code>, e.g. <code>LoadSetting<bool>("Notifications", false)</code> or <code>LoadSetting("Notifications", false)</code>, since the type '''bool''' is implicit from using '''false'''.
    
There's also '''TryLoadSetting''', if you want to handle when the setting doesn't exist and '''DeleteSetting''' to remove existing settings.
 
There's also '''TryLoadSetting''', if you want to handle when the setting doesn't exist and '''DeleteSetting''' to remove existing settings.

Navigation menu