/
SceneView.xaml
204 lines (204 loc) · 12.1 KB
/
SceneView.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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<Window x:Class="ORTS.TrackViewer.UserInterface.SceneView"
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:ORTS.TrackViewer.UserInterface"
mc:Ignorable="d"
Title="Scene View" SizeToContent="WidthAndHeight">
<Window.CommandBindings>
<CommandBinding Command="Undo" Executed="UndoCommand" CanExecute="UndoRedoCanExecute"/>
<CommandBinding Command="Redo" Executed="RedoCommand" CanExecute="UndoRedoCanExecute"/>
<CommandBinding Command="Stop" Executed="CancelCommand"/>
<CommandBinding Command="{x:Static local:SceneView.Rotate}" Executed="RotateCommand"/>
<CommandBinding Command="{x:Static local:SceneView.Move}" Executed="MoveCommand"/>
<CommandBinding Command="{x:Static local:SceneView.MoveHandle}" Executed="MoveHandleCommand"/>
<CommandBinding Command="{x:Static local:SceneView.ToggleOrtho}" Executed="ToggleOrthoCommand"/>
<CommandBinding Command="{x:Static local:SceneView.ToggleElevationLock}" Executed="ToggleElevationLockCommand"/>
<CommandBinding Command="{x:Static local:SceneView.ToggleObjectSnap}" Executed="ToggleObjectSnapCommand"/>
</Window.CommandBindings>
<Window.InputBindings>
<KeyBinding Key="Esc" Command="Stop"/><!--This one doesn't work, Escape is eaten somewhere, need to workaround it in code-->
<KeyBinding Key="R" Command="{x:Static local:SceneView.Rotate}"/>
<KeyBinding Key="M" Command="{x:Static local:SceneView.Move}"/>
<KeyBinding Key="H" Command="{x:Static local:SceneView.MoveHandle}"/>
<KeyBinding Key="F3" Command="{x:Static local:SceneView.ToggleObjectSnap}"/>
<KeyBinding Key="F7" Command="{x:Static local:SceneView.ToggleElevationLock}"/>
<KeyBinding Key="F8" Command="{x:Static local:SceneView.ToggleOrtho}"/>
</Window.InputBindings>
<DockPanel LastChildFill="True">
<Menu DockPanel.Dock="Top" Height="22" Name="menuMain" Width="Auto">
<MenuItem Header="_File">
<MenuItem Header="Nothing to see here" Name="menuNothing" />
</MenuItem>
<MenuItem Header="_Edit">
<MenuItem Header="_Undo" Command="Undo" InputGestureText="Ctrl+Z"/>
<MenuItem Header="_Redo" Command="Redo" InputGestureText="Ctrl+Y"/>
<Separator/>
<MenuItem Header="_Move" Command="{x:Static local:SceneView.Move}" InputGestureText="M"/>
<MenuItem Header="_Rotate" Command="{x:Static local:SceneView.Rotate}" InputGestureText="R"/>
<MenuItem Header="Move _Handle" Command="{x:Static local:SceneView.MoveHandle}" InputGestureText="H"/>
<Separator/>
<MenuItem Header="Ortho Mode X-Z" Command="{x:Static local:SceneView.ToggleOrtho}" InputGestureText="F8"/>
<MenuItem Header="Elevation Lock Y" Command="{x:Static local:SceneView.ToggleElevationLock}" InputGestureText="F7"/>
<MenuItem Header="Object Snap" Command="{x:Static local:SceneView.ToggleObjectSnap}" InputGestureText="F3" IsCheckable="True"/>
</MenuItem>
<MenuItem Header="_View">
<MenuItem Header="Nothing to see here" Name="menuNothing3" />
</MenuItem>
</Menu>
<StatusBar DockPanel.Dock="Bottom" Name="tvStatusbar" Height="22" VerticalAlignment="Bottom">
<StatusBar.ItemsPanel>
<ItemsPanelTemplate>
<Grid MaxHeight="22">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="85" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="58" />
<ColumnDefinition Width="58" />
<ColumnDefinition Width="58" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="85" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="58" />
<ColumnDefinition Width="58" />
<ColumnDefinition Width="58" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="63" />
<ColumnDefinition Width="63" />
<ColumnDefinition Width="63"/>
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</StatusBar.ItemsPanel>
<StatusBarItem Grid.Column="0">
<TextBlock Name="tileXZ">
<TextBlock.ToolTip>
<TextBlock Text="Shows tileX and tileZ of the world location at the mouse pointer"/>
</TextBlock.ToolTip>
</TextBlock>
</StatusBarItem>
<Separator Grid.Column="1" />
<StatusBarItem Grid.Column="2">
<TextBlock Name="LocationX" Width="55" TextAlignment="Right">
<TextBlock.ToolTip>
<TextBlock Text="X-coordinate (without tileX) at the mouse pointer"/>
</TextBlock.ToolTip>
</TextBlock>
</StatusBarItem>
<StatusBarItem Grid.Column="3">
<TextBlock Name="LocationY" Width="55" TextAlignment="Right">
<TextBlock.ToolTip>
<TextBlock Text="Y-coordinate at the mouse pointer"/>
</TextBlock.ToolTip>
</TextBlock>
</StatusBarItem>
<StatusBarItem Grid.Column="4">
<TextBlock Name="LocationZ" Width="55" TextAlignment="Right">
<TextBlock.ToolTip>
<TextBlock Text="Z-coordinate (without tileZ) at the mouse pointer"/>
</TextBlock.ToolTip>
</TextBlock>
</StatusBarItem>
<Separator Grid.Column="5"/>
<StatusBarItem Grid.Column="6">
<TextBlock Name="tileXZcursor">
<TextBlock.ToolTip>
<TextBlock Text="Shows tileX and tileZ of the world location at the mouse pointer"/>
</TextBlock.ToolTip>
</TextBlock>
</StatusBarItem>
<Separator Grid.Column="7" />
<StatusBarItem Grid.Column="8">
<TextBlock Name="LocationXcursor" Width="55" TextAlignment="Right">
<TextBlock.ToolTip>
<TextBlock Text="X-coordinate (without tileX) at the mouse pointer"/>
</TextBlock.ToolTip>
</TextBlock>
</StatusBarItem>
<StatusBarItem Grid.Column="9">
<TextBlock Name="LocationYcursor" Width="55" TextAlignment="Right">
<TextBlock.ToolTip>
<TextBlock Text="Y-coordinate at the mouse pointer"/>
</TextBlock.ToolTip>
</TextBlock>
</StatusBarItem>
<StatusBarItem Grid.Column="10">
<TextBlock Name="LocationZcursor" Width="55" TextAlignment="Right">
<TextBlock.ToolTip>
<TextBlock Text="Z-coordinate (without tileZ) at the mouse pointer"/>
</TextBlock.ToolTip>
</TextBlock>
</StatusBarItem>
<Separator Grid.Column="11"/>
<StatusBarItem Grid.Column="12">
<Border BorderThickness="1 1 0 0" BorderBrush="Gray">
<Border BorderThickness="0 0 1 1" BorderBrush="AntiqueWhite">
<TextBlock Name="DeltaXBlock" Width="55" TextAlignment="Right" Background="#FFF7DCDC"/>
</Border>
</Border>
</StatusBarItem>
<StatusBarItem Grid.Column="13">
<Border BorderThickness="1 1 0 0" BorderBrush="Gray">
<Border BorderThickness="0 0 1 1" BorderBrush="AntiqueWhite">
<TextBlock Name="DeltaYBlock" Width="55" TextAlignment="Right" Background="#FFC3CFFB"/>
</Border>
</Border>
</StatusBarItem>
<StatusBarItem Grid.Column="14">
<Border BorderThickness="1 1 0 0" BorderBrush="Gray">
<Border BorderThickness="0 0 1 1" BorderBrush="AntiqueWhite">
<TextBlock Name="DeltaZBlock" Width="55" TextAlignment="Right" Background="#FFCDF9D8"/>
</Border>
</Border>
</StatusBarItem>
</StatusBar>
<Border BorderThickness="2">
<StackPanel Orientation="Vertical" Width="150">
<TextBox FontWeight="Bold" Name="Filename" Text="{Binding SelectedWorldObject.FileName}"/>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="0.7*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="Tile X" HorizontalAlignment="Center"/>
<TextBlock Grid.Row="0" Grid.Column="1" Text="Tile Z" HorizontalAlignment="Center"/>
<TextBlock Grid.Row="0" Grid.Column="2" Text="UID" HorizontalAlignment="Center"/>
<TextBox Grid.Row="1" Grid.Column="0" Name="TileX" TextAlignment="Center"/>
<TextBox Grid.Row="1" Grid.Column="1" Name="TileZ" TextAlignment="Center"/>
<TextBox Grid.Row="1" Grid.Column="2" Name="Uid" TextAlignment="Center"/>
</Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="1" Text="Position" HorizontalAlignment="Center"/>
<TextBlock Grid.Row="0" Grid.Column="2" Text="Rotation" HorizontalAlignment="Center"/>
<TextBlock Grid.Row="1" Text="X: "/>
<TextBlock Grid.Row="2" Text="Y: "/>
<TextBlock Grid.Row="3" Text="Z: "/>
<TextBox Grid.Row="1" Grid.Column="1" x:Name="PosX" Text="{Binding SelectedObject.Location.Location.X, StringFormat=N3}" PreviewTextInput="FloatValidationTextBox"/>
<TextBox Grid.Row="2" Grid.Column="1" x:Name="PosY" Text="{Binding SelectedObject.Location.Location.Y, StringFormat=N3}" PreviewTextInput="FloatValidationTextBox"/>
<TextBox Grid.Row="3" Grid.Column="1" x:Name="PosZ" Text="{Binding SelectedObject.Location.Location.Z, StringFormat=N3}" PreviewTextInput="FloatValidationTextBox"/>
<TextBox Grid.Row="1" Grid.Column="2" x:Name="RotX" PreviewTextInput="FloatValidationTextBox"/>
<TextBox Grid.Row="2" Grid.Column="2" x:Name="RotY" PreviewTextInput="FloatValidationTextBox"/>
<TextBox Grid.Row="3" Grid.Column="2" x:Name="RotZ" PreviewTextInput="FloatValidationTextBox"/>
</Grid>
</StackPanel>
</Border>
<Grid DockPanel.Dock="Bottom" x:Name="GraphicsHostElement" />
</DockPanel>
</Window>