-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
ModBackground Rework #4156
Open
Lion8cake
wants to merge
18
commits into
tModLoader:1.4.4
Choose a base branch
from
Lion8cake:ModBackground-Rework
base: 1.4.4
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
ModBackground Rework #4156
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### What is the new feature? Remix hallow worldgen now is properly included in the Hardmode Good genpass that tmod adds. This also makes the Hardmode Evil also run in remix seeds aswell ### Why should this be part of tModLoader? This allows worldgen that relies on either one of the Hardmode Good and Hardmode Evil to be ran in remix seeds. ### Are there alternative designs? Not that I can identify, the current patch for the remix seed was a bad fix when porting tmodloader to 1.4.4 ### Sample usage for the new feature Made a new mod, make worldgen that relies on the Hardmode Good pass to run. Results on the remix seed
Changed/fixed the following: Renamed ModifyFarFades to ModifyStyleFade Added scale, parallax, topY and loopWidth to all choose texture hooks Added ChoseCloseMidTexture and ChooseCloseFarTexture Added PredrawBackground hook to both Surface and underground backgrounds Completely changed how Close Background is drawn Fixed height with the close background in the menu Fixed World Globe changing forest bgs when in modded biomes Added lava layer showcase in example mod Added CloseMid and CloseFar support in example mod This may require tmodporter stuff due to surface mod backgrounds having almost all of its hooks changed in some way.
Added BackgroundLayerParams struct
~~copied the ug background code from the enabled backgrounds hook because they were literally the same~~
fixed some random code getting removed in a commit
…ow for easier drawing
Closed
BasicallyIAmFox
suggested changes
Apr 9, 2024
Comment on lines
+5
to
+8
internal float* ScalePtr { get; init; } | ||
internal double* ParallaxPtr { get; init; } | ||
internal int* TopYPtr { get; init; } | ||
internal int* LoopWidthPtr { get; init; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to ref
fields/properties/whatever. Pointers are no longer needed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
(A while ago I cleaned up my forks to allow myself for easier forks for any new feature I wanted to add to tmodloader. This caused the last background rework to become closed as it used my 1.4.4 branch instead of its own.
This is a clone of #3889 )
What is the new feature?
This is a massive rework and change to ModSurface/UndergroundBackground. This contains both fixes to make modbackground easier to configure and edit as well as fixes to make this be on par with vanilla background drawing.
Why should this be part of tModLoader?
Currently ModSurfaceBackground has almost no customisability and when it does its only for the Close background stuff. Even the comment on the current close background texture hook mentions that whoever wrote the summary has no idea what half the parameters even do. Along with this, mod backgrounds are only limited to 3 layers (Far, Middle, Close) while vanilla has a maximum of 5.
This should make modding backgrounds easier and to allow those who want their backgrounds to have the same movement, styling, and height of vanilla bgs can do so.
Predraws have also been given to both the surface and underground background styles along allowing for extra drawing on top or in replacement of the mod background.
This also fixes World Globe changing forest backgrounds when in a mod biome.
Lastly this contains example mod additions to backgrounds to show how CloseMid and CloseFar work along with an extra part for the example mod underground transition between the lava and cavern layer.
Are there alternative designs?
A completely rewrite of the mod background. I’m not advanced enough to rewrite the background from scratch so someone more advanced may want to completely rewrite modbackground to do what i have done in addition with some additional content.
Sample usage for the new feature
Please see the following:
ExampleMod/Content/Biomes/ExampleSurfaceBackgroundStyle.cs
ExampleMod/Content/Biomes/ExampleUndergroundBackgroundStyle.cs