Compare commits
10 Commits
ef3d738200
...
baf0a5972a
Author | SHA1 | Date | |
---|---|---|---|
|
baf0a5972a | ||
|
395f2d189a | ||
|
e8aaa94415 | ||
|
a37f2ef496 | ||
|
917bfbbe61 | ||
|
9d0aa305e2 | ||
|
e38bd2754e | ||
|
38c924b178 | ||
|
859f4498e1 | ||
|
e37bd5b097 |
8
API.md
8
API.md
@ -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
9
LICENSE.txt
Normal 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.
|
@ -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.
|
||||
|
2
init.lua
2
init.lua
@ -1,5 +1,3 @@
|
||||
local S = minetest.get_translator("tt")
|
||||
|
||||
tt = {}
|
||||
tt.COLOR_DEFAULT = "#d0ffd0"
|
||||
tt.COLOR_DANGER = "#ffff00"
|
||||
|
@ -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=
|
||||
|
@ -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
|
||||
|
1
mod.conf
1
mod.conf
@ -1,2 +1,3 @@
|
||||
name = tt
|
||||
title = Extended Tooltips
|
||||
description = Support for custom tooltip extensions for items
|
||||
|
BIN
screenshot.png
Normal file
BIN
screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user