Add back in Options.Set(string, string) to avoid MissingMethod. (Thanks Cheesse), fixes #235

This commit is contained in:
UnknownShadow200 2016-09-13 06:51:51 +10:00
parent b3c2a21fc0
commit 94dc022567
3 changed files with 24 additions and 12 deletions

View File

@ -114,13 +114,13 @@ namespace ClassicalSharp.Hotkeys {
public void UserRemovedHotkey( Key baseKey, byte flags ) { public void UserRemovedHotkey( Key baseKey, byte flags ) {
string key = "hotkey-" + baseKey + "&" + flags; string key = "hotkey-" + baseKey + "&" + flags;
Options.Set<string>( key, null ); Options.Set( key, null );
} }
public void UserAddedHotkey( Key baseKey, byte flags, bool moreInput, string text ) { public void UserAddedHotkey( Key baseKey, byte flags, bool moreInput, string text ) {
string key = "hotkey-" + baseKey + "&" + flags; string key = "hotkey-" + baseKey + "&" + flags;
string value = moreInput + "&" + text; string value = moreInput + "&" + text;
Options.Set<string>( key, value ); Options.Set( key, value );
} }
} }

View File

@ -120,6 +120,18 @@ namespace ClassicalSharp {
return mapping; return mapping;
} }
public static void Set( string key, string value ) {
key = key.ToLower();
if( value != null ) {
OptionsSet[key] = value;
} else {
OptionsSet.Remove( key );
}
if( !OptionsChanged.Contains( key ) )
OptionsChanged.Add( key );
}
public static void Set<T>( string key, T value ) { public static void Set<T>( string key, T value ) {
key = key.ToLower(); key = key.ToLower();
if( value != null ) { if( value != null ) {

View File

@ -40,7 +40,7 @@ namespace Launcher {
for( int yy = 0; yy < height; yy++ ) { for( int yy = 0; yy < height; yy++ ) {
int* row = dst.GetRowPtr( y + yy ); int* row = dst.GetRowPtr( y + yy );
float t = (float)yy / height; float t = (float)yy / (height - 1); // so last row has b as its colour
c.R = (byte)Utils.Lerp( a.R, b.R, t ); c.R = (byte)Utils.Lerp( a.R, b.R, t );
c.G = (byte)Utils.Lerp( a.G, b.G, t ); c.G = (byte)Utils.Lerp( a.G, b.G, t );