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; }
|
get { return _hideOtherPlayers; }
|
||||||
set { SetProperty(ref _hideOtherPlayers, value, nameof(HideOtherPlayers)); }
|
set { SetProperty(ref _hideOtherPlayers, value, nameof(HideOtherPlayers)); }
|
||||||
}
|
}
|
||||||
public bool HideZeroKC
|
public bool HideZeroGained
|
||||||
{
|
{
|
||||||
get { return _hideZeroKC; }
|
get { return _hideZeroKC; }
|
||||||
set { SetProperty(ref _hideZeroKC, value, nameof(HideZeroKC)); }
|
set { SetProperty(ref _hideZeroKC, value, nameof(HideZeroGained)); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICommand Update
|
public ICommand Update
|
||||||
|
@@ -39,10 +39,10 @@ namespace osrs_toolbox
|
|||||||
get { return _hideOtherPlayers; }
|
get { return _hideOtherPlayers; }
|
||||||
set { SetProperty(ref _hideOtherPlayers, value, nameof(HideOtherPlayers)); }
|
set { SetProperty(ref _hideOtherPlayers, value, nameof(HideOtherPlayers)); }
|
||||||
}
|
}
|
||||||
public bool HideZeroKC
|
public bool HideZeroGained
|
||||||
{
|
{
|
||||||
get { return _hideZeroKC; }
|
get { return _hideZeroKC; }
|
||||||
set { SetProperty(ref _hideZeroKC, value, nameof(HideZeroKC)); }
|
set { SetProperty(ref _hideZeroKC, value, nameof(HideZeroGained)); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICommand ToggleCompetitionOverlay
|
public ICommand ToggleCompetitionOverlay
|
||||||
|
@@ -28,7 +28,7 @@ namespace osrs_toolbox
|
|||||||
PlayerName = "kalakoi";
|
PlayerName = "kalakoi";
|
||||||
GridOutput = new StackPanel();
|
GridOutput = new StackPanel();
|
||||||
HideOtherPlayers = false;
|
HideOtherPlayers = false;
|
||||||
HideZeroKC = false;
|
HideZeroGained = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeVariables(string Username, int GroupID, int CompetitionID)
|
private void InitializeVariables(string Username, int GroupID, int CompetitionID)
|
||||||
@@ -38,7 +38,7 @@ namespace osrs_toolbox
|
|||||||
PlayerName = Username;
|
PlayerName = Username;
|
||||||
GridOutput = new StackPanel();
|
GridOutput = new StackPanel();
|
||||||
HideOtherPlayers = false;
|
HideOtherPlayers = false;
|
||||||
HideZeroKC = false;
|
HideZeroGained = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeCommands()
|
private void InitializeCommands()
|
||||||
@@ -156,7 +156,7 @@ namespace osrs_toolbox
|
|||||||
bool AddToDisplay = true;
|
bool AddToDisplay = true;
|
||||||
if (HideOtherPlayers && PlayerName.ToUpper() != cp.player.displayName.ToUpper())
|
if (HideOtherPlayers && PlayerName.ToUpper() != cp.player.displayName.ToUpper())
|
||||||
AddToDisplay = false;
|
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;
|
AddToDisplay = false;
|
||||||
|
|
||||||
if (AddToDisplay)
|
if (AddToDisplay)
|
||||||
@@ -268,7 +268,7 @@ namespace osrs_toolbox
|
|||||||
bool AddToDisplay = true;
|
bool AddToDisplay = true;
|
||||||
if (HideOtherPlayers && PlayerName.ToUpper() != cp.player.displayName.ToUpper())
|
if (HideOtherPlayers && PlayerName.ToUpper() != cp.player.displayName.ToUpper())
|
||||||
AddToDisplay = false;
|
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;
|
AddToDisplay = false;
|
||||||
|
|
||||||
if (AddToDisplay)
|
if (AddToDisplay)
|
||||||
|
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
namespace osrs_toolbox
|
namespace osrs_toolbox
|
||||||
{
|
{
|
||||||
@@ -16,11 +17,11 @@ namespace osrs_toolbox
|
|||||||
|
|
||||||
private void InitializeVariables()
|
private void InitializeVariables()
|
||||||
{
|
{
|
||||||
CompetitionID = -1;
|
CompetitionID = Properties.Settings.Default.LastCompetitionID;
|
||||||
GroupID = -1;
|
GroupID = Properties.Settings.Default.LastGroupID;
|
||||||
PlayerName = string.Empty;
|
PlayerName = Properties.Settings.Default.LastUserName;
|
||||||
HideOtherPlayers = false;
|
HideOtherPlayers = Properties.Settings.Default.LastHideOthers;
|
||||||
HideZeroKC = false;
|
HideZeroGained = Properties.Settings.Default.LastHideZeroGained;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeCommands()
|
private void InitializeCommands()
|
||||||
@@ -42,8 +43,14 @@ namespace osrs_toolbox
|
|||||||
(cov.DataContext as CompetitionOverlayViewModel).GroupID = GroupID;
|
(cov.DataContext as CompetitionOverlayViewModel).GroupID = GroupID;
|
||||||
(cov.DataContext as CompetitionOverlayViewModel).CompetitionID = CompetitionID;
|
(cov.DataContext as CompetitionOverlayViewModel).CompetitionID = CompetitionID;
|
||||||
(cov.DataContext as CompetitionOverlayViewModel).HideOtherPlayers = HideOtherPlayers;
|
(cov.DataContext as CompetitionOverlayViewModel).HideOtherPlayers = HideOtherPlayers;
|
||||||
(cov.DataContext as CompetitionOverlayViewModel).HideZeroKC = HideZeroKC;
|
(cov.DataContext as CompetitionOverlayViewModel).HideZeroGained = HideZeroGained;
|
||||||
cov.Show();
|
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