Skip to content

Commit

Permalink
Reset control fonts on deselection
Browse files Browse the repository at this point in the history
  • Loading branch information
ItEndsWithTens committed Jul 4, 2024
1 parent 2f38a1d commit 7966f14
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/SHME.ExternalTool/UI/CameraTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ private void ClearDisplayedCameraPathInfo()
MtbCameraPathThing4.ResetText();
MtbCameraPathThing5.ResetText();
MtbCameraPathThing6.ResetText();

ResetFonts(typeof(CameraPath));
}

private void BtnCameraPathGoToVolumeMin_Click(object sender, EventArgs e)
Expand Down
11 changes: 11 additions & 0 deletions src/SHME.ExternalTool/UI/Edit_Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ private void MakeBoldIfChanged(Control ctrl, SilentHillType changed, string name
}
}

private void ResetFonts(Type type)
{
foreach ((string _, IList<Control> controls) in _fontChangeMap[type])
{
foreach (Control control in controls)
{
control.Font = _fontDefaultValue;
}
}
}

private void HexMaskedTextBox_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
bool alphanumeric =
Expand Down
4 changes: 4 additions & 0 deletions src/SHME.ExternalTool/UI/PoisTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ private void ClearDisplayedPoiInfo()
TbxSelectedPoiX.Text = "<x>";
TbxSelectedPoiZ.Text = "<z>";
MtbSelectedPoiGeometry.ResetText();

ResetFonts(typeof(PointOfInterest));
}

private void ClearDisplayedTriggerInfo()
Expand Down Expand Up @@ -182,6 +184,8 @@ private void ClearDisplayedTriggerInfo()
MtbSelectedTriggerThing6.ResetText();
NudSelectedTriggerStageIndex.Value = 0;
CbxSelectedTriggerSomeBool.Checked = false;

ResetFonts(typeof(Trigger));
}

private void RefreshLbxPoiAssociatedTriggers()
Expand Down

0 comments on commit 7966f14

Please sign in to comment.