Conversation
|
I don't dislike the PR, but I was always picturing people using templates for this, like I did on the Ender-Rift manual: https://github.com/gigaherz/Ender-Rift/blob/master/src/main/resources/assets/enderrift/xml/book.xml#L3 |
|
Interesting. I wanted to see if I could support more interactive features within the book such as spin, z-layer hiding via a slider, and an option to view both expanded and compacted. To do this, I was thinking of rendering in 3d and then translating to screen space via transforms. What do you think about these features? |
Working system Known issues: redstone connection, redstone color, grass color, everything marked TODO
And things and javadocs and comments
Oops never answered to this: Yeah I do like it. It's quite a lot more interesting than just a static template, even if it deviates from the "pseudo-html" that I originally had in mind. |
Features (Some Still WIP)
Adds the new
<multiblock>tag which represents aMultiblockPanelelement and allows guidebook authors to display a multiblock structure:structureattribute, an array of resource locations can be specified that point to*.nbtstructure files within the folderassets/<domain>/structures/MultiblockComponents, each of which represents one object in one position within the multiblock structureBlockComponentextensions can be registered via aFactorysystem in order to correctly display non-standard blocks, such as fluids (as is done withBlockFluidComponent) and tile-entitiestransformationattribute, a translation, scale, and/or rotation/quaternion can be specified to offset, scale, and/or rotate the structuretransformation="t[-1,-1.35,-1] q[0,1,0,0] s[0.9]"specifies:-xby1, down-yby1.35, and towards-zby1180°about they-axis0.9heightattribute, authors specify the target height that the guidebook is rendered to. Note that this height is not used toGL_SCISSORor anything that creates a viewport; it exists only for spacing and it is up to the author to ensure the structure fits withinexpansionandcollapsingmode, allows users to view the multiblock structure in both an "exploded" and "condensed" state, as is shown in thegifs belowMultiblockComponents, the component under the user's cursor becomes highlighted and a descriptive tooltip of the component's contents is displayed (as is shown in one of the images below)floorattributeItemComponents. This behavior is specified via thepolesattribute<multiblock>tag, additional tags can be nested as follows:MultiblockComponent,ParsableMultiblockComponentprovides a way to register parsing factories (calledParsers) for custom multiblock components that are specified viaXML, such asItemStacksItemComponentparses a<stack>node similar to how normalStackelements are parsed within guidebooks, except it includes two additional attributes:position, which is an attribute for allParsableMultiblockComponents and specifys the component's position within the multiblock structuretransformation, which allows authors to specify render transformations and is described aboveExample
Produces the following multiblock:
In addition, a mouseHover system is in the works, with the current iteration appearing as follows:
Tasks
BlockimplementationClasses to customBlockComponentimplementationsBlockComponents would be able to correctly parse theIBlockStateand render the correct models for connecting blocks (which for some reason doesn't happen)ItemStackrenderingMultiblockComponents from the child elements of the<multiblock>nodeMultiblockComponenttype and the ray-tracing needed for itList<>instead of anotherMultiblockComponent[][][]matrix)javadocdocumentationoffsetandinitialRotto aninitialTransformattribute which parses aTRSRTransformation