Bugfix + Theme

This commit is contained in:
BubbaGumpShrump 2025-01-04 14:17:24 -05:00
parent 3bc70b77fd
commit 2d5d1f9f99
3 changed files with 19 additions and 4 deletions

View file

@ -92,7 +92,7 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<EmbeddedResource Include="KillTrackR_MainScript.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>

View file

@ -15,6 +15,12 @@ namespace AutoTrackR2
public HomePage()
{
InitializeComponent();
// Get the current month
string currentMonth = DateTime.Now.ToString("MMMM", CultureInfo.InvariantCulture);
// Set the TextBlock text
KillTallyTitle.Text = $"Kill Tally - {currentMonth}";
}
private Process runningProcess; // Field to store the running process

View file

@ -108,11 +108,19 @@ $global:killTally = 0
# Load historic kills from csv
if (Test-Path "$scriptFolder\Kill-Log.csv") {
$historicKills = Import-CSV "$scriptFolder\Kill-log.csv"
$currentDate = Get-Date
$dateFormat = "dd MMM yyyy HH:mm UTC"
foreach ($kill in $historicKills) {
$killDate = [datetime]::parseExact($kill.KillTime, $dateFormat, $null)
If ($killdate.year -eq $currentDate.Year -and $killdate.month -eq $currentDate.Month) {
$global:killTally++
}
Try {
Write-Output "NewKill=throwaway,$($kill.EnemyPilot),$($kill.EnemyShip),$($kill.OrgAffiliation),$($kill.Enlisted),$($kill.RecordNumber),$($kill.KillTime), $($kill.PFP)"
$global:killTally++
} Catch {Write-Output "Error Loading Kill: $($kill.EnemyPilot)"}
} Catch {
Write-Output "Error Loading Kill: $($kill.EnemyPilot)"
}
}
}
Write-Output "KillTally=$global:killTally"
@ -198,7 +206,7 @@ function Read-LogEntry {
Stop-Process -Id $PID -Force
}
If ($enemyShip -eq $global:lastKill){
If ($enemyShip -eq $global:lastKill -and $global:lastKill -ne "Player"){
$enemyShip = "Passenger"
} Else {
$global:lastKill = $enemyShip
@ -217,6 +225,7 @@ function Read-LogEntry {
}
if ($damageType -like "*bullet*") {
$ship = "Player"
$enemyShip = "Player"
}
If ($ship -match $cleanupPattern){
$ship = $matches[1]