Skip to content

Commit

Permalink
Merge pull request #351 from Thraka/vnext
Browse files Browse the repository at this point in the history
v10.4.1 release
  • Loading branch information
Thraka committed Jun 13, 2024
2 parents 38f7c5a + 7904a8a commit 3fdc6d1
Show file tree
Hide file tree
Showing 136 changed files with 7,128 additions and 1,193 deletions.
10 changes: 9 additions & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
"version": "2.2.1",
"commands": [
"InheritDoc"
]
],
"rollForward": false
},
"dotnet-mgcb": {
"version": "3.8.1.303",
"commands": [
"mgcb"
],
"rollForward": false
}
}
}
12 changes: 6 additions & 6 deletions MSBuild/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<DocumentationFile>$(AssemblyName).xml</DocumentationFile>

<!-- The current package versions -->
<SadConsole_Version>10.4.0</SadConsole_Version>
<SadConsole_Version>10.4.1</SadConsole_Version>
<SadConsole_Extended_Version>10.4.0</SadConsole_Extended_Version>
<SadConsole_Host_MonoGameWPF_Version>10.4.0</SadConsole_Host_MonoGameWPF_Version>
<SadConsole_Host_MonoGame_Version>10.4.0</SadConsole_Host_MonoGame_Version>
<SadConsole_Host_SFML_Version>10.4.0</SadConsole_Host_SFML_Version>
<SadConsole_Host_FNA_Version>10.4.0</SadConsole_Host_FNA_Version>
<SadConsole_Debug_MonoGame_Version>10.4.0</SadConsole_Debug_MonoGame_Version>
<SadConsole_Host_MonoGameWPF_Version>10.4.1</SadConsole_Host_MonoGameWPF_Version>
<SadConsole_Host_MonoGame_Version>10.4.1</SadConsole_Host_MonoGame_Version>
<SadConsole_Host_SFML_Version>10.4.1</SadConsole_Host_SFML_Version>
<SadConsole_Host_FNA_Version>10.4.1</SadConsole_Host_FNA_Version>
<SadConsole_Debug_MonoGame_Version>10.4.1</SadConsole_Debug_MonoGame_Version>

<!-- Author information -->
<Authors>Thraka</Authors>
Expand Down
151 changes: 151 additions & 0 deletions MiscCodeFragments/Layout/LayoutScreen.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Gum;
using Gum.Wireframe;
using RenderingLibrary;
using RenderingLibrary.Graphics;

namespace SadConsole.Layout;

public class LayoutScreen: ScreenObject
{
public LayoutScreen(GraphicalUiElement root)
{

}
}

public enum ObjectType
{
Surface,
AnimatedSurface,
Console,
ControlsConsole
}

public struct LayoutSettings
{
public string Name { get; init; }
public ObjectType ObjectType { get; init; }
}

public class LayoutElement :GraphicalUiElement
{

}

public class LayoutRenderable : IVisible, IRenderableIpso, IRenderable, IPositionedSizedObject, ISetClipsChildren
{
private ObservableCollection<IRenderableIpso> children = new ObservableCollection<IRenderableIpso>();

private float height;

private IRenderableIpso mParent;

public bool AbsoluteVisible
{
get
{
if (((IVisible)this).Parent == null)
{
return Visible;
}

return Visible && ((IVisible)this).Parent.AbsoluteVisible;
}
}

public BlendState BlendState => Gum.BlendState.NonPremultiplied;

public ObservableCollection<IRenderableIpso> Children => children;

ColorOperation IRenderableIpso.ColorOperation => ColorOperation.Modulate;

public bool ClipsChildren { get; set; }

public float Height
{
get
{
return height;
}
set
{
if (float.IsPositiveInfinity(value))
{
throw new ArgumentException();
}

height = value;
}
}

public string Name { get; set; }

public IRenderableIpso Parent
{
get
{
return mParent;
}
set
{
if (mParent != value)
{
if (mParent != null)
{
mParent.Children.Remove(this);
}

mParent = value;
if (mParent != null)
{
mParent.Children.Add(this);
}
}
}
}

public float Rotation { get; set; }

public object Tag { get; set; }

public bool Visible { get; set; } = true;


public float Width { get; set; }

public bool Wrap => false;

public float X { get; set; }

public float Y { get; set; }

public float Z { get; set; }

public bool FlipHorizontal { get; set; }

IVisible IVisible.Parent => Parent;

public void PreRender()
{
}

public void Render(ISystemManagers managers)
{
}

void IRenderableIpso.SetParentDirect(IRenderableIpso parent)
{
mParent = parent;
}

public override string ToString()
{
return Name;
}
}
14 changes: 7 additions & 7 deletions SadConsole.Debug.MonoGame/Debugger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public static bool IsOpened
/// </summary>
public static void BasicInit()
{
_imGui = new ImGuiMonoGameComponent(SadConsole.Host.Global.GraphicsDeviceManager, Game.Instance.MonoGameInstance, true);
_imGui = new ImGuiMonoGameComponent(SadConsole.Host.Global.GraphicsDeviceManager, (Microsoft.Xna.Framework.Game)Game.Instance.MonoGameInstance, true);
//_imGui.Font = "Roboto-Regular.ttf";
//_imGui.fontSize = 14f;

Game.Instance.MonoGameInstance.Components.Add(_imGui);
SadConsole.Game.Instance.MonoGameInstance.SadConsoleComponent.Enabled = false;
Host.Global.SadConsoleComponent.Enabled = false;

}

Expand All @@ -45,19 +45,19 @@ public static void Start()
_imGui.Visible = true;
_imGui.Enabled = true;

SadConsole.Game.Instance.MonoGameInstance.SadConsoleComponent.Enabled = false;
Host.Global.SadConsoleComponent.Enabled = false;
SadConsole.Settings.DoFinalDraw = GuiState.ShowSadConsoleRendering;

return;
}

SadConsole.Game.Instance.MonoGameInstance.SadConsoleComponent.Enabled = false;
Host.Global.SadConsoleComponent.Enabled = false;
SadConsole.Settings.DoFinalDraw = GuiState.ShowSadConsoleRendering;

//SadConsole.Game.Instance.MonoGameInstance.ClearScreenComponent.Visible = false;
//SadConsole.Game.Instance.MonoGameInstance.ClearScreenComponent.Enabled = false;

_imGui = new ImGuiMonoGameComponent(SadConsole.Host.Global.GraphicsDeviceManager, Game.Instance.MonoGameInstance, true);
_imGui = new ImGuiMonoGameComponent(SadConsole.Host.Global.GraphicsDeviceManager, (Microsoft.Xna.Framework.Game)Game.Instance.MonoGameInstance, true);
//_imGui.Font = "Roboto-Regular.ttf";
//_imGui.fontSize = 14f;
//ImGui.Theme = coolTheme;
Expand Down Expand Up @@ -91,8 +91,8 @@ private static void _imGui_HostClosed(object sender, EventArgs e) =>

public static void Stop()
{
SadConsole.Game.Instance.MonoGameInstance.SadConsoleComponent.Visible = true;
SadConsole.Game.Instance.MonoGameInstance.SadConsoleComponent.Enabled = true;
Host.Global.SadConsoleComponent.Visible = true;
Host.Global.SadConsoleComponent.Enabled = true;
SadConsole.Settings.DoFinalDraw = true;

//SadConsole.Game.Instance.MonoGameInstance.ClearScreenComponent.Visible = true;
Expand Down
26 changes: 26 additions & 0 deletions SadConsole.Debug.MonoGame/ImGuiSystem/ImGuiWindow.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using ImGuiNET;

namespace SadConsole.ImGuiSystem
{
Expand All @@ -16,5 +17,30 @@ public abstract class ImGuiWindow : ImGuiObjectBase

protected void OnClosed() =>
Closed?.Invoke(this, EventArgs.Empty);


public static bool DrawButtons(out bool result, bool acceptDisabled = false)
{
bool buttonClicked = false;
result = false;

ImGui.Separator();

if (ImGui.Button("Cancel")) { buttonClicked = true; }

// Right-align button
float pos = ImGui.GetItemRectSize().X + ImGui.GetStyle().ItemSpacing.X;
ImGui.SameLine(ImGui.GetWindowWidth() - pos);

ImGui.BeginDisabled(acceptDisabled);
if (ImGui.Button("Accept"))
{
buttonClicked = true;
result = true;
}
ImGui.EndDisabled();

return buttonClicked;
}
}
}
3 changes: 2 additions & 1 deletion SadConsole.Debug.MonoGame/ImGuiTypes/ImGuiGroupPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static void BeginGroupPanel(string name) =>
public static void BeginGroupPanel(string name, Vector2 size)
{
ImGui.BeginGroup();

ImGui.PushID($"panel_{name}");
var cursorPos = ImGui.GetCursorScreenPos();
var itemSpacing = ImGui.GetStyle().ItemSpacing;
var framePadding = ImGui.GetStyle().FramePadding;
Expand Down Expand Up @@ -129,6 +129,7 @@ public unsafe static void EndGroupPanel()

ImGui.Dummy(new Vector2(0.0f, 0.0f));

ImGui.PopID();
ImGui.EndGroup();
}
}
4 changes: 1 addition & 3 deletions SadConsole.Host.FNA/SadConsole.Host.FNA.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
<PackageId>SadConsole.Host.FNA</PackageId>
<PackageTags>sadconsole;fna;roguelike;cli;xna;game;development;console;ansi;ascii;textmode;dotnet</PackageTags>
<PackageReleaseNotes>
- Reversioned to follow new versioning scheme.
- Configuration namespace was moved to SadConsole directly. Only library specific config options are here now.
- Package contains all dependencies now.
Cursor rendering has changed to draw on the hosting surface. Previously it was rendered on top as an entire separate process.
</PackageReleaseNotes>
</PropertyGroup>

Expand Down
Loading

0 comments on commit 3fdc6d1

Please sign in to comment.