mirror of
https://github.com/BubbaGumpShrump/AutoTrackR2.git
synced 2025-06-19 21:19:07 +00:00
Merge branch 'default' into bob-fork
This commit is contained in:
commit
7f7be269b0
7 changed files with 30 additions and 10 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -360,4 +360,7 @@ MigrationBackup/
|
||||||
.ionide/
|
.ionide/
|
||||||
|
|
||||||
# Fody - auto-generated XML schema
|
# Fody - auto-generated XML schema
|
||||||
FodyWeavers.xsd
|
FodyWeavers.xsd
|
||||||
|
|
||||||
|
### Rider ###
|
||||||
|
.idea/
|
|
@ -4,6 +4,7 @@
|
||||||
Height="410"
|
Height="410"
|
||||||
Width="626">
|
Width="626">
|
||||||
|
|
||||||
|
|
||||||
<Grid Background="{DynamicResource BackgroundLightBrush}">
|
<Grid Background="{DynamicResource BackgroundLightBrush}">
|
||||||
<!-- Main Layout Grid -->
|
<!-- Main Layout Grid -->
|
||||||
<Grid Margin="0,0,5,7">
|
<Grid Margin="0,0,5,7">
|
||||||
|
|
|
@ -515,6 +515,7 @@ namespace AutoTrackR2
|
||||||
|
|
||||||
private void SaveButton_Click(object sender, RoutedEventArgs e)
|
private void SaveButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
ConfigManager.ApiKey = ApiKey.Password;
|
ConfigManager.ApiKey = ApiKey.Password;
|
||||||
ConfigManager.ApiUrl = ApiUrl.Text;
|
ConfigManager.ApiUrl = ApiUrl.Text;
|
||||||
ConfigManager.LogFile = LogFilePath.Text;
|
ConfigManager.LogFile = LogFilePath.Text;
|
||||||
|
@ -523,7 +524,6 @@ namespace AutoTrackR2
|
||||||
ConfigManager.VideoRecord = (int)VideoRecordSlider.Value;
|
ConfigManager.VideoRecord = (int)VideoRecordSlider.Value;
|
||||||
ConfigManager.OfflineMode = (int)OfflineModeSlider.Value;
|
ConfigManager.OfflineMode = (int)OfflineModeSlider.Value;
|
||||||
ConfigManager.Theme = (int)ThemeSlider.Value;
|
ConfigManager.Theme = (int)ThemeSlider.Value;
|
||||||
|
|
||||||
// Save the current config values
|
// Save the current config values
|
||||||
ConfigManager.SaveConfig();
|
ConfigManager.SaveConfig();
|
||||||
// Start the flashing effect
|
// Start the flashing effect
|
||||||
|
|
|
@ -12,10 +12,12 @@ using AutoTrackR2.LogEventHandlers;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
|
|
||||||
namespace AutoTrackR2;
|
namespace AutoTrackR2;
|
||||||
|
|
||||||
public partial class HomePage : UserControl
|
public partial class HomePage : UserControl
|
||||||
{
|
{
|
||||||
|
|
||||||
private LogHandler? _logHandler;
|
private LogHandler? _logHandler;
|
||||||
private KillHistoryManager _killHistoryManager;
|
private KillHistoryManager _killHistoryManager;
|
||||||
private bool _UIEventsRegistered = false;
|
private bool _UIEventsRegistered = false;
|
||||||
|
@ -164,7 +166,6 @@ public partial class HomePage : UserControl
|
||||||
if (actorDeathData.VictimPilot != LocalPlayerData.Username)
|
if (actorDeathData.VictimPilot != LocalPlayerData.Username)
|
||||||
{
|
{
|
||||||
var playerData = await WebHandler.GetPlayerData(actorDeathData.VictimPilot);
|
var playerData = await WebHandler.GetPlayerData(actorDeathData.VictimPilot);
|
||||||
|
|
||||||
if (playerData != null)
|
if (playerData != null)
|
||||||
{
|
{
|
||||||
var killData = new KillData
|
var killData = new KillData
|
||||||
|
@ -391,7 +392,6 @@ public partial class HomePage : UserControl
|
||||||
VisualTreeHelper.GetDpi(this).PixelsPerDip
|
VisualTreeHelper.GetDpi(this).PixelsPerDip
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply the adjusted font size
|
// Apply the adjusted font size
|
||||||
textBlock.FontSize = fontSize;
|
textBlock.FontSize = fontSize;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@ public struct VehicleDestructionData
|
||||||
public class VehicleDestructionEvent : ILogEventHandler
|
public class VehicleDestructionEvent : ILogEventHandler
|
||||||
{
|
{
|
||||||
public Regex Pattern { get; }
|
public Regex Pattern { get; }
|
||||||
|
|
||||||
public VehicleDestructionEvent()
|
public VehicleDestructionEvent()
|
||||||
{
|
{
|
||||||
Pattern = new Regex("""
|
Pattern = new Regex("""
|
||||||
|
|
|
@ -12,7 +12,6 @@ public class LogEntry
|
||||||
{
|
{
|
||||||
public DateTime Timestamp { get; set; }
|
public DateTime Timestamp { get; set; }
|
||||||
public required string? Message { get; set; }
|
public required string? Message { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum GameProcessState
|
enum GameProcessState
|
||||||
|
@ -45,7 +44,7 @@ public class LogHandler
|
||||||
new JumpDriveStateChangedEvent(),
|
new JumpDriveStateChangedEvent(),
|
||||||
new RequestJumpFailedEvent()
|
new RequestJumpFailedEvent()
|
||||||
];
|
];
|
||||||
|
|
||||||
public LogHandler(string? logPath)
|
public LogHandler(string? logPath)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(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
|
// Ensures that any deaths already in log aren't sent to the APIs until the monitor thread is running
|
||||||
_eventHandlers.Add(new ActorDeathEvent());
|
_eventHandlers.Add(new ActorDeathEvent());
|
||||||
|
|
||||||
StartMonitoring();
|
StartMonitoring();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +153,6 @@ public class LogHandler
|
||||||
var process = Process.GetProcesses().FirstOrDefault(p => p.MainWindowTitle == "Star Citizen");
|
var process = Process.GetProcesses().FirstOrDefault(p => p.MainWindowTitle == "Star Citizen");
|
||||||
|
|
||||||
GameProcessState newGameProcessState = process != null ? GameProcessState.Running : GameProcessState.NotRunning;
|
GameProcessState newGameProcessState = process != null ? GameProcessState.Running : GameProcessState.NotRunning;
|
||||||
|
|
||||||
if (newGameProcessState == GameProcessState.Running && _gameProcessState == GameProcessState.NotRunning)
|
if (newGameProcessState == GameProcessState.Running && _gameProcessState == GameProcessState.NotRunning)
|
||||||
{
|
{
|
||||||
// Game process went from NotRunning to Running, so reload the Game.log file
|
// 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);
|
_fileStream = new FileStream(_logPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||||
_reader = new StreamReader(_fileStream);
|
_reader = new StreamReader(_fileStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
_gameProcessState = newGameProcessState;
|
_gameProcessState = newGameProcessState;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -189,6 +189,27 @@ namespace AutoTrackR2
|
||||||
public static int VideoRecord { get; set; }
|
public static int VideoRecord { get; set; }
|
||||||
public static int OfflineMode { get; set; }
|
public static int OfflineMode { get; set; }
|
||||||
public static int Theme { 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()
|
static ConfigManager()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue