Skip to content

Commit

Permalink
Automatic merge of T1.5.1-687-gd279e384a and 10 pull requests
Browse files Browse the repository at this point in the history
- 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 67014b7: 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 #878 at da8978d: Implement Polach Adhesion
- Pull request #882 at d8a1c4d: Blueprint/train car operations UI window
- Pull request #883 at edcc2dd: SwitchPanel disconnect/connect handling
- Pull request #885 at c81447b: feat: Add notifications to Menu
  • Loading branch information
openrails-bot committed Nov 4, 2023
12 parents bcb149e + d279e38 + c59c788 + d00beb9 + 67014b7 + f8dbeab + 43bf33e + f92de76 + da8978d + d8a1c4d + edcc2dd + c81447b commit f870e00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private void ModifyWindowSize()
if (SymbolsRowCount > 0)
{
var desiredHeight = FontToBold ? Owner.TextFontDefaultBold.Height * RowsCount
: Owner.TextFontDefault.Height * RowsCount + SymbolWidth;
: (Owner.TextFontDefault.Height * RowsCount) + SymbolWidth;
var desiredWidth = (SymbolsRowCount * SymbolWidth) + (SpacerRowCount * (SymbolWidth / 2)) + (LocoRowCount * (SymbolWidth * 2));

var newHeight = (int)MathHelper.Clamp(desiredHeight, 80, WindowHeightMax);
Expand Down Expand Up @@ -406,8 +406,8 @@ public override void PrepareFrame(ElapsedTime elapsedTime, bool updateFull)
// Updates power supply status
else if (isElectricDieselLocomotive &&
(PowerSupplyStatus != null && PowerSupplyStatus != Owner.Viewer.PlayerTrain.Cars[CarPosition].GetStatus()
|| BatteryStatus != null && BatteryStatus != Owner.Viewer.PlayerTrain.Cars[CarPosition].GetStatus()
|| CircuitBreakerState != null && CircuitBreakerState != (trainCar as MSTSElectricLocomotive).ElectricPowerSupply.CircuitBreaker.State.ToString()))
|| (BatteryStatus != null && BatteryStatus != Owner.Viewer.PlayerTrain.Cars[CarPosition].GetStatus())
|| (CircuitBreakerState != null && CircuitBreakerState != (trainCar as MSTSElectricLocomotive).ElectricPowerSupply.CircuitBreaker.State.ToString())))
{
Layout();
UpdateWindowSize();
Expand Down Expand Up @@ -549,8 +549,6 @@ void buttonHandBrake_Click(Control arg1, Point arg2)
if ((Viewer.PlayerTrain.Cars[CarPosition] as MSTSWagon).GetTrainHandbrakeStatus())
{
Viewer.Simulator.Confirmer.Information(Viewer.Catalog.GetString("Handbrake set"));


Texture = HandBrakeSet;
}
else
Expand Down Expand Up @@ -849,7 +847,7 @@ public buttonToggleMU(int x, int y, int size, Viewer viewer, int carPosition)
var multipleUnitsConfiguration = Viewer.PlayerLocomotive.GetMultipleUnitsConfiguration();
if (Viewer.PlayerTrain.Cars[CarPosition] is MSTSDieselLocomotive && multipleUnitsConfiguration != null)
{
Texture = Viewer.TrainCarOperationsWindow.ModifiedSetting || (Viewer.PlayerTrain.Cars[CarPosition] as MSTSLocomotive).RemoteControlGroup == 0 && multipleUnitsConfiguration != "1" ? MUconnected : MUdisconnected;
Texture = Viewer.TrainCarOperationsWindow.ModifiedSetting || ((Viewer.PlayerTrain.Cars[CarPosition] as MSTSLocomotive).RemoteControlGroup == 0 && multipleUnitsConfiguration != "1")? MUconnected : MUdisconnected;
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public class TrainCarOperationsWindow : Window
internal static Texture2D RearAngleCockClosed;
internal static Texture2D RearAngleCockOpened;


public int DisplaySizeY;
public bool LayoutUpdated = false;
public bool AllSymbolsMode = true;
Expand Down Expand Up @@ -266,7 +265,7 @@ private void ModifyWindowSize()

DesiredHeight = FontToBold ? (Owner.TextFontDefaultBold.Height * (RowsCount + 1)) + (separatorSize * (SeparatorCount + 3))
: (Owner.TextFontDefault.Height * (RowsCount + 1)) + (separatorSize * (SeparatorCount + 3));
var desiredWidth = (SymbolsRowCount * SymbolSize) + (SpacerRowCount * (textWidth / 2)) + CarUIDLenght + textWidth * 2;
var desiredWidth = (SymbolsRowCount * SymbolSize) + (SpacerRowCount * (textWidth / 2)) + CarUIDLenght + (textWidth * 2);

// Takes the height of the TrainOperationsViewer as the margin area.
RowHeight = textWidth + separatorSize;
Expand All @@ -277,7 +276,7 @@ private void ModifyWindowSize()
: marginTraincarViewer;
WindowHeightMax = DisplaySizeY - marginTraincarViewer;

var newHeight = MathHelper.Clamp(DesiredHeight, (textWidth + separatorSize) * 3 + separatorSize, WindowHeightMax);
var newHeight = MathHelper.Clamp(DesiredHeight, ((textWidth + separatorSize) * 3) + separatorSize, WindowHeightMax);
var newWidth = MathHelper.Clamp(desiredWidth, 100, WindowWidthMax);

// Move the dialog up if we're expanding it, or down if not; this keeps the center in the same place.
Expand Down Expand Up @@ -936,7 +935,6 @@ public Texture2D LocomotiveStatus(int CarPosition)
string valuePart = parts?[1];
if (keyPart.Contains(Viewer.Catalog.GetString("Engine")))
{

TrainCarOperations.PowerSupplyStatus = locomotiveStatus;

Texture = valuePart.Contains(Viewer.Catalog.GetString("Running")) ? PowerOn
Expand Down

0 comments on commit f870e00

Please sign in to comment.