diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/analyzer.lua b/mods/game_bot/default_configs/vBot_4.8/vBot/analyzer.lua index 76c5d3df08..8a2eff1f66 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/analyzer.lua +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/analyzer.lua @@ -723,11 +723,10 @@ local expPerHour = function(calculation) end local function add(t, text, color, last) - table.insert(t, text) - table.insert(t, color) + local coloredText = "{" .. text .. ", " .. color .. "}" + table.insert(t, coloredText) if not last then - table.insert(t, ", ") - table.insert(t, "#FFFFFF") + table.insert(t, "{, , #FFFFFF}") end end @@ -958,7 +957,8 @@ onTextMessage(function(mode, text) local panel = console.consoleTabBar:getTabPanel(tab) local consoleBuffer = panel:getChildById('consoleBuffer') local message = consoleBuffer:getLastChild() - message:setColoredText(t) + message:setColoredText(table.concat(t)) + end) local function niceFormat(v) diff --git a/modules/game_interface/widgets/uiitem.lua b/modules/game_interface/widgets/uiitem.lua index 274cd733cb..253cab6496 100644 --- a/modules/game_interface/widgets/uiitem.lua +++ b/modules/game_interface/widgets/uiitem.lua @@ -43,6 +43,14 @@ function UIItem:onDrop(widget, mousePos) if not(toPos) and self:getParent() and self:getParent().slotPosition then toPos = self:getParent().slotPosition end + + if not g_game.isEnabledBotProtection() and self.selectable then + if item:isPickupable() then + self:setItem(Item.create(item:getId(), item:getCountOrSubType())) + return true + end + return false + end if not itemPos or not toPos then local pressedWidget = g_ui.getPressedWidget() local rootWidget = g_ui.getRootWidget() @@ -170,8 +178,14 @@ function UIItem:onMouseRelease(mousePosition, mouseButton) end function UIItem:canAcceptDrop(widget, mousePos) - if self:isVirtual() or not self:isDraggable() then - return false + if not g_game.isEnabledBotProtection() then + if not self.selectable and (self:isVirtual() or not self:isDraggable()) then + return false + end + else + if self:isVirtual() or not self:isDraggable() then + return false + end end if not widget or not widget.currentDragThing then return false diff --git a/src/client/uiitem.cpp b/src/client/uiitem.cpp index 4a7b1a2654..cfd59f3b19 100644 --- a/src/client/uiitem.cpp +++ b/src/client/uiitem.cpp @@ -74,7 +74,7 @@ void UIItem::setItemId(int id) m_item->setId(id); else m_item = Item::create(id); -#ifdef BOT_PROTECTION +#ifndef BOT_PROTECTION callLuaField("onItemChange"); #endif } @@ -82,7 +82,7 @@ void UIItem::setItemId(int id) void UIItem::setItemCount(int count) { if (m_item) m_item->setCount(count); -#ifdef BOT_PROTECTION +#ifndef BOT_PROTECTION callLuaField("onItemChange"); #endif } @@ -90,7 +90,7 @@ void UIItem::setItemCount(int count) void UIItem::setItemSubType(int subType) { if (m_item) m_item->setSubType(subType); -#ifdef BOT_PROTECTION +#ifndef BOT_PROTECTION callLuaField("onItemChange"); #endif } @@ -99,7 +99,7 @@ void UIItem::setItem(const ItemPtr& item) { m_item = item; -#ifdef BOT_PROTECTION +#ifndef BOT_PROTECTION callLuaField("onItemChange"); #endif }