From 6b529e1204ae39d86f1b50a57acc64986f8fe02c Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 12 Mar 2020 02:29:30 +0100 Subject: [PATCH] Colorize some item tooltips --- mods/ENTITIES/mobs_mc/1_items_default.lua | 2 +- mods/HELP/mcl_tt/init.lua | 2 +- mods/ITEMS/mcl_core/craftitems.lua | 3 ++- mods/ITEMS/mcl_core/nodes_cactuscane.lua | 2 +- mods/ITEMS/mcl_farming/locale/mcl_farming.de.tr | 2 +- mods/ITEMS/mcl_farming/potatoes.lua | 2 +- mods/ITEMS/mcl_fishing/init.lua | 2 +- mods/ITEMS/mcl_mobitems/init.lua | 8 ++++---- mods/ITEMS/mcl_nether/init.lua | 2 +- mods/ITEMS/mcl_throwing/init.lua | 2 +- 10 files changed, 14 insertions(+), 13 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/1_items_default.lua b/mods/ENTITIES/mobs_mc/1_items_default.lua index a86bc012ef..8d67823bf7 100644 --- a/mods/ENTITIES/mobs_mc/1_items_default.lua +++ b/mods/ENTITIES/mobs_mc/1_items_default.lua @@ -532,7 +532,7 @@ if c("totem") then -- Totem of Undying minetest.register_craftitem("mobs_mc:totem", { description = S("Totem of Undying"), - _tt_help = S("Protects you from death while wielding it"), + _tt_help = minetest.colorize("#00FF00", S("Protects you from death while wielding it")), _doc_items_longdesc = S("A totem of undying is a rare artifact which may safe you from certain death."), _doc_items_usagehelp = S("The totem only works while you hold it in your hand. If you receive fatal damage, you are saved from death and you get a second chance with 1 HP. The totem is destroyed in the process, however."), inventory_image = "mcl_totems_totem.png", diff --git a/mods/HELP/mcl_tt/init.lua b/mods/HELP/mcl_tt/init.lua index 445ec09b08..569dbe6866 100644 --- a/mods/HELP/mcl_tt/init.lua +++ b/mods/HELP/mcl_tt/init.lua @@ -71,7 +71,7 @@ end) tt.register_snippet(function(itemstring) local def = minetest.registered_items[itemstring] if minetest.get_item_group(itemstring, "crush_after_fall") == 1 then - return S("Deals damage when falling") + return S("Deals damage when falling"), "#FFFF00" end end) diff --git a/mods/ITEMS/mcl_core/craftitems.lua b/mods/ITEMS/mcl_core/craftitems.lua index 3b980f1d84..ab2bcd1f8c 100644 --- a/mods/ITEMS/mcl_core/craftitems.lua +++ b/mods/ITEMS/mcl_core/craftitems.lua @@ -146,7 +146,8 @@ minetest.register_craftitem("mcl_core:apple", { -- TODO: Status effects minetest.register_craftitem("mcl_core:apple_gold", { - description = minetest.colorize("#55FFFF", S("Golden Apple")), + -- TODO: Add special highlight color when this item is special + description = S("Golden Apple"), _doc_items_longdesc = S("Golden apples are precious food items which can be eaten."), wield_image = "mcl_core_apple_golden.png", inventory_image = "mcl_core_apple_golden.png", diff --git a/mods/ITEMS/mcl_core/nodes_cactuscane.lua b/mods/ITEMS/mcl_core/nodes_cactuscane.lua index 326182db0e..e8555f1487 100644 --- a/mods/ITEMS/mcl_core/nodes_cactuscane.lua +++ b/mods/ITEMS/mcl_core/nodes_cactuscane.lua @@ -4,7 +4,7 @@ local S = minetest.get_translator("mcl_core") minetest.register_node("mcl_core:cactus", { description = S("Cactus"), - _tt_help = S("Grows on sand").."\n"..S("Contact damage: @1 per half second", 1), + _tt_help = S("Grows on sand").."\n"..minetest.colorize("#FFFF00", S("Contact damage: @1 per half second", 1)), _doc_items_longdesc = S("This is a piece of cactus commonly found in dry areas, especially deserts. Over time, cacti will grow up to 3 blocks high on sand or red sand. A cactus hurts living beings touching it with a damage of 1 HP every half second. When a cactus block is broken, all cactus blocks connected above it will break as well."), _doc_items_usagehelp = S("A cactus can only be placed on top of another cactus or any sand."), drawtype = "nodebox", diff --git a/mods/ITEMS/mcl_farming/locale/mcl_farming.de.tr b/mods/ITEMS/mcl_farming/locale/mcl_farming.de.tr index 0295e620fe..54b3563064 100644 --- a/mods/ITEMS/mcl_farming/locale/mcl_farming.de.tr +++ b/mods/ITEMS/mcl_farming/locale/mcl_farming.de.tr @@ -93,7 +93,7 @@ To carve a face into the pumpkin, use the shears on the side you want to carve.= Use the “Place” key on an animal to try to feed it wheat.=Benutzen Sie die „Platzieren“-Taste auf einem Tier, um zu versuchen, es zu füttern. Grows on farmland=Wächst auf Ackerboden Turns block into farmland=Macht Block zu Ackerboden -60% chance of poisoning=60% Vergiftungsgefahr +60% chance of poisoning=60% Vergiftungswahrscheinlichkeit Surface for crops=Boden für Nutzpflanzen Can become wet=Kann nass werden Uses: @1=Verwendungen: @1 diff --git a/mods/ITEMS/mcl_farming/potatoes.lua b/mods/ITEMS/mcl_farming/potatoes.lua index a4049cce66..2d8978df4e 100644 --- a/mods/ITEMS/mcl_farming/potatoes.lua +++ b/mods/ITEMS/mcl_farming/potatoes.lua @@ -118,7 +118,7 @@ minetest.register_craftitem("mcl_farming:potato_item_baked", { minetest.register_craftitem("mcl_farming:potato_item_poison", { description = S("Poisonous Potato"), - _tt_help = S("60% chance of poisoning"), + _tt_help = minetest.colorize("#FFFF00", S("60% chance of poisoning")), _doc_items_longdesc = S("This potato doesn't look too healthy. You can eat it to restore hunger points, but there's a 60% chance it will poison you briefly."), stack_max = 64, inventory_image = "farming_potato_poison.png", diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index 30c1826b3c..192a8f6efe 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -418,7 +418,7 @@ minetest.register_craftitem("mcl_fishing:clownfish_raw", { -- TODO: Add real status effect minetest.register_craftitem("mcl_fishing:pufferfish_raw", { description = S("Pufferfish"), - _tt_help = S("Very poisonous"), + _tt_help = minetest.colorize("#FFFF00", S("Very poisonous")), _doc_items_longdesc = S("Pufferfish are a common species of fish and can be obtained by fishing. They can technically be eaten, but they are very bad for humans. Eating a pufferfish only restores 1 hunger point and will poison you very badly (which drains your health non-fatally) and causes serious food poisoning (which increases your hunger)."), inventory_image = "mcl_fishing_pufferfish_raw.png", on_place = minetest.item_eat(1), diff --git a/mods/ITEMS/mcl_mobitems/init.lua b/mods/ITEMS/mcl_mobitems/init.lua index 9cebf1f30c..3e6aef4853 100644 --- a/mods/ITEMS/mcl_mobitems/init.lua +++ b/mods/ITEMS/mcl_mobitems/init.lua @@ -4,7 +4,7 @@ local S = minetest.get_translator("mcl_mobitems") minetest.register_craftitem("mcl_mobitems:rotten_flesh", { description = S("Rotten Flesh"), - _tt_help = S("80% chance of food poisoning"), + _tt_help = minetest.colorize("#FFFF00", S("80% chance of food poisoning")), _doc_items_longdesc = S("Yuck! This piece of flesh clearly has seen better days. If you're really desperate, you can eat it to restore a few hunger points, but there's a 80% chance it causes food poisoning, which increases your hunger for a while."), inventory_image = "mcl_mobitems_rotten_flesh.png", wield_image = "mcl_mobitems_rotten_flesh.png", @@ -65,7 +65,7 @@ minetest.register_craftitem("mcl_mobitems:cooked_beef", { minetest.register_craftitem("mcl_mobitems:chicken", { description = S("Raw Chicken"), - _tt_help = S("30% chance of food poisoning"), + _tt_help = minetest.colorize("#FFFF00", S("30% chance of food poisoning")), _doc_items_longdesc = S("Raw chicken is a food item which is not safe to consume. You can eat it to restore a few hunger points, but there's a 30% chance to suffer from food poisoning, which increases your hunger rate for a while. Cooking raw chicken will make it safe to eat and increases its nutritional value."), inventory_image = "mcl_mobitems_chicken_raw.png", wield_image = "mcl_mobitems_chicken_raw.png", @@ -148,7 +148,7 @@ end -- TODO: Clear *all* status effects minetest.register_craftitem("mcl_mobitems:milk_bucket", { description = S("Milk"), - _tt_help = S("Cures poison"), + _tt_help = minetest.colorize("#00FF00", S("Cures poison")), _doc_items_longdesc = S("Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will cure all forms of poisoning, but restores no hunger points."), _doc_items_usagehelp = "Rightclick to drink the milk.", inventory_image = "mcl_mobitems_bucket_milk.png", @@ -162,7 +162,7 @@ minetest.register_craftitem("mcl_mobitems:milk_bucket", { minetest.register_craftitem("mcl_mobitems:spider_eye", { description = S("Spider Eye"), - _tt_help = S("Poisonous"), + _tt_help = minetest.colorize("#FFFF00", S("Poisonous")), _doc_items_longdesc = S("Spider eyes are used mainly in crafting. If you're really desperate, you can eat a spider eye, but it will poison you briefly."), inventory_image = "mcl_mobitems_spider_eye.png", wield_image = "mcl_mobitems_spider_eye.png", diff --git a/mods/ITEMS/mcl_nether/init.lua b/mods/ITEMS/mcl_nether/init.lua index 50c0bf667b..07c575f048 100644 --- a/mods/ITEMS/mcl_nether/init.lua +++ b/mods/ITEMS/mcl_nether/init.lua @@ -85,7 +85,7 @@ minetest.register_node("mcl_nether:netherrack", { minetest.register_node("mcl_nether:magma", { description = S("Magma Block"), - _tt_help = S("Burns your feet"), + _tt_help = minetest.colorize("#FFFF00", S("Burns your feet")), _doc_items_longdesc = S("Magma blocks are hot solid blocks which hurt anyone standing on it, unless they have fire resistance. Starting a fire on this block will create an eternal fire."), stack_max = 64, tiles = {{name="mcl_nether_magma.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1.5}}}, diff --git a/mods/ITEMS/mcl_throwing/init.lua b/mods/ITEMS/mcl_throwing/init.lua index 7e9249a6c9..9dcbb2f2d3 100644 --- a/mods/ITEMS/mcl_throwing/init.lua +++ b/mods/ITEMS/mcl_throwing/init.lua @@ -419,7 +419,7 @@ minetest.register_craftitem("mcl_throwing:egg", { -- Ender Pearl minetest.register_craftitem("mcl_throwing:ender_pearl", { description = S("Ender Pearl"), - _tt_help = S("Throwable").."\n"..S("Teleports you on impact for cost of 5 HP"), + _tt_help = S("Throwable").."\n"..minetest.colorize("#FFFF00", S("Teleports you on impact for cost of 5 HP")), _doc_items_longdesc = S("An ender pearl is an item which can be used for teleportation at the cost of health. It can be thrown and teleport the thrower to its impact location when it hits a solid block or a plant. Each teleportation hurts the user by 5 hit points."), _doc_items_usagehelp = how_to_throw, wield_image = "mcl_throwing_ender_pearl.png",