Skip to content

Commit

Permalink
Added ability to change menu navigation keys
Browse files Browse the repository at this point in the history
  • Loading branch information
IncoCode committed May 29, 2015
1 parent 2e736f5 commit 00b522a
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
9 changes: 8 additions & 1 deletion AccountInBankS.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@ MarkATMKey=B
OpenATMMenuKey=O
LoseCachOnDeath=False
LoseCachOnArrest=False
ShowAllATMLocations=False
ShowAllATMLocations=False
[MenuNavigation]
ActivateKey=NumPad5
BackKey=NumPad0
LeftKey=NumPad4
RightKey=NumPad6
UpKey=NumPad8
DownKey=NumPad2
11 changes: 11 additions & 0 deletions Code/AccountInBank/AccountInBank.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ public AccountInBank()
{
this.PrintAllBlips();
}
this.ApplyMenuNavigationKeys();
}

private void ApplyMenuNavigationKeys()
{
this.ActivateKey = this._mySettings.ActivateKey;
this.BackKey = this._mySettings.BackKey;
this.LeftKey = this._mySettings.LeftKey;
this.RightKey = this._mySettings.RightKey;
this.UpKey = this._mySettings.UpKey;
this.DownKey = this._mySettings.DownKey;
}

private void PrintAllBlips()
Expand Down
19 changes: 19 additions & 0 deletions Code/AccountInBank/MySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ internal class MySettings
public bool LoseCashOnArrest { get; private set; }
public bool ShowAllATMLocations { get; private set; }

public Keys ActivateKey { get; private set; }
public Keys BackKey { get; private set; }
public Keys LeftKey { get; private set; }
public Keys RightKey { get; private set; }
public Keys UpKey { get; private set; }
public Keys DownKey { get; private set; }

#endregion

public MySettings()
Expand All @@ -34,6 +41,18 @@ private void Load()
this.LoseCashOnDeath = this._settings.Read( "LoseCachOnDeath", "Settings", false );
this.LoseCashOnArrest = this._settings.Read( "LoseCachOnArrest", "Settings", false );
this.ShowAllATMLocations = this._settings.Read( "ShowAllATMLocations", "Settings", false );

this.ActivateKey = Helper.StringToKey( this._settings.Read( "ActivateKey", "MenuNavigation", "NumPad5" ),
Keys.NumPad5 );
this.BackKey = Helper.StringToKey( this._settings.Read( "BackKey", "MenuNavigation", "NumPad0" ),
Keys.NumPad0 );
this.LeftKey = Helper.StringToKey( this._settings.Read( "LeftKey", "MenuNavigation", "NumPad4" ),
Keys.NumPad4 );
this.RightKey = Helper.StringToKey( this._settings.Read( "RightKey", "MenuNavigation", "NumPad6" ),
Keys.NumPad6 );
this.UpKey = Helper.StringToKey( this._settings.Read( "UpKey", "MenuNavigation", "NumPad8" ), Keys.NumPad8 );
this.DownKey = Helper.StringToKey( this._settings.Read( "DownKey", "MenuNavigation", "NumPad2" ),
Keys.NumPad2 );
}
}
}
4 changes: 2 additions & 2 deletions Code/AccountInBank/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion( "1.0.4.0" )]
[assembly: AssemblyFileVersion( "1.0.4.0" )]
[assembly: AssemblyVersion( "1.0.5.0" )]
[assembly: AssemblyFileVersion( "1.0.5.0" )]

0 comments on commit 00b522a

Please sign in to comment.