Allow multiple possible loading screens, including from mods
Summary
Features "Allow multiple possible loading screens, including from mods"
Purpose of change
People would like alternate loading screens.
Describe the solution
Just do that
extremely WIP
Describe alternatives you've considered
Testing
Additional context
Currently this picks randomly, which may not be desirable. There is no way to weight the choices either, it's just pure random.
Currently it checks every folder in the /mods/ directory, regardless of whether or not the mod is enabled, or obsolete, etc.
-Also it only accepts the filename cdda.png, and if your mod wants to ship more than one it would have to put them in subfolders, if that works at all
I would like to add some sort of conditions or maybe a setting to change between a person's desired loading screen
Yes please
Fixes #76268.
The "obvious" solution is JSON, i.e. a new JSON structure for loading screens with fields such as:
- file: the relative path of the image file. An alternative would be just a file name, with the folder being a fixed one (relative to the base game or mod), e.g. load_screens.
- weight: the weight value for the selection process, with 0 to disable it (if a mod wants to remove vanilla screens, assuming mod overload is supported).
- optional start and end time: for seasonal screens.
- optional game start and end time?: don't know if that would be possible, as it would require delaying the screen display until the start of the loading process, and the game date being the stuff that had to be read first. Could allow for date/time only for seasonal screens, or full date for progress based screens.
The "obvious" solution is JSON, i.e. a new JSON structure for loading screens with fields such as:
- file: the relative path of the image file. An alternative would be just a file name, with the folder being a fixed one (relative to the base game or mod), e.g. load_screens.
- weight: the weight value for the selection process, with 0 to disable it (if a mod wants to remove vanilla screens, assuming mod overload is supported).
- optional start and end time: for seasonal screens.
- optional game start and end time?: don't know if that would be possible, as it would require delaying the screen display until the start of the loading process, and the game date being the stuff that had to be read first. Could allow for date/time only for seasonal screens, or full date for progress based screens.
Currently I've grafted it into modinfo.json. It searches the entire mod folder and subfolders for files matching that filename. This could be easily be made more restrictive/permission if needed, but I feel that exact filename matching gives plenty of control to the mod authors while not leaving any possibility for accidents.
Still no weighting/conditionals for the moment. I feel like that could wait for a future PR, to see if there are any mods that do want it. No point writing it if nobody uses it, right?
@db48x @vetall812 Courtesy notification, hope neither of you minds. As detailed in the summary, both of your loading screens have been folded into the alternate_loading_screens default mod, and may appear when that mod is enabled. Images were committed separately with your authorships.
The fallback/default loading screen without this mod remains the one by vetall812.
I certainly don't mind, but I will point out that the image you are attributing to me is not mine in any sense of the word.
I’m terrible at most artistic stuff, so when I added an image to the loading screen I started with a random image I had in my home directory. Once I got it working I did a quick search for images on Google, and didn’t find much. I rejected the image on the website since it’s a screenshot and might have been confusing. The only other things I found were title cards for some Let’s Play video series on Youtube, and the image I settled on which came from the Kickstarter campaign page. I assume @kevingranade made it, but I didn’t ask.
We should definitely make sure that's the case and Kevin/possible other rights holder allows it before this gets merged, then.
Until that copyright stuff can be resolved I force pushed the commits out of existence, just to prevent any accidental merges or other potential problems. For Kevin's/other readers' sake, this is the image in question:
https://github.com/db48x/Cataclysm-DDA/blob/c949b58736e1151cdcf73d24a93bc6c36fe25811/gfx/cdda.png
Other than re-adding the images and adjusting the filenames, this should be good to go.
You know what? We don't NEED this new mod. Let's just get support for it out the door, and then we can come back to make the mod later (like if we get more proposals for loading screen images).
You know what? We don't NEED this new mod. Let's just get support for it out the door, and then we can come back to make the mod later (like if we get more proposals for loading screen images).
So would a PR adding more loading screens just re-add the mod you made, or is there something else needed? Because IIRC we have 3 more, srcwyas, Candleburies, and mine
You know what? We don't NEED this new mod. Let's just get support for it out the door, and then we can come back to make the mod later (like if we get more proposals for loading screen images).
So would a PR adding more loading screens just re-add the mod you made, or is there something else needed? Because IIRC we have 3 more, srcwyas, Candleburies, and mine
I'm not aware of any of those. I only had vetal's and the one that db48x committed.