Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ PublishScripts/
*.nupkg
# NuGet Symbol Packages
*.snupkg

# Except for *.nupkg and *.snupkg files in src/TSMapEditor/References
!src/TSMapEditor/References/*.nupkg
!src/TSMapEditor/References/*.snupkg

# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
Expand Down
12 changes: 12 additions & 0 deletions src/TSMapEditor/Content/Fonts.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Fonts]
Count=2

[Font0]
Type=Forme
Path=arial.ttf
Size=14

[Font1]
Type=Forme
Path=arial.ttf
Size=14
Binary file added src/TSMapEditor/Content/arial.ttf
Binary file not shown.
8 changes: 8 additions & 0 deletions src/TSMapEditor/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear/>
<add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
<add key="Local file package source" value="References" />
</packageSources>
</configuration>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
30 changes: 15 additions & 15 deletions src/TSMapEditor/Rendering/GameClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
using TSMapEditor.UI;

#if !DEBUG
using System.Windows.Forms;

Check warning on line 22 in src/TSMapEditor/Rendering/GameClass.cs

View workflow job for this annotation

GitHub Actions / build-editor

The using directive for 'System.Windows.Forms' appeared previously in this namespace
#endif

namespace TSMapEditor.Rendering
Expand Down Expand Up @@ -132,21 +132,21 @@
AssetLoader.AssetSearchPaths.Add(Path.Combine(Environment.CurrentDirectory, "Config", "Translations", TranslatorSetup.ActiveTranslationDirectory()));
AssetLoader.AssetSearchPaths.Add(Environment.CurrentDirectory + DSC + "Content" + DSC);

// Hack: allow translations to override fonts
int i = 0;
while (true)
{
string spriteFontPath = Path.Combine("Translations", TranslatorSetup.ActiveTranslationDirectory(), "SpriteFont" + i + ".xnb");
if (AssetLoader.AssetExists(Path.Combine(Environment.CurrentDirectory, "Config", spriteFontPath)))
{
var spriteFont = Content.Load<SpriteFont>(spriteFontPath);
Renderer.GetFontList()[i] = spriteFont;
}
else
{
break;
}
}
// // Hack: allow translations to override fonts
// int i = 0;
// while (true)
// {
// string spriteFontPath = Path.Combine("Translations", TranslatorSetup.ActiveTranslationDirectory(), "SpriteFont" + i + ".xnb");
// if (AssetLoader.AssetExists(Path.Combine(Environment.CurrentDirectory, "Config", spriteFontPath)))
// {
// var spriteFont = Content.Load<SpriteFont>(spriteFontPath);
// Renderer.GetFontList()[i] = spriteFont;
// }
// else
// {
// break;
// }
// }

windowManager = new WindowManager(this, graphics);
windowManager.Initialize(Content, Environment.CurrentDirectory + DSC + "Content" + DSC);
Expand Down
12 changes: 9 additions & 3 deletions src/TSMapEditor/TSMapEditor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,12 @@
<None Update="Content\SpriteFont1.xnb">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Content\arial.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Content\Fonts.ini">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Content\star.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -493,10 +499,10 @@
<ItemGroup>
<PackageReference Include="ImeSharp" Version="1.4.1" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="MonoGame.Framework.WindowsDX" Version="3.8.3" />
<PackageReference Include="MonoGame.Framework.WindowsDX" Version="3.8.4.1" />
<PackageReference Include="Rampastring.Tools" Version="2.0.7" />
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.3" />
<PackageReference Include="Rampastring.XNAUI.WindowsDX" Version="3.1.8" />
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.4.1" />
<PackageReference Include="Rampastring.XNAUI.WindowsDX" Version="3.1.8-copilot-add-forme-ttf-font-wrapper.1+23" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.11" />
<PackageReference Include="Westwind.Scripting" Version="1.3.3" />
</ItemGroup>
Expand Down
Loading