mirror of
https://github.com/BubbaGumpShrump/AutoTrackR2.git
synced 2025-06-19 13:09:07 +00:00
Fixed displaying time on the kill feed.
This commit is contained in:
parent
a27746c45e
commit
b34e7d0165
1 changed files with 25 additions and 2 deletions
|
@ -23,6 +23,8 @@ public partial class HomePage : UserControl
|
||||||
private bool _UIEventsRegistered = false;
|
private bool _UIEventsRegistered = false;
|
||||||
private System.Timers.Timer _statusCheckTimer;
|
private System.Timers.Timer _statusCheckTimer;
|
||||||
private bool _isLogHandlerRunning = false;
|
private bool _isLogHandlerRunning = false;
|
||||||
|
private int _counter = 1;
|
||||||
|
private System.Timers.Timer _counterTimer;
|
||||||
|
|
||||||
public HomePage()
|
public HomePage()
|
||||||
{
|
{
|
||||||
|
@ -45,6 +47,11 @@ public partial class HomePage : UserControl
|
||||||
_statusCheckTimer.Elapsed += CheckStarCitizenStatus;
|
_statusCheckTimer.Elapsed += CheckStarCitizenStatus;
|
||||||
_statusCheckTimer.Start();
|
_statusCheckTimer.Start();
|
||||||
|
|
||||||
|
// Initialize and start the counter timer
|
||||||
|
_counterTimer = new System.Timers.Timer(1000); // Update every second
|
||||||
|
_counterTimer.Elapsed += UpdateCounter;
|
||||||
|
_counterTimer.Start();
|
||||||
|
|
||||||
// Check if Star Citizen is already running and initialize accordingly
|
// Check if Star Citizen is already running and initialize accordingly
|
||||||
if (IsStarCitizenRunning())
|
if (IsStarCitizenRunning())
|
||||||
{
|
{
|
||||||
|
@ -184,7 +191,7 @@ public partial class HomePage : UserControl
|
||||||
GameVersion = LocalPlayerData.GameVersion ?? "Unknown",
|
GameVersion = LocalPlayerData.GameVersion ?? "Unknown",
|
||||||
TrackRver = "2.10",
|
TrackRver = "2.10",
|
||||||
Enlisted = playerData?.JoinDate,
|
Enlisted = playerData?.JoinDate,
|
||||||
KillTime = ((DateTimeOffset)DateTime.Parse(actorDeathData.Timestamp)).ToUnixTimeSeconds().ToString(),
|
KillTime = ((DateTimeOffset)DateTime.ParseExact(actorDeathData.Timestamp, "yyyy-MM-ddTHH:mm:ss.fffZ", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal)).ToUnixTimeSeconds().ToString(),
|
||||||
PFP = playerData?.PFPURL ?? "https://cdn.robertsspaceindustries.com/static/images/account/avatar_default_big.jpg"
|
PFP = playerData?.PFPURL ?? "https://cdn.robertsspaceindustries.com/static/images/account/avatar_default_big.jpg"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -213,6 +220,13 @@ public partial class HomePage : UserControl
|
||||||
_killHistoryManager.AddKill(killData);
|
_killHistoryManager.AddKill(killData);
|
||||||
VisorWipe();
|
VisorWipe();
|
||||||
VideoRecord();
|
VideoRecord();
|
||||||
|
|
||||||
|
// Update kill tally
|
||||||
|
Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
KillTallyTextBox.Text = _killHistoryManager.GetKillsInCurrentMonth().Count.ToString();
|
||||||
|
AdjustFontSize(KillTallyTextBox);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -446,7 +460,7 @@ public partial class HomePage : UserControl
|
||||||
_isLogHandlerRunning = true;
|
_isLogHandlerRunning = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void Cleanup()
|
public void Cleanup()
|
||||||
{
|
{
|
||||||
|
@ -462,4 +476,13 @@ public partial class HomePage : UserControl
|
||||||
{
|
{
|
||||||
return Process.GetProcessesByName("StarCitizen").Length > 0;
|
return Process.GetProcessesByName("StarCitizen").Length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UpdateCounter(object? sender, ElapsedEventArgs e)
|
||||||
|
{
|
||||||
|
Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
DebugPanel.Text = _counter.ToString();
|
||||||
|
_counter = (_counter % 10) + 1; // Count from 1 to 10 and loop
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue