write something there

This commit is contained in:
N-Nachtigal 2025-05-04 16:01:41 +02:00
commit b4b6c08f4f
8546 changed files with 309825 additions and 0 deletions

1
mods/tt_base/.mailmap Normal file
View file

@ -0,0 +1 @@
Wuzzy <Wuzzy@disroot.org> <Wuzzy2@mail.ru>

28
mods/tt_base/README.md Normal file
View file

@ -0,0 +1,28 @@
# Extended Tooltips: Base
This mod is for the Extended Tooltips [tt] mod to extend item tooltips with the following
basic info:
* Tool digging times
* Weapon stats
* Food stats
* Node damage
* Node light level
* Node info: climbable, slippery, bouncy, jumping restriction
This mod assumes that the default gameplay behavior of Luanti is used.
This mod introduces support for new item definition fields:
* `_tt_food`: If `true`, item is a food item that can be consumed by the player
* `_tt_food_hp`: Health increase (in HP) for player when consuming food item
Because there is no standard way in Luanti to mark an item as food, these fields
are required for food items to be recognized as such.
## Version
1.0.0
This mod requires Luanti 5.10.0 or later.
## License
MIT License.

196
mods/tt_base/init.lua Normal file
View file

@ -0,0 +1,196 @@
local S, PS = minetest.get_translator("tt_base")
local function get_min_digtime(caps)
local mintime
local unique = true
local maxlevel = caps.maxlevel
if not maxlevel then
maxlevel = 1
end
if maxlevel > 1 then
unique = false
end
if caps.times then
for r=1,3 do
local time = caps.times[r]
if time and maxlevel > 1 then
time = time / maxlevel
end
if time and ((not mintime) or (time < mintime)) then
if mintime and (time < mintime) then
unique = false
end
mintime = time
end
end
end
return mintime, unique
end
local function newline(str)
if str ~= "" then
str = str .. "\n"
end
return str
end
-- Tool information (digging times, weapon stats)
tt.register_snippet(function(itemstring)
local def = minetest.registered_items[itemstring]
local desc = ""
if def.tool_capabilities then
-- Digging times
local digs = ""
local d
if def.tool_capabilities.groupcaps then
for group, caps in pairs(def.tool_capabilities.groupcaps) do
local mintime, unique_mintime
if caps.times then
mintime, unique_mintime = get_min_digtime(caps)
if mintime and (mintime > 0 or (not unique_mintime)) then
d = S("Digs @1 blocks", group) .. "\n"
d = d .. S("Minimum dig time: @1s", string.format("%.2f", mintime))
digs = newline(digs)
digs = digs .. d
elseif mintime and mintime == 0 then
d = S("Digs @1 blocks instantly", group)
digs = newline(digs)
digs = digs .. d
end
end
end
if digs ~= "" then
desc = desc .. digs
end
end
-- Weapon stats
if def.tool_capabilities.damage_groups then
for group, damage in pairs(def.tool_capabilities.damage_groups) do
local msg
if group == "fleshy" then
if damage >= 0 then
msg = S("Damage: @1", damage)
else
msg = S("Healing: @1", math.abs(damage))
end
else
if damage >= 0 then
msg = S("Damage (@1): @2", group, damage)
else
msg = S("Healing (@1): @2", group, math.abs(damage))
end
end
desc = newline(desc)
desc = desc .. msg
end
local full_punch_interval = def.tool_capabilities.full_punch_interval
if not full_punch_interval then
full_punch_interval = 1
end
desc = newline(desc)
desc = desc .. S("Full punch interval: @1s", string.format("%.2f", full_punch_interval))
end
end
if desc == "" then
desc = nil
end
return desc
end)
-- Food
tt.register_snippet(function(itemstring)
local def = minetest.registered_items[itemstring]
local desc
if def._tt_food then
desc = S("Food item")
if def._tt_food_hp then
local msg
if PS then
msg = PS("+@1 food point", "+@1 food points", def._tt_food_hp, def._tt_food_hp)
else
-- fallback when plural forms are unavailable
msg = S("+@1 food points", def._tt_food_hp)
end
desc = desc .. "\n" .. msg
end
end
return desc
end)
-- Node info
tt.register_snippet(function(itemstring)
local def = minetest.registered_items[itemstring]
local desc = ""
-- Health-related node facts
if def.damage_per_second then
if def.damage_per_second > 0 then
desc = newline(desc)
desc = desc .. minetest.colorize(tt.COLOR_DANGER, S("Contact damage: @1 per second", def.damage_per_second))
elseif def.damage_per_second < 0 then
desc = newline(desc)
desc = desc .. minetest.colorize(tt.COLOR_GOOD, S("Contact healing: @1 per second", math.abs(def.damage_per_second)))
end
end
if def.drowning and def.drowning ~= 0 then
desc = newline(desc)
desc = desc .. minetest.colorize(tt.COLOR_DANGER, S("Drowning damage: @1", def.drowning))
end
local tmp = minetest.get_item_group(itemstring, "fall_damage_add_percent")
if tmp > 0 then
desc = newline(desc)
desc = desc .. minetest.colorize(tt.COLOR_DANGER, S("Fall damage: +@1%", tmp))
elseif tmp == -100 then
desc = newline(desc)
desc = desc .. minetest.colorize(tt.COLOR_GOOD, S("No fall damage"))
elseif tmp < 0 then
desc = newline(desc)
desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("Fall damage: @1%", tmp))
end
-- Movement-related node facts
if minetest.get_item_group(itemstring, "disable_jump") == 1 and not def.climbable then
if def.liquidtype == "none" then
desc = newline(desc)
desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("No jumping"))
elseif minetest.get_item_group(itemstring, "fake_liquid") == 0 then
desc = newline(desc)
desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("No swimming upwards"))
else
desc = newline(desc)
desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("No rising"))
end
end
if def.climbable then
if minetest.get_item_group(itemstring, "disable_jump") == 1 then
desc = newline(desc)
desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("Climbable (only downwards)"))
else
desc = newline(desc)
desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("Climbable"))
end
end
if minetest.get_item_group(itemstring, "slippery") >= 1 then
desc = newline(desc)
desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("Slippery"))
end
tmp = minetest.get_item_group(itemstring, "bouncy")
if tmp >= 1 then
desc = newline(desc)
desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("Bouncy (@1%)", tmp))
end
-- Node appearance
tmp = def.light_source
if tmp and tmp >= 1 then
desc = newline(desc)
desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("Luminance: @1", tmp))
end
if desc == "" then
desc = nil
end
return desc, false
end)

View file

@ -0,0 +1,94 @@
msgid ""
msgstr ""
"Project-Id-Version: Luanti textdomain tt_base x.x.x\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
msgid "Extended Tooltips: Base"
msgstr "Erweiterte Tooltips: Basis"
msgid "Adds generic tooltip extensions to items"
msgstr "Fügt generische Tooltip-Erweiterungen zu Gegenständen hinzu"
msgid "Damage: @1"
msgstr "Schaden: @1"
msgid "Damage (@1): @2"
msgstr "Schaden (@1): @2"
msgid "Healing: @1"
msgstr "Heilung: @1"
msgid "Healing (@1): @2"
msgstr "Heilung (@1): @2"
msgid "Full punch interval: @1s"
msgstr "Zeit zum Ausholen: @1s"
msgid "Food item"
msgstr "Lebensmittel"
msgid "+@1 food point"
msgid_plural "+@1 food points"
msgstr[0] "+@1 Nahrungspunkt"
msgstr[1] "+@1 Nahrungspunkte"
msgid "Contact damage: @1 per second"
msgstr "Kontaktschaden: @1 pro Sekunde"
msgid "Contact healing: @1 per second"
msgstr "Kontaktheilung: @1 pro Sekunde"
msgid "Drowning damage: @1"
msgstr "Ertrinkensschaden: @1"
msgid "Bouncy (@1%)"
msgstr "Sprunghaft (@1%)"
msgid "Luminance: @1"
msgstr "Lichtstärke: @1"
msgid "Slippery"
msgstr "Rutschig"
msgid "Climbable"
msgstr "Erkletterbar"
msgid "Climbable (only downwards)"
msgstr "Erkletterbar (nur nach unten)"
msgid "No jumping"
msgstr "Kein Springen"
msgid "No swimming upwards"
msgstr "Kein nach oben schwimmen"
msgid "No rising"
msgstr "Kein Aufsteigen"
msgid "Fall damage: @1%"
msgstr "Fallschaden: @1%"
msgid "Fall damage: +@1%"
msgstr "Fallschaden: +@1%"
msgid "No fall damage"
msgstr "Kein Fallschaden"
msgid "Digs @1 blocks"
msgstr "Gräbt „@1“-Blöcke"
msgid "Digs @1 blocks instantly"
msgstr "Gräbt „@1“-Blöcke sofort"
msgid "Minimum dig time: @1s"
msgstr "Minimale Grabezeit: @1s"

View file

@ -0,0 +1,95 @@
msgid ""
msgstr ""
"Project-Id-Version: Luanti textdomain tt_base x.x.x\n"
"Report-Msgid-Bugs-To: Wuzzy@disroot.org\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
msgid "Extended Tooltips: Base"
msgstr ""
msgid "Adds generic tooltip extensions to items"
msgstr ""
msgid "Damage: @1"
msgstr "Dégâts: @1"
msgid "Damage (@1): @2"
msgstr "Dégâts (@1): @2"
msgid "Healing: @1"
msgstr "Guérison: @1"
msgid "Healing (@1): @2"
msgstr "Guérison (@1): @2"
msgid "Full punch interval: @1s"
msgstr "Intervalle de coup: @1s"
msgid "Food item"
msgstr "alimentaire"
#, fuzzy
msgid "+@1 food point"
msgid_plural "+@1 food points"
msgstr[0] "+@1 de saturation"
msgstr[1] "+@1 de saturation"
msgid "Contact damage: @1 per second"
msgstr "Dégâts de contact: @1 par seconde"
msgid "Contact healing: @1 per second"
msgstr "Guérison de contact: @1 par seconde"
msgid "Drowning damage: @1"
msgstr "Dégâts de noyade: @1"
msgid "Bouncy (@1%)"
msgstr "Rebondissant (@1%)"
msgid "Luminance: @1"
msgstr "Luminance: @1"
msgid "Slippery"
msgstr "Glissant"
msgid "Climbable"
msgstr "Grimpable"
msgid "Climbable (only downwards)"
msgstr "Grimpable (uniquement vers le bas)"
msgid "No jumping"
msgstr "Ne pas sauter"
msgid "No swimming upwards"
msgstr "Ne pas nager vers le haut"
msgid "No rising"
msgstr "Pas de montée"
msgid "Fall damage: @1%"
msgstr "Dégâts de chute: @1%"
msgid "Fall damage: +@1%"
msgstr "Dégâts de chute: +@1%"
msgid "No fall damage"
msgstr "Pas de dégâts de chute"
msgid "Digs @1 blocks"
msgstr "Digs @1 blocks"
msgid "Digs @1 blocks instantly"
msgstr "Digs @1 blocks instantly"
msgid "Minimum dig time: @1s"
msgstr "Minimum dig time: @1s"

View file

@ -0,0 +1,94 @@
msgid ""
msgstr ""
"Project-Id-Version: Luanti textdomain tt_base x.x.x\n"
"Report-Msgid-Bugs-To: Wuzzy@disroot.org\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
msgid "Extended Tooltips: Base"
msgstr ""
msgid "Adds generic tooltip extensions to items"
msgstr ""
msgid "Damage: @1"
msgstr ""
msgid "Damage (@1): @2"
msgstr ""
msgid "Healing: @1"
msgstr ""
msgid "Healing (@1): @2"
msgstr ""
msgid "Full punch interval: @1s"
msgstr ""
msgid "Food item"
msgstr ""
msgid "+@1 food point"
msgid_plural "+@1 food points"
msgstr[0] ""
msgstr[1] ""
msgid "Contact damage: @1 per second"
msgstr ""
msgid "Contact healing: @1 per second"
msgstr ""
msgid "Drowning damage: @1"
msgstr ""
msgid "Bouncy (@1%)"
msgstr ""
msgid "Luminance: @1"
msgstr ""
msgid "Slippery"
msgstr ""
msgid "Climbable"
msgstr ""
msgid "Climbable (only downwards)"
msgstr ""
msgid "No jumping"
msgstr ""
msgid "No swimming upwards"
msgstr ""
msgid "No rising"
msgstr ""
msgid "Fall damage: @1%"
msgstr ""
msgid "Fall damage: +@1%"
msgstr ""
msgid "No fall damage"
msgstr ""
msgid "Digs @1 blocks"
msgstr ""
msgid "Digs @1 blocks instantly"
msgstr ""
msgid "Minimum dig time: @1s"
msgstr ""

View file

@ -0,0 +1,96 @@
msgid ""
msgstr ""
"Project-Id-Version: Luanti textdomain tt_base x.x.x\n"
"Report-Msgid-Bugs-To: Wuzzy@disroot.org\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
msgid "Extended Tooltips: Base"
msgstr ""
msgid "Adds generic tooltip extensions to items"
msgstr ""
msgid "Damage: @1"
msgstr "Урон: @1"
msgid "Damage (@1): @2"
msgstr "Урон (@1): @2"
msgid "Healing: @1"
msgstr "Исцеление: @1"
msgid "Healing (@1): @2"
msgstr "Исцеление (@1): @2"
msgid "Full punch interval: @1s"
msgstr "Интервал полного удара: @1 с"
msgid "Food item"
msgstr "Еда"
#, fuzzy
msgid "+@1 food point"
msgid_plural "+@1 food points"
msgstr[0] "+@1 к сытости"
msgstr[1] "+@1 к сытости"
msgstr[2] "+@1 к сытости"
msgid "Contact damage: @1 per second"
msgstr "Урон при контакте: @1 в секунду"
msgid "Contact healing: @1 per second"
msgstr "Исцеление при контакте: @1 в секунду"
msgid "Drowning damage: @1"
msgstr "Урон при падении: @1"
msgid "Bouncy (@1%)"
msgstr "Упругость (@1%)"
msgid "Luminance: @1"
msgstr "Свечение: @1"
msgid "Slippery"
msgstr "Скользкость"
msgid "Climbable"
msgstr "Можно карабкаться"
msgid "Climbable (only downwards)"
msgstr "Можно спускаться"
msgid "No jumping"
msgstr "Нельзя прыгать"
msgid "No swimming upwards"
msgstr "Нельзя плыть вверх"
msgid "No rising"
msgstr "Нельзя подниматься"
msgid "Fall damage: @1%"
msgstr "Урон при падении: @1%"
msgid "Fall damage: +@1%"
msgstr "Урон при падении: +@1%"
msgid "No fall damage"
msgstr "Нет урона при падении"
msgid "Digs @1 blocks"
msgstr "Добывает @1 блоки"
msgid "Digs @1 blocks instantly"
msgstr "Добывает @1 блоки мгновенно"
msgid "Minimum dig time: @1s"
msgstr "Минимальный интервал добычи: @1с"

4
mods/tt_base/mod.conf Normal file
View file

@ -0,0 +1,4 @@
name = tt_base
title = Extended Tooltips: Base
description = Adds generic tooltip extensions to items
depends = tt