[DiscordArchive] What method is used to conditionally override right clicks like in Hour of Twilight's scrapper?
[DiscordArchive] What method is used to conditionally override right clicks like in Hour of Twilight's scrapper?
%d+)"))Archived author: whatwere • Posted: 2023-02-17T22:50:36.992000+00:00
Original source
```lua
-- override for right clicking items while UI is open
local origContainerFrameItemButton_OnClick = ContainerFrameItemButton_OnClick;
ContainerFrameItemButton_OnClick = function(...)
local self, button = ...
if(button == "RightButton" and ScrapperUI.main:IsShown()) then
local bag, slot = self:GetParent():GetID(), self:GetID();
local _, _, _, _, _, _, link = GetContainerItemInfo(bag, slot)
if link then
local itemId = select(3, strfind(link, "item
%d+)"))
return ScrapperUI.OnRightClickItem(itemId)
end
end
return origContainerFrameItemButton_OnClick(...)
end;
``` is how its done in HoT
Archived author: tester • Posted: 2023-02-17T22:50:49.237000+00:00
Original source
so yes, they hook the clientside then
Archived author: tester • Posted: 2023-02-17T22:51:09.080000+00:00
Original source
so i go back to the first comment