Closed nealxm closed 2 months ago
you could make min = -1 to use for auto, although then you can't use the field (but it seems to be only used for thread priority anyway)
-1 made sense to me too yeah. the only issue i found with that is the annotation above the backgroundPreviews
declaration is for whole numbers only. is there another annotation for integers? i wasn't able to find it
it's just an int, long, and short wrapper, I'm pretty sure it works for negative numbers... https://github.com/KingContaria/SpeedrunAPI/blob/master/src/main/java/org/mcsr/speedrunapi/config/option/WholeNumberOption.java. maybe best to ask contaria.
i see, thanks for the help! you're right it works fine subbing -1 for 0. my fault i didn't think the whole number annotation would take integers
i was working on it 🙄
This branch has everything i've done so far
Using rows x columns is not a reliable way of getting the main groups size, since resourcepacks can override that.
Instead SeedQueueConfig#getBackgroundPreviews
could return an Optional
and if it's set to AUTO it returns Optional#empty
. This would then tell the wall screen to calculate the background previews using the data available through SeedQueueWallScreen#layout
.
That would also allow for including the size of the preparing group in the formula like i suggested in the issue
Also justin is right, -1 will work
thanks for your feedback! was working on this a bit with @Crystal15118 and i think this is a step in the right direction. i think it can be done with only SeedQueueWallScreen#getBackgroundPreviews
without the use of Optional
& SeedQueueConfig#getBackgroundPreviews
but i wanted to include that since was suggested
i added the new process for getting the sensible value and also cleaned up the rest of my edits so it doesn't require the use of Optional
anymore. hope this is better!
Lgtm, only thing left to discuss is if the option should be renamed internally to reset all users to AUTO, opinions are welcome
Please rename backgroundPreviews
(just the field, not the method in SeedQueueWallScreen
) to reset everyones option to Auto. I'd recommend preparingPreviews
just because it's consistent with the preparing group in custom layouts.
should be good to go!
a start on resolving #46
for all the other configurations, 0 is used for the auto state. currently this follows that convention for consistency. but i was wondering if 0 might be a state you want to preserve since having 0 background previews may be desirable for lower end hardware.