Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion PlayerManagement/TailgrabPannel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Tailgrab Player Panel"
Width="900" Height="520"
Width="990" Height="520"
FontFamily="Segoe UI"
Language="en-US"
WindowStartupLocation="CenterOwner"
Expand Down Expand Up @@ -88,6 +88,19 @@
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>

<!-- Actions column -->
<GridViewColumn Width="80">
<GridViewColumn.Header>
<GridViewColumnHeader Content="Actions" />
</GridViewColumn.Header>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Button Content="Copy" Click="CopyPlayer_Click" Padding="4,2"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>

</GridView>
</ListView.View>
</ListView>
Expand Down Expand Up @@ -172,6 +185,19 @@
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>

<!-- Actions column -->
<GridViewColumn Width="80">
<GridViewColumn.Header>
<GridViewColumnHeader Content="Actions" />
</GridViewColumn.Header>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Button Content="Copy" Click="CopyPlayer_Click" Padding="4,2"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>

</GridView>
</ListView.View>
</ListView>
Expand Down
43 changes: 43 additions & 0 deletions PlayerManagement/TailgrabPannel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,49 @@ private void GridViewColumnHeader_Click(object sender, RoutedEventArgs e)
UpdateHeaderSortIndicator(header, view, property);
}

private void CopyPlayer_Click(object sender, RoutedEventArgs e)
{
if (sender is not System.Windows.Controls.Button btn) return;

// Find the DataContext for the row (should be PlayerViewModel)
if (btn.DataContext is PlayerViewModel pvm)
{
// Try to find the underlying Player by UserId
var player = PlayerManager.GetPlayerByUserId(pvm.UserId);
if (player == null)
{
// Build formatted string from the viewmodel alone
var sb = new System.Text.StringBuilder();
sb.AppendLine($"DisplayName: {pvm.DisplayName}");
sb.AppendLine($"UserId: {pvm.UserId}");
sb.AppendLine($"AvatarName: {pvm.AvatarName}");
sb.AppendLine($"InstanceStart: {pvm.InstanceStartTime}");
sb.AppendLine($"InstanceEnd: {pvm.InstanceEndTime}");
var text = sb.ToString();
System.Windows.Clipboard.SetText(text);
return;
}

var sb2 = new System.Text.StringBuilder();
sb2.AppendLine($"DisplayName: {player.DisplayName}");
sb2.AppendLine($"UserId: {player.UserId}");
sb2.AppendLine($"AvatarName: { (string.IsNullOrEmpty(player.AvatarName) ? string.Empty : player.AvatarName) }");
sb2.AppendLine($"InstanceStart: {player.InstanceStartTime:u}");
sb2.AppendLine($"InstanceEnd: { (player.InstanceEndTime.HasValue ? player.InstanceEndTime.Value.ToString("u") : string.Empty) }");

if (player.Events != null && player.Events.Count > 0)
{
sb2.AppendLine("Events:");
foreach (var ev in player.Events)
{
sb2.AppendLine($" - {ev.EventTime:u} {ev.Type} {ev.EventDescription}");
}
}

System.Windows.Clipboard.SetText(sb2.ToString());
}
}

private static T? FindAncestor<T>(DependencyObject? child) where T : DependencyObject
{
if (child == null) return null;
Expand Down
34 changes: 1 addition & 33 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,39 +70,7 @@
"pattern": "([\\d]{4}.[\\d]{2}.[\\d]{2}\\W[\\d]{2}:[\\d]{2}:[\\d]{2})\\W(Log[\\W]{8}|Debug[\\W]{6})-\\W\\W\\[ModerationManager\\] A vote kick has been initiated against ([\\S\\W]+), do you agree",
"logOutput": true,
"logOutputColor": "Default",
"actions": [
{
"actionTypeValue": "KeyPressAction",
"windowTitle": "Voicemod",
"keys": "%{f}"
},
{
"actionTypeValue": "OSCAction",
"parameterName": "/avatar/parameters/Ear/Right_Angle",
"oscValueType": "Float",
"value": "20.0"
},
{
"actionTypeValue": "DelayAction",
"milliseconds": 500
},
{
"actionTypeValue": "OSCAction",
"parameterName": "/avatar/parameters/Ear/Right_Angle",
"oscValueType": "Float",
"value": "0.0"
},
{
"actionTypeValue": "KeyPressAction",
"windowTitle": "OBS 64",
"keys": "^{F8}"
},
{
"actionTypeValue": "KeyPressAction",
"windowTitle": "VRChat",
"keys": "^{F12}"
}
]
"actions": []
},
{
"handlerTypeValue": "WarnKick",
Expand Down
1 change: 0 additions & 1 deletion regular-expressions.txt

This file was deleted.

6 changes: 3 additions & 3 deletions tailgrab.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<Nullable>enable</Nullable>
<AssemblyVersion>1.0.4.1041</AssemblyVersion> <!-- Explicitly set the build number -->
<FileVersion>1.0.4.1041</FileVersion>
<InformationalVersion>1.0.4.1041-beta</InformationalVersion>
<AssemblyVersion>1.0.5.1059</AssemblyVersion> <!-- Explicitly set the build number -->
<FileVersion>1.0.5.1059</FileVersion>
<InformationalVersion>1.0.5.1059-beta</InformationalVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading