-
Notifications
You must be signed in to change notification settings - Fork 0
Code Explanation
There are a few important variables in the mod's module that are quite important to understand if you plan on forking, contributing, or adding compatibility for this mod.
Both of these is what the code refers to for replacing textures. Each one is just the path of a png file in any mod, but minus the ModName/Graphics/Atlases/Gameplay/ at the start of it. They absolutely HAVE to have the same length in order to work. Luckily, in most cases, it's pretty easy to tell if they're a different length.
This is a relatively simple array with each of the maps that have Art Spots. However, at the end of the map's GID, you're going to need to put either _Normal, _BSide, or _CSide, depending on whether your map is a B/C-Side or not. (In most cases, just choose _Normal.) For example, using Celeste's vanilla Chapter 1 A-Side would need me to do "Celeste/1-ForsakenCity_Normal", but the Chapter 8 C-Side would require "Celeste/8-Core_CSide".
This array has 3 layers. The first layer contains all of the levels, indexed by their order in hasArtSpots respectively. The second layer contains all of the Art Spots for that level. And the third just contains 5 integers, of which is the data of the Art Spot. An Art Spot looks like this: [x, y, width, height, texture index¹].
Similarly to textureNamespaces/textureReplaceNamespaces, this array is the path to a png file in any mod minus the ModName/Graphics/Atlases/Gameplay/ at the start of it. However, for convenience, it also removes the _x or _y at the end. This is because, for custom decals, all of the unreplaced decals have _x at the end, and all of the replaced decals have _y at the end. (This doesn't automatically add to textureNamespaces nor textureReplaceNamespaces automatically, so simply just add the file paths with _x/_y at the end to each one respectively!
Similarly to hasArtSpots, this array contains all of the maps that have custom decals. The naming convention with the _Something at the end is the same, too.
Similarly to how artSpots works, there are 3 layers to this array. The first layer contains all of the levels indexed by their respective hasCustomDecals order, the second layer contains all of the custom decals for the level, and the third contains the information for each decal. The custom decal internally looks like this: [x, y, width (usually just 1), height (usually just 1), layering², decal index³].
This one is a simple array with all of the graffiti-compatible characters. (This also includes the silhouette variants by including their SkinName from SkinModHelperConfig.yaml too.)
This array uses multiple of int[a,b] within. For each one, the code checks if the texture of index¹ a is replaced, and if it is, it also replaces the texture of index¹ b.
This array is directly tied to the index of textureNamespaces/textureReplaceNamespaces, and each entry in that array has an entry in this one too. This is the reason that textures added via Interop are currently unavailable.
¹ - The texture index this refers to is the index in textureNamespaces and textureReplaceNamespaces.
² - The "Layer" is either Background, Foreground, or Super Foreground, which corresponds to numbers 0, 1, and 2 respectively. Background is the default, being behind the player, Foreground is for most Dream Block Graffiti, being in front of Dream Blocks but not everything, and Super Foreground is in front of everything except for FG effects.
³ - The decal index this refers to is the index in decalNamespaces.