-
Notifications
You must be signed in to change notification settings - Fork 4
/
DiscordWebhookWindow.xaml
87 lines (87 loc) · 6.81 KB
/
DiscordWebhookWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<Window x:Class="ValheimServerWarden.DiscordWebhookWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ValheimServerWarden"
mc:Ignorable="d"
xmlns:ui="http://schemas.modernwpf.com/2019"
ui:WindowHelper.UseModernWindowStyle="True"
Title="Discord Webhook" Height="Auto" Width="800" SizeToContent="Height">
<Window.Resources>
<Image x:Key="Edit" Source="Resources/Edit_32x.png"/>
<Image x:Key="Cancel" Source="Resources/Cancel_32x.png"/>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Label Content="Webhook URL" HorizontalAlignment="Left" Margin="10,10,0,5" VerticalAlignment="Top" Grid.Row="0" Grid.ColumnSpan="3"/>
<TextBox x:Name="txtWebhook" HorizontalAlignment="Stretch" Margin="10,5,10,5" TextWrapping="Wrap" VerticalAlignment="Stretch" Grid.Row="1" Grid.ColumnSpan="3"/>
<Label Content="Webhook Messages" ToolTip="To disable the webhook for an event, just erase the messge" HorizontalAlignment="Left" Margin="10,10,0,5" VerticalAlignment="Top" Grid.Row="2" Grid.ColumnSpan="2"/>
<Label Content="Server Started" Margin="10,5,5,5" VerticalAlignment="Center" Grid.Row="3" Grid.Column="0"/>
<TextBox x:Name="txtOnStarted" Tag="OnStarted" Margin="5" Grid.Row="3" Grid.Column="1" />
<Button x:Name="btnTestServerStarted" Content="Test" Tag="OnStarted" Margin="0,5,10,5" VerticalAlignment="Center" Grid.Row="3" Grid.Column="2" Click="btnTestWebhook_Click"/>
<Label Content="Server Start Failed" Margin="10,5,5,5" VerticalAlignment="Center" Grid.Row="4" Grid.Column="0"/>
<TextBox x:Name="txtOnStartFailed" Tag="OnStartFailed" Margin="5" Grid.Row="4" Grid.Column="1" />
<Button x:Name="btnTestServerStartFailed" Content="Test" Tag="OnStartFailed" Margin="0,5,10,5" VerticalAlignment="Center" Grid.Row="4" Grid.Column="2" Click="btnTestWebhook_Click"/>
<Label Content="Server Stopped" Margin="10,5,5,5" VerticalAlignment="Center" Grid.Row="5" Grid.Column="0"/>
<TextBox x:Name="txtOnServerExited" Tag="OnStopped" Margin="5" Grid.Row="5" Grid.Column="1" />
<Button x:Name="btnTestServerStopped" Content="Test" Tag="OnStopped" Margin="0,5,10,5" VerticalAlignment="Center" Grid.Row="5" Grid.Column="2" Click="btnTestWebhook_Click"/>
<Label Content="Player Connected" Margin="10,5,5,5" VerticalAlignment="Center" Grid.Row="6" Grid.Column="0"/>
<TextBox x:Name="txtOnPlayerConnected" Tag="OnPlayerConnected" Margin="5" Grid.Row="6" Grid.Column="1" />
<Button x:Name="btnTestConnected" Content="Test" Tag="OnPlayerConnected" Margin="0,5,10,5" VerticalAlignment="Center" Grid.Row="6" Grid.Column="2" Click="btnTestWebhook_Click"/>
<Label Content="Player Disconnected" Margin="10,5,5,5" VerticalAlignment="Center" Grid.Row="7" Grid.Column="0"/>
<TextBox x:Name="txtOnPlayerDisconnected" Tag="OnPlayerDisconnected" Margin="6" Grid.Row="7" Grid.Column="1" />
<Button x:Name="btnTestDisconnected" Content="Test" Tag="OnPlayerDisconnected" Margin="0,5,10,5" VerticalAlignment="Center" Grid.Row="7" Grid.Column="2" Click="btnTestWebhook_Click"/>
<Label Content="Player Died" Margin="10,5,5,5" VerticalAlignment="Center" Grid.Row="8" Grid.Column="0"/>
<TextBox x:Name="txtOnPlayerDied" Tag="OnPlayerDied" Margin="5" Grid.Row="8" Grid.Column="1" />
<Button x:Name="btnTestDied" Content="Test" Tag="OnPlayerDied" Margin="0,5,10,5" VerticalAlignment="Center" Grid.Row="8" Grid.Column="2" Click="btnTestWebhook_Click"/>
<Label Content="Wrong Password" Margin="10,5,5,5" VerticalAlignment="Center" Grid.Row="9" Grid.Column="0"/>
<TextBox x:Name="txtOnFailedPassword" Tag="OnFailedPassword" Margin="5" Grid.Row="9" Grid.Column="1" />
<Button x:Name="btnFailedPassword" Content="Test" Tag="OnFailedPassword" Margin="0,5,10,5" VerticalAlignment="Center" Grid.Row="9" Grid.Column="2" Click="btnTestWebhook_Click"/>
<Label Content="Random Event" Margin="10,5,5,5" VerticalAlignment="Center" Grid.Row="10" Grid.Column="0"/>
<TextBox x:Name="txtOnRandomServerEvent" Tag="OnRandomServerEvent" Margin="5" Grid.Row="10" Grid.Column="1">
<TextBox.ContextMenu>
<ContextMenu>
<MenuItem x:Name="menuServerEventNames" Header="Edit random event names" Click="menuServerEventNames_Click">
<MenuItem.Icon>
<Image Source="Resources/Edit_32x.png"/>
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</TextBox.ContextMenu>
</TextBox>
<Button x:Name="btnRandomServerEvent" Content="Test" Tag="OnRandomServerEvent" Margin="0,5,10,5" VerticalAlignment="Center" Grid.Row="10" Grid.Column="2" Click="btnTestWebhook_Click"/>
<Label Content="Server Updated" Margin="10,5,5,5" VerticalAlignment="Center" Grid.Row="11" Grid.Column="0"/>
<TextBox x:Name="txtOnUpdated" Tag="OnUpdateEnded" Margin="5" Grid.Row="11" Grid.Column="1" />
<Button x:Name="btnTestUpdated" Content="Test" Tag="OnUpdateEnded" Margin="0,5,10,5" VerticalAlignment="Center" Grid.Row="11" Grid.Column="2" Click="btnTestWebhook_Click"/>
<Grid Grid.Row="12" Grid.ColumnSpan="3" HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button x:Name="btnSave" Content="Save" Margin="10,5,5,10" VerticalAlignment="Center" Click="btnSave_Click" Grid.Column="1"/>
<Button x:Name="btnCancel" Content="Cancel" Margin="10,5,5,10" VerticalAlignment="Center" Grid.Column="2" Click="btnCancel_Click"/>
</Grid>
</Grid>
</Window>