Skip to content

Commit b99c0eb

Browse files
committed
Automatic merge of T1.5.1-722-g01614a154 and 17 pull requests
- Pull request #570 at c59c788: Experimental glTF 2.0 support with PBR lighting - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #865 at 3b5a2fe: Dispatcher window improvements - Pull request #874 at f8dbeab: Dynamic brake controller refactoring - Pull request #875 at 43bf33e: Bug fix for https://bugs.launchpad.net/or/+bug/2036346 Player train switching doesn't work with 3D cabs - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at 9df6e1d: Blueprint/train car operations UI window - Pull request #885 at c81447b: feat: Add notifications to Menu - Pull request #886 at b88f1d4: Scene viewer extension to TrackViewer - Pull request #888 at d7daf62: docs: Document player application model - Pull request #890 at 39a9fa4: Allow depart early - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #893 at bf8876b: Signal errors - Pull request #894 at 794fddf: Correct Decrease Colour - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #897 at 0a9d939: feat: Improved system information collection - Pull request #898 at e271395: Extra line with all the arguments for debugging purposes in logfile
19 parents a6b0062 + 01614a1 + c59c788 + d00beb9 + 3b5a2fe + f8dbeab + 43bf33e + f92de76 + 9df6e1d + c81447b + b88f1d4 + d7daf62 + 39a9fa4 + 1f5ba4c + bf8876b + 794fddf + 5866028 + 0a9d939 + e271395 commit b99c0eb

File tree

9 files changed

+441
-176
lines changed

9 files changed

+441
-176
lines changed

Source/Contrib/TrackViewer/Drawing/Labels/DrawLabels.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ private void CreateContextMenu()
156156

157157
SetLocationMenuItem = new MenuItem() { Header = "View scene here" };
158158
SetLocationMenuItem.Click += new RoutedEventHandler((sender, e) => TrackViewer.menuControl.MenuSceneWindow_Click(sender, e));
159-
SetLocationMenuItem.Click += new RoutedEventHandler(async (sender, e) => await TrackViewer.SceneViewer?.SetCameraLocation());
159+
SetLocationMenuItem.Click += new RoutedEventHandler(async (sender, e) => await TrackViewer.SceneViewer?.SetCameraLocation(
160+
SetLocationMenuItem.CommandParameter as WorldLocation? ?? new WorldLocation()));
160161
ContextMenu.Items.Add(SetLocationMenuItem);
161162
}
162163

Source/Contrib/TrackViewer/SceneViewer.cs

Lines changed: 299 additions & 74 deletions
Large diffs are not rendered by default.

Source/Contrib/TrackViewer/UserInterface/MenuControl.xaml.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,8 +1233,7 @@ public void MenuSceneWindow_Click(object sender, RoutedEventArgs e)
12331233
if (trackViewer.CurrentRoute == null)
12341234
return;
12351235
trackViewer.InitializeSceneViewer(null);
1236-
trackViewer.SceneViewer.SceneWindow.Show();
1237-
trackViewer.SceneViewer.SceneWindow.Activate();
1236+
trackViewer.SceneViewer.Show();
12381237
}
12391238
}
12401239

Source/Contrib/TrackViewer/UserInterface/SceneWindow.xaml

Lines changed: 48 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
<ColumnDefinition Width="Auto" />
2323
<ColumnDefinition Width="58" />
2424
<ColumnDefinition Width="58" />
25+
<ColumnDefinition Width="58" />
2526
<ColumnDefinition Width="Auto" />
27+
<ColumnDefinition Width="85" />
2628
<ColumnDefinition Width="Auto" />
27-
<ColumnDefinition Width="42" />
28-
<ColumnDefinition Width="Auto" />
29-
<ColumnDefinition Width="Auto" />
30-
<ColumnDefinition Width="80" />
31-
<ColumnDefinition Width="42" />
32-
<ColumnDefinition Width="60" />
33-
<ColumnDefinition Width="60" />
29+
<ColumnDefinition Width="58" />
30+
<ColumnDefinition Width="58" />
31+
<ColumnDefinition Width="58" />
3432
<ColumnDefinition Width="Auto" />
35-
<ColumnDefinition Width="*"/>
33+
<ColumnDefinition Width="63" />
34+
<ColumnDefinition Width="63" />
35+
<ColumnDefinition Width="63"/>
3636
</Grid.ColumnDefinitions>
3737
</Grid>
3838
</ItemsPanelTemplate>
@@ -68,69 +68,76 @@
6868
</StatusBarItem>
6969
<Separator Grid.Column="5"/>
7070
<StatusBarItem Grid.Column="6">
71-
<Border BorderThickness="1 1 0 0" BorderBrush="Gray">
72-
<Border BorderThickness="0 0 1 1" BorderBrush="AntiqueWhite">
73-
<TextBlock Name="statusTrIndex" Width="37" TextAlignment="Right"
74-
ToolTip="Index in the Track DataBase (.tdb) file"/>
75-
</Border>
76-
</Border>
71+
<TextBlock Name="tileXZcursor">
72+
<TextBlock.ToolTip>
73+
<TextBlock Text="Shows tileX and tileZ of the world location at the mouse pointer"/>
74+
</TextBlock.ToolTip>
75+
</TextBlock>
7776
</StatusBarItem>
78-
<Separator Grid.Column="7"/>
77+
<Separator Grid.Column="7" />
7978
<StatusBarItem Grid.Column="8">
80-
<TextBlock Text="Item"/>
79+
<TextBlock Name="LocationXcursor" Width="55" TextAlignment="Right">
80+
<TextBlock.ToolTip>
81+
<TextBlock Text="X-coordinate (without tileX) at the mouse pointer"/>
82+
</TextBlock.ToolTip>
83+
</TextBlock>
8184
</StatusBarItem>
8285
<StatusBarItem Grid.Column="9">
83-
<Border BorderThickness="1 1 0 0" BorderBrush="Gray">
84-
<Border BorderThickness="0 0 1 1" BorderBrush="AntiqueWhite">
85-
<TextBlock Name="statusTrItemType" Width="75"/>
86-
</Border>
87-
</Border>
86+
<TextBlock Name="LocationYcursor" Width="55" TextAlignment="Right">
87+
<TextBlock.ToolTip>
88+
<TextBlock Text="Y-coordinate at the mouse pointer"/>
89+
</TextBlock.ToolTip>
90+
</TextBlock>
8891
</StatusBarItem>
8992
<StatusBarItem Grid.Column="10">
93+
<TextBlock Name="LocationZcursor" Width="55" TextAlignment="Right">
94+
<TextBlock.ToolTip>
95+
<TextBlock Text="Z-coordinate (without tileZ) at the mouse pointer"/>
96+
</TextBlock.ToolTip>
97+
</TextBlock>
98+
</StatusBarItem>
99+
<Separator Grid.Column="11"/>
100+
<StatusBarItem Grid.Column="12">
90101
<Border BorderThickness="1 1 0 0" BorderBrush="Gray">
91102
<Border BorderThickness="0 0 1 1" BorderBrush="AntiqueWhite">
92-
<TextBlock Name="statusTrItemIndex" Width="37" TextAlignment="Right"
93-
ToolTip="Index in the Track DataBase (.tdb) file"/>
103+
<TextBlock Name="DeltaX" Width="55" TextAlignment="Right" Background="#FFF7DCDC"/>
94104
</Border>
95105
</Border>
96106
</StatusBarItem>
97-
<StatusBarItem Grid.Column="11">
107+
<StatusBarItem Grid.Column="13">
98108
<Border BorderThickness="1 1 0 0" BorderBrush="Gray">
99109
<Border BorderThickness="0 0 1 1" BorderBrush="AntiqueWhite">
100-
<TextBlock Name="statusTrItemLocationX" Width="55" TextAlignment="Right"/>
110+
<TextBlock Name="DeltaY" Width="55" TextAlignment="Right" Background="#FFC3CFFB"/>
101111
</Border>
102112
</Border>
103113
</StatusBarItem>
104-
<StatusBarItem Grid.Column="12">
114+
<StatusBarItem Grid.Column="14">
105115
<Border BorderThickness="1 1 0 0" BorderBrush="Gray">
106116
<Border BorderThickness="0 0 1 1" BorderBrush="AntiqueWhite">
107-
<TextBlock Name="statusTrItemLocationZ" Width="55" TextAlignment="Right"/>
117+
<TextBlock Name="DeltaZ" Width="55" TextAlignment="Right" Background="#FFCDF9D8"/>
108118
</Border>
109119
</Border>
110120
</StatusBarItem>
111-
<Separator Grid.Column="13"/>
112-
<StatusBarItem Grid.Column="14">
113-
<TextBlock Name="statusAdditional" ToolTip="Any other relevant information. Make your choice via Statusbar menu"/>
114-
</StatusBarItem>
115121
</StatusBar>
116122
<Border BorderThickness="2">
117123
<StackPanel Orientation="Vertical" Width="150">
118124
<TextBox FontWeight="Bold" Name="Filename" Text="{Binding SelectedWorldObject.FileName}"/>
119-
<DockPanel>
120-
<TextBlock Text="UID: " PreviewTextInput="UintValidationTextBox"/>
121-
<TextBlock Name="Uid" Text="{Binding SelectedWorldObject.UID}"/>
122-
</DockPanel>
123125
<Grid>
126+
<Grid.RowDefinitions>
127+
<RowDefinition Height="Auto" />
128+
<RowDefinition Height="Auto" />
129+
</Grid.RowDefinitions>
124130
<Grid.ColumnDefinitions>
125-
<ColumnDefinition Width="Auto"/>
126131
<ColumnDefinition Width="*"/>
127-
<ColumnDefinition Width="Auto"/>
128132
<ColumnDefinition Width="*"/>
133+
<ColumnDefinition Width="0.7*"/>
129134
</Grid.ColumnDefinitions>
130-
<TextBlock Grid.Column="0" Text="Tile X: " />
131-
<TextBox Grid.Column="1" Name="TileX" PreviewTextInput="IntValidationTextBox" Text="{Binding SelectedObject.Location.TileX}" />
132-
<TextBlock Grid.Column="2" Text=" Z: " />
133-
<TextBox Grid.Column="3" Name="TileZ" PreviewTextInput="IntValidationTextBox" Text="{Binding SelectedObject.Location.TileZ}" />
135+
<TextBlock Grid.Row="0" Grid.Column="0" Text="Tile X" HorizontalAlignment="Center"/>
136+
<TextBlock Grid.Row="0" Grid.Column="1" Text="Tile Z" HorizontalAlignment="Center"/>
137+
<TextBlock Grid.Row="0" Grid.Column="2" Text="UID" HorizontalAlignment="Center"/>
138+
<TextBox Grid.Row="1" Grid.Column="0" Name="TileX" TextAlignment="Center"/>
139+
<TextBox Grid.Row="1" Grid.Column="1" Name="TileZ" TextAlignment="Center"/>
140+
<TextBox Grid.Row="1" Grid.Column="2" Name="Uid" TextAlignment="Center"/>
134141
</Grid>
135142
<Grid>
136143
<Grid.RowDefinitions>

Source/ORTS.Common/Coordinates.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ public override string ToString()
181181
{
182182
return WorldLocation.ToString();
183183
}
184+
185+
public void CopyFrom(WorldPosition copy)
186+
{
187+
TileX = copy.TileX;
188+
TileZ = copy.TileZ;
189+
Location = copy.Location;
190+
}
184191
}
185192

186193

Source/ORTS.Common/Input/UserCommand.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,13 @@ public enum UserCommand
253253
[GetString("Control DP Less")] ControlDPLess,
254254

255255
// Editor
256-
[GetString("Editor Unselect All")] EditorUnselectAll,
256+
[GetString("Editor Unselect All")] EditorCancel,
257257
[GetString("Editor Undo")] EditorUndo,
258258
[GetString("Editor Redo")] EditorRedo,
259+
[GetString("Editor Move")] EditorMove,
260+
[GetString("Editor Move Handle")] EditorMoveHandle,
261+
[GetString("Editor Move Orthogonal")] EditorLockOrthogonal,
262+
[GetString("Editor Move Orthogonal")] EditorLockElevation,
263+
[GetString("Editor Move Orthogonal")] EditorLockRotation,
259264
}
260265
}

Source/ORTS.Settings/InputSettings.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,14 @@ static void InitializeCommands(UserCommandInput[] Commands)
540540
Commands[(int)UserCommand.GameSwitchPicked] = new UserCommandKeyInput(0x22, KeyModifiers.Alt);
541541
Commands[(int)UserCommand.GameUncoupleWithMouse] = new UserCommandKeyInput(0x16);
542542

543-
Commands[(int)UserCommand.EditorUnselectAll] = new UserCommandKeyInput(0x01);
543+
Commands[(int)UserCommand.EditorCancel] = new UserCommandKeyInput(0x01);
544544
Commands[(int)UserCommand.EditorUndo] = new UserCommandKeyInput(Keys.Z, KeyModifiers.Control); // Not assigning by scan code, because on German influenced keyboard layounts
545545
Commands[(int)UserCommand.EditorRedo] = new UserCommandKeyInput(Keys.Y, KeyModifiers.Control); // the Y and Z keys are exchanged, and we want these to match the o/s
546+
Commands[(int)UserCommand.EditorMove] = new UserCommandKeyInput(Keys.M);
547+
Commands[(int)UserCommand.EditorMoveHandle] = new UserCommandKeyInput(Keys.M, KeyModifiers.Alt);
548+
Commands[(int)UserCommand.EditorLockOrthogonal] = new UserCommandModifierInput(KeyModifiers.Shift);
549+
Commands[(int)UserCommand.EditorLockElevation] = new UserCommandModifierInput(KeyModifiers.Control);
550+
Commands[(int)UserCommand.EditorLockRotation] = new UserCommandKeyInput(Keys.R);
546551
}
547552
#endregion
548553

Source/RunActivity/Viewer3D/Cameras.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,15 +822,17 @@ public override void HandleUserInput(ElapsedTime elapsedTime)
822822
if (UserInput.IsMouseMiddleButtonPressed && UserInput.ModifiersMaskShiftCtrlAlt(false, false, false))
823823
{
824824
StoreRotationOrigin(Viewer.TerrainPoint);
825-
Viewer.EditorShapes.CrosshairPositionUpdateEnabled = false;
825+
if (Viewer.EditorShapes != null)
826+
Viewer.EditorShapes.CrosshairPositionUpdateEnabled = false;
826827
}
827828
if (UserInput.IsMouseMiddleButtonDown && UserInput.ModifiersMaskShiftCtrlAlt(false, false, false))
828829
{
829830
RotateByMouse();
830831
}
831832
else
832833
{
833-
Viewer.EditorShapes.CrosshairPositionUpdateEnabled = true;
834+
if (Viewer.EditorShapes != null)
835+
Viewer.EditorShapes.CrosshairPositionUpdateEnabled = true;
834836
}
835837
if (UserInput.IsMouseMiddleButtonDown && UserInput.ModifiersMaskShiftCtrlAlt(true, false, false))
836838
{

0 commit comments

Comments
 (0)