User talk:Leaftenant/Wand-With-Custom-Styling

From Noita Wiki
Jump to navigation Jump to search

Oh hey, I just spotted this on one of the category pages. I'm doing some work to improve the Wand/Wand Card templates - if more support for custom-styling within them is of interest it'd be pretty easy to add 'style' parameters in :) (A way to show spell groupings/multicast/etc. in examples would be pretty sweet!) -flowsINtomAyHeM (talk) 18:38, 6 June 2023 (UTC)

This would definitely be cool! I was hoping to use this sort of spell grouping annotation for Requirement#Advanced. I think I had a limited version working, allowing changing of the dotted line borders around each spell after setstyle<n>= commands, in around this revision (I assume preview doesn't work properly for templates), if it'd be of use. However:
  • This probably didn't have the best performance; it puts a style= inside every spell card element, even for empty style strings, and copying "real" styling strings a bunch of times.
  • I was hoping to be able to draw boxes and/or underlines around the groups instead / in addition to the above, so was playing around moving the restyling from the spell elements to divs/spans wrapping around the existing spell card elements. That seems more likely to eventually work (without gaps in the boxes/underlines between spells), but introduces some spacing, alignment, and CSS questions&issues that I haven't been able to research yet. Current version is just broken experimentation. Plus, I'm not sure setstyle<n>= would be the best interface for drawing boxes around spell groups; looks like it'd involve (i) long style setting for first spell in group, (ii) long style setting for second spell in group (applied through the penultimate spell), (iii) long style setting for last spell in group, and (iv) setting extra styling back to empty.
Looking forward to seeing whatever you come up with, or if there's a way I can contribute. Leaftenant (talk) 07:43, 7 June 2023 (UTC)
I wouldn't worry too much about performance using inline styles for this, unless we had hundreds of wands per page :) I'll have a play with this idea when I've finished converting the wand template to use spell IDs (which is going to make it so much nicer). Using grouping boxes with the Requirement demos is a great idea - showing casting groups would also be great for examples. -flowsINtomAyHeM (talk) 16:07, 7 June 2023 (UTC)