diff --git a/TODO.txt b/TODO.txt index 7404db6..7c74774 100644 --- a/TODO.txt +++ b/TODO.txt @@ -5,5 +5,4 @@ TODO: - add chat command to show formspec in case suppored UI handler not available - support protection mods (don't allow bookmarks to be set in protected areas that player can't access) - areas -- support inventory mods: - - i3 +- fix i3 support diff --git a/changelog.txt b/changelog.txt index e93319b..ece601e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ v1.1 ---- - added unified_inventory support +- added i3 support v1.0 ---- diff --git a/mod.conf b/mod.conf index fb85100..ee04b62 100644 --- a/mod.conf +++ b/mod.conf @@ -5,4 +5,4 @@ version = 1.0 license = MIT author = Jordan Irwin (AntumDeluge) depends = wdata -optional_depends = sfinv_buttons, unified_inventory, simple_protection +optional_depends = sfinv_buttons, unified_inventory, i3, simple_protection diff --git a/ui.lua b/ui.lua index fdfc29b..d6fb370 100644 --- a/ui.lua +++ b/ui.lua @@ -2,6 +2,7 @@ local S = core.get_translator(pbmarks.modname) local ui_handlers = { + "i3", "sfinv_buttons", "unified_inventory", } @@ -9,6 +10,22 @@ local ui_handlers = { local handler_available = false +if core.global_exists("i3") then + i3.new_tab({ + name = pbmarks.modname, + description = S("Personal Bookmarks"), + formspec = function(player, data, fs) + -- FIXME: + -- - use i3 widgets + -- - inventory widgets are missing after close + i3.set_tab(player, "inventory") + pbmarks.show_formspec(player:get_player_name(), {noback=true}) + end, + }) + + handler_available = true +end + if core.global_exists("sfinv_buttons") then sfinv_buttons.register_button(pbmarks.modname, { title = S("Personal Bookmarks"),