Skip to content

Commit 6dd7738

Browse files
committed
Distributed power: cleanup scaling issues and make DP screen page background transparent
1 parent 9e80053 commit 6dd7738

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Source/RunActivity/Viewer3D/RollingStock/SubSystems/DistributedPowerInterface.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class DistributedPowerInterface
5555
public static readonly Color ColorYellow = new Color(223, 223, 0);
5656
public static readonly Color ColorOrange = new Color(234, 145, 0);
5757
public static readonly Color ColorRed = new Color(191, 0, 2);
58-
public static readonly Color ColorBackground = new Color(8, 8, 8); // almost black
58+
public static readonly Color ColorBackground = new Color(0, 0, 0, 0); // transparent
5959
public static readonly Color ColorPASPlight = new Color(41, 74, 107);
6060
public static readonly Color ColorPASPdark = new Color(33, 49, 74);
6161
public static readonly Color ColorShadow = new Color(8, 24, 57);
@@ -355,8 +355,8 @@ public class DPITable : DPIWindow
355355
TextPrimitive[,] TableSymbol = new TextPrimitive[NumberOfRowsFull, NumberOfColumns];
356356
WindowTextFont TableTextFont;
357357
WindowTextFont TableSymbolFont;
358-
readonly int FontHeightTableText = 32;
359-
readonly int FontHeightTableSymbol = 38;
358+
readonly int FontHeightTableText = 16;
359+
readonly int FontHeightTableSymbol = 19;
360360
readonly int RowHeight = 34;
361361
readonly int ColLength = 88;
362362
public bool FullTable = true;
@@ -391,15 +391,15 @@ public DPITable(bool fullTable, bool fullScreen, DistributedPowerInterface dpi)
391391
for (int iCol = 0; iCol < NumberOfColumns; iCol++)
392392
{
393393
// text = iCol.ToString() + "--" + iRow.ToString();
394-
TableText[iRow, iCol] = new TextPrimitive(new Point(20 + ColLength * iCol, (iRow) * (FontHeightTableText - 8)), Color.White, text, TableTextFont);
395-
TableSymbol[iRow, iCol] = new TextPrimitive(new Point(10 + ColLength * iCol, (iRow) * (FontHeightTableText - 8)), Color.Green, text, TableSymbolFont);
394+
TableText[iRow, iCol] = new TextPrimitive(new Point(20 + ColLength * iCol, (iRow) * (FontHeightTableText + 8)), Color.White, text, TableTextFont);
395+
TableSymbol[iRow, iCol] = new TextPrimitive(new Point(10 + ColLength * iCol, (iRow) * (FontHeightTableText + 8)), Color.Green, text, TableSymbolFont);
396396
}
397397
}
398398
}
399399

400400
public override void ScaleChanged()
401401
{
402-
base.ScaleChanged();
402+
// base.ScaleChanged();
403403
SetFont();
404404
}
405405
void SetFont()
@@ -483,11 +483,13 @@ public override void PrepareFrame(DPIStatus dpiStatus)
483483
{
484484
var text = tempStatus[j, i].Replace('|', ' ');
485485
var colorFirstColEndsWith = ColorCodeCtrl.Keys.Any(text.EndsWith) ? ColorCodeCtrl[text.Substring(text.Length - 3)] : Color.White;
486+
TableText[i, j + 1].Font = TableTextFont;
486487
TableText[i, j + 1].Text = (colorFirstColEndsWith == Color.White) ? text : text.Substring(0, text.Length - 3); ;
487488
TableText[i, j + 1].Color = colorFirstColEndsWith;
489+
TableSymbol[i, j + 1].Font = TableSymbolFont;
488490
TableSymbol[i, j + 1].Text = (tempStatus[j, i] != null && tempStatus[j, i].Contains("|")) ? Fence : "";
489491
}
490-
492+
TableText[i, 0].Font = TableTextFont;
491493
TableText[i, 0].Text = dieselLocoHeader[i];
492494
}
493495
}

0 commit comments

Comments
 (0)