Skip to content

Commit

Permalink
Merge pull request #243 from SadConsole/develop
Browse files Browse the repository at this point in the history
8.99.3 release to support MonoGame 3.8 release.
  • Loading branch information
SadConsole authored Aug 15, 2020
2 parents 24c461e + 71777dd commit ec2e117
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 25 deletions.
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 08/14/2020 V8.99.3

- Added `Settings.FullScreenPreventScaleChangeForNone` to keep `ToggleFullScreen` in `None` resize mode. (thanks ASCII Guy)
- Added `ParseCommandClearEffect` with string parser command `ceffect` or `ce`. (thanks regulark)
- Updated templates.
- Update to MonoGame 3.8.

## 07/13/2020 V8.99.2

- Added DrawImageComponent.
Expand Down
8 changes: 4 additions & 4 deletions src/DemoProject/DesktopDX/DemoProject.DirectX.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="MonoGame.Framework, Version=3.7.1.189, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\MonoGame.Framework.WindowsDX.3.7.1.189\lib\net45\MonoGame.Framework.dll</HintPath>
<Reference Include="MonoGame.Framework, Version=3.8.0.1641, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\MonoGame.Framework.WindowsDX.3.8.0.1641\lib\net452\MonoGame.Framework.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
Expand Down Expand Up @@ -104,12 +104,12 @@
</ItemGroup>
<Import Project="..\SharedCode\DemoProject.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\..\packages\MonoGame.Framework.WindowsDX.3.7.1.189\build\MonoGame.Framework.WindowsDX.targets" Condition="Exists('..\..\..\packages\MonoGame.Framework.WindowsDX.3.7.1.189\build\MonoGame.Framework.WindowsDX.targets')" />
<Import Project="..\..\..\packages\MonoGame.Framework.WindowsDX.3.8.0.1641\build\MonoGame.Framework.WindowsDX.targets" Condition="Exists('..\..\..\packages\MonoGame.Framework.WindowsDX.3.8.0.1641\build\MonoGame.Framework.WindowsDX.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\packages\MonoGame.Framework.WindowsDX.3.7.1.189\build\MonoGame.Framework.WindowsDX.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\MonoGame.Framework.WindowsDX.3.7.1.189\build\MonoGame.Framework.WindowsDX.targets'))" />
<Error Condition="!Exists('..\..\..\packages\MonoGame.Framework.WindowsDX.3.8.0.1641\build\MonoGame.Framework.WindowsDX.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\MonoGame.Framework.WindowsDX.3.8.0.1641\build\MonoGame.Framework.WindowsDX.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
2 changes: 1 addition & 1 deletion src/DemoProject/DesktopDX/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MonoGame.Framework.WindowsDX" version="3.7.1.189" targetFramework="net461" />
<package id="MonoGame.Framework.WindowsDX" version="3.8.0.1641" targetFramework="net472" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net472" />
<package id="SharpDX" version="4.0.1" targetFramework="net461" />
<package id="SharpDX.Direct2D1" version="4.0.1" targetFramework="net461" />
Expand Down
8 changes: 4 additions & 4 deletions src/DemoProject/DesktopGL/DemoProject.OpenGL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
<StartupObject>StarterProject.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="MonoGame.Framework, Version=3.7.1.189, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\MonoGame.Framework.DesktopGL.3.7.1.189\lib\net45\MonoGame.Framework.dll</HintPath>
<Reference Include="MonoGame.Framework, Version=3.8.0.1641, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\MonoGame.Framework.DesktopGL.3.8.0.1641\lib\net452\MonoGame.Framework.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
Expand Down Expand Up @@ -96,12 +96,12 @@
</ItemGroup>
<Import Project="..\SharedCode\DemoProject.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\..\packages\MonoGame.Framework.DesktopGL.3.7.1.189\build\MonoGame.Framework.DesktopGL.targets" Condition="Exists('..\..\..\packages\MonoGame.Framework.DesktopGL.3.7.1.189\build\MonoGame.Framework.DesktopGL.targets')" />
<Import Project="..\..\..\packages\MonoGame.Framework.DesktopGL.3.8.0.1641\build\MonoGame.Framework.DesktopGL.targets" Condition="Exists('..\..\..\packages\MonoGame.Framework.DesktopGL.3.8.0.1641\build\MonoGame.Framework.DesktopGL.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\packages\MonoGame.Framework.DesktopGL.3.7.1.189\build\MonoGame.Framework.DesktopGL.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\MonoGame.Framework.DesktopGL.3.7.1.189\build\MonoGame.Framework.DesktopGL.targets'))" />
<Error Condition="!Exists('..\..\..\packages\MonoGame.Framework.DesktopGL.3.8.0.1641\build\MonoGame.Framework.DesktopGL.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\MonoGame.Framework.DesktopGL.3.8.0.1641\build\MonoGame.Framework.DesktopGL.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
2 changes: 1 addition & 1 deletion src/DemoProject/DesktopGL/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MonoGame.Framework.DesktopGL" version="3.7.1.189" targetFramework="net461" />
<package id="MonoGame.Framework.DesktopGL" version="3.8.0.1641" targetFramework="net472" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net461" />
</packages>
5 changes: 2 additions & 3 deletions src/DemoProject/SharedCode/DemoProjectCoreApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -19,8 +19,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.0.4" />
<PackageReference Include="MonoGame.Framework.DesktopGL.Core" Version="3.7.0.7" />
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.0.1641" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/DemoProject/SharedCode/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ private static void Init()
// We'll instead use our demo consoles that show various features of SadConsole.
Global.CurrentScreen = MainConsole;

//var con = new Console(10, 10);
//con.Print("[c:b]test");
//Global.CurrentScreen = con;

// Initialize the windows
_characterWindow = new Windows.CharacterViewer();
}
Expand Down
4 changes: 4 additions & 0 deletions src/SadConsole/ColoredString.Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ public static ColoredString Parse(string value, int surfaceIndex = -1, CellSurfa
case "sg":
commandObject = new ParseCommandSetGlyph(commandParams);
break;
case "ceffect":
case "ce":
commandObject = new ParseCommandClearEffect(commandParams, commandStacks);
break;
default:
break;
}
Expand Down
13 changes: 7 additions & 6 deletions src/SadConsole/SadConsole.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>SadConsole</AssemblyName>
<DocumentationFile>SadConsole.xml</DocumentationFile>
<AssemblyVersion>8.99.2.0</AssemblyVersion>
<Version>8.99.2</Version>
<AssemblyVersion>8.99.3.0</AssemblyVersion>
<Version>8.99.3</Version>
<Version Condition="'$(Configuration)'=='Debug'">$(Version)-debug</Version>
<Authors>Thraka</Authors>
<Company>SadLogic</Company>
Expand All @@ -15,7 +15,7 @@
<Copyright>Copyright © 2020 Steve De George JR (Thraka)</Copyright>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>SadConsole</PackageId>
<PackageReleaseNotes>Fix xml docs</PackageReleaseNotes>
<PackageReleaseNotes>Upgrade MonoGame to 3.8.</PackageReleaseNotes>
<PackageIcon>icon.png</PackageIcon>
<PackageIconUrl>https://raw.githubusercontent.com/SadConsole/SadConsole/d110fc4a0dfdaa25496c973518ea6a14a563e191/images/oD8yyro5.png</PackageIconUrl>
<RepositoryUrl>https://github.com/SadConsole/SadConsole</RepositoryUrl>
Expand All @@ -26,6 +26,7 @@
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedAllSources>true</EmbedAllSources>
<PackageTags>monogame;roguelike;cli;xna;game;development;console;ansi;ascii;standard</PackageTags>
</PropertyGroup>

Expand Down Expand Up @@ -55,16 +56,16 @@
<EmbeddedResource Include="Resources\IBM8x16.png" />
<EmbeddedResource Include="Resources\IBM.font" />
<None Include="Resources\readme.txt" pack="true" PackagePath="." />
<None Include="Resources\icon.png" Pack="true" PackagePath="\"/>
<None Include="Resources\icon.png" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.0.9" PrivateAssets="All" />
<PackageReference Include="MonoGame.Framework.DesktopGL.Core" Version="3.7.0.7" PrivateAssets="All" />
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.0.1641" PrivateAssets="All" />
<PackageReference Include="newtonsoft.json" Version="11.*" />
</ItemGroup>

Expand Down
12 changes: 11 additions & 1 deletion src/SadConsole/SadConsole.xml

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

9 changes: 7 additions & 2 deletions src/SadConsole/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,15 @@ public static class Settings
public static bool SerializationIsCompressed { get; set; } = false;

/// <summary>
/// When set to true, and a font is not specified with the <see cref="Game.Create(string, int, int, Action{Game})"/> overload, the IBM 8x16 extended SadConsole font will be used.
/// When set to true, and a font is not specified with the <see cref="Game.Create(string, int, int, System.Action{Game})"/> overload, the IBM 8x16 extended SadConsole font will be used.
/// </summary>
public static bool UseDefaultExtendedFont { get; set; } = false;

/// <summary>
/// When <see langword="true"/> and <see cref="Settings.ResizeMode"/> is <see cref="WindowResizeOptions.None"/>, the <see cref="ToggleFullScreen"/> method will leave the <see cref="Settings.ResizeMode"/> alone.
/// </summary>
public static bool FullScreenPreventScaleChangeForNone { get; set; } = false;

/// <summary>
/// Toggles between windowed and fullscreen rendering for SadConsole.
/// </summary>
Expand All @@ -104,7 +109,7 @@ public static void ToggleFullScreen()
_preFullScreenWidth = Global.GraphicsDevice.PresentationParameters.BackBufferWidth;
_preFullScreenHeight = Global.GraphicsDevice.PresentationParameters.BackBufferHeight;

if (Settings.ResizeMode == WindowResizeOptions.None)
if (Settings.ResizeMode == WindowResizeOptions.None && !FullScreenPreventScaleChangeForNone)
{
_handleResizeNone = true;
Settings.ResizeMode = WindowResizeOptions.Scale;
Expand Down
41 changes: 41 additions & 0 deletions src/SadConsole/StringParser/ParseCommandClearEffect.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System.Globalization;

namespace SadConsole.StringParser
{
/// <summary>
/// Clears the cell effect for the glyph.
/// </summary>
public sealed class ParseCommandClearEffect : ParseCommandBase
{
public int Counter;

public ParseCommandClearEffect(string parameters, ParseCommandStacks commandStack)
{
string[] parametersArray = parameters.Split(':');

if (parametersArray.Length == 1 && parametersArray[0] != "")
Counter = int.Parse(parametersArray[0], CultureInfo.InvariantCulture);
else
Counter = -1;

commandStack.TurnOnEffects = true;

// No exceptions, set the type
CommandType = CommandTypes.Effect;
}

public override void Build(ref ColoredGlyph glyphState, ColoredGlyph[] glyphString, int surfaceIndex,
CellSurface surface, ref int stringIndex, string processedString, ParseCommandStacks commandStack)
{
glyphState.Effect = null;

if (Counter != -1)
{
Counter--;

if (Counter == 0)
commandStack.RemoveSafe(this);
}
}
}
}
2 changes: 1 addition & 1 deletion templates/SadConsole.Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PackageType>Template</PackageType>
<PackageVersion>1.0.4</PackageVersion>
<PackageVersion>1.0.5</PackageVersion>
<PackageId>SadConsole.Templates</PackageId>
<Title>SadConsole Game Templates</Title>
<Authors>Thraka</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.0.1375-develop" />
<PackageReference Include="SadConsole" Version="8.99.2" />
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.0.1641" />
<PackageReference Include="SadConsole" Version="8.99.3" />
</ItemGroup>

</Project>

0 comments on commit ec2e117

Please sign in to comment.