Skip to content

Commit

Permalink
THE PLACEABLE DECALS ARE REAL
Browse files Browse the repository at this point in the history
  • Loading branch information
RepeatGitHub committed May 14, 2024
1 parent 0d92dc3 commit d9f4edf
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CREDITS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Me, for making the mod
OlayColay, for creating Vinki
AllInLuck and kuksa for Downpour of Slugcats and the updated version respectively, of which I used as a base
BigKahuna and AAA1459 for Skin Mod Helper and Skin Mod Helper Plus respectively
Various members of the Celeste discord server for helping me out, including Snippy, bit8289, Viv, and ESPECIALLY Popax21, for actually getting the dynamic texture replacer working.
Various members of the Celeste discord server for helping me out, including Snippy, bit8289, Viv, Brokemia, and ESPECIALLY Popax21, for actually getting the dynamic texture replacer working.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Graphics/Atlases/Gameplay/decals/vinki/painting_d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 12 additions & 11 deletions Source/GraffitiIndicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@ namespace Celeste.Mod.VinkiMod;

public class GraffitiIndicator : Entity { // this should not show up in ahorn/lonn hopefully
public GraffitiIndicator() {
Depth = (Depths.FGTerrain + Depths.FGDecals) / 2;
//Depth = (Depths.FGTerrain + Depths.FGDecals) / 2;
Depth = Depths.FakeWalls - 1;
AddTag(Tags.Persistent);
}

public override void Update() {
base.Update();

// thank u extended variants
if (Collider != null && CollideAll<Solid>().Any(solid => solid.Depth < (Depths.FGTerrain + Depths.FGDecals) / 2)) {
Depth = Depths.FakeWalls - 1;
} else {
Depth = (Depths.FGTerrain + Depths.FGDecals) / 2;
}
}
//public override void Update() {
// base.Update();
//
// // thank u extended variants
// if (Collider != null && CollideAll<Solid>().Any(solid => solid.Depth < (Depths.FGTerrain + Depths.FGDecals) / 2)) {
// Depth = Depths.FakeWalls - 1;
// } else {
// Depth = (Depths.FGTerrain + Depths.FGDecals) / 2;
// }
//}

public override void Render() {
base.Render();
Expand Down
39 changes: 29 additions & 10 deletions Source/VinkiModModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,33 @@ public class VinkiModModule : EverestModule {
public static String[] textureNamespaces = [
"scenery/car/body","decals/1-forsakencity/big_sign_b","decals/1-forsakencity/camping_medium","decals/1-forsakencity/hanging_sign","decals/1-forsakencity/big_sign_e",//0-4
"decals/1-forsakencity/big_sign_d","decals/1-forsakencity/big_sign","decals/1-forsakencity/big_sign_c","scenery/memorial/memorial","decals/3-resort/painting_d",//5-9
"decals/4-cliffside/rockaline","decals/5-temple/statue_f","decals/5-temple/statue_c","decals/SJ2021/BeginnerLobby/jizo_game_a"//10-14
"decals/4-cliffside/rockaline","decals/5-temple/statue_f","decals/5-temple/statue_c","decals/SJ2021/BeginnerLobby/jizo_game_a","decals/vinki/graffiti/0_dream_x",//10-14
"decals/vinki/graffiti/0_heart_x","decals/vinki/graffiti/0_dream2_x","decals/vinki/graffiti/0_bad_x","decals/vinki/graffiti/1_pico8_x","decals/vinki/graffiti/1_sicktricks_x"//15-19
];
public static String[] textureReplaceNamespaces = ["decals/vinki/car/body","decals/vinki/big_sign_b","decals/vinki/camping_medium","decals/vinki/hanging_sign","decals/vinki/big_sign_e",
public static String[] textureReplaceNamespaces = [
"decals/vinki/car/body","decals/vinki/big_sign_b","decals/vinki/camping_medium","decals/vinki/hanging_sign","decals/vinki/big_sign_e",
"decals/vinki/big_sign_d","decals/vinki/big_sign","decals/vinki/big_sign_c","decals/vinki/memorial","decals/vinki/painting_d",//5-9
"decals/vinki/rockavink","decals/vinki/statue_f","decals/vinki/statue_c","decals/vinki/jizo_game_a"//10-14
"decals/vinki/rockavink","decals/vinki/statue_f","decals/vinki/statue_c","decals/vinki/jizo_game_a","decals/vinki/graffiti/0_dream_y",//10-14
"decals/vinki/graffiti/0_heart_y","decals/vinki/graffiti/0_dream2_y","decals/vinki/graffiti/0_bad_y","decals/vinki/graffiti/1_pico8_y","decals/vinki/graffiti/1_sicktricks_y"//15-19
];
public static String[] hasArtSpots = ["Celeste/0-Intro","Celeste/1-ForsakenCity","Celeste/2-OldSite","Celeste/3-CelestialResort","Celeste/4-GoldenRidge","Celeste/5-MirrorTemple","StrawberryJam2021/0-Lobbies/1-Beginner"];
public static int[][][] artSpots = [//x,y,w,h,textureNamespaces directory
[[-180,120,80,50,0]],//intro
[[1115,-1072,30,20,1],[695,-1064,40,30,2],[1742,-1440,38,22,3],[3040,-1880,40,24,3],[2233,-1344,40,66,4],[2665,-1600,20,25,5],[3340,-1950,70,35,6],[3465,-2575,75,30,7],[3985,-3140,40,80,8]],//forsaken city
[[790,1725,50,20,2]],//old site
[[1590,-75,50,30,9]],//celestial hotel
[[790,1725,50,20,2],[1724,508,144,80,14],[115,-515,35,50,15],[1400,268,22,22,16],[835,-1645,32,40,17]],//old site
[[1590,-75,50,30,9],[5632,-69,56,32,18],[3196,-562,1,1,19]],//celestial resort, not hotel
[[5145,-1425,100,25,10]],//golden ridge
[[3960,424,80,120,11],[7248,-504,240,50,12]],//mirror temple
[[3272,324,64,32,13]]//sj beginner lobby
];

public static String[] hasCustomDecals = ["Celeste/0-Intro"];
public static String[] decalNamespaces = ["0_heart","0_dream","0_dream2","0_bad","1_pico8","1_sicktricks"];

public static int[][][] customDecals = [//x,y,w,h,decals/vinki/graffiti/(this)(_x or _y depending on off/on status).png
[[0,100,1,1,0]]//intro
public static String[] hasCustomDecals = ["Celeste/2-OldSite","Celeste/3-CelestialResort"];

public static int[][][] customDecals = [//x,y,w,h,bg/fg/sfg=0/1/2,decals/vinki/graffiti/(this index in decalNamespaces)(_x or _y depending on off/on status).png
[[130,-510,1,1,0,0],[1760,524,1,1,1,1],[1412,279,1,1,1,2],[852,-1644,1,1,0,3],[111,1137,1,1,0,0]],//old site
[[5660,-68,1,1,0,4],[3164,-556,1,1,0,5]]//celestial resort
];

public VinkiModModule() {
Expand All @@ -67,6 +73,7 @@ public override void Load() {
Everest.Events.Level.OnEnter += triggerVinkiGUI2;
On.Celeste.Player.Update += vinkiButtonPress;
Everest.Events.LevelLoader.OnLoadingThread += vinkiRenderer;
Everest.Events.Level.OnLoadLevel += vinkiDecalier;//brokemia saves the day by telling me to use onloadlevel instead of onloadingthread
On.Celeste.IntroCar.Added += introCarScrewery;

foreach(MethodInfo method in typeof(MTexture).GetMethods()) {
Expand All @@ -81,6 +88,7 @@ public override void Unload() {
Everest.Events.Level.OnEnter -= triggerVinkiGUI2;
On.Celeste.Player.Update -= vinkiButtonPress;
Everest.Events.LevelLoader.OnLoadingThread -= vinkiRenderer;
Everest.Events.Level.OnLoadLevel -= vinkiDecalier;
On.Celeste.IntroCar.Added -= introCarScrewery;

hooks.ForEach(h => h.Dispose());
Expand Down Expand Up @@ -181,7 +189,7 @@ public static void vinkiButtonPress(On.Celeste.Player.orig_Update orig, Player s
}
}
}
// but here's the DECAL CODE
// but here's the graffiti indicator
private static void vinkiRenderer(Level self) {
if (SkinModHelperModule.GetPlayerSkinName(-1)=="Vinki_Scug") {
// If Vinki's Skin is enabled, it adds these entities to the level first.
Expand All @@ -191,13 +199,24 @@ private static void vinkiRenderer(Level self) {
self.Session.LevelData.Entities[2].Values["depth"]=2;
}
}
}
// but here's the DECAL CODE
private void vinkiDecalier(Level self, Player.IntroTypes playerIntro, bool isFromLoader) {
if (Array.IndexOf(hasCustomDecals,self.Session.Area.SID)!=-1) {
// If the current level is within hasCustomDecals, it sets variable myLvl for convenience.
var myLvl=Array.IndexOf(hasCustomDecals,self.Session.Area.SID);
for (var a=0;a<customDecals[myLvl].Length;a++) {
// Then, for each custom decal in the array, it places that decal in the level.
Logger.Log(LogLevel.Warn,"VinkiMod_vinkiRenderer",a.ToString());
self.Add(new Decal("vinki/graffiti/"+customDecals[myLvl][a][4]+"_x",new Microsoft.Xna.Framework.Vector2 (customDecals[myLvl][a][0],customDecals[myLvl][a][1]),new Microsoft.Xna.Framework.Vector2 (customDecals[myLvl][a][2],customDecals[myLvl][a][3]),1));
var myDepth=customDecals[myLvl][a][4];
if (myDepth==0) {
myDepth=8029;
} else if (myDepth==1) {
myDepth=-11029;
} else {
myDepth=-13029;
}
self.Add(new Decal("vinki/graffiti/"+decalNamespaces[customDecals[myLvl][a][5]]+"_x",new Microsoft.Xna.Framework.Vector2 (customDecals[myLvl][a][0],customDecals[myLvl][a][1]),new Microsoft.Xna.Framework.Vector2 (customDecals[myLvl][a][2],customDecals[myLvl][a][3]),myDepth));
}
}
}
Expand Down

0 comments on commit d9f4edf

Please sign in to comment.