So for literally 2 hours straight searching on the forums and even longer through my own source code I cannot figure out how to add a completely new item, new image and everything. I can get the items stats in but for some reason the the tool-tip wont apply nor will the icon apply to the item. Maybe there is something that I have missed, maybe not...some help/clerification would be great! (No I will not swich to tAPI or tConfig...my ideas and plans doesn't work at all with those)
Changes/Additions I have done so far:
Created a new image in .png and converted it to .xnb (Tested and works when changing a buff icon, but now renamed to Item_2749)
Edit: Ok the item is now in the game but for some reason the item information is not showing up :/ and for some reason beds refuse to set spawn point >_>
(Note: All code bits are from different lines in the file its from...)
Item.cs
Code:
if (type == 2749)
{
this.name = "Item Test";
this.useStyle = 1;
this.useTurn = true;
this.useAnimation = 25;
this.useTime = 25;
this.autoReuse = true;
this.width = 24;
this.height = 28;
this.damage = 12;
this.pick = 100;
this.scale = 1.15f;
this.useSound = 1;
this.knockBack = 2f;
this.rare = 3;
this.value = 27000;
this.melee = true;
return;
}
if (this.type >= 2750)
{
this.type = 0;
}
for (int i = 0; i < 2750; i++)
{
if (Main.itemName[i] == ItemName)
{
this.SetDefaults(i, false);
this.checkMat();
return;
}
}
ItemID.cs
Code:
public const short ItemTest = 2749;
Lang.cs
Code:
case 2749:
return "Item Test";
Recipe.cs
Code:
Recipe.addRecipe();
Recipe.newRecipe.createItem.SetDefaults(2749, false);
Recipe.newRecipe.requiredItem[0].SetDefaults(19, false);
Recipe.newRecipe.requiredItem[0].stack = 12;
Recipe.addRecipe()
public static void tTip()
{
for (int i = 1; i < 2750; i++)
{
Item item = new Item();
item.SetDefaults(i, false);
if (item.toolTip2 != "" && item.toolTip2 != null)
{
string.Concat(new object[]
{
"case ",
i,
": return \"",
item.toolTip2,
"\";"
});
}
}
}
Main.cs
Code:
public const int maxItemTypes = 2750;
public static bool[] itemFlameLoaded = new bool[2750];
public static Texture2D[] itemTexture = new Texture2D[2750];
public static Texture2D[] itemFlameTexture = new Texture2D[2750];
public static string[] itemName = new string[2750];
for (int num16 = 0; num16 < 2750; num16++)
{
Item item = new Item();
item.SetDefaults(num16, false);
Main.itemName[num16] = item.name;
if (item.headSlot > 0)
{
Item.headType[item.headSlot] = item.type;
}
if (item.bodySlot > 0)
{
Item.bodyType[item.bodySlot] = item.type;
}
if (item.legSlot > 0)
{
Item.legType[item.legSlot] = item.type;
}
}
for (int num12 = 0; num12 < 2750; num12++)
{
Main.itemTexture[num12] = base.Content.Load<Texture2D>(string.Concat(new object[]
{
"Images",
Path.DirectorySeparatorChar,
"Item_",
num12
}));
}