-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMainWindow.xaml
183 lines (177 loc) · 13.7 KB
/
MainWindow.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<Window x:Class="Canary_monster_converter.MainWindow"
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:Control="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:Canary_monster_converter"
mc:Ignorable="d"
Title="Devm converter" Width="465" WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow" Height="340" ResizeMode="NoResize">
<Window.Resources>
<ControlTemplate x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="20" />
</Grid.ColumnDefinitions>
<Border x:Name="Border" CornerRadius="2" Grid.ColumnSpan="2" Background="#FF4D6886" BorderBrush="#FF3F3F3F" BorderThickness="1" />
<Border Grid.Column="0" CornerRadius="0" Margin="1" Background="White" BorderBrush="#FF685F5A" BorderThickness="0,0,1,0" Width="Auto"/>
<Path x:Name="Arrow" Grid.Column="1" Fill="White" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M0,0 L0,2 L4,6 L8,2 L8,0 L4,4 z" />
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="ComboBoxTextBox" TargetType="{x:Type TextBox}">
<Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}"/>
</ControlTemplate>
<Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
<Setter Property="Background" Value="White"/>
</Style>
<Style x:Key="{x:Type ComboBox}" TargetType="{x:Type ComboBox}">
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
<Setter Property="MinWidth" Value="70"/>
<Setter Property="MinHeight" Value="20"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ComboBox}">
<Grid>
<ToggleButton Name="ToggleButton" Template="{StaticResource ComboBoxToggleButton}" Grid.Column="2" Focusable="false" IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"/>
<ContentPresenter Name="ContentSite" IsHitTestVisible="False" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Margin="3,3,23,3" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox x:Name="PART_EditableTextBox" Style="{x:Null}" Template="{StaticResource ComboBoxTextBox}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3,3,23,3" Focusable="True" Background="White" Foreground="#FF4D6886" Visibility="Hidden" IsReadOnly="{TemplateBinding IsReadOnly}"/>
<Popup Name="Popup" Placement="Bottom" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Slide">
<Grid Name="DropDown" SnapsToDevicePixels="True" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
<Border x:Name="DropDownBorder" Background="White" BorderThickness="1" BorderBrush="#888888"/>
<ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
</ScrollViewer>
</Grid>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="HasItems" Value="false">
<Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="#777777"/>
</Trigger>
<Trigger Property="IsGrouping" Value="true">
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
</Trigger>
<Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
<Setter TargetName="DropDownBorder" Property="CornerRadius" Value="0"/>
<Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0"/>
</Trigger>
<Trigger Property="IsEditable" Value="true">
<Setter Property="IsTabStop" Value="false"/>
<Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible"/>
<Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}">
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ComboBoxItem}">
<Border Name="Border" Padding="2" SnapsToDevicePixels="true">
<ContentPresenter />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsHighlighted" Value="true">
<Setter TargetName="Border" Property="Background" Value="#FFC2DCF9"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="#FF9DCDF3"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="{x:Type Button}" TargetType="{x:Type Button}">
<Setter Property="Background" Value="#FF4D6886"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="#FF3F3F3F"/>
<Setter Property="Padding" Value="5"/>
<Setter Property="MinHeight" Value="25"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="4" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="border" Value="#FF7BA4D1"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="border" Value="#FF91C0F5"/>
</Trigger>
<Trigger Property="IsEnabled" Value="true">
<Setter Property="Opacity" TargetName="border" Value="1"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.5"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid Background="#FFD6D5D5">
<StackPanel Margin="0,5,0,0" VerticalAlignment="Top" Orientation="Vertical" FlowDirection="LeftToRight">
<Grid Width="390" Height="150">
<Image Source="/icon.ico" Stretch="Uniform" Width="75" Height="75" VerticalAlignment="Top" ToolTip="Convert lua monsters from serverid to clientid."/>
<TextBlock Text="Devm monster converter" Foreground="#FF05398F" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,75,0,0" FontSize="18" ToolTip="Convert lua monsters from serverid to clientid."/>
<TextBlock Text="Version 1.0" HorizontalAlignment="Center" Foreground="#FF05398F" VerticalAlignment="Top" Margin="0,100,0,0" ToolTip="Convert lua monsters from serverid to clientid."/>
<TextBlock Text="Author: @marcosvf132" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,10,0" FontSize="9" Opacity="0.5"/>
</Grid>
<Rectangle Height="1" Margin="5,0,5,0" Fill="Black" Opacity="0.1"/>
<StackPanel VerticalAlignment="Top" Height="32" Orientation="Horizontal">
<TextBlock Padding="15,0,10,0" Text="Otb file:" VerticalAlignment="Center" Width="70"/>
<TextBox x:Name="OtbPath" Width="300" Padding="5,0,5,0" Text="Click on 'open' to select a '.otb' file" VerticalAlignment="Center" BorderBrush="#FF3F3F3F" Background="White" IsEnabled="False" VerticalContentAlignment="Center"/>
<Button x:Name="OpenOtb" Margin="12,0,10,0" Padding="5,0,5,0" Content="Open" VerticalAlignment="Center" Click="Otb_Click"/>
</StackPanel>
<Rectangle Height="1" Margin="5,0,5,0" Fill="Black" Opacity="0.1"/>
<StackPanel VerticalAlignment="Top" Height="32" Orientation="Horizontal">
<TextBlock Padding="15,0,6,0" Text="Monster file:" VerticalAlignment="Center"/>
<TextBox x:Name="OtbmPath" Width="236" Padding="5,0,5,0" Text="Click 'file' to select a '.lua' file or 'folder'" VerticalAlignment="Center" BorderBrush="#FF3F3F3F" Background="White" Foreground="Black" IsEnabled="False" VerticalContentAlignment="Center"/>
<Button x:Name="OpenLua" Margin="15,0,0,0" Padding="5,0,5,0" Content="File" VerticalAlignment="Center" IsEnabled="false" Click="LuaFile_Click"/>
<Button x:Name="OpenFolder" Margin="10,0,10,0" Padding="5,0,5,0" Content="Folder" VerticalAlignment="Center" IsEnabled="false" Click="LuaPath_Click"/>
</StackPanel>
<Rectangle Height="1" Margin="5,0,5,0" Fill="Black" Opacity="0.1"/>
<StackPanel VerticalAlignment="Top" Height="36" Orientation="Horizontal">
<TextBlock Padding="15,0,6,0" Text="Convert from:" VerticalAlignment="Center"/>
<ComboBox x:Name="FromType" SelectedIndex="1" Padding="5,0,5,0" VerticalAlignment="Center" Width="72" Height="25">
<TextBlock Text="Name/ServerID"/>
<TextBlock Text="Name/ClientID"/>
<TextBlock Text="ClientID"/>
<TextBlock Text="ServerID"/>
</ComboBox>
<TextBlock Padding="5,0,5,0" Text="to:" VerticalAlignment="Center"/>
<ComboBox x:Name="ToType" SelectedIndex="0" Padding="5,0,5,0" VerticalAlignment="Center" Width="72" Height="25">
<TextBlock Text="ClientID"/>
<TextBlock Text="ServerID"/>
</ComboBox>
<TextBlock Margin="0,5,4,5" x:Name="ProgressText" Width="100" Text="Files loaded: 0" HorizontalAlignment="Stretch" TextAlignment="Right" Opacity="0.5" VerticalAlignment="Center"/>
<Button x:Name="Convert" Margin="5,5,0,5" Padding="5,0,5,0" Content="Convert" VerticalAlignment="Center" IsEnabled="false" Click="Convert_Click"/>
</StackPanel>
<Rectangle Height="1" Margin="5,0,5,0" Fill="Black" Opacity="0.1"/>
<StackPanel VerticalAlignment="Top" Orientation="Horizontal" HorizontalAlignment="Left">
<Button Margin="15,5,160,5" x:Name="LogButton" Padding="5,0,5,0" Content="Log" VerticalAlignment="Center" HorizontalAlignment="Right" Click="Log_Click" Width="35"/>
<Button Margin="154,5,0,5" Padding="15,0,15,0" Content="Close" VerticalAlignment="Center" HorizontalAlignment="Right" Click="Close_Click"/>
</StackPanel>
</StackPanel>
</Grid>
</Window>