Made the Schematics display their unlocked recipes in their tooltips.
This commit is contained in:
1 parent
08fc7696dc
commit
436a67448f
5 files changed
+191
-12
No files matched your search
@@ -1,10 +1,13 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Items.Weapons.DraedonsArsenal;
|
||||
using CalamityMod.Items.DraedonMisc;
|
||||
using CalamityMod.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -42,10 +45,42 @@ namespace CalamityMod.Items.DraedonMisc
|
||||
public override void ModifyTooltips(List<TooltipLine> list)
|
||||
{
|
||||
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0");
|
||||
if (RecipeUnlockHandler.HasUnlockedT4ArsenalRecipes)
|
||||
{
|
||||
if (line != null)
|
||||
line.Text = "Has already been decrypted.\n" +
|
||||
"Click to view its contents.\n" +
|
||||
"Unlocked recipes:";
|
||||
int insertIndex = list.FindIndex(x => x.Name == "Tooltip0" && x.Mod == "Terraria");
|
||||
if (insertIndex != -1)
|
||||
{
|
||||
TooltipLine meleeDisplay = new TooltipLine(this.Mod, "CalamityMod:MeleeDisplay", $"[i:{ModContent.ItemType<PulseDragon>()}] Pulse Dragon");
|
||||
meleeDisplay.OverrideColor = new Color(201, 41, 255);
|
||||
list.Insert(insertIndex + 1, meleeDisplay);
|
||||
|
||||
TooltipLine rangedDisplay = new TooltipLine(this.Mod, "CalamityMod:RangedDisplay", $"[i:{ModContent.ItemType<HeavyLaserRifle>()}] Heavy Laser Rifle");
|
||||
rangedDisplay.OverrideColor = new Color(255, 64, 31);
|
||||
list.Insert(insertIndex + 2, rangedDisplay);
|
||||
|
||||
TooltipLine mageDisplay = new TooltipLine(this.Mod, "CalamityMod:MageDisplay", $"[i:{ModContent.ItemType<PlasmaCaster>()}] Plasma Caster");
|
||||
mageDisplay.OverrideColor = new Color(149, 243, 43);
|
||||
list.Insert(insertIndex + 3, mageDisplay);
|
||||
|
||||
TooltipLine summonDisplay = new TooltipLine(this.Mod, "CalamityMod:SummonDisplay", $"[i:{ModContent.ItemType<SnakeEyes>()}] Snake Eyes");
|
||||
summonDisplay.OverrideColor = new Color(31, 242, 245);
|
||||
list.Insert(insertIndex + 4, summonDisplay);
|
||||
|
||||
TooltipLine rogueDisplay = new TooltipLine(this.Mod, "CalamityMod:RogueDisplay", $"[i:{ModContent.ItemType<WavePounder>()}] Wave Pounder");
|
||||
rogueDisplay.OverrideColor = new Color(236, 255, 31);
|
||||
list.Insert(insertIndex + 5, rogueDisplay);
|
||||
|
||||
TooltipLine machineDisplay = new TooltipLine(this.Mod, "CalamityMod:CodeDisplay", $"[i:{ModContent.ItemType<VoltageRegulationSystem>()}] Voltage Regulation System");
|
||||
machineDisplay.OverrideColor = new Color(165, 118, 104);
|
||||
list.Insert(insertIndex + 6, machineDisplay);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (line != null && RecipeUnlockHandler.HasUnlockedT4ArsenalRecipes)
|
||||
line.Text = "Has already been decrypted.\n" +
|
||||
"Click to view its contents.";
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.DraedonsArsenal;
|
||||
using CalamityMod.Items.DraedonMisc;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -43,10 +46,41 @@ namespace CalamityMod.Items.DraedonMisc
|
||||
public override void ModifyTooltips(List<TooltipLine> list)
|
||||
{
|
||||
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0");
|
||||
if (RecipeUnlockHandler.HasUnlockedT5ArsenalRecipes)
|
||||
{
|
||||
if (line != null)
|
||||
line.Text = "Has already been decrypted.\n" +
|
||||
"Click to view its contents.\n" +
|
||||
"Unlocked recipes:";
|
||||
int insertIndex = list.FindIndex(x => x.Name == "Tooltip0" && x.Mod == "Terraria");
|
||||
if (insertIndex != -1)
|
||||
{
|
||||
TooltipLine meleeDisplay = new TooltipLine(this.Mod, "CalamityMod:MeleeDisplay", $"[i:{ModContent.ItemType<Phaseslayer>()}] Phaseslayer");
|
||||
meleeDisplay.OverrideColor = new Color(255, 64, 31);
|
||||
list.Insert(insertIndex + 1, meleeDisplay);
|
||||
|
||||
if (line != null && RecipeUnlockHandler.HasUnlockedT5ArsenalRecipes)
|
||||
line.Text = "Has already been decrypted.\n" +
|
||||
"Click to view its contents.";
|
||||
TooltipLine rangedDisplay = new TooltipLine(this.Mod, "CalamityMod:RangedDisplay", $"[i:{ModContent.ItemType<PulseRifle>()}] Pulse Rifle");
|
||||
rangedDisplay.OverrideColor = new Color(201, 41, 255);
|
||||
list.Insert(insertIndex + 2, rangedDisplay);
|
||||
|
||||
TooltipLine mageDisplay = new TooltipLine(this.Mod, "CalamityMod:MageDisplay", $"[i:{ModContent.ItemType<TeslaCannon>()}] Tesla Cannon");
|
||||
mageDisplay.OverrideColor = new Color(31, 242, 245);
|
||||
list.Insert(insertIndex + 3, mageDisplay);
|
||||
|
||||
TooltipLine summonDisplay = new TooltipLine(this.Mod, "CalamityMod:SummonDisplay", $"[i:{ModContent.ItemType<PoleWarper>()}] Pole Warper");
|
||||
summonDisplay.OverrideColor = new Color(236, 255, 31);
|
||||
list.Insert(insertIndex + 4, summonDisplay);
|
||||
|
||||
TooltipLine rogueDisplay = new TooltipLine(this.Mod, "CalamityMod:RogueDisplay", $"[i:{ModContent.ItemType<PlasmaGrenade>()}] Plasma Grenade");
|
||||
rogueDisplay.OverrideColor = new Color(149, 243, 43);
|
||||
list.Insert(insertIndex + 5, rogueDisplay);
|
||||
|
||||
TooltipLine machineDisplay = new TooltipLine(this.Mod, "CalamityMod:CodeDisplay", $"[i:{ModContent.ItemType<AuricQuantumCoolingCell>()}] Auric Quantum Cooling Cell");
|
||||
machineDisplay.OverrideColor = new Color(255, 215, 0);
|
||||
list.Insert(insertIndex + 6, machineDisplay);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.DraedonsArsenal;
|
||||
using CalamityMod.Items.DraedonMisc;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -42,10 +45,41 @@ namespace CalamityMod.Items.DraedonMisc
|
||||
public override void ModifyTooltips(List<TooltipLine> list)
|
||||
{
|
||||
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0");
|
||||
if (RecipeUnlockHandler.HasUnlockedT3ArsenalRecipes)
|
||||
{
|
||||
if (line != null)
|
||||
line.Text = "Has already been decrypted.\n" +
|
||||
"Click to view its contents.\n" +
|
||||
"Unlocked recipes:";
|
||||
int insertIndex = list.FindIndex(x => x.Name == "Tooltip0" && x.Mod == "Terraria");
|
||||
if (insertIndex != -1)
|
||||
{
|
||||
TooltipLine meleeDisplay = new TooltipLine(this.Mod, "CalamityMod:MeleeDisplay", $"[i:{ModContent.ItemType<GalvanizingGlaive>()}] Galvanizing Glaive");
|
||||
meleeDisplay.OverrideColor = new Color(149, 243, 43);
|
||||
list.Insert(insertIndex + 1, meleeDisplay);
|
||||
|
||||
if (line != null && RecipeUnlockHandler.HasUnlockedT3ArsenalRecipes)
|
||||
line.Text = "Has already been decrypted.\n" +
|
||||
"Click to view its contents.";
|
||||
TooltipLine rangedDisplay = new TooltipLine(this.Mod, "CalamityMod:RangedDisplay", $"[i:{ModContent.ItemType<GaussRifle>()}] Gauss Rifle");
|
||||
rangedDisplay.OverrideColor = new Color(236, 255, 31);
|
||||
list.Insert(insertIndex + 2, rangedDisplay);
|
||||
|
||||
TooltipLine mageDisplay = new TooltipLine(this.Mod, "CalamityMod:MageDisplay", $"[i:{ModContent.ItemType<GatlingLaser>()}] Gatling Laser");
|
||||
mageDisplay.OverrideColor = new Color(255, 64, 31);
|
||||
list.Insert(insertIndex + 3, mageDisplay);
|
||||
|
||||
TooltipLine summonDisplay = new TooltipLine(this.Mod, "CalamityMod:SummonDisplay", $"[i:{ModContent.ItemType<PulseTurretRemote>()}] Pulse Turret Remote");
|
||||
summonDisplay.OverrideColor = new Color(201, 41, 255);
|
||||
list.Insert(insertIndex + 4, summonDisplay);
|
||||
|
||||
TooltipLine rogueDisplay = new TooltipLine(this.Mod, "CalamityMod:RogueDisplay", $"[i:{ModContent.ItemType<SystemBane>()}] System Bane");
|
||||
rogueDisplay.OverrideColor = new Color(31, 242, 245);
|
||||
list.Insert(insertIndex + 5, rogueDisplay);
|
||||
|
||||
TooltipLine machineDisplay = new TooltipLine(this.Mod, "CalamityMod:CodeDisplay", $"[i:{ModContent.ItemType<AdvancedDisplay>()}] Advanced Display");
|
||||
machineDisplay.OverrideColor = new Color(165, 118, 104);
|
||||
list.Insert(insertIndex + 6, machineDisplay);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.DraedonsArsenal;
|
||||
using CalamityMod.Items.DraedonMisc;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -42,10 +45,41 @@ namespace CalamityMod.Items.DraedonMisc
|
||||
public override void ModifyTooltips(List<TooltipLine> list)
|
||||
{
|
||||
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0");
|
||||
if (RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes)
|
||||
{
|
||||
if (line != null)
|
||||
line.Text = "Has already been decrypted.\n" +
|
||||
"Click to view its contents.\n" +
|
||||
"Unlocked recipes:";
|
||||
int insertIndex = list.FindIndex(x => x.Name == "Tooltip0" && x.Mod == "Terraria");
|
||||
if (insertIndex != -1)
|
||||
{
|
||||
TooltipLine meleeDisplay = new TooltipLine(this.Mod, "CalamityMod:MeleeDisplay", $"[i:{ModContent.ItemType<HydraulicVoltCrasher>()}] Hydraulic Volt Crasher");
|
||||
meleeDisplay.OverrideColor = new Color(31, 242, 245);
|
||||
list.Insert(insertIndex + 1, meleeDisplay);
|
||||
|
||||
if (line != null && RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes)
|
||||
line.Text = "Has already been decrypted.\n" +
|
||||
"Click to view its contents.";
|
||||
TooltipLine rangedDisplay = new TooltipLine(this.Mod, "CalamityMod:RangedDisplay", $"[i:{ModContent.ItemType<MatterModulator>()}] Matter Modulator");
|
||||
rangedDisplay.OverrideColor = new Color(149, 243, 43);
|
||||
list.Insert(insertIndex + 2, rangedDisplay);
|
||||
|
||||
TooltipLine mageDisplay = new TooltipLine(this.Mod, "CalamityMod:MageDisplay", $"[i:{ModContent.ItemType<GaussPistol>()}] Gauss Pistol");
|
||||
mageDisplay.OverrideColor = new Color(236, 255, 31);
|
||||
list.Insert(insertIndex + 3, mageDisplay);
|
||||
|
||||
TooltipLine summonDisplay = new TooltipLine(this.Mod, "CalamityMod:SummonDisplay", $"[i:{ModContent.ItemType<MountedScanner>()}] Mounted Scanner");
|
||||
summonDisplay.OverrideColor = new Color(255, 64, 31);
|
||||
list.Insert(insertIndex + 4, summonDisplay);
|
||||
|
||||
TooltipLine rogueDisplay = new TooltipLine(this.Mod, "CalamityMod:RogueDisplay", $"[i:{ModContent.ItemType<FrequencyManipulator>()}] Frequency Manipulator");
|
||||
rogueDisplay.OverrideColor = new Color(201, 41, 255);
|
||||
list.Insert(insertIndex + 5, rogueDisplay);
|
||||
|
||||
TooltipLine machineDisplay = new TooltipLine(this.Mod, "CalamityMod:CodeDisplay", $"[i:{ModContent.ItemType<LongRangedSensorArray>()}] Long Ranged Sensor Array");
|
||||
machineDisplay.OverrideColor = new Color(165, 118, 104);
|
||||
list.Insert(insertIndex + 6, machineDisplay);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.DraedonsArsenal;
|
||||
using CalamityMod.Items.DraedonMisc;
|
||||
using CalamityMod.UI;
|
||||
using CalamityMod.Rarities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -54,6 +59,43 @@ namespace CalamityMod.Items.DraedonMisc
|
||||
Register();
|
||||
}
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> list)
|
||||
{
|
||||
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0");
|
||||
if (RecipeUnlockHandler.HasUnlockedT1ArsenalRecipes)
|
||||
{
|
||||
int insertIndex = list.FindIndex(x => x.Name == "Tooltip2" && x.Mod == "Terraria");
|
||||
if (insertIndex != -1)
|
||||
{
|
||||
TooltipLine meleeDisplay = new TooltipLine(this.Mod, "CalamityMod:MeleeDisplay", $"[i:{ModContent.ItemType<GaussDagger>()}] Gauss Dagger");
|
||||
meleeDisplay.OverrideColor = new Color(236, 255, 31);
|
||||
list.Insert(insertIndex + 1, meleeDisplay);
|
||||
|
||||
TooltipLine rangedDisplay = new TooltipLine(this.Mod, "CalamityMod:RangedDisplay", $"[i:{ModContent.ItemType<Taser>()}] Taser");
|
||||
rangedDisplay.OverrideColor = new Color(31, 242, 245);
|
||||
list.Insert(insertIndex + 2, rangedDisplay);
|
||||
|
||||
TooltipLine mageDisplay = new TooltipLine(this.Mod, "CalamityMod:MageDisplay", $"[i:{ModContent.ItemType<PulsePistol>()}] Pulse Pistol");
|
||||
mageDisplay.OverrideColor = new Color(201, 41, 255);
|
||||
list.Insert(insertIndex + 3, mageDisplay);
|
||||
|
||||
TooltipLine summonDisplay = new TooltipLine(this.Mod, "CalamityMod:SummonDisplay", $"[i:{ModContent.ItemType<StarSwallowerContainmentUnit>()}] Star Swallower Containment Unit");
|
||||
summonDisplay.OverrideColor = new Color(149, 243, 43);
|
||||
list.Insert(insertIndex + 4, summonDisplay);
|
||||
|
||||
TooltipLine rogueDisplay = new TooltipLine(this.Mod, "CalamityMod:RogueDisplay", $"[i:{ModContent.ItemType<TrackingDisk>()}] Tracking Disk");
|
||||
rogueDisplay.OverrideColor = new Color(255, 64, 31);
|
||||
list.Insert(insertIndex + 5, rogueDisplay);
|
||||
|
||||
TooltipLine machineDisplay = new TooltipLine(this.Mod, "CalamityMod:CodeDisplay", $"[i:{ModContent.ItemType<DecryptionComputer>()}] Decryption Computer");
|
||||
machineDisplay.OverrideColor = new Color(165, 118, 104);
|
||||
list.Insert(insertIndex + 6, machineDisplay);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override bool? UseItem(Player player)
|
||||
{
|
||||
if (Main.myPlayer == player.whoAmI && RecipeUnlockHandler.HasUnlockedT1ArsenalRecipes)
|
||||
|
||||
Reference in new issue
Block a user