Skip to content

Commit

Permalink
Assgen porting for hotspots
Browse files Browse the repository at this point in the history
  • Loading branch information
ScalarVector1 committed Jun 2, 2024
1 parent d3b282e commit beda170
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Content/Bosses/VitricBoss/NPCs.VitricBossPlatforms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public override void SafeAI()

public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Texture2D tex = ModContent.Request<Texture2D>(Texture).Value;
Texture2D tex = Assets.Bosses.VitricBoss.VitricBossPlatform.Value;

if (dontCollide)
drawColor *= 0.25f;
Expand Down
14 changes: 12 additions & 2 deletions Content/CustomHooks/Visuals.VitricBackground.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ class VitricBackground : HookGroup
internal static ParticleSystem ForegroundParticles;
internal static ParticleSystem BackgroundParticles;

internal static Asset<Texture2D>[] textures =
{
Assets.Backgrounds.Glass0,
Assets.Backgrounds.Glass1,
Assets.Backgrounds.Glass2,
Assets.Backgrounds.Glass3,
Assets.Backgrounds.Glass4,
Assets.Backgrounds.Glass5
};

public override void Load()
{
if (Main.dedServ)
Expand Down Expand Up @@ -118,7 +128,7 @@ private void DrawVitricBackground(On_Main.orig_DrawBackgroundBlackFill orig, Mai
if (k == 5)
off = 100;

DrawLayer(basepoint, Request<Texture2D>("StarlightRiver/Assets/Backgrounds/Glass" + k).Value, k + 1, Vector2.UnitY * off, default, false); //the crystal layers and front sand
DrawLayer(basepoint, textures[k].Value, k + 1, Vector2.UnitY * off, default, false); //the crystal layers and front sand

if (k == 1)
{
Expand Down Expand Up @@ -192,7 +202,7 @@ public static void DrawTitleVitricBackground()
Main.spriteBatch.Begin(SpriteSortMode.Deferred, default, SamplerState.PointClamp, default, default, default, Main.UIScaleMatrix);
}

Texture2D tex = Request<Texture2D>("StarlightRiver/Assets/Backgrounds/Glass" + k).Value;
Texture2D tex = textures[k].Value;

float heightRatio = Main.screenHeight / (float)Main.screenWidth;
int width = (int)(tex.Width * heightRatio);
Expand Down
10 changes: 5 additions & 5 deletions Content/Tiles/Vitric/Temple/TempleWindowSmall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ namespace StarlightRiver.Content.Tiles.Vitric.Temple
{
abstract class TallWindowDummyBase : Dummy
{
public virtual string TextureOver => AssetDirectory.VitricTile + "TallWindowOver";
public virtual Asset<Texture2D> TextureOver => Assets.Tiles.Vitric.TallWindowOver;

public TallWindowDummyBase(int type) : base(type, 16, 16) { }

public override void DrawBehindTiles()
{
SpriteBatch spriteBatch = Main.spriteBatch;

Texture2D tex = Request<Texture2D>(TextureOver).Value;
Texture2D tex = TextureOver.Value;
Vector2 pos = Center - Main.screenPosition - Vector2.One * 8;

var bgTarget = new Rectangle(6, 32, 84, 256);
Expand Down Expand Up @@ -101,7 +101,7 @@ class TallWindowLavaDummy : TallWindowDummyBase
{
public TallWindowLavaDummy() : base(ModContent.TileType<TallWindowLava>()) { }

public override string TextureOver => AssetDirectory.VitricTile + "TallWindowOverLava";
public override Asset<Texture2D> TextureOver => Assets.Tiles.Vitric.TallWindowOverLava;

public override void PostDraw(Color lightColor)
{
Expand All @@ -112,7 +112,7 @@ public override void PostDraw(Color lightColor)

SpriteBatch spriteBatch = Main.spriteBatch;

Texture2D tex = Request<Texture2D>(TextureOver + "Glow").Value;
Texture2D tex = Assets.Tiles.Vitric.TallWindowOverLavaGlow.Value;
Vector2 pos = Center - Main.screenPosition - Vector2.One * 8;
float sin = 0.5f + (float)Math.Sin(Main.GameUpdateCount * 0.05f + position.X * 1 / 16f) * 0.25f;

Expand All @@ -135,6 +135,6 @@ class TallWindowCrystalDummy : TallWindowDummyBase
{
public TallWindowCrystalDummy() : base(ModContent.TileType<TallWindowCrystal>()) { }

public override string TextureOver => AssetDirectory.VitricTile + "TallWindowOverCrystal";
public override Asset<Texture2D> TextureOver => Assets.Tiles.Vitric.TallWindowOverCrystal;
}
}
2 changes: 1 addition & 1 deletion Content/Tiles/Vitric/Temple/VitricPillarWall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public override void PostDraw(int i, int j, SpriteBatch spriteBatch)

Tile tile = Framing.GetTileSafely(i, j);

Texture2D tex = Request<Texture2D>(Texture + "Glow").Value;
Texture2D tex = Assets.Tiles.Vitric.VitricPillarWallLavaGlow.Value;
Vector2 pos = (new Vector2(i, j) + Helpers.Helper.TileAdj) * 16 - Main.screenPosition;
float sin = 0.5f + (float)Math.Sin((Main.GameUpdateCount + i + j * 10) * 0.05f) * 0.25f;

Expand Down

0 comments on commit beda170

Please sign in to comment.