Compare commits

...

10 Commits

Author SHA1 Message Date
Wuzzy
baf0a5972a Add locale files 2024-12-14 18:23:08 +01:00
Wuzzy
395f2d189a Use classic Markdown code block style 2024-12-14 18:22:44 +01:00
Wuzzy
e8aaa94415 Change title in README 2024-11-28 15:19:31 +01:00
Wuzzy
a37f2ef496 Add mod title 2024-11-28 15:18:20 +01:00
Wuzzy
917bfbbe61 Add LICENSE.txt file 2024-04-22 11:23:15 +02:00
Wuzzy
9d0aa305e2 Add Wuzzy to .mailmap file 2023-03-08 20:38:01 +01:00
Wuzzy
e38bd2754e Version 1.0.0 2020-09-10 16:01:25 +02:00
Wuzzy
38c924b178 Add screenie 2020-09-10 15:57:51 +02:00
Wuzzy
859f4498e1 Fix snippet text color 2020-09-10 15:48:02 +02:00
Wuzzy
e37bd5b097 Remove unused code 2020-09-10 15:21:59 +02:00
10 changed files with 29 additions and 68 deletions

1
.mailmap Normal file
View File

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

8
API.md
View File

@ -7,8 +7,6 @@ Add these to the item definition.
* `_tt_ignore`: If `true`, the `description` of this item won't be altered at all
* `_tt_help`: Custom help text
* `_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
Once this mod had overwritten the `description` field of an item was overwritten, it will save the original (unaltered) `description` in the `_tt_original_description` field.
@ -24,10 +22,8 @@ Returns: Two values, the first one is required.
Example:
```
tt.register_snippet(function(itemstring)
tt.register_snippet(function(itemstring)
if minetest.get_item_group(itemstring, "magic") == 1 then
return "This item is magic"
end
end)
```
end)

9
LICENSE.txt Normal file
View File

@ -0,0 +1,9 @@
Copyright 2024 Wuzzy
The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,8 +1,12 @@
# Extended Tooltip (`tt`)
# Extended Tooltips (`tt`)
This mod extends the tooltip of items to add more informative texts.
The mod itself does nothing and is meant to be integrated into
games to use the API to define custom tooltips (see `API.md`).
## Version
1.0.0
## License
MIT License.
This mod is free software, released under the MIT License.
See `LICENSE.txt` for the full text.

View File

@ -1,5 +1,3 @@
local S = minetest.get_translator("tt")
tt = {}
tt.COLOR_DEFAULT = "#d0ffd0"
tt.COLOR_DANGER = "#ffff00"

View File

@ -1,27 +1,3 @@
# textdomain:tt
Damage: @1=
Damage (@1): @2=
Healing: @1=
Healing (@1): @2=
Full punch interval: @1s=
Food item=
+@1 satiation=
@1 satiation=
+@1 food points=
Contact damage: @1 per second=
Contact healing: @1 per second=
Drowning damage: @1=
Bouncy (@1%)=
Luminance: @1=
Slippery=
Climbable=
Climbable (only downwards)=
No jumping=
No swimming upwards=
No rising=
Fall damage: @1%=
Fall damage: +@1%=
No fall damage=
Digs @1 blocks=
Digs @1 blocks instantly=
Minimum dig time: @1s=
# textdomain: tt
Extended Tooltips=
Support for custom tooltip extensions for items=

View File

@ -1,27 +1,3 @@
# textdomain:tt
Damage: @1=Schaden: @1
Damage (@1): @2=Schaden (@1): @2
Healing: @1=Heilung: @1
Healing (@1): @2=Heilung (@1): @2
Full punch interval: @1s=Zeit zum Ausholen: @1s
Food item=Lebensmittel
+@1 satiation=+@1 Sättigung
@1 satiation=@1 Sättigung
+@1 food points=+@1 Nahrungspunkte
Contact damage: @1 per second=Kontaktschaden: @1 pro Sekunde
Contact healing: @1 per second=Kontaktheilung: @1 pro Sekunde
Drowning damage: @1=Ertrinkensschaden: @1
Bouncy (@1%)=Sprunghaft (@1%)
Luminance: @1=Lichtstärke: @1
Slippery=Rutschig
Climbable=Erkletterbar
Climbable (only downwards)=Erkletterbar (nur nach unten)
No jumping=Kein Springen
No swimming upwards=Kein nach oben schwimmen
No rising=Kein Aufsteigen
Fall damage: @1%=Fallschaden: @1%
Fall damage: +@1%=Fallschaden: +@1%
No fall damage=Kein Fallschaden
Digs @1 blocks=Gräbt „@1“-Blöcke
Digs @1 blocks instantly=Gräbt „@1“-Blöcke sofort
Minimum dig time: @1s=Minimale Grabezeit: @1s
# textdomain: tt
Extended Tooltips=Erweiterte Tooltips
Support for custom tooltip extensions for items=Unterstützung für eigene Tooltip-Erweiterungen für Gegenstände

View File

@ -1,2 +1,3 @@
name = tt
title = Extended Tooltips
description = Support for custom tooltip extensions for items

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -4,7 +4,7 @@
tt.register_snippet(function(itemstring)
local def = minetest.registered_items[itemstring]
if def._tt_help then
return def._tt_help, false
return def._tt_help
end
end)