mirror of
https://github.com/ArnoldSmith86/virtualtabletop.git
synced 2026-03-02 22:57:02 -05:00
Improve access to images on cardTypes #599
Labels
No labels
PCIO compatibility
Validator
automated testing
bug
documentation
duplicate
editor
enhancement
enhancement
library
library
maintenance
needs legacy server
pile related
reported client crash
routine operations
user interface
widget properties
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/virtualtabletop#599
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @96LawDawg on GitHub (Nov 14, 2022).
While building a complex deck that had a bunch of individual cards, I found myself reusing the same images over and over. It would be nice to have an internal reference on the deck for those images. This would help in 2 areas. First, it would allow for an easy reference by a readable name rather than a bunch of numbers. Second if you want to replace an image (because there was an error or the color isn't just quite right) after you've built a bunch of cards, you only need to replace it in one place rather than 170.
Examples.
Current cardType:
Proposed cardType:
Then, in the second example, the deck would contain properties that contain the information for the image to be used. Change the property and it changes all the cards at once.
@flackr commented on GitHub (Nov 14, 2022):
Sounds like a good idea. We'll have to make sure there's no infinite loops of property references (which shouldn't be too hard, just need to track if we ever visit the same node twice in the same recursive expansion of properties. I'm torn about whether this should be
${PROPERTY food1}or${food1}given that in this context there is no access to local variables. This is why in my PR #1407 I just used${propertyName}to refer to other properties from thevalueproperty.@96LawDawg commented on GitHub (Nov 14, 2022):
${food1}is even better. You know how many times I'm mistyped "PROPERTY"?@96LawDawg commented on GitHub (Nov 14, 2022):
One thing that we would have to be careful about is other widgets looking at that property.
For example, if you had a “dropTaget”: “${food1}” the holder probably would not be able to look into the deck to see what that actually is. So the dropTarget would need to still list the specific asset/123456 etc location.
That doesn’t mean we shouldn’t do this. It is just a limitation of the engine that we will have to be aware of.
@ArnoldSmith86 commented on GitHub (Nov 14, 2022):
food1intocardDefaults. (I realize that that only solves a fraction of the use cases.)@96LawDawg commented on GitHub (Jul 10, 2023):
Possible (complicated) work-around using css ::after demonstrated at https://discord.com/channels/770758631146782780/793626590848352306/1128131279095857232
@mousewax commented on GitHub (Jul 11, 2023):
I did proof of concept based on the conversation @96LawDawg linked.
https://virtualtabletop.io/8t5h
It has a corner that uses images, one that uses plain text, one that uses emoji, and one that uses material icons.
@96LawDawg commented on GitHub (Jul 11, 2023):
Thank you! I added this (calling it Card Images with CSS Classes) to https://virtualtabletop.io/DemoLibrary. If there is anything in the explanation you want to add or clarify, let me know.