some mineral cleanups

This commit is contained in:
darkrose 2014-01-16 23:26:34 +10:00
parent 9e43e7ea80
commit af5bfac4bb
10 changed files with 152 additions and 133 deletions

View File

@ -56,7 +56,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_PAPER;
f->texture = "paper.png";
f->name = "paper";
f->gui_name = "Paper";
f->description = "Paper";
crafting::setRow1Recipe(CONTENT_PAPYRUS,CONTENT_CRAFTITEM_PAPER);
i = CONTENT_CRAFTITEM_BOOK;
@ -64,7 +64,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_BOOK;
f->texture = "book.png";
f->name = "book";
f->gui_name = "Book";
f->description = "Book";
crafting::setCol1Recipe(CONTENT_CRAFTITEM_PAPER,CONTENT_CRAFTITEM_BOOK);
i = CONTENT_CRAFTITEM_CHARCOAL;
@ -72,7 +72,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_CHARCOAL;
f->texture = "lump_of_charcoal.png";
f->name = "lump_of_charcoal";
f->gui_name = "Charcoal Lump";
f->description = "Charcoal Lump";
f->fuel_time = 40;
i = CONTENT_CRAFTITEM_COAL;
@ -80,7 +80,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_COAL;
f->texture = "lump_of_coal.png";
f->name = "lump_of_coal";
f->gui_name = "Coal Lump";
f->description = "Coal Lump";
f->fuel_time = 40;
i = CONTENT_CRAFTITEM_IRON;
@ -88,7 +88,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_IRON;
f->texture = "lump_of_iron.png";
f->name = "lump_of_iron";
f->gui_name = "Iron Lump";
f->description = "Iron Lump";
f->cook_result = "CraftItem steel_ingot 1";
i = CONTENT_CRAFTITEM_CLAY;
@ -96,7 +96,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_CLAY;
f->texture = "lump_of_clay.png";
f->name = "lump_of_clay";
f->gui_name = "Clay Lump";
f->description = "Clay Lump";
f->cook_result = "CraftItem clay_brick 1";
i = CONTENT_CRAFTITEM_TIN;
@ -104,7 +104,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_TIN;
f->texture = "lump_of_tin.png";
f->name = "lump_of_tin";
f->gui_name = "Tin Lump";
f->description = "Tin Lump";
f->cook_result = "CraftItem tin_ingot 1";
i = CONTENT_CRAFTITEM_COPPER;
@ -112,7 +112,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_COPPER;
f->texture = "lump_of_copper.png";
f->name = "lump_of_copper";
f->gui_name = "Copper Lump";
f->description = "Copper Lump";
f->cook_result = "CraftItem copper_ingot 1";
i = CONTENT_CRAFTITEM_SILVER;
@ -120,7 +120,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_SILVER;
f->texture = "lump_of_silver.png";
f->name = "lump_of_silver";
f->gui_name = "Silver Lump";
f->description = "Silver Lump";
f->cook_result = "CraftItem silver_ingot 1";
i = CONTENT_CRAFTITEM_GOLD;
@ -128,7 +128,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_GOLD;
f->texture = "lump_of_gold.png";
f->name = "lump_of_gold";
f->gui_name = "Gold Lump";
f->description = "Gold Lump";
f->cook_result = "CraftItem gold_ingot 1";
i = CONTENT_CRAFTITEM_QUARTZ;
@ -136,63 +136,63 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_QUARTZ;
f->texture = "lump_of_quartz.png";
f->name = "lump_of_quartz";
f->gui_name = "Quartz Crystal";
f->description = "Quartz Crystal";
i = CONTENT_CRAFTITEM_TIN_INGOT;
f = &g_content_craftitem_features[i];
f->content = CONTENT_CRAFTITEM_TIN_INGOT;
f->texture = "tin_ingot.png";
f->name = "tin_ingot";
f->gui_name = "Tin Ingot";
f->description = "Tin Ingot";
i = CONTENT_CRAFTITEM_COPPER_INGOT;
f = &g_content_craftitem_features[i];
f->content = CONTENT_CRAFTITEM_COPPER_INGOT;
f->texture = "copper_ingot.png";
f->name = "copper_ingot";
f->gui_name = "Copper Ingot";
f->description = "Copper Ingot";
i = CONTENT_CRAFTITEM_SILVER_INGOT;
f = &g_content_craftitem_features[i];
f->content = CONTENT_CRAFTITEM_SILVER_INGOT;
f->texture = "silver_ingot.png";
f->name = "silver_ingot";
f->gui_name = "Silver Ingot";
f->description = "Silver Ingot";
i = CONTENT_CRAFTITEM_GOLD_INGOT;
f = &g_content_craftitem_features[i];
f->content = CONTENT_CRAFTITEM_GOLD_INGOT;
f->texture = "gold_ingot.png";
f->name = "gold_ingot";
f->gui_name = "Gold Ingot";
f->description = "Gold Ingot";
i = CONTENT_CRAFTITEM_FLINT;
f = &g_content_craftitem_features[i];
f->content = CONTENT_CRAFTITEM_FLINT;
f->texture = "lump_of_flint.png";
f->name = "lump_of_flint";
f->gui_name = "Flint";
f->description = "Flint";
i = CONTENT_CRAFTITEM_STEEL_INGOT;
f = &g_content_craftitem_features[i];
f->content = CONTENT_CRAFTITEM_STEEL_INGOT;
f->texture = "steel_ingot.png";
f->name = "steel_ingot";
f->gui_name = "Steel Ingot";
f->description = "Steel Ingot";
i = CONTENT_CRAFTITEM_CLAY_BRICK;
f = &g_content_craftitem_features[i];
f->content = CONTENT_CRAFTITEM_CLAY_BRICK;
f->texture = "clay_brick.png";
f->name = "clay_brick";
f->gui_name = "Brick";
f->description = "Brick";
i = CONTENT_CRAFTITEM_RAT;
f = &g_content_craftitem_features[i];
f->content = CONTENT_CRAFTITEM_RAT;
f->texture = "rat.png";
f->name = "rat";
f->gui_name = "Rat";
f->description = "Rat";
f->cook_result = "CraftItem cooked_rat 1";
f->drop_count = 1;
@ -201,7 +201,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_COOKED_RAT;
f->texture = "cooked_rat.png";
f->name = "cooked_rat";
f->gui_name = "Cooked Rat";
f->description = "Cooked Rat";
f->cook_result = "CraftItem scorched_stuff 1";
f->edible = 6;
@ -210,14 +210,14 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_SCORCHED_STUFF;
f->texture = "scorched_stuff.png";
f->name = "scorched_stuff";
f->gui_name = "Scorched Stuff";
f->description = "Scorched Stuff";
i = CONTENT_CRAFTITEM_FIREFLY;
f = &g_content_craftitem_features[i];
f->content = CONTENT_CRAFTITEM_FIREFLY;
f->texture = "firefly.png";
f->name = "firefly";
f->gui_name = "Firefly";
f->description = "Firefly";
f->drop_count = 1;
i = CONTENT_CRAFTITEM_APPLE;
@ -225,7 +225,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_APPLE;
f->texture = "apple.png^[forcesingle";
f->name = "apple";
f->gui_name = "Apple";
f->description = "Apple";
f->edible = 4;
i = CONTENT_CRAFTITEM_APPLE_IRON;
@ -233,7 +233,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_APPLE_IRON;
f->texture = "apple_iron.png";
f->name = "apple_iron";
f->gui_name = "apple_iron";
f->description = "apple_iron";
f->edible = 8;
{
u16 recipe[9] = {
@ -249,7 +249,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_DYE_BLUE;
f->texture = "dye_blue.png";
f->name = "dye_blue";
f->gui_name = "Blue Dye";
f->description = "Blue Dye";
crafting::set1To2Recipe(CONTENT_FLOWER_TULIP,CONTENT_CRAFTITEM_DYE_BLUE);
i = CONTENT_CRAFTITEM_DYE_GREEN;
@ -257,7 +257,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_DYE_GREEN;
f->texture = "dye_green.png";
f->name = "dye_green";
f->gui_name = "Green Dye";
f->description = "Green Dye";
crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_DYE_GREEN);
i = CONTENT_CRAFTITEM_DYE_ORANGE;
@ -265,7 +265,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_DYE_ORANGE;
f->texture = "dye_orange.png";
f->name = "dye_orange";
f->gui_name = "Orange Dye";
f->description = "Orange Dye";
crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_DYE_ORANGE);
i = CONTENT_CRAFTITEM_DYE_PURPLE;
@ -273,7 +273,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_DYE_PURPLE;
f->texture = "dye_purple.png";
f->name = "dye_purple";
f->gui_name = "Purple Dye";
f->description = "Purple Dye";
crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_DYE_PURPLE);
i = CONTENT_CRAFTITEM_DYE_RED;
@ -281,7 +281,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_DYE_RED;
f->texture = "dye_red.png";
f->name = "dye_red";
f->gui_name = "Red Dye";
f->description = "Red Dye";
crafting::set1To2Recipe(CONTENT_FLOWER_ROSE,CONTENT_CRAFTITEM_DYE_RED);
i = CONTENT_CRAFTITEM_DYE_YELLOW;
@ -289,7 +289,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_DYE_YELLOW;
f->texture = "dye_yellow.png";
f->name = "dye_yellow";
f->gui_name = "Yellow Dye";
f->description = "Yellow Dye";
crafting::set1To2Recipe(CONTENT_FLOWER_DAFFODIL,CONTENT_CRAFTITEM_DYE_YELLOW);
i = CONTENT_CRAFTITEM_DYE_WHITE;
@ -297,7 +297,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_DYE_WHITE;
f->texture = "dye_white.png";
f->name = "dye_white";
f->gui_name = "White Dye";
f->description = "White Dye";
crafting::set1To1Recipe(CONTENT_CRAFTITEM_APPLE_BLOSSOM,CONTENT_CRAFTITEM_DYE_WHITE);
crafting::set2Any3Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_DYE_WHITE);
@ -306,7 +306,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_DYE_BLACK;
f->texture = "dye_black.png";
f->name = "dye_black";
f->gui_name = "Black Dye";
f->description = "Black Dye";
crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_CRAFTITEM_COAL,CONTENT_CRAFTITEM_DYE_BLACK);
i = CONTENT_CRAFTITEM_QUARTZ_DUST;
@ -314,7 +314,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_QUARTZ_DUST;
f->texture = "quartz_dust.png";
f->name = "quartz_dust";
f->gui_name = "Quartz Dust";
f->description = "Quartz Dust";
crafting::set1To1Recipe(CONTENT_CRAFTITEM_QUARTZ,CONTENT_CRAFTITEM_QUARTZ_DUST);
i = CONTENT_CRAFTITEM_SALTPETER;
@ -322,14 +322,14 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_SALTPETER;
f->texture = "saltpeter.png";
f->name = "saltpeter";
f->gui_name = "Saltpeter";
f->description = "Saltpeter";
i = CONTENT_CRAFTITEM_GUNPOWDER;
f = &g_content_craftitem_features[i];
f->content = CONTENT_CRAFTITEM_GUNPOWDER;
f->texture = "gunpowder.png";
f->name = "gunpowder";
f->gui_name = "Gun Powder";
f->description = "Gun Powder";
crafting::set1Any3Recipe(CONTENT_CRAFTITEM_CHARCOAL,CONTENT_CRAFTITEM_FLINT,CONTENT_CRAFTITEM_SALTPETER,CONTENT_CRAFTITEM_GUNPOWDER);
i = CONTENT_CRAFTITEM_SNOW_BALL;
@ -337,14 +337,14 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_SNOW_BALL;
f->texture = "snow_ball.png";
f->name = "snow_ball";
f->gui_name = "Snow Ball";
f->description = "Snow Ball";
i = CONTENT_CRAFTITEM_STICK;
f = &g_content_craftitem_features[i];
f->content = CONTENT_CRAFTITEM_STICK;
f->texture = "stick.png";
f->name = "Stick";
f->gui_name = "Stick";
f->description = "Stick";
f->fuel_time = 30/16;
crafting::set1To2Recipe(CONTENT_CRAFTITEM_PINE_PLANK,CONTENT_CRAFTITEM_STICK);
crafting::set1To2Recipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_CRAFTITEM_STICK);
@ -359,7 +359,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_PINE_PLANK;
f->texture = "pine_plank.png";
f->name = "pine_plank";
f->gui_name = "Pine Plank";
f->description = "Pine Plank";
f->fuel_time = 30/16;
crafting::set1To4Recipe(CONTENT_WOOD_PINE,CONTENT_CRAFTITEM_PINE_PLANK);
@ -368,7 +368,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_WOOD_PLANK;
f->texture = "wood_plank.png";
f->name = "wood_plank";
f->gui_name = "Wood Plank";
f->description = "Wood Plank";
f->fuel_time = 30/16;
crafting::set1To4Recipe(CONTENT_WOOD,CONTENT_CRAFTITEM_WOOD_PLANK);
@ -377,7 +377,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_JUNGLE_PLANK;
f->texture = "jungle_plank.png";
f->name = "jungle_plank";
f->gui_name = "Jungle Wood Plank";
f->description = "Jungle Wood Plank";
f->fuel_time = 30/16;
crafting::set1To4Recipe(CONTENT_JUNGLEWOOD,CONTENT_CRAFTITEM_JUNGLE_PLANK);
@ -386,7 +386,7 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_TNT;
f->texture = "tnt_stick.png";
f->name = "tnt_stick";
f->gui_name = "TNT Stick";
f->description = "TNT Stick";
{
u16 recipe[9] = {
CONTENT_CRAFTITEM_PAPER, CONTENT_CRAFTITEM_GUNPOWDER, CONTENT_CRAFTITEM_PAPER,
@ -401,14 +401,14 @@ void content_craftitem_init()
f->content = CONTENT_CRAFTITEM_ASH;
f->texture = "lump_of_ash.png";
f->name = "lump_of_ash";
f->gui_name = "Ash";
f->description = "Ash";
i = CONTENT_CRAFTITEM_APPLE_BLOSSOM;
f = &g_content_craftitem_features[i];
f->content = CONTENT_CRAFTITEM_APPLE_BLOSSOM;
f->texture = "apple_blossom.png";
f->name = "apple_blossom";
f->gui_name = "Apple Blossoms";
f->description = "Apple Blossoms";
f->edible = 1;
f->fuel_time = 30/16;

View File

@ -11,7 +11,7 @@ struct CraftItemFeatures {
// the old 'subname'
std::string name;
// tooltip used in inventory
std::string gui_name;
std::string description;
// the result of cooking this item
std::string cook_result;
// the fuel value of this item
@ -25,7 +25,7 @@ struct CraftItemFeatures {
content(CONTENT_IGNORE),
texture("unknown_item.png"),
name(""),
gui_name(""),
description(""),
cook_result(""),
fuel_time(0.0),
edible(0),

View File

@ -57,7 +57,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_woodpick.png";
f->name = "WPick";
f->gui_name = "Wooden Pick";
f->description = "Wooden Pick";
crafting::setPickRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WPICK);
crafting::setPickRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WPICK);
@ -66,7 +66,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_stonepick.png";
f->name = "STPick";
f->gui_name = "Stone Pick";
f->description = "Stone Pick";
crafting::setPickRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STPICK);
i = CONTENT_TOOLITEM_STEELPICK;
@ -74,7 +74,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_steelpick.png";
f->name = "SteelPick";
f->gui_name = "Steel Pick";
f->description = "Steel Pick";
crafting::setPickRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELPICK);
i = CONTENT_TOOLITEM_MESEPICK;
@ -82,7 +82,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_mesepick.png";
f->name = "MesePick";
f->gui_name = "Mese Pick";
f->description = "Mese Pick";
crafting::setPickRecipe(CONTENT_MESE,CONTENT_TOOLITEM_MESEPICK);
i = CONTENT_TOOLITEM_WSHOVEL;
@ -90,7 +90,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_woodshovel.png";
f->name = "WShovel";
f->gui_name = "Wooden Shovel";
f->description = "Wooden Shovel";
crafting::setShovelRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WSHOVEL);
crafting::setShovelRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WSHOVEL);
@ -99,7 +99,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_stoneshovel.png";
f->name = "STShovel";
f->gui_name = "Stone Shovel";
f->description = "Stone Shovel";
crafting::setShovelRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STSHOVEL);
i = CONTENT_TOOLITEM_STEELSHOVEL;
@ -107,7 +107,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_steelshovel.png";
f->name = "SteelShovel";
f->gui_name = "Steel Shovel";
f->description = "Steel Shovel";
crafting::setShovelRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSHOVEL);
i = CONTENT_TOOLITEM_WAXE;
@ -115,7 +115,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_woodaxe.png";
f->name = "WAxe";
f->gui_name = "Wooden Axe";
f->description = "Wooden Axe";
crafting::setAxeRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WAXE);
crafting::setAxeRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WAXE);
@ -124,7 +124,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_stoneaxe.png";
f->name = "STAxe";
f->gui_name = "Stone Axe";
f->description = "Stone Axe";
crafting::setAxeRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STAXE);
i = CONTENT_TOOLITEM_STEELAXE;
@ -132,7 +132,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_steelaxe.png";
f->name = "SteelAxe";
f->gui_name = "Steel Axe";
f->description = "Steel Axe";
crafting::setAxeRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELAXE);
i = CONTENT_TOOLITEM_WSWORD;
@ -140,7 +140,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_woodsword.png";
f->name = "WSword";
f->gui_name = "Wooden Sword";
f->description = "Wooden Sword";
crafting::setSwordRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WSWORD);
crafting::setSwordRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WSWORD);
@ -149,7 +149,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_stonesword.png";
f->name = "STSword";
f->gui_name = "Stone Sword";
f->description = "Stone Sword";
crafting::setSwordRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STSWORD);
i = CONTENT_TOOLITEM_STEELSWORD;
@ -157,7 +157,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_steelsword.png";
f->name = "SteelSword";
f->gui_name = "Steel Sword";
f->description = "Steel Sword";
crafting::setSwordRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSWORD);
i = CONTENT_TOOLITEM_STEELSHEARS;
@ -165,7 +165,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_shears.png";
f->name = "Shears";
f->gui_name = "Steel Shears";
f->description = "Steel Shears";
crafting::setShearsRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSHEARS);
i = CONTENT_TOOLITEM_WBUCKET;
@ -173,7 +173,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_woodbucket.png";
f->name = "WBucket";
f->gui_name = "Wooden Bucket";
f->description = "Wooden Bucket";
f->liquids_pointable = true;
crafting::setURecipe(CONTENT_CRAFTITEM_STICK,CONTENT_TOOLITEM_WBUCKET);
@ -182,7 +182,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_tinbucket.png";
f->name = "TinBucket";
f->gui_name = "Tin Bucket";
f->description = "Tin Bucket";
f->liquids_pointable = true;
crafting::setURecipe(CONTENT_CRAFTITEM_TIN_INGOT,CONTENT_TOOLITEM_TINBUCKET);
@ -191,21 +191,21 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_woodbucket_water.png";
f->name = "WBucket_water";
f->gui_name = "Wooden Bucket of Water";
f->description = "Wooden Bucket of Water";
i = CONTENT_TOOLITEM_TINBUCKET_WATER;
f = &g_content_toolitem_features[i];
f->content = i;
f->texture = "tool_tinbucket_water.png";
f->name = "TinBucket_water";
f->gui_name = "Tin Bucket of Water";
f->description = "Tin Bucket of Water";
i = CONTENT_TOOLITEM_STEELBUCKET;
f = &g_content_toolitem_features[i];
f->content = i;
f->texture = "tool_steelbucket.png";
f->name = "SteelBucket";
f->gui_name = "Steel Bucket";
f->description = "Steel Bucket";
f->liquids_pointable = true;
crafting::setURecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELBUCKET);
@ -214,14 +214,14 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_steelbucket_water.png";
f->name = "SteelBucket_water";
f->gui_name = "Steel Bucket of Water";
f->description = "Steel Bucket of Water";
i = CONTENT_TOOLITEM_STEELBUCKET_LAVA;
f = &g_content_toolitem_features[i];
f->content = i;
f->texture = "tool_steelbucket_lava.png";
f->name = "SteelBucket_lava";
f->gui_name = "Steel Bucket of Lava";
f->description = "Steel Bucket of Lava";
f->fuel_time = 80;
i = CONTENT_TOOLITEM_FIRESTARTER;
@ -229,7 +229,7 @@ void content_toolitem_init()
f->content = i;
f->texture = "tool_fire_starter.png";
f->name = "FireStarter";
f->gui_name = "Fire Starter";
f->description = "Fire Starter";
f->liquids_pointable = true;
crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FLINT,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_FIRESTARTER);
@ -238,6 +238,6 @@ void content_toolitem_init()
f->content = i;
f->texture = "crowbar.png";
f->name = "crowbar";
f->gui_name = "Crowbar";
f->description = "Crowbar";
crafting::set1over1Recipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_CROWBAR);
}

View File

@ -11,7 +11,7 @@ struct ToolItemFeatures {
// the old 'subname'
std::string name;
// tooltip used in inventory
std::string gui_name;
std::string description;
// the result of cooking this item
std::string cook_result;
// the fuel value of this item
@ -27,7 +27,7 @@ struct ToolItemFeatures {
content(CONTENT_IGNORE),
texture("unknown_item.png"),
name(""),
gui_name(""),
description(""),
cook_result(""),
fuel_time(0.0),
edible(0),

View File

@ -184,7 +184,7 @@ video::ITexture * CraftItem::getImage() const
#endif
std::string CraftItem::getGuiName()
{
return content_craftitem_features(m_content).gui_name;
return content_craftitem_features(m_content).description;
}
ServerActiveObject* CraftItem::createSAO(ServerEnvironment *env, u16 id, v3f pos)

View File

@ -377,7 +377,7 @@ public:
}
#endif
std::string getGuiName() {
return content_toolitem_features(m_content).gui_name;
return content_toolitem_features(m_content).description;
}
std::string getText()
{

View File

@ -344,7 +344,7 @@ TileSpec MapNode::getTile(v3s16 dir)
if(content_features(*this).param_type == CPT_MINERAL && g_texturesource)
{
u8 mineral = getMineral();
std::string mineral_texture_name = mineral_block_texture(mineral);
std::string mineral_texture_name = mineral_features(mineral).texture;
if(mineral_texture_name != "")
{
u32 orig_id = spec.texture.id;

View File

@ -19,38 +19,54 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "mineral.h"
struct MineralFeatures g_mineral_features[MINERAL_MAX+1];
const char *mineral_filenames[MINERAL_COUNT] =
MineralFeatures & mineral_features(u8 i)
{
NULL,
"mineral_coal.png",
"mineral_iron.png",
"mineral_tin.png",
"mineral_copper.png",
"mineral_silver.png",
"mineral_gold.png",
"mineral_quartz.png"
};
std::string mineral_textures[MINERAL_COUNT];
return g_mineral_features[i];
}
void init_mineral()
{
for(u32 i=0; i<MINERAL_COUNT; i++)
{
if(mineral_filenames[i] == NULL)
continue;
mineral_textures[i] = mineral_filenames[i];
u8 i;
MineralFeatures *f = NULL;
i = MINERAL_COAL;
f = &mineral_features(i);
f->texture = "mineral_coal.png";
f->dug_item = CONTENT_CRAFTITEM_COAL;
f->dug_count = 2;
i = MINERAL_IRON;
f = &mineral_features(i);
f->texture = "mineral_iron.png";
f->dug_item = CONTENT_CRAFTITEM_IRON;
f->dug_count = 2;
i = MINERAL_TIN;
f = &mineral_features(i);
f->texture = "mineral_tin.png";
f->dug_item = CONTENT_CRAFTITEM_TIN;
f->dug_count = 2;
i = MINERAL_COPPER;
f = &mineral_features(i);
f->texture = "mineral_copper.png";
f->dug_item = CONTENT_CRAFTITEM_COPPER;
f->dug_count = 2;
i = MINERAL_SILVER;
f = &mineral_features(i);
f->texture = "mineral_silver.png";
f->dug_item = CONTENT_CRAFTITEM_SILVER;
i = MINERAL_GOLD;
f = &mineral_features(i);
f->texture = "mineral_gold.png";
f->dug_item = CONTENT_CRAFTITEM_GOLD;
i = MINERAL_QUARTZ;
f = &mineral_features(i);
f->texture = "mineral_quartz.png";
f->dug_item = CONTENT_CRAFTITEM_QUARTZ;
}
}
std::string mineral_block_texture(u8 mineral)
{
if(mineral >= MINERAL_COUNT)
return "";
return mineral_textures[mineral];
}

View File

@ -22,16 +22,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "inventory.h"
/*
Minerals
Value is stored in the lowest 5 bits of a MapNode's CPT_MINERAL
type param.
*/
// Caches textures
void init_mineral();
#define MINERAL_NONE 0
#define MINERAL_COAL 1
#define MINERAL_IRON 2
@ -41,29 +31,40 @@ void init_mineral();
#define MINERAL_GOLD 6
#define MINERAL_QUARTZ 7
#define MINERAL_COUNT 8
struct MineralFeatures {
std::string texture;
// the dug item
content_t dug_item;
// the number of dug_items received when dug
s16 dug_count;
std::string mineral_block_texture(u8 mineral);
MineralFeatures():
texture(""),
dug_item(CONTENT_IGNORE),
dug_count(1)
{}
};
/*
Minerals
Value is stored in the lowest 5 bits of a MapNode's CPT_MINERAL
type param.
*/
// Caches textures
void init_mineral();
MineralFeatures & mineral_features(u8 i);
#define MINERAL_MAX 255
inline CraftItem * getDiggedMineralItem(u8 mineral)
{
if (mineral == MINERAL_COAL) {
return new CraftItem("lump_of_coal", 2);
}else if(mineral == MINERAL_IRON) {
return new CraftItem("lump_of_iron", 2);
}else if(mineral == MINERAL_TIN) {
return new CraftItem("lump_of_tin", 2);
}else if(mineral == MINERAL_COPPER) {
return new CraftItem("lump_of_copper", 2);
}else if(mineral == MINERAL_SILVER) {
return new CraftItem("lump_of_silver", 1);
}else if(mineral == MINERAL_GOLD) {
return new CraftItem("lump_of_gold", 1);
}else if(mineral == MINERAL_QUARTZ) {
return new CraftItem("lump_of_quartz", 1);
}
MineralFeatures m = mineral_features(mineral);
if (m.dug_item == CONTENT_IGNORE)
return NULL;
return new CraftItem(content_craftitem_features(m.dug_item).name,m.dug_count);
}
#endif

View File

@ -419,8 +419,10 @@ void TextureSource::buildMainAtlas()
sourcelist[name] = true;
if (f->often_contains_mineral) {
for(int k=1; k<MINERAL_COUNT; k++){
std::string mineraltexture = mineral_block_texture(k);
for (int k=1; k<MINERAL_MAX; k++){
std::string mineraltexture = mineral_features(k).texture;
if (mineraltexture == "")
continue;
std::string fulltexture = name + "^" + mineraltexture;
sourcelist[fulltexture] = true;
}