Particle fixes
This commit is contained in:
1 parent
f91c2fe215
commit
48645809e2
2 files changed
+12
-6
No files matched your search
@@ -112,6 +112,11 @@ namespace CalamityMod.CalPlayer
|
||||
// Potions (Quick Buff && Potion Sickness)
|
||||
HandlePotions(player, modPlayer);
|
||||
|
||||
// Update all particle sets for items.
|
||||
// This must be done here instead of in the item logic because these sets are not properly instanced
|
||||
// in the global classes. Attempting to update them there will cause multiple updates to one set for multiple items.
|
||||
CalamityGlobalItem.UpdateAllParticleSets();
|
||||
|
||||
// Regularly sync player stats during multiplayer
|
||||
if (player.whoAmI == Main.myPlayer && Main.netMode == NetmodeID.MultiplayerClient)
|
||||
{
|
||||
|
||||
@@ -87,7 +87,6 @@ namespace CalamityMod.Items
|
||||
public CalamityGlobalItem()
|
||||
{
|
||||
StealthGenBonus = 1f;
|
||||
EnchantmentEnergyParticles = new ChargingEnergyParticleSet(-1, 2, Color.DarkViolet, Color.White, 0.04f, 24f);
|
||||
}
|
||||
|
||||
public override GlobalItem Clone(Item item, Item itemClone)
|
||||
@@ -1692,14 +1691,19 @@ namespace CalamityMod.Items
|
||||
#endregion
|
||||
|
||||
#region Inventory Drawing
|
||||
internal ChargingEnergyParticleSet EnchantmentEnergyParticles;
|
||||
internal static ChargingEnergyParticleSet EnchantmentEnergyParticles = new ChargingEnergyParticleSet(-1, 2, Color.DarkViolet, Color.White, 0.04f, 24f);
|
||||
|
||||
internal static void UpdateAllParticleSets()
|
||||
{
|
||||
EnchantmentEnergyParticles.Update();
|
||||
}
|
||||
|
||||
public override bool PreDrawInInventory(Item item, SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
void drawItemManually(Color color, float generalScale)
|
||||
{
|
||||
Texture2D itemTexture = Main.itemTexture[item.type];
|
||||
Rectangle itemFrame = (Main.itemAnimations[item.type] == null) ? itemTexture.Frame(1, 1, 0, 0) : Main.itemAnimations[item.type].GetFrame(itemTexture);
|
||||
Rectangle itemFrame = (Main.itemAnimations[item.type] == null) ? itemTexture.Frame() : Main.itemAnimations[item.type].GetFrame(itemTexture);
|
||||
Vector2 itemOrigin = itemFrame.Size() * 0.5f;
|
||||
spriteBatch.Draw(itemTexture, position, itemFrame, color, 0f, itemOrigin, scale * generalScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
@@ -1707,9 +1711,6 @@ namespace CalamityMod.Items
|
||||
if (!EnchantmentManager.ItemUpgradeRelationship.ContainsKey(item.type) || !Main.LocalPlayer.InventoryHas(ModContent.ItemType<BrimstoneLocus>()))
|
||||
return true;
|
||||
|
||||
// Create particle positions as necessary.
|
||||
EnchantmentEnergyParticles.Update();
|
||||
|
||||
// Draw all particles.
|
||||
float currentPower = 0f;
|
||||
int calamitasNPCIndex = NPC.FindFirstNPC(ModContent.NPCType<WITCH>());
|
||||
|
||||
Reference in new issue
Block a user