Add preprint check logic, PDF generation functionality, and new print page to character creation tool XML

This commit is contained in:
Florian 2026-05-08 15:41:37 +02:00
parent cf1386466f
commit ecea5860b6
5 changed files with 47 additions and 3 deletions

View File

@ -210,5 +210,10 @@
<String Name="new_description"/>
</Variables>
</Group>
<Group Name="print">
<Variables>
<Bool Name="preprintcheck"/>
</Variables>
</Group>
</Groups>
</DataStructure>

View File

@ -36,5 +36,9 @@
</Actions>
<Return>[local.cost]</Return>
</Function>-->
<Function Name="charlib_checkpreprint">
<Return>true</Return>
</Function>
</Functions>
</Library>

View File

@ -3,5 +3,8 @@
<Function Name="charlib_midval">
<Return>Truncate(([param.0] + [param.1] + [param.2]) / 3)</Return>
</Function>
<Function Name="charlibcreate_checkpreprint">
<Return>true</Return>
</Function>
</Functions>
</Library>

View File

@ -0,0 +1,16 @@
<Pdf Name="charpdf">
<Styles>
<Style Name="main_table">
<BorderWidth>1</BorderWidth>
</Style>
</Styles>
<Pages>
<Page>
<Header></Header>
<Body>
<Label></Label>
</Body>
<Footer></Footer>
</Page>
</Pages>
</Pdf>

View File

@ -3941,9 +3941,9 @@
<Label>
<Text>"Description:"</Text>
</Label>
<StringInput>
<TextInput>
<Output>[data.character.magic.new_description]</Output>
</StringInput>
</TextInput>
<Empty/>
<Button>
<Text>"Hinzufügen"</Text>
@ -4175,5 +4175,21 @@
</BaseToListPicker>
</Content>
</Page>
<Page Name="print">
<OnOpen>
<Action>
<Do>charlib_checkpreprint() and charlibcreate_checkpreprint()</Do>
<Output>[data.character.print.preprintcheck]</Output>
</Action>
</OnOpen>
<Content>
<Label Visible="![data.character.print.preprintcheck]">
<Text>"Pre print check failed"</Text>
</Label>
<PdfGenerator Visible="[data.character.print.preprintcheck]">
<Pdf>"charpdf"</Pdf>
</PdfGenerator>
</Content>
</Page>
</Pages>
</Tool>