Ready for user testing

This commit is contained in:
BubbaGumpShrump 2024-12-04 21:11:13 -05:00
parent 8e4541895e
commit 27b9e0d057
7 changed files with 71 additions and 18 deletions

Binary file not shown.

After

(image error) Size: 42 KiB

View file

@ -16,6 +16,7 @@
<None Remove="Assets\HIT.png" />
<None Remove="Assets\NW.png" />
<None Remove="Assets\VOX.png" />
<None Remove="Assets\WRITH.jpg" />
<None Remove="Fonts\Orbitron-Bold.ttf" />
<None Remove="Fonts\Roboto-Regular.ttf" />
<None Remove="KillTrackR_MainScript.ps1" />
@ -41,6 +42,9 @@
<Resource Include="Assets\VOX.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\WRITH.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Fonts\Orbitron-Bold.ttf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>

View file

@ -35,7 +35,7 @@
<TextBlock Text="API URL:" Foreground="{DynamicResource TextBrush}" FontSize="16" Margin="0,5,0,5"/>
<StackPanel Orientation="Horizontal" Margin="30,0,0,0">
<TextBox Name="ApiUrl" Width="340" Height="30" Style="{StaticResource RoundedTextBox}"/>
<Button Content="Test" Width="75" Height="30" FontFamily="{StaticResource Orbitron}" Margin="5,0" Style="{StaticResource ButtonStyle}"/>
<Button Content="Test" Width="75" Height="30" FontFamily="{StaticResource Orbitron}" Margin="5,0" Style="{StaticResource ButtonStyle}" Click="TestApiButton_Click"/>
</StackPanel>
</StackPanel>

View file

@ -1,4 +1,9 @@
using System.IO;
using System.Diagnostics;
using System.IO;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
@ -208,7 +213,17 @@ namespace AutoTrackR2
);
ChangeLogo("/Assets/HIT.png");
break;
case 8: // VOX Theme
case 8: // WRAITH Theme
UpdateThemeColors(
(Color)ColorConverter.ConvertFromString("#ff0000"), // Accent/Border
(Color)ColorConverter.ConvertFromString("#ce8946"), // Button
(Color)ColorConverter.ConvertFromString("#000000"), // Background
(Color)ColorConverter.ConvertFromString("#ce8946"), // Text
(Color)ColorConverter.ConvertFromString("#A88F2C") // AltText
);
ChangeLogo("/Assets/WRITH.png", (Color)ColorConverter.ConvertFromString("#ff0000"));
break;
case 9: // VOX Theme
UpdateThemeColors(
(Color)ColorConverter.ConvertFromString("#C0C0C0"), // Accent/Border
(Color)ColorConverter.ConvertFromString("#1C1C1C"), // Button
@ -218,7 +233,7 @@ namespace AutoTrackR2
);
ChangeLogo("/Assets/VOX.png", (Color)ColorConverter.ConvertFromString("#FFD700"));
break;
case 9: // EMP Theme
case 10: // EMP Theme
UpdateThemeColors(
(Color)ColorConverter.ConvertFromString("#F5721C"), // Accent/Border
(Color)ColorConverter.ConvertFromString("#535353"), // Button
@ -404,5 +419,48 @@ namespace AutoTrackR2
// Start the timer
timer.Start();
}
private async void TestApiButton_Click(object sender, RoutedEventArgs e)
{
string apiUrl = ApiUrl.Text;
string modifiedUrl = Regex.Replace(apiUrl, @"(https?://[^/]+)/?.*", "$1/test");
string apiKey = ApiKey.Text;
Debug.WriteLine($"Sending to {modifiedUrl}");
try
{
// Configure HttpClient with TLS 1.2
var handler = new HttpClientHandler
{
SslProtocols = System.Security.Authentication.SslProtocols.Tls12
};
using (var client = new HttpClient(handler))
{
// Set headers
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
client.DefaultRequestHeaders.UserAgent.ParseAdd("AutoTrackR");
// Empty JSON body
var content = new StringContent("{}", Encoding.UTF8, "application/json");
// Send POST
var response = await client.PostAsync(modifiedUrl, content);
if (response.IsSuccessStatusCode)
{
MessageBox.Show("API Test Success.");
}
else
{
MessageBox.Show($"Error: {response.StatusCode} - {response.ReasonPhrase}");
}
}
}
catch (Exception ex)
{
MessageBox.Show($"API Test Failure. {ex.Message}");
}
}
}
}

View file

@ -15,7 +15,7 @@ if (Test-Path $configFile) {
# Convert to key-value pairs
$config = $configContent -replace '^([^=]+)=(.+)$', '$1=$2' | ConvertFrom-StringData
} else {
Write-Output "PlayerName=Config.ini not found."
Write-Output "Config.ini not found."
exit
}
@ -49,18 +49,9 @@ if ($visorWipe -eq 1){
If (Test-Path $logFilePath) {
Write-Output "PlayerName=Logfile found"
} else {
Write-Output "PlayerName=Logfile not found."
Write-Output "Logfile not found."
}
$enemyPilot = "6lasphemous"
$enemyShip = "MISC_Freelancer_MAX"
$enemyOrgs = "GrieferNet"
$joinDate = "12 Dec 2022"
$citizenRecord = "237890"
$KillTime = (Get-Date).ToUniversalTime().ToString("d MMM yyyy H:mm 'UTC'")
Write-Output "NewKill=break,$enemyPilot,$enemyShip,$($enemyOrgs),$joinDate,$citizenRecord,$killTime"
# Ship Manufacturers
$prefixes = @(
"ORIG",
@ -215,7 +206,7 @@ function Read-LogEntry {
$ship = $ship -replace '_(PU|AI|CIV|MIL|PIR)$', ''
}
$KillTime = Get-Date([DateTime]::UtcNow) -UFormat "%d%b%Y %r"
$KillTime = (Get-Date).ToUniversalTime().ToString("d MMM yyyy H:mm 'UTC'")
$page1 = Invoke-WebRequest -uri "https://robertsspaceindustries.com/citizens/$enemyPilot"
$page2 = Invoke-WebRequest -uri "https://robertsspaceindustries.com/citizens/$enemyPilot/organizations"

View file

@ -3,6 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="396" Width="626">
<Grid Background="{DynamicResource BackgroundLightBrush}">
<TextBlock Text="Welcome to the Stats Tab!" FontSize="24" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="Stats and graphs coming soon!" FontSize="24" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</UserControl>

View file

@ -3,6 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="396" Width="626">
<Grid Background="{DynamicResource BackgroundLightBrush}">
<TextBlock Text="Welcome to the Update Tab!" FontSize="24" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="Download and update features coming soon!" FontSize="24" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</UserControl>