Skip to content

Commit ae6b6e3

Browse files
committed
light refactoring/renaming in MonitorPage
1 parent 15df57f commit ae6b6e3

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

RasterPropMonitor/Core/MonitorPage.cs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,15 @@ public class MonitorPage
3737
private StringProcessorFormatter[] spf;
3838
private string[] outputLines;
3939
bool allTextConstant;
40-
private string processedText = string.Empty;
4140

42-
public string Text
41+
public string ProcessedText
4342
{
44-
get
45-
{
46-
return processedText;
47-
}
43+
get; private set;
4844
}
4945

50-
private bool isActive;
5146
public bool IsActive
5247
{
53-
get
54-
{
55-
return isActive;
56-
}
48+
get; private set;
5749
}
5850

5951
public readonly string textOverlay = string.Empty;
@@ -128,7 +120,7 @@ public void UpdateText(RasterPropMonitorComputer rpmComp)
128120

129121
if (text.IndexOf(JUtil.VariableListSeparator[0]) == -1)
130122
{
131-
processedText = text;
123+
ProcessedText = text;
132124
spf = null;
133125
outputLines = null;
134126
allTextConstant = true;
@@ -169,7 +161,7 @@ public void UpdateText(RasterPropMonitorComputer rpmComp)
169161
}
170162
}
171163

172-
processedText = string.Join(Environment.NewLine, outputLines);
164+
ProcessedText = string.Join(Environment.NewLine, outputLines);
173165

174166
if (allTextConstant)
175167
{
@@ -616,7 +608,7 @@ private static MethodInfo InstantiateHandler(ConfigNode node, RasterPropMonitor
616608

617609
public void Active(bool state)
618610
{
619-
isActive = state;
611+
IsActive = state;
620612
if (pageHandlerS.activate != null)
621613
{
622614
pageHandlerS.activate(state, pageNumber);

RasterPropMonitor/Core/RasterPropMonitor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ private void RenderScreen()
455455
// Actual rendering of the background is delegated to the page object.
456456
activePage.RenderBackground(screenTexture);
457457

458-
if (!string.IsNullOrEmpty(activePage.Text))
458+
if (!string.IsNullOrEmpty(activePage.ProcessedText))
459459
{
460460
textRenderer.Render(screenTexture);
461461
}

RasterPropMonitor/Core/TextRenderer.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,21 +519,21 @@ private bool DrawChar(FontRenderer fr, char letter, float xPos, float yPos, Colo
519519

520520
public bool UpdateText(MonitorPage activePage)
521521
{
522-
bool textDirty = (cachedText != activePage.Text) || (cachedOverlayText != activePage.textOverlay);
522+
bool textDirty = (cachedText != activePage.ProcessedText) || (cachedOverlayText != activePage.textOverlay);
523523

524524
if (textDirty)
525525
{
526-
cachedText = activePage.Text;
526+
cachedText = activePage.ProcessedText;
527527
cachedOverlayText = activePage.textOverlay;
528528

529529
for (int i = 0; i < fontRenderer.Count; ++i)
530530
{
531531
fontRenderer[i].Clear();
532532
}
533533

534-
if (!string.IsNullOrEmpty(activePage.Text))
534+
if (!string.IsNullOrEmpty(activePage.ProcessedText))
535535
{
536-
ParseText(activePage.Text, activePage.screenXMin, activePage.screenYMin, activePage.defaultColor, activePage.pageFont);
536+
ParseText(activePage.ProcessedText, activePage.screenXMin, activePage.screenYMin, activePage.defaultColor, activePage.pageFont);
537537
}
538538

539539
if (!string.IsNullOrEmpty(activePage.textOverlay))

0 commit comments

Comments
 (0)