Skip to content

Commit

Permalink
Remove italics offset field and add mod name field
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachHembree committed Jan 28, 2021
1 parent dc60cf0 commit 6ebfb64
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 90 deletions.
131 changes: 47 additions & 84 deletions RichHudFontGen.Designer.cs

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

19 changes: 13 additions & 6 deletions RichHudFontGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ private void CheckBoxBold_CheckedChanged(object sender, EventArgs e) =>
private void CheckBoxUseName_CheckedChanged(object sender, EventArgs e) =>
nameBox.Enabled = checkBoxUseName.Checked;

private void modNameBox_TextChanged(object sender, EventArgs e)
{ }

/// <summary>
/// Updates font style to reflect configuration specified by the UI.
/// </summary>
Expand Down Expand Up @@ -198,8 +201,16 @@ private void GenerateFontData()
richConsoleBox.ScrollToCaret();
}

string modName = modNameBox.Text;

if (modName.Length == 0)
modName = "ModName";

richConsoleBox.AppendText($"Using mod name: {modName}\n");
richConsoleBox.ScrollToCaret();

WriteSbcData(data, $"{CustomFontName}\\Data");
WriteCsData(data, $"{CustomFontName}\\Data\\Scripts\\ModName\\FontData");
WriteCsData(data, $"{CustomFontName}\\Data\\Scripts\\{modName}\\FontData");
MoveAtlases(data, $"{CustomFontName}\\Fonts\\{CustomFontName}");
ConvertAtlases(data, $"{CustomFontName}\\Fonts\\{CustomFontName}");
}
Expand All @@ -213,8 +224,7 @@ private List<FontData> GetFontStyles()
List<FontData> styles = new List<FontData>();
Vector2
padding = GetPadding(paddingBox1X, paddingBox1Y),
offsetB = GetPadding(paddingBox2X, paddingBox2Y),
offsetI = GetPadding(paddingBox3X, paddingBox3Y);
offsetB = GetPadding(paddingBox2X, paddingBox2Y);

for (int n = 0; n < 4; n++)
{
Expand All @@ -225,9 +235,6 @@ private List<FontData> GetFontStyles()
if ((n & 1) == 1)
offset += offsetB;

if ((n & 2) == 2)
offset += offsetI;

styles.Add(new FontData(this, padding + offset, n));
}
}
Expand Down
22 changes: 22 additions & 0 deletions RichHudFontGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,28 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Win32.Registry, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Win32.Registry.4.5.0\lib\net461\Microsoft.Win32.Registry.dll</HintPath>
Expand Down
6 changes: 6 additions & 0 deletions RichHudFontGen.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ACED79BF-9B3E-4F98-98D1-57A82F5CF2A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ACED79BF-9B3E-4F98-98D1-57A82F5CF2A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ACED79BF-9B3E-4F98-98D1-57A82F5CF2A6}.Debug|x64.ActiveCfg = Debug|x64
{ACED79BF-9B3E-4F98-98D1-57A82F5CF2A6}.Debug|x64.Build.0 = Debug|x64
{ACED79BF-9B3E-4F98-98D1-57A82F5CF2A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ACED79BF-9B3E-4F98-98D1-57A82F5CF2A6}.Release|Any CPU.Build.0 = Release|Any CPU
{ACED79BF-9B3E-4F98-98D1-57A82F5CF2A6}.Release|x64.ActiveCfg = Release|x64
{ACED79BF-9B3E-4F98-98D1-57A82F5CF2A6}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 6ebfb64

Please sign in to comment.