Added ability to save last used data from competition overlay for next run.
This commit is contained in:
@@ -40,10 +40,10 @@ namespace osrs_toolbox
|
||||
get { return _hideOtherPlayers; }
|
||||
set { SetProperty(ref _hideOtherPlayers, value, nameof(HideOtherPlayers)); }
|
||||
}
|
||||
public bool HideZeroKC
|
||||
public bool HideZeroGained
|
||||
{
|
||||
get { return _hideZeroKC; }
|
||||
set { SetProperty(ref _hideZeroKC, value, nameof(HideZeroKC)); }
|
||||
set { SetProperty(ref _hideZeroKC, value, nameof(HideZeroGained)); }
|
||||
}
|
||||
|
||||
public ICommand Update
|
||||
|
@@ -39,10 +39,10 @@ namespace osrs_toolbox
|
||||
get { return _hideOtherPlayers; }
|
||||
set { SetProperty(ref _hideOtherPlayers, value, nameof(HideOtherPlayers)); }
|
||||
}
|
||||
public bool HideZeroKC
|
||||
public bool HideZeroGained
|
||||
{
|
||||
get { return _hideZeroKC; }
|
||||
set { SetProperty(ref _hideZeroKC, value, nameof(HideZeroKC)); }
|
||||
set { SetProperty(ref _hideZeroKC, value, nameof(HideZeroGained)); }
|
||||
}
|
||||
|
||||
public ICommand ToggleCompetitionOverlay
|
||||
|
@@ -28,7 +28,7 @@ namespace osrs_toolbox
|
||||
PlayerName = "kalakoi";
|
||||
GridOutput = new StackPanel();
|
||||
HideOtherPlayers = false;
|
||||
HideZeroKC = false;
|
||||
HideZeroGained = false;
|
||||
}
|
||||
|
||||
private void InitializeVariables(string Username, int GroupID, int CompetitionID)
|
||||
@@ -38,7 +38,7 @@ namespace osrs_toolbox
|
||||
PlayerName = Username;
|
||||
GridOutput = new StackPanel();
|
||||
HideOtherPlayers = false;
|
||||
HideZeroKC = false;
|
||||
HideZeroGained = false;
|
||||
}
|
||||
|
||||
private void InitializeCommands()
|
||||
@@ -156,7 +156,7 @@ namespace osrs_toolbox
|
||||
bool AddToDisplay = true;
|
||||
if (HideOtherPlayers && PlayerName.ToUpper() != cp.player.displayName.ToUpper())
|
||||
AddToDisplay = false;
|
||||
else if (HideZeroKC && cp.progress.gained == 0 && PlayerName.ToUpper() != cp.player.displayName.ToUpper())
|
||||
else if (HideZeroGained && cp.progress.gained == 0 && PlayerName.ToUpper() != cp.player.displayName.ToUpper())
|
||||
AddToDisplay = false;
|
||||
|
||||
if (AddToDisplay)
|
||||
@@ -268,7 +268,7 @@ namespace osrs_toolbox
|
||||
bool AddToDisplay = true;
|
||||
if (HideOtherPlayers && PlayerName.ToUpper() != cp.player.displayName.ToUpper())
|
||||
AddToDisplay = false;
|
||||
else if (HideZeroKC && cp.progress.gained == 0 && PlayerName.ToUpper() != cp.player.displayName.ToUpper())
|
||||
else if (HideZeroGained && cp.progress.gained == 0 && PlayerName.ToUpper() != cp.player.displayName.ToUpper())
|
||||
AddToDisplay = false;
|
||||
|
||||
if (AddToDisplay)
|
||||
|
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace osrs_toolbox
|
||||
{
|
||||
@@ -16,11 +17,11 @@ namespace osrs_toolbox
|
||||
|
||||
private void InitializeVariables()
|
||||
{
|
||||
CompetitionID = -1;
|
||||
GroupID = -1;
|
||||
PlayerName = string.Empty;
|
||||
HideOtherPlayers = false;
|
||||
HideZeroKC = false;
|
||||
CompetitionID = Properties.Settings.Default.LastCompetitionID;
|
||||
GroupID = Properties.Settings.Default.LastGroupID;
|
||||
PlayerName = Properties.Settings.Default.LastUserName;
|
||||
HideOtherPlayers = Properties.Settings.Default.LastHideOthers;
|
||||
HideZeroGained = Properties.Settings.Default.LastHideZeroGained;
|
||||
}
|
||||
|
||||
private void InitializeCommands()
|
||||
@@ -42,8 +43,14 @@ namespace osrs_toolbox
|
||||
(cov.DataContext as CompetitionOverlayViewModel).GroupID = GroupID;
|
||||
(cov.DataContext as CompetitionOverlayViewModel).CompetitionID = CompetitionID;
|
||||
(cov.DataContext as CompetitionOverlayViewModel).HideOtherPlayers = HideOtherPlayers;
|
||||
(cov.DataContext as CompetitionOverlayViewModel).HideZeroKC = HideZeroKC;
|
||||
(cov.DataContext as CompetitionOverlayViewModel).HideZeroGained = HideZeroGained;
|
||||
cov.Show();
|
||||
Properties.Settings.Default.LastUserName = PlayerName;
|
||||
Properties.Settings.Default.LastGroupID = GroupID;
|
||||
Properties.Settings.Default.LastCompetitionID = CompetitionID;
|
||||
Properties.Settings.Default.LastHideOthers = HideOtherPlayers;
|
||||
Properties.Settings.Default.LastHideZeroGained = HideZeroGained;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user