Make Addons menu transparent #376
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
This PR makes the Addons screen transparent.
Current:

After changes in this PR:

Why?
This is actually an indirect bugfix.
I noticed a bug with the Addons related to a recent change in commit c279f08. When you launch the game, select Addons, choose a level set you already have installed, and click "Start", it opens the level selection screen but with an incorrect background gradient:
I believe the bug is caused by the call
back_init("back/gui.png")in the functionpackage_enter. The background gradient gets set toback/gui.png, but it is not restored to the previous gradient when transitioning to the level selection screen.This could be solved directly while keeping the blue background in the Addons screen, but I wanted to propose this change as an alternative solution. The aesthetic change fixes the bug since clicking the "Addons" button no longer changes the background gradient.
I think it's up to your personal preference, @parasti, whether you like this aesthetic change or would rather keep the blue background in the Addons screen.
How?
This PR makes the function
package_paint()callshared_paint()instead ofback_draw_easy(). This is the same behavior as other states like the "set" state.Because
package.cbelongs inshare/, I couldn't useshared_paint()directly. Instead, I made a new functionpackage_set_paint_action()called bymain_init()insidemain.c. It uses the exact same pattern as thepackage_set_installed_action()function added in c279f08. (I probably could've chosen a better name.)package_enter()no longer callsback_init("back/gui.png").I added calls to
load_title_background(); game_kill_fade();to correctly load the title background when launching the game with the--linkoption.Those are all the changes.