Skip to content

Commit

Permalink
Add extra large text
Browse files Browse the repository at this point in the history
  • Loading branch information
andyaiken committed Jul 15, 2021
1 parent e3c8461 commit 551cd7e
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 46 deletions.
5 changes: 5 additions & 0 deletions Libraries/README.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Libraries

This folder contains Masterplan library files.

They contains lots of monsters, magic items, map tiles, and so on, that you can use to create your adventures in Masterplan.
2 changes: 1 addition & 1 deletion Masterplan/Masterplan.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,7 @@

md $(TargetDir)\Libraries

xcopy /y $(ProjectDir)..\Libraries\* $(TargetDir)\Libraries\</PostBuildEvent>
xcopy /y $(ProjectDir)..\Libraries\*.library $(TargetDir)\Libraries\</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>
Expand Down
2 changes: 1 addition & 1 deletion Masterplan/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2c6aabe4-bd47-498a-9dd1-cf0d8d69973e")]

[assembly: AssemblyVersion("12.0.0.*")]
[assembly: AssemblyVersion("12.1.0.*")]
69 changes: 32 additions & 37 deletions Masterplan/Tools/HTML.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ public enum DisplaySize
/// <summary>
/// Large text.
/// </summary>
Large
Large,

/// <summary>
/// Extra large text.
/// </summary>
ExtraLarge
}

class HTML
Expand Down Expand Up @@ -1639,7 +1644,7 @@ public static string EncyclopediaEntry(EncyclopediaEntry entry, Encyclopedia enc
foreach (EncyclopediaGroup group in groups)
{
lines.Add("<P class=table>");
lines.Add("<TABLE class=wide>");
lines.Add("<TABLE>");

lines.Add("<TR class=shaded align=center>");
lines.Add("<TD>");
Expand Down Expand Up @@ -2310,7 +2315,7 @@ public static string EncounterReportTable(ReportTable table, DisplaySize size)
#endregion

lines.Add("<P class=table>");
lines.Add("<TABLE class=wide>");
lines.Add("<TABLE>");

#region Header row

Expand Down Expand Up @@ -2715,17 +2720,18 @@ public static List<string> GetHead(string title, string description, DisplaySize

lines.Add("<HEAD>");

if (title != null)
lines.Add(wrap(title, "title"));
lines.Add("<META http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />");
lines.Add("<META name=\"Generator\" content=\"Masterplan\" />");
lines.Add("<META name=\"Originator\" content=\"Masterplan\" />");

if (description != null)
lines.Add("<META name=\"Description\" content=\"" + description + "\">");

lines.Add("<META name=\"Generator\" content=\"Masterplan\">");
lines.Add("<META name=\"Originator\" content=\"Masterplan\">");
lines.Add("<META name=\"Description\" content=\"" + description + "\" />");

lines.AddRange(GetStyle(size));

if (title != null)
lines.Add(wrap(title, "title"));

lines.Add("</HEAD>");

return lines;
Expand Down Expand Up @@ -2757,6 +2763,13 @@ public static List<string> GetStyle(DisplaySize size)
pt_sizes[24] = 36;
break;
case DisplaySize.Large:
pt_sizes[8] = 16;
pt_sizes[9] = 18;
pt_sizes[12] = 24;
pt_sizes[16] = 32;
pt_sizes[24] = 48;
break;
case DisplaySize.ExtraLarge:
pt_sizes[8] = 25;
pt_sizes[9] = 30;
pt_sizes[12] = 40;
Expand All @@ -2765,23 +2778,6 @@ public static List<string> GetStyle(DisplaySize size)
break;
}

Dictionary<int, int> px_sizes = new Dictionary<int, int>();
switch (size)
{
case DisplaySize.Small:
px_sizes[15] = 15;
px_sizes[300] = 300;
break;
case DisplaySize.Medium:
px_sizes[15] = 30;
px_sizes[300] = 300;
break;
case DisplaySize.Large:
px_sizes[15] = 45;
px_sizes[300] = 300;
break;
}

#endregion

List<string> lines = new List<string>();
Expand All @@ -2808,27 +2804,26 @@ public static List<string> GetStyle(DisplaySize size)

if (!loaded)
{
lines.Add("body { font-family: Arial; font-size: " + pt_sizes[9] + "pt }");
lines.Add("body { font-family: 'Segoe UI'; font-size: " + pt_sizes[9] + "pt }");
lines.Add("h1, h2, h3, h4 { color: #000060 }");
lines.Add("h1 { font-size: " + pt_sizes[24] + "pt; font-weight: bold; text-align: center }");
lines.Add("h2 { font-size: " + pt_sizes[16] + "pt; font-weight: bold; text-align: center }");
lines.Add("h3 { font-size: " + pt_sizes[12] + "pt }");
lines.Add("h4 { font-size: " + pt_sizes[9] + "pt }");
lines.Add("p { }");
lines.Add("p { padding: 3px 0 }");
lines.Add("p.instruction { color: #666666; text-align: center; font-size: " + pt_sizes[8] + "pt }");
lines.Add("p.description { }");
lines.Add("p.signature { color: #666666; text-align: center }");
lines.Add("p.readaloud { padding-left: " + px_sizes[15] + "px; padding-right: " + px_sizes[15] + "px; font-style: italic }");
lines.Add("p.readaloud { padding-left: 15px; padding-right: 15px; font-style: italic }");
lines.Add("p.background { }");
lines.Add("p.encounter_note { }");
lines.Add("p.encyclopedia_entry { }");
lines.Add("p.note { }");
lines.Add("p.table { text-align: center }");
lines.Add("p.figure { text-align: center }");
lines.Add("table { font-size: " + pt_sizes[8] + "pt; border-color: #BBBBBB; border-style: solid; border-width: 1px; border-collapse: collapse; table-layout: fixed; width: " + px_sizes[300] + "px }");
lines.Add("table.clear { border-style: none; table-layout: fixed; width: 99% }");
lines.Add("table.wide { width: 99% }");
lines.Add("table.initiative { table-layout: auto; border-style: none; width=99% }");
lines.Add("table { font-size: " + pt_sizes[8] + "pt; border-color: #BBBBBB; border-style: solid; border-width: 1px; border-collapse: collapse; table-layout: fixed; width: 99% }");
lines.Add("table.clear { border-style: none }");
lines.Add("table.initiative { table-layout: auto; border-style: none }");
lines.Add("tr { background-color: #E1E7C5 }");
lines.Add("tr.clear { background-color: #FFFFFF }");
lines.Add("tr.heading { background-color: #143D5F; color: #FFFFFF }");
Expand All @@ -2846,13 +2841,13 @@ public static List<string> GetStyle(DisplaySize size)
lines.Add("tr.encounter { background-color: #8B0000; color: #FFFFFF }");
lines.Add("tr.daily { background-color: #000000; color: #FFFFFF }");
lines.Add("tr.warning { background-color: #E5A0A0; color: #000000; text-align: center }");
lines.Add("td { padding-top: 2px; padding-bottom: 2px; vertical-align: top }");
lines.Add("td.clear { vertical-align: top }");
lines.Add("td.indent { padding-left: " + px_sizes[15] + "px }");
lines.Add("td { padding-top: 3px; padding-bottom: 3px; vertical-align: top }");
lines.Add("td.clear { vertical-align: top; padding-left: 10px; padding-right: 10px }");
lines.Add("td.indent { padding-left: 15px }");
lines.Add("td.readaloud { font-style: italic }");
lines.Add("td.dimmed { color: #666666 }");
lines.Add("td.pvlogentry { color: lightgrey; background-color: #000000 }");
lines.Add("td.pvlogindent { color: #FFFFFF; background-color: #000000; padding-left: " + px_sizes[15] + "px }");
lines.Add("td.pvlogindent { color: #FFFFFF; background-color: #000000; padding-left: 15px }");
lines.Add("ul, ol { font-size: " + pt_sizes[8] + "pt }");
lines.Add("a { text-decoration: none }");
lines.Add("a:link { color: #0000C0 }");
Expand Down
28 changes: 24 additions & 4 deletions Masterplan/UI/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 41 additions & 3 deletions Masterplan/UI/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2715,12 +2715,14 @@ private void ToolsMenu_DropDownOpening(object sender, EventArgs e)
ToolsExportProject.Enabled = (Session.Project != null);
ToolsExportHandout.Enabled = (Session.Project != null);
ToolsIssues.Enabled = (Session.Project != null);
ToolsPreferencesTextSizeSmall.Checked = (Session.Preferences.PlayerViewTextSize == DisplaySize.Small);
ToolsPreferencesTextSizeMedium.Checked = (Session.Preferences.PlayerViewTextSize == DisplaySize.Medium);
ToolsPreferencesTextSizeLarge.Checked = (Session.Preferences.PlayerViewTextSize == DisplaySize.Large);
ToolsPreferencesTextSizeSmall.Checked = (Session.Preferences.TextSize == DisplaySize.Small);
ToolsPreferencesTextSizeMedium.Checked = (Session.Preferences.TextSize == DisplaySize.Medium);
ToolsPreferencesTextSizeLarge.Checked = (Session.Preferences.TextSize == DisplaySize.Large);
ToolsPreferencesTextSizeExtraLarge.Checked = (Session.Preferences.TextSize == DisplaySize.ExtraLarge);
ToolsPreferencesPlayerViewSmall.Checked = (Session.Preferences.PlayerViewTextSize == DisplaySize.Small);
ToolsPreferencesPlayerViewMedium.Checked = (Session.Preferences.PlayerViewTextSize == DisplaySize.Medium);
ToolsPreferencesPlayerViewLarge.Checked = (Session.Preferences.PlayerViewTextSize == DisplaySize.Large);
ToolsPreferencesPlayerViewExtraLarge.Checked = (Session.Preferences.PlayerViewTextSize == DisplaySize.ExtraLarge);
ToolsPreferencesPlayerViewOtherDisplay.Enabled = (Screen.AllScreens.Length > 1);
ToolsPreferencesPlayerViewOtherDisplay.Checked = ((Screen.AllScreens.Length > 1) && (PlayerViewForm.UseOtherDisplay));

Expand Down Expand Up @@ -3427,6 +3429,9 @@ private void ToolsPreferencesTextSizeSmall_Click(object sender, EventArgs e)
try
{
Session.Preferences.TextSize = DisplaySize.Small;
update_preview();
if (fWelcome != null)
fWelcome.RefreshOptions();
}
catch (Exception ex)
{
Expand All @@ -3439,6 +3444,9 @@ private void ToolsPreferencesTextSizeMedium_Click(object sender, EventArgs e)
try
{
Session.Preferences.TextSize = DisplaySize.Medium;
update_preview();
if (fWelcome != null)
fWelcome.RefreshOptions();
}
catch (Exception ex)
{
Expand All @@ -3451,6 +3459,24 @@ private void ToolsPreferencesTextSizeLarge_Click(object sender, EventArgs e)
try
{
Session.Preferences.TextSize = DisplaySize.Large;
update_preview();
if (fWelcome != null)
fWelcome.RefreshOptions();
}
catch (Exception ex)
{
LogSystem.Trace(ex);
}
}

private void ToolsPreferencesTextSizeExtraLarge_Click(object sender, EventArgs e)
{
try
{
Session.Preferences.TextSize = DisplaySize.ExtraLarge;
update_preview();
if (fWelcome != null)
fWelcome.RefreshOptions();
}
catch (Exception ex)
{
Expand Down Expand Up @@ -3494,6 +3520,18 @@ private void ToolsPreferencesPlayerViewLarge_Click(object sender, EventArgs e)
}
}

private void ToolsPreferencesPlayerViewExtraLarge_Click(object sender, EventArgs e)
{
try
{
Session.Preferences.PlayerViewTextSize = DisplaySize.ExtraLarge;
}
catch (Exception ex)
{
LogSystem.Trace(ex);
}
}

private void ToolsPreferencesPlayerViewOtherDisplay_Click(object sender, EventArgs e)
{
try
Expand Down
5 changes: 5 additions & 0 deletions Projects/README.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Projects

This folder contains a collection of example Masterplan projects.

You can use them as-is, or use them for inspiration.

0 comments on commit 551cd7e

Please sign in to comment.