diff --git a/api.lua b/api.lua index f8cb9e6..a8884cb 100644 --- a/api.lua +++ b/api.lua @@ -689,13 +689,16 @@ end -- \param displayName Display name of cell -- \param node Node which can be picked up with this cell -- \returns nil -industrialtest.api.registerStorageCell=function(name,displayName,node,modname) +industrialtest.api.registerStorageCell=function(name,displayName,node,modname,color) + color = color or "#ffffffff" if not modname then modname="industrialtest" end minetest.register_craftitem("industrialtest:"..name.."_cell",{ description=S(displayName.." Cell"), - inventory_image=modname.."_"..name.."_cell.png", + inventory_image="industrialtest_cell_fluid.png", + inventory_overlay="industrialtest_cell_casing.png", + color=color, on_place=function(itemstack,user,pointed) if pointed.type~="node" or not user or not user:is_player() then return nil diff --git a/craftitems.lua b/craftitems.lua index c9b54d7..90379c4 100644 --- a/craftitems.lua +++ b/craftitems.lua @@ -31,6 +31,14 @@ local colors={ sulfur="#b88805ff", tin="#ebd182ff", uranium="#3b8c09ff", + -- fluid colors + lava="#ff5712ff", + water="#277bbcff", + river_water="#0ebfc2ff", + biomass="#2a8626ff", + biofuel="#4eba49ff", + coalfuel="#462228ff", + coolant="#188676ff" } -- Power storage items @@ -626,12 +634,12 @@ minetest.register_craft({ {"",industrialtest.elementKeys.tinIngot,""} } }) -industrialtest.api.registerStorageCell("water","Water",industrialtest.elementKeys.waterSource) +industrialtest.api.registerStorageCell("water","Water",industrialtest.elementKeys.waterSource,nil,colors.water) if industrialtest.mtgAvailable then - industrialtest.api.registerStorageCell("river_water","River Water","default:river_water_source") + industrialtest.api.registerStorageCell("river_water","River Water","default:river_water_source",nil,colors.river_water) end -industrialtest.api.registerStorageCell("lava","Lava",industrialtest.elementKeys.lavaSource) +industrialtest.api.registerStorageCell("lava","Lava",industrialtest.elementKeys.lavaSource,nil,colors.lava) minetest.register_tool("industrialtest:uranium_cell",{ description=S("Uranium Cell"), @@ -639,7 +647,9 @@ minetest.register_tool("industrialtest:uranium_cell",{ _industrialtest_placedInNuclearReactor=1, _industrialtest_nuclearReactorFuel=1 }, - inventory_image="industrialtest_uranium_cell.png", + inventory_image="industrialtest_cell_fluid.png", + inventory_overlay="industrialtest_cell_casing.png", + color=colors.uranium, }) minetest.register_craft({ type="shapeless", @@ -656,7 +666,9 @@ minetest.register_tool("industrialtest:coolant_cell",{ _industrialtest_placedInNuclearReactor=1, _industrialtest_nuclearReactorCoolant=1 }, - inventory_image="industrialtest_coolant_cell.png", + inventory_image="industrialtest_cell_fluid.png", + inventory_overlay="industrialtest_cell_casing.png", + color=colors.coolant, }) minetest.register_craft({ type="shaped", @@ -681,7 +693,9 @@ end minetest.register_craftitem("industrialtest:bio_cell",{ description=S("Bio Cell"), - inventory_image="industrialtest_bio_cell.png" + inventory_image="industrialtest_cell_fluid.png", + inventory_overlay="industrialtest_cell_casing.png", + color=colors.biomass, }) minetest.register_craft({ type="shapeless", @@ -694,7 +708,9 @@ minetest.register_craft({ minetest.register_craftitem("industrialtest:biofuel_cell",{ description=S("Biofuel Cell"), - inventory_image="industrialtest_bio_cell.png", + inventory_image="industrialtest_cell_fluid.png", + inventory_overlay="industrialtest_cell_casing.png", + color=colors.biofuel, groups={ _industrialtest_fuel=1 }, @@ -709,7 +725,9 @@ industrialtest.api.registerExtractorRecipe({ minetest.register_craftitem("industrialtest:hydrated_coal_cell",{ description=S("Hydrated Coal Cell"), - inventory_image="industrialtest_hydrated_coal_cell.png" + inventory_image="industrialtest_cell_fluid.png", + inventory_overlay="industrialtest_cell_casing.png", + color=colors.coal, }) minetest.register_craft({ type="shapeless", @@ -722,7 +740,9 @@ minetest.register_craft({ minetest.register_craftitem("industrialtest:coalfuel_cell",{ description=S("Coalfuel Cell"), - inventory_image="industrialtest_coalfuel_cell.png", + inventory_image="industrialtest_cell_fluid.png", + inventory_overlay="industrialtest_cell_casing.png", + color=colors.coalfuel, groups={ _industrialtest_fuel=1 }, diff --git a/textures/industrialtest_bio_cell.png b/textures/industrialtest_bio_cell.png deleted file mode 100644 index 2612044..0000000 Binary files a/textures/industrialtest_bio_cell.png and /dev/null differ diff --git a/textures/industrialtest_biofuel_cell.png b/textures/industrialtest_biofuel_cell.png deleted file mode 100644 index e9fdba5..0000000 Binary files a/textures/industrialtest_biofuel_cell.png and /dev/null differ diff --git a/textures/industrialtest_cell_casing.png b/textures/industrialtest_cell_casing.png new file mode 100644 index 0000000..17292e2 Binary files /dev/null and b/textures/industrialtest_cell_casing.png differ diff --git a/textures/industrialtest_cell_fluid.png b/textures/industrialtest_cell_fluid.png new file mode 100644 index 0000000..3eab237 Binary files /dev/null and b/textures/industrialtest_cell_fluid.png differ diff --git a/textures/industrialtest_coalfuel_cell.png b/textures/industrialtest_coalfuel_cell.png deleted file mode 100644 index db45911..0000000 Binary files a/textures/industrialtest_coalfuel_cell.png and /dev/null differ diff --git a/textures/industrialtest_coolant_cell.png b/textures/industrialtest_coolant_cell.png deleted file mode 100644 index ae07ec8..0000000 Binary files a/textures/industrialtest_coolant_cell.png and /dev/null differ diff --git a/textures/industrialtest_empty_cell.png b/textures/industrialtest_empty_cell.png index 667f132..c52b3e4 100644 Binary files a/textures/industrialtest_empty_cell.png and b/textures/industrialtest_empty_cell.png differ diff --git a/textures/industrialtest_hydrated_coal_cell.png b/textures/industrialtest_hydrated_coal_cell.png deleted file mode 100644 index 0586e16..0000000 Binary files a/textures/industrialtest_hydrated_coal_cell.png and /dev/null differ diff --git a/textures/industrialtest_lava_cell.png b/textures/industrialtest_lava_cell.png deleted file mode 100644 index 2f3b0e5..0000000 Binary files a/textures/industrialtest_lava_cell.png and /dev/null differ diff --git a/textures/industrialtest_river_water_cell.png b/textures/industrialtest_river_water_cell.png deleted file mode 100644 index 5c3bb88..0000000 Binary files a/textures/industrialtest_river_water_cell.png and /dev/null differ diff --git a/textures/industrialtest_uranium_cell.png b/textures/industrialtest_uranium_cell.png deleted file mode 100644 index fad7f94..0000000 Binary files a/textures/industrialtest_uranium_cell.png and /dev/null differ diff --git a/textures/industrialtest_water_cell.png b/textures/industrialtest_water_cell.png deleted file mode 100644 index adbbe9c..0000000 Binary files a/textures/industrialtest_water_cell.png and /dev/null differ