Work on the ue wingman manual

This commit is contained in:
2026-04-13 22:51:35 -04:00
parent 34011e43d5
commit 07b90ced1a
4 changed files with 32 additions and 21 deletions

View File

@@ -12,16 +12,19 @@ class UWing_Documentation_Manual : public UWingHandler
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, meta=(Optional, Description="If specified, print only this section of the manual"))
UPROPERTY(EditAnywhere, meta=(Optional, Description="section of the manual"))
FString Section;
virtual void Register() override
{
UWingServer::AddHandler(this,
TEXT("Print the user manual."));
TStringBuilder<128> Docs;
Docs.Append(TEXT("Print a section of the manual. Valid sections: "));
WingManual::PrintSectionNames(nullptr, WingManual::GetSections(), Docs);
UWingServer::AddHandler(this, Docs.ToString());
}
virtual void Handle() override
{
TSet<FName> Sections = WingManual::GetSections();
if (Section.IsEmpty())
{
UWingManualSections::FetcherPaths();
@@ -34,10 +37,15 @@ public:
else
{
FName SectionName(*Section);
if (!WingManual::PrintSection(SectionName))
if (WingManual::PrintSection(SectionName))
{
WingOut::Stdout.Printf(TEXT("ERROR: Unknown manual section '%s'\nAvailable sections: "), *Section);
WingManual::PrintSectionNames(WingManual::GetSections());
WingOut::Stdout.Printf(TEXT("\n"));
WingManual::PrintSectionNames(TEXT("Other manual sections:"), Sections, WingOut::Stdout);
}
else
{
WingOut::Stdout.Printf(TEXT("Unknown manual section '%s'\n"));
WingManual::PrintSectionNames(TEXT("Valid manual sections:"), Sections, WingOut::Stdout);
}
}
}