bullseye555 / scoreboard

CRG Derby Scoreboard
Other
0 stars 0 forks source link

[FEATURE REQUEST] - Add the Thom Grimes Slideshow as native functionality #1

Open bullseye555 opened 1 year ago

bullseye555 commented 1 year ago

@frank-weinberg - Dropping this one in here, as it's something I'd like some assistance on but thought it'd be worthwhile keeping of the main repository until it's ready to go in

After a user in the FB group asked for some help with the Thom Grimes slideshow (that hasn't been maintained since CRG 3-point-something), I did some quick updates so that it would work with 5.x and thought this would be useful to have as base functionality with a some extensions

  1. Ability to set the sort order (this was originally suggested by the person that made the original help request
  2. Ability to vary the time between image changes (eg: each rotation is 8 seconds; not the gap between image 1 & 2 is 15 seconds, and between image 2 & 3 is 5 seconds, etc)
  3. Consistency with existing Image & Video Scaling selecatbility
  4. Extend functionality so that instead of being a purely Intermission function, it can be used as a display screen (eg: it can be on a screen in the foyer of a venue, showing entry cost, sponsor logos, other messages etc, while being able to see a condensed version of the scoreboard for the on-going game - yes, this could be expanded many times over, but I think for 99% of use cases this will be sufficient. Anyone else that wants to get "cute" will use things like Raspberry Pi's etc to achieve their desired result)

I've done a chunk of the work to get this as a native screen [Hyperlink on the Index Page, choose-able as a Main Display view], however there are a couple of issue's I'm having and hoping you can point me in the right direction(s)

  1. I've been able to create the Rotate Time option and have it generate into the JSON when edited (the Sort Order would be same concept, as the Object Fit, so I know it's possible - I just haven't put it in) but I'm having issues in extracting the Rotate Time value. I've tried using WS.state but it doesn't appear to grab all of the values (even if I change the WS name to be similar to something it's already pulling, it doesn't automatically grab it, and I can't seem to find where to add it as one of the list of values it does return)
  2. I haven't been able to get the Object-Fit CSS update to function as expected... every time I add in the WS.Register... it doesn't make any change to how the images are actually being displayed [using the WS.Register... that's in /views/standard/index.js as my starting base]
  3. For the Rotate Time & Object-Fit I haven't worked out how to set a default value for these? There doesn't seem to be anything in the JS script (at least, not that stood out to me) - is this buried in the JAVA code that is complied? [I've found the Overlay Scaling being set in there, but couldn't seen any references to ImageScaling being set to use it as a reference point]
  4. Lastly, the sort order - it looks like it's using (at least from the sample below) the order the Array is built in, but I haven't had any luck in being able to change the Array build sort order

image

I've been working on building this on & off since about 5.0.9 or 10, and have merged it over into v2023.2 base today (and spent literally all afternoon today making tweaks and trying to work on the above 3 pain-points

Hoping you can (and are willing) to point me in the right directions. I'm not expecting you to go through and make the updates, I'm happy to do that, just need some understanding of where to start

Edit: I have an instance of this running too - if you want to see it, let me know and I'll put the IP & Port in a new comment, then delete it so it doesn't stay publicly available

~Bullseye

frank-weinberg commented 1 year ago
  1. As is this has zero chance of going into the main repository as it essentially duplicates the main display, which makes it annoying to maintain.

  2. In order for a key to show up in WS.state, you need to add it (or a wild card key covering it) via a call to WS.Register. (And then wait for the value to actually be sent over from the backend.)

  3. The css update needs to be applied to the corresponding img tag. If you follow the ImageScaling or VideoScaling code directly, it would apply it to the iframe instead.

  4. Default values for settings are set in src/com/carolinarollergirls/scoreboard/core/admin/SettingsImpl.java

  5. The sort function is in line 49 of html/views/slideshow/index.js - try a.Name and b.Name instead of a.Id and b.Id

  6. In line 219 of settings-tab.js you have a typo: ScoreBoardOprtions

bullseye555 commented 6 months ago

Thanks for the response @frank-weinberg Finally getting back to this...

To point 0 - There's been some interest in something like this raised in the FB group over the last few months, so having (while not maybe this version specifically, but something that they can run a slideshow on that's not the sponsor banners would be a good QoL improvement)

Thanks for Point 5, fixed!

I've been playing with point 4 (sorting) and this looking like it's not just an issue with the sort in here - looking at the Sponsor Banner, it doesn't appear to be adhering to the sort order either Array output from Slideshow (this was told to be sorted on Name = Name image

Array output from Standard view (this was told to be sorted on Id = Id image Let me know if you want this raised as a bug due to unexpected behaviour (It would be good to have an expected sort order for Sponsor Banners, incase sponsors need to be displayed in a particular order)