mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-18 05:59:03 +03:00
# Description Adds an auto-generated list of recipes to the guidebook. This was mostly made using the chemical list as a reference, so it's a bit shitcode-ey. # TODO - [X] Make less ugly (add paddings to table cells and fix colors) - [X] Fix sprites not working - [X] Unshitcode (if possible) <details><summary><h1>Media</h1></summary> <p> https://github.com/user-attachments/assets/597cbec1-7114-480b-ab8d-5ed9f8b2e0c3 </p> </details> # Changelog 🆑 - add: The "food recipes" page in guidebook now contains an automatically generated list of food recipes.
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using System.Diagnostics.CodeAnalysis;
|
|
using System.Linq;
|
|
using Content.Client.Guidebook.Richtext;
|
|
using Content.Client.Nutrition.EntitySystems;
|
|
using JetBrains.Annotations;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Client.UserInterface.XAML;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Client.Guidebook.Controls;
|
|
|
|
[UsedImplicitly, GenerateTypedNameReferences]
|
|
public sealed partial class GuideFoodGroupEmbed : BoxContainer, IDocumentTag
|
|
{
|
|
[Dependency] private readonly IEntitySystemManager _sysMan = default!;
|
|
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
|
|
|
public GuideFoodGroupEmbed()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
IoCManager.InjectDependencies(this);
|
|
MouseFilter = MouseFilterMode.Stop;
|
|
|
|
foreach (var data in _sysMan.GetEntitySystem<FoodGuideDataSystem>().Registry.OrderBy(it => it.Identifier))
|
|
{
|
|
var embed = new GuideFoodEmbed(data);
|
|
GroupContainer.AddChild(embed);
|
|
}
|
|
}
|
|
|
|
public bool TryParseTag(Dictionary<string, string> args, [NotNullWhen(true)] out Control? control)
|
|
{
|
|
control = this;
|
|
return true;
|
|
}
|
|
}
|