-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extended Tooltips: add properties description. Closes #1490
- Loading branch information
Showing
8 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
local DS = os.DIRECTORY_SEPARATOR | ||
local mod_path = minetest.get_modpath(minetest.get_current_modname()) | ||
local old_require = require | ||
require = function(name) return dofile(mod_path .. DS .. "src" .. DS .. name:gsub("%.", DS) .. ".lua") end | ||
|
||
|
||
require("lord_tooltips").init() | ||
|
||
|
||
require = old_require |
10 changes: 10 additions & 0 deletions
10
mods/lord/Player/Help/lord_tooltips/locale/lord_tooltips.en.tr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# textdomain: lord_tooltips | ||
|
||
Properties=Properties | ||
|
||
crumbly=crumbly | ||
cracky=cracky | ||
snappy=snappy | ||
choppy=choppy | ||
fleshy=fleshy | ||
explody=explody |
10 changes: 10 additions & 0 deletions
10
mods/lord/Player/Help/lord_tooltips/locale/lord_tooltips.ru.tr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# textdomain: lord_tooltips | ||
|
||
Properties=Свойства | ||
|
||
crumbly=сыпучий | ||
cracky=разламывающийся | ||
snappy=непрочный | ||
choppy=рубящийся | ||
fleshy=живой/прокалываемый | ||
explody=взрывающийся |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# textdomain: lord_tooltips | ||
|
||
Properties= | ||
|
||
crumbly= | ||
cracky= | ||
snappy= | ||
choppy= | ||
fleshy= | ||
explody= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
name = lord_tooltips | ||
depends = tt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
local items, colorize | ||
= minetest.registered_items, minetest.colorize | ||
|
||
local S = minetest.get_translator(minetest.get_current_modname()) | ||
|
||
|
||
local properties = { | ||
"crumbly", "cracky", "snappy", "choppy", "fleshy", "explody", | ||
} | ||
|
||
|
||
local function register_properties_snippet() | ||
tt.register_snippet(function(itemstring) | ||
local groups = items[itemstring].groups | ||
|
||
local prop_strings = {} | ||
for _, property in pairs(properties) do | ||
if table.has_key(groups, property) then | ||
prop_strings[#prop_strings+1] = " • " .. colorize("#aaa", S(property)) .. ": " .. groups[property] | ||
end | ||
end | ||
|
||
return #prop_strings ~= 0 | ||
and (colorize("#ee8", "\n" .. S("Properties")) .. ":\n" .. table.concat(prop_strings, "\n")) | ||
or nil | ||
end) | ||
end | ||
|
||
|
||
return { | ||
init = function() | ||
register_properties_snippet() | ||
end, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
name = Player_Help |