diff --git a/SekiroFpsUnlockAndMore/MainWindow.xaml b/SekiroFpsUnlockAndMore/MainWindow.xaml
index 4fc5190..dad717c 100644
--- a/SekiroFpsUnlockAndMore/MainWindow.xaml
+++ b/SekiroFpsUnlockAndMore/MainWindow.xaml
@@ -22,7 +22,7 @@
-
+
If your monitor is 60 Hz you will have to use
@@ -47,5 +47,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SekiroFpsUnlockAndMore/MainWindow.xaml.cs b/SekiroFpsUnlockAndMore/MainWindow.xaml.cs
index 2db3491..b4b12fc 100644
--- a/SekiroFpsUnlockAndMore/MainWindow.xaml.cs
+++ b/SekiroFpsUnlockAndMore/MainWindow.xaml.cs
@@ -52,17 +52,21 @@ namespace SekiroFpsUnlockAndMore
internal const string deathCounterFilename = "DeathCouner.txt";
internal const string totalKillsFilename = "TotalKillsCounter.txt";
+ internal StatViewModel _statViewModel = new StatViewModel();
+ private bool _statLoggingEnabled = false;
internal readonly Timer _statRecordTimer = new Timer();
internal readonly DispatcherTimer _dispatcherTimerCheck = new DispatcherTimer();
internal bool _running = false;
internal string _logPath;
internal bool _retryAccess = true;
internal RECT _windowRect;
+
public MainWindow()
- {
- InitializeComponent();
- }
+ {
+ InitializeComponent();
+ DataContext = _statViewModel;
+ }
///
/// On window loaded.
@@ -87,6 +91,7 @@ namespace SekiroFpsUnlockAndMore
_statRecordTimer.Elapsed += new ElapsedEventHandler(StatReadTimer);
_statRecordTimer.Interval = 1500;
+ _statRecordTimer.Start();
}
///
@@ -447,18 +452,19 @@ namespace SekiroFpsUnlockAndMore
/// (_gameProc, _pointer_player_deaths);
- //Debug.WriteLine("[STAT]Player deaths: " + playerDeaths);
- LogStatFile(deathCounterFilename, playerDeaths.ToString());
+ _statViewModel.Deaths = playerDeaths;
+ if (_statLoggingEnabled) LogStatFile(deathCounterFilename, playerDeaths.ToString());
if (IsValid(_pointer_total_kills))
{
int totalKills = Read(_gameProc, _pointer_total_kills);
totalKills -= playerDeaths; //Since this value seems to track every death, including the player
- //Debug.WriteLine("[STAT]Enemies killed: " + totalKills);
- LogStatFile(totalKillsFilename, totalKills.ToString());
+ _statViewModel.Kills = totalKills;
+ if (_statLoggingEnabled) LogStatFile(totalKillsFilename, totalKills.ToString());
}
}
}
@@ -698,7 +704,7 @@ namespace SekiroFpsUnlockAndMore
private void CbStatChanged(object sender, RoutedEventArgs e)
{
- _statRecordTimer.Enabled = (bool)cbLogStats.IsChecked;
+ _statLoggingEnabled = (bool)cbLogStats.IsChecked;
}
private void BPatch_Click(object sender, RoutedEventArgs e)
diff --git a/SekiroFpsUnlockAndMore/StatViewModel.cs b/SekiroFpsUnlockAndMore/StatViewModel.cs
new file mode 100644
index 0000000..6c1a35c
--- /dev/null
+++ b/SekiroFpsUnlockAndMore/StatViewModel.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+
+namespace SekiroFpsUnlockAndMore
+{
+ ///
+ /// For Status bar display
+ ///
+ class StatViewModel : INotifyPropertyChanged
+ {
+ private int _deaths = 0;
+ public int Deaths
+ {
+ get { return _deaths; }
+ set
+ {
+ _deaths = value;
+ OnPropertyChanged(new PropertyChangedEventArgs("Deaths"));
+ }
+ }
+
+ private int _kills = 0;
+ public int Kills
+ {
+ get { return _kills; }
+ set
+ {
+ _kills = value;
+ OnPropertyChanged(new PropertyChangedEventArgs("Kills"));
+ }
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ public void OnPropertyChanged(PropertyChangedEventArgs e)
+ {
+ PropertyChanged?.Invoke(this, e);
+ }
+ }
+}