From 367cdfd439f78fb86d146cd9ce4684e948ff7070 Mon Sep 17 00:00:00 2001 From: 12rabbits <53499656+12rabbits@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:06:54 -0700 Subject: [PATCH] Make guidebook remember where you left off (#31375) * Guidebook tracks last read entry * Persistent guidebook fixes * Persistent guidebook requested changes * Update Content.Client/UserInterface/Systems/Guidebook/GuidebookUIController.cs --------- Co-authored-by: Pieter-Jan Briers --- .../Guidebook/Controls/GuidebookWindow.xaml.cs | 4 ++++ .../Systems/Guidebook/GuidebookUIController.cs | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Content.Client/Guidebook/Controls/GuidebookWindow.xaml.cs b/Content.Client/Guidebook/Controls/GuidebookWindow.xaml.cs index 469b0ed222..de06d85bb0 100644 --- a/Content.Client/Guidebook/Controls/GuidebookWindow.xaml.cs +++ b/Content.Client/Guidebook/Controls/GuidebookWindow.xaml.cs @@ -23,6 +23,8 @@ public sealed partial class GuidebookWindow : FancyWindow, ILinkClickHandler private readonly ISawmill _sawmill; + public ProtoId LastEntry; + public GuidebookWindow() { RobustXamlLoader.Load(this); @@ -90,6 +92,8 @@ public sealed partial class GuidebookWindow : FancyWindow, ILinkClickHandler _sawmill.Error($"Failed to parse contents of guide document {entry.Id}."); } + + LastEntry = entry.Id; } public void UpdateGuides( diff --git a/Content.Client/UserInterface/Systems/Guidebook/GuidebookUIController.cs b/Content.Client/UserInterface/Systems/Guidebook/GuidebookUIController.cs index 03ea47827f..702b0a52ac 100644 --- a/Content.Client/UserInterface/Systems/Guidebook/GuidebookUIController.cs +++ b/Content.Client/UserInterface/Systems/Guidebook/GuidebookUIController.cs @@ -30,6 +30,7 @@ public sealed class GuidebookUIController : UIController, IOnStateEntered UIManager.GetActiveUIWidgetOrNull()?.GuidebookButton; + private ProtoId? _lastEntry; public void OnStateEntered(LobbyState state) { @@ -142,7 +143,10 @@ public sealed class GuidebookUIController : UIController, IOnStateEntered() @@ -193,6 +195,17 @@ public sealed class GuidebookUIController : UIController, IOnStateEntered