Skip to content

Code Explanation

Repeat edited this page May 23, 2024 · 11 revisions

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.

Textures

textureNamespaces/textureReplaceNamespaces

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.

Art Spots

hasArtSpots

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

artSpots

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¹].

Custom Decals

Miscellaneous

graffitiUsers

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

alsoReplace

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.

Key

¹ - (The texture index this refers to is the index in textureNamespaces and textureReplaceNamespaces.)

Clone this wiki locally