Merge branch 'default' into bob-fork

This commit is contained in:
DorkNormalize 2025-04-06 17:59:18 -07:00 committed by GitHub
commit 7f7be269b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 30 additions and 10 deletions

5
.gitignore vendored
View file

@ -360,4 +360,7 @@ MigrationBackup/
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd
### Rider ###
.idea/

View file

@ -4,6 +4,7 @@
Height="410"
Width="626">
<Grid Background="{DynamicResource BackgroundLightBrush}">
<!-- Main Layout Grid -->
<Grid Margin="0,0,5,7">

View file

@ -515,6 +515,7 @@ namespace AutoTrackR2
private void SaveButton_Click(object sender, RoutedEventArgs e)
{
ConfigManager.ApiKey = ApiKey.Password;
ConfigManager.ApiUrl = ApiUrl.Text;
ConfigManager.LogFile = LogFilePath.Text;
@ -523,7 +524,6 @@ namespace AutoTrackR2
ConfigManager.VideoRecord = (int)VideoRecordSlider.Value;
ConfigManager.OfflineMode = (int)OfflineModeSlider.Value;
ConfigManager.Theme = (int)ThemeSlider.Value;
// Save the current config values
ConfigManager.SaveConfig();
// Start the flashing effect

View file

@ -12,10 +12,12 @@ using AutoTrackR2.LogEventHandlers;
using System.Timers;
using System.Linq;
namespace AutoTrackR2;
public partial class HomePage : UserControl
{
private LogHandler? _logHandler;
private KillHistoryManager _killHistoryManager;
private bool _UIEventsRegistered = false;
@ -164,7 +166,6 @@ public partial class HomePage : UserControl
if (actorDeathData.VictimPilot != LocalPlayerData.Username)
{
var playerData = await WebHandler.GetPlayerData(actorDeathData.VictimPilot);
if (playerData != null)
{
var killData = new KillData
@ -391,7 +392,6 @@ public partial class HomePage : UserControl
VisualTreeHelper.GetDpi(this).PixelsPerDip
);
}
// Apply the adjusted font size
textBlock.FontSize = fontSize;
}

View file

@ -19,7 +19,6 @@ public struct VehicleDestructionData
public class VehicleDestructionEvent : ILogEventHandler
{
public Regex Pattern { get; }
public VehicleDestructionEvent()
{
Pattern = new Regex("""

View file

@ -12,7 +12,6 @@ public class LogEntry
{
public DateTime Timestamp { get; set; }
public required string? Message { get; set; }
}
enum GameProcessState
@ -45,7 +44,7 @@ public class LogHandler
new JumpDriveStateChangedEvent(),
new RequestJumpFailedEvent()
];
public LogHandler(string? logPath)
{
if (string.IsNullOrEmpty(logPath))
@ -72,7 +71,6 @@ public class LogHandler
// Ensures that any deaths already in log aren't sent to the APIs until the monitor thread is running
_eventHandlers.Add(new ActorDeathEvent());
StartMonitoring();
}
@ -155,7 +153,6 @@ public class LogHandler
var process = Process.GetProcesses().FirstOrDefault(p => p.MainWindowTitle == "Star Citizen");
GameProcessState newGameProcessState = process != null ? GameProcessState.Running : GameProcessState.NotRunning;
if (newGameProcessState == GameProcessState.Running && _gameProcessState == GameProcessState.NotRunning)
{
// Game process went from NotRunning to Running, so reload the Game.log file
@ -167,7 +164,6 @@ public class LogHandler
_fileStream = new FileStream(_logPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
_reader = new StreamReader(_fileStream);
}
_gameProcessState = newGameProcessState;
}
}

View file

@ -189,6 +189,27 @@ namespace AutoTrackR2
public static int VideoRecord { get; set; }
public static int OfflineMode { get; set; }
public static int Theme { get; set; }
static ConfigManager()
{
LoadConfig();
// Set default values
// AppData\Local\AutoTrackR2\Kill-log.csv
KillHistoryFile = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"AutoTrackR2",
"Kill-log.csv"
);
AHKScriptFolder = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"AutoTrackR2"
);
VisorWipeScript = "visorwipe.ahk";
VideoRecordScript = "videorecord.ahk";
}
static ConfigManager()
{