diff --git a/media/lua/client/ISUI/hotbar_inventorypage.lua b/media/lua/client/ISUI/hotbar_inventorypage.lua index 3f7835b..69d5750 100644 --- a/media/lua/client/ISUI/hotbar_inventorypage.lua +++ b/media/lua/client/ISUI/hotbar_inventorypage.lua @@ -22,6 +22,7 @@ HotBar.loadConfig = function()--{{{ HotBar.config.main.numSlots = 10; HotBar.config.main.size = 75; HotBar.config.main.smart = "traditional"; + HotBar.config.main.showContext = "yes"; HotBar.config.items = {}; local ini = bcUtils.readINI("hotbar.ini"); @@ -29,6 +30,7 @@ HotBar.loadConfig = function()--{{{ if not ini.main then ini.main = {} end if not ini.items then ini.items = {} end -- safeguard HotBar.config.main.smart = ini.main.smart or "traditional"; + HotBar.config.main.showContext = ini.main.showContext or "yes"; HotBar.config.main.numSlots = tonumber(ini.main.numSlots) or 10; HotBar.config.main.size = tonumber(ini.main.size) or 75; for k,v in pairs(ini.items) do @@ -368,6 +370,7 @@ end -- }}} HotBar.FillContextMenu = function(player, context, items) -- {{{ + if HotBar.config.main.showContext == "no" then return end if #items > 1 then return end; -- we only create an entry for the first object if HotBar.inventoryPage == nil then -- safeguard HotBarISInventoryPage.onKeyPressed(getCore():getKey("Toggle Inventory")); diff --git a/media/lua/client/hotbar_keybinds.lua b/media/lua/client/hotbar_keybinds.lua index 0d9e0f5..2665fa5 100644 --- a/media/lua/client/hotbar_keybinds.lua +++ b/media/lua/client/hotbar_keybinds.lua @@ -79,6 +79,14 @@ function HotBarKeyBinds.SmartChanged(_, box) end end +function HotBarKeyBinds.ContextChanged(_, box) + if box.options[box.selected] ~= nil then + local choices = { "yes", "no" } + HotBar.config.main.showContext = choices[box.selected]; + HotBar.saveConfig(); + end +end + HotBarKeyBinds.MainOptionsCreate = MainOptions.create; MainOptions.create = function(self) HotBarKeyBinds.MainOptionsCreate(self); @@ -112,5 +120,12 @@ MainOptions.create = function(self) selected = 1; end box = self:addCombo(x, y, w, h, getText("UI_optionscreen_hotbar_smartaction"), { getText("UI_optionscreen_traditional"), getText("UI_optionscreen_smart") }, selected, self, HotBarKeyBinds.SmartChanged); + + if HotBar.config.main.showContext == "yes" then + selected = 1; + else + selected = 2; + end + box = self:addCombo(x, y, w, h, getText("UI_optionscreen_show_contextmenu"), { getText("UI_optionscreen_show_contextmenu_yes"), getText("UI_optionscreen_show_contextmenu_no") }, selected, self, HotBarKeyBinds.ContextChanged); end diff --git a/media/lua/shared/Translate/DE/UI_DE.txt b/media/lua/shared/Translate/DE/UI_DE.txt index 80535d8..1e71607 100644 --- a/media/lua/shared/Translate/DE/UI_DE.txt +++ b/media/lua/shared/Translate/DE/UI_DE.txt @@ -43,5 +43,8 @@ UI_DE = { UI_optionscreen_binding_Slot28 = "Slot 28", UI_optionscreen_binding_Slot29 = "Slot 29", UI_optionscreen_binding_Slot30 = "Slot 30", + UI_optionscreen_show_contextmenu = "Hotbar im Kontextmenue anzeigen:", + UI_optionscreen_show_contextmenu_yes = "Ja", + UI_optionscreen_show_contextmenu_no = "Nein (nur Drag'n'Drop!)", UI_Clear = "Entfernen" } diff --git a/media/lua/shared/Translate/EN/UI_EN.txt b/media/lua/shared/Translate/EN/UI_EN.txt index e8a8cc2..2b71a51 100644 --- a/media/lua/shared/Translate/EN/UI_EN.txt +++ b/media/lua/shared/Translate/EN/UI_EN.txt @@ -43,5 +43,8 @@ UI_EN = { UI_optionscreen_binding_Slot28 = "Slot 28", UI_optionscreen_binding_Slot29 = "Slot 29", UI_optionscreen_binding_Slot30 = "Slot 30", + UI_optionscreen_show_contextmenu = "Show Hotbar in contextmenu:", + UI_optionscreen_show_contextmenu_yes = "Yes", + UI_optionscreen_show_contextmenu_no = "No (Drag'n'Drop only!)", UI_Clear = "Clear" }