Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple possible loading screens, including from mods #76362

Merged
merged 3 commits into from
Sep 14, 2024

Conversation

RenechCDDA
Copy link
Member

@RenechCDDA RenechCDDA commented Sep 11, 2024

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

Mods can define a new loading_images in their modinfo.json which allows them to specify one (or more!) possible loading images. All loaded mods for the world will have all their images put into a list, and one image will be randomly picked from the list.

If any mods define a loading screen image (and that image can actually be found), it will always pick from one of the mod images. Otherwise it will use the default loading screen.

Add a new default mod to showcase and handle our extra loading screens. Brings back the loading screen by @db48x and adds it into the pool of possible picks. Because of the way this works, a copy of our current loading screen by @vetall812 (at gfx/cdda.png) has also been added to the mod.

Describe alternatives you've considered

The default/fallback loading screen could be a blank, transparent image so cdda.png isn't duplicated. But eh, it's nice to have a default one so why not.

Testing

image

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.

I would like to add some sort of conditions or maybe a setting to change between a person's desired loading screen.

@github-actions github-actions bot added Info / User Interface Game - player communication, menus, etc. [JSON] Changes (can be) made in JSON Mods Issues related to mods or modding [C++] Changes (can be) made in C++. Previously named `Code` labels Sep 11, 2024
@Srcwya
Copy link

Srcwya commented Sep 11, 2024

Yes please

@github-actions github-actions bot added <Enhancement / Feature> New features, or enhancements on existing astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Sep 11, 2024
@CLIDragon
Copy link
Contributor

Fixes #76268.

@PatrikLundell
Copy link
Contributor

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.

@RenechCDDA RenechCDDA force-pushed the modded_loading_screens branch from 24312ae to 57e35ad Compare September 13, 2024 07:51
@RenechCDDA
Copy link
Member Author

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?

@RenechCDDA RenechCDDA force-pushed the modded_loading_screens branch from 57e35ad to eac8dc1 Compare September 13, 2024 09:25
@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [Markdown] Markdown issues and PRs labels Sep 13, 2024
@RenechCDDA
Copy link
Member Author

@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.

@db48x
Copy link
Contributor

db48x commented Sep 13, 2024

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.

@RenechCDDA
Copy link
Member Author

We should definitely make sure that's the case and Kevin/possible other rights holder allows it before this gets merged, then.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Sep 13, 2024
@RenechCDDA RenechCDDA force-pushed the modded_loading_screens branch from eac8dc1 to 91b7708 Compare September 13, 2024 11:12
@github-actions github-actions bot added the <Bugfix> This is a fix for a bug (or closes open issue) label Sep 13, 2024
@RenechCDDA RenechCDDA force-pushed the modded_loading_screens branch from 91b7708 to 8f5f962 Compare September 13, 2024 11:43
@RenechCDDA
Copy link
Member Author

RenechCDDA commented Sep 13, 2024

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.

@RenechCDDA RenechCDDA force-pushed the modded_loading_screens branch from 8f5f962 to 8d629e5 Compare September 13, 2024 11:50
@github-actions github-actions bot added SDL: Tiles / Sound Tiles visual interface and sounds. Monsters Monsters both friendly and unfriendly. labels Sep 13, 2024
@RenechCDDA RenechCDDA force-pushed the modded_loading_screens branch from 8d629e5 to 4804282 Compare September 13, 2024 11:56
@RenechCDDA RenechCDDA force-pushed the modded_loading_screens branch from 4804282 to 8b0b2e8 Compare September 13, 2024 11:57
@RenechCDDA
Copy link
Member Author

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).

@RenechCDDA RenechCDDA marked this pull request as ready for review September 14, 2024 04:41
@Holli-Git
Copy link
Contributor

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

@RenechCDDA
Copy link
Member Author

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.

@Maleclypse Maleclypse merged commit 384b356 into CleverRaven:master Sep 14, 2024
26 checks passed
@RenechCDDA RenechCDDA deleted the modded_loading_screens branch September 14, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. <Enhancement / Feature> New features, or enhancements on existing Info / User Interface Game - player communication, menus, etc. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Mods Issues related to mods or modding Monsters Monsters both friendly and unfriendly. SDL: Tiles / Sound Tiles visual interface and sounds.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Have More Than 1 Loading Screen
7 participants