File tree Expand file tree Collapse file tree 3 files changed +20
-6
lines changed
Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ public class MultiPlayerWindow : Window
6363
6464 Label indicator ;
6565 Label LabelFontToBold ;
66+ public static bool FontChanged ;
6667 public static bool FontToBold = false ;
6768 public static bool MonoFont ;
6869
@@ -185,6 +186,7 @@ protected override ControlLayout Layout(ControlLayout layout)
185186
186187 void FontToBold_Click ( Control arg1 , Point arg2 )
187188 {
189+ FontChanged = true ;
188190 FontToBold = ! FontToBold ;
189191 UpdateWindowSize ( ) ;
190192 }
@@ -403,8 +405,13 @@ public override void PrepareFrame(ElapsedTime elapsedTime, bool updateFull)
403405 UpdateWindowSize ( ) ;
404406 LinesCount = labels . Count ( ) ;
405407 }
406-
407-
408+ //Resize this window after the font has been changed externally
409+ if ( TrainDrivingWindow . FontChanged )
410+ {
411+ TrainDrivingWindow . FontChanged = false ;
412+ FontToBold = ! FontToBold ;
413+ UpdateWindowSize ( ) ;
414+ }
408415 //Update Layout
409416 Layout ( ) ;
410417 }
Original file line number Diff line number Diff line change @@ -200,6 +200,7 @@ private static class Symbols
200200 public bool normalTextMode = true ; // Standard text
201201 public bool TrainDrivingUpdating = false ;
202202 public static bool MonoFont ;
203+ public static bool FontChanged ;
203204 public static bool FontToBold ;
204205 string keyPressed ; // display a symbol when a control key is pressed.
205206
@@ -388,8 +389,8 @@ protected override ControlLayout Layout(ControlLayout layout)
388389
389390 void FontToBold_Click ( Control arg1 , Point arg2 )
390391 {
392+ FontChanged = true ;
391393 FontToBold = ! FontToBold ;
392- Owner . Viewer . Settings . WindowGlass = ! Owner . Viewer . Settings . WindowGlass ; // to help user with ageing eyesight.
393394 UpdateWindowSize ( ) ;
394395 }
395396
@@ -1288,7 +1289,13 @@ public override void PrepareFrame(ElapsedTime elapsedTime, bool updateFull)
12881289 UpdateWindowSize ( ) ;
12891290 LinesCount = labels . Count ( ) ;
12901291 }
1291-
1292+ //Resize this window after the font has been changed externally
1293+ if ( MultiPlayerWindow . FontChanged )
1294+ {
1295+ MultiPlayerWindow . FontChanged = false ;
1296+ FontToBold = ! FontToBold ;
1297+ UpdateWindowSize ( ) ;
1298+ }
12921299 //Update Layout
12931300 Layout ( ) ;
12941301 }
Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ public override void Draw(GraphicsDevice graphicsDevice)
240240 var xnaWorld = window . XNAWorld ;
241241
242242 var oldTargets = graphicsDevice . GetRenderTargets ( ) ;
243- if ( Viewer . Settings . WindowGlass && Screen != null )
243+ if ( Viewer . Settings . WindowGlass )
244244 {
245245 graphicsDevice . SetRenderTarget ( Screen ) ;
246246 graphicsDevice . Clear ( ClearOptions . Target | ClearOptions . DepthBuffer | ClearOptions . Stencil , Color . Transparent , 1 , 0 ) ;
@@ -255,7 +255,7 @@ public override void Draw(GraphicsDevice graphicsDevice)
255255 SpriteBatch . Begin ( SpriteSortMode . Immediate , BlendState . NonPremultiplied ) ;
256256 window . Draw ( SpriteBatch ) ;
257257 SpriteBatch . End ( ) ;
258- if ( Viewer . Settings . WindowGlass && Screen != null )
258+ if ( Viewer . Settings . WindowGlass )
259259 {
260260 graphicsDevice . SetRenderTargets ( oldTargets ) ;
261261 SpriteBatchMaterial . SetState ( graphicsDevice , null ) ;
You can’t perform that action at this time.
0 commit comments