any2cards / gloomhaven

All of the JSON data files and card images that the GCV utilizes for Gloomhaven
180 stars 59 forks source link

Conflict between JotL and GH Card Viewer Extensions #13

Closed fifguy85 closed 3 years ago

fifguy85 commented 3 years ago

Not sure how "fixable" this bug is (as I know there are other issues with multiple GH-universe card viewers acting on a single page), but thought it worth mentioning.

The string "Twin Restoration" is evaluating only as the "Restoration" JotL Monster Attack Modifier card, and not for the Spellweaver level 7 card "Twin Restoration". Each card viewer works correctly independently, but somehow JotL is getting precedence. I would've expected both to try to render (as has happened with other keywords shared across card viewers, but that appears to not be the case.

https://boardgamegeek.com/thread/2623615/spellweaver-summoner-build Chrome: Version 83.0.4103.116 (Official Build) (64-bit)

any2cards commented 3 years ago

I use Chrome (Version 89.0.4389.90 (Official Build) (64-bit)). I have the GCV loaded first (left most icon showing), then the JCV loaded second. When I hover over "Twin" of "Twin Restoration, it shows the Spellweaver card. When I hover over "Restoration" of Twin Restoration, it shows the JOTL monster ability card. Have you tried this?

As for precedence, it depends on the order that the card viewers are loaded into Chrome. I would appreciate if you could test with your install with the instructions above, and tell me what behavior you see.

fifguy85 commented 3 years ago

Yup, that does it now. When I have it load GH first, hovering over "Twin" shows Twin Restoration, but "Restoration" shows only the monster modifier. Vice versa, only the "Restoration" is highlighted by JotLCV, and Twin doesn't work.

Incidentally, it looks like Chrome updated when I went to "About" and now I'm also running: Version 89.0.4389.90 (Official Build) (64-bit)

any2cards commented 3 years ago

FYI ... there is an actual logical reason for this, although I wish it wasn't this way. When all of the JSON code is read in for all of the various card types, part of my code specifically looks to match longer strings first, and then shorter strings. This is to avoid issues with things like "Giant" versus "Jolly Green Giant". I want Jolly Green Giant to be seen different from just Giant. This was all well and good when there was only a single card viewer. In fact, originally, the card viewer for Forgotten Circles was separate from Gloomhaven, but I ended up integrating it into Gloomhaven because of this and other issues.

Then, when JotL came out, and then eventually Frosthaven, I needed to make them separate viewers for multiple reasons. Now we run into different issues.

There is actually a list of things I would like to do with these card viewers, but I am FAR FAR from an expert on JS, Web Programming, etc. And at 79 years old, I really don't want to try teaching myself new tricks. I have reached out to younger, more flexible minds with the proper skills, but nobody has wanted to help, unless they are paid. Oh well.

fifguy85 commented 3 years ago

Yup, I hear that. Being in the technology space (IT App Support for a University), I definitely understand. Perhaps someone else will eventually come along and want to collaborate. Until then though, thank you so much for the continued support to keep these working. They're a godsend for this small little niche of our hobby. :)