Work on the ue wingman manual
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user