Open the guidebook when people with less than an hour playing join the round (#28774)

* Open the guidebook when people with less than an hour playing join the round

* Filter for gameplayState

* Fix tests

* tweaks

* saltern update (#28773)

Co-authored-by: deltanedas <@deltanedas:kde.org>

* Fix admin menu objects list (#28787)

* Make `MakeAntag()` log errors instead of throwing exceptions (#28771)

Make `MakeAntag()` log errors instead of throw

* add default page support for the guidebook (#28772)

* Probably a better way to handle this

---------

Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
This commit is contained in:
AJCM-git
2024-06-09 12:26:48 -04:00
committed by GitHub
parent c549573f7a
commit 346ac44a28
5 changed files with 23 additions and 22 deletions

View File

@@ -18,8 +18,6 @@ namespace Content.Client.Guidebook.Controls;
[GenerateTypedNameReferences]
public sealed partial class GuidebookWindow : FancyWindow, ILinkClickHandler
{
[Dependency] private readonly IConfigurationManager _configuration = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IResourceManager _resourceManager = default!;
[Dependency] private readonly DocumentParsingManager _parsingMan = default!;
@@ -38,20 +36,6 @@ public sealed partial class GuidebookWindow : FancyWindow, ILinkClickHandler
};
}
protected override void Opened()
{
base.Opened();
var guideProto = _configuration.GetCVar(CCVars.DefaultGuide);
if (_prototypeManager.TryIndex<GuideEntryPrototype>(guideProto, out var guideEntry))
{
if (Tree.Items.FirstOrDefault(x => x.Metadata is GuideEntry entry && entry.Id == guideProto) is { } item)
Tree.SetSelectedIndex(item.Index);
else
ShowGuide(guideEntry);
}
}
private void OnSelectionChanged(TreeItem? item)
{
if (item != null && item.Metadata is GuideEntry entry)