summaryrefslogtreecommitdiff
path: root/register.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-08-14 06:31:03 -0400
committerGitHub <noreply@github.com>2016-08-14 06:31:03 -0400
commitfc879df7619a15af28f785d7db164c7eaae340ce (patch)
treef35a2e58da9b0ed810b53b72085b9386aa55f878 /register.lua
parent23a27b38ae7b33588b1d12ad954fe3f62d2b4e14 (diff)
parenta1e7b650ab2690f522dabf410149bd7e01425001 (diff)
Merge pull request #62 from Wuzzy2/alternate_prev
Allow to move back and forth in alternate recipes and usages in craft guide
Diffstat (limited to 'register.lua')
-rw-r--r--register.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/register.lua b/register.lua
index 978646b..66c9cef 100644
--- a/register.lua
+++ b/register.lua
@@ -207,6 +207,14 @@ local role_text = {
recipe = "Result",
usage = "Ingredient",
}
+local next_alt_text = {
+ recipe = "Show next recipe",
+ usage = "Show next usage",
+}
+local prev_alt_text = {
+ recipe = "Show previous recipe",
+ usage = "Show previous usage",
+}
local other_dir = {
recipe = "usage",
usage = "recipe",
@@ -313,7 +321,10 @@ unified_inventory.register_page("craftguide", {
if alternates and alternates > 1 then
formspec = formspec.."label[5.5,"..(formspecy + 1.6)..";"
..string.format(F(recipe_text[dir]), alternate, alternates).."]"
- .."button[5.5,"..(formspecy + 2)..";2,1;alternate;" .. F("Alternate") .. "]"
+ .."image_button[5.5,"..(formspecy + 2)..";1,1;ui_left_icon.png;alternate_prev;]"
+ .."image_button[6.5,"..(formspecy + 2)..";1,1;ui_right_icon.png;alternate;]"
+ .."tooltip[alternate_prev;"..F(prev_alt_text[dir]).."]"
+ .."tooltip[alternate;"..F(next_alt_text[dir]).."]"
end
return {formspec = formspec}
end,