diff --git a/.nuget/README.md b/.nuget/README.md index 35a21d56..03a91c98 100644 --- a/.nuget/README.md +++ b/.nuget/README.md @@ -91,6 +91,7 @@ NetAF provides frames for rendering the various game screens. These are fully ex * Game over frame. * Transition frame. * Conversation frame. + * Visual frame. ### Maps Maps are automatically generated for regions and rooms, and can be viewed with the **map** command: diff --git a/NetAF.Examples/Assets/Regions/Everglades/Rooms/ForestEntrance.cs b/NetAF.Examples/Assets/Regions/Everglades/Rooms/ForestEntrance.cs index 6a6fc338..ece53efb 100644 --- a/NetAF.Examples/Assets/Regions/Everglades/Rooms/ForestEntrance.cs +++ b/NetAF.Examples/Assets/Regions/Everglades/Rooms/ForestEntrance.cs @@ -1,4 +1,7 @@ using NetAF.Assets.Locations; +using NetAF.Commands; +using NetAF.Examples.Assets.Regions.Everglades.Visuals; +using NetAF.Logic.Modes; using NetAF.Utilities; namespace NetAF.Examples.Assets.Regions.Everglades.Rooms @@ -20,7 +23,16 @@ internal class ForestEntrance : IAssetTemplate /// The asset. public Room Instantiate() { - return new(Name, Description, [new Exit(Direction.North)]); + return new(Name, Description, [new Exit(Direction.North)], commands: + [ + new(new("Look", "Look around the area."), true, true, (g, a) => + { + var frame = new ForestEntranceVisualFrame(Name, g.Configuration.DisplaySize).Instantiate(); + g.ChangeMode(new DirectRenderMode(frame)); + return new(ReactionResult.GameModeChanged, string.Empty); + }) + ]); + } #endregion diff --git a/NetAF.Examples/Assets/Regions/Everglades/Visuals/ForestEntranceVisualFrame.cs b/NetAF.Examples/Assets/Regions/Everglades/Visuals/ForestEntranceVisualFrame.cs new file mode 100644 index 00000000..b0844db5 --- /dev/null +++ b/NetAF.Examples/Assets/Regions/Everglades/Visuals/ForestEntranceVisualFrame.cs @@ -0,0 +1,110 @@ +using NetAF.Assets; +using NetAF.Extensions; +using NetAF.Rendering; +using NetAF.Rendering.Console; +using NetAF.Rendering.Console.FrameBuilders; +using NetAF.Utilities; + +namespace NetAF.Examples.Assets.Regions.Everglades.Visuals +{ + internal class ForestEntranceVisualFrame(string name, Size size) : IAssetTemplate