Forums WoW Modding Support Archives WoWModding Support Archives [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?

[DiscordArchive] What method is used to conditionally override right clicks like in Hour of Twilight's scrapper?

Pages (2): Previous 1 2
rektbyfaith
Administrator
0
02-17-2023, 10:50 PM
#11
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, "itemSad%d+)"))
return ScrapperUI.OnRightClickItem(itemId)
end
end
return origContainerFrameItemButton_OnClick(...)
end;
``` is how its done in HoT
rektbyfaith
02-17-2023, 10:50 PM #11

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, "itemSad%d+)"))
return ScrapperUI.OnRightClickItem(itemId)
end
end
return origContainerFrameItemButton_OnClick(...)
end;
``` is how its done in HoT

rektbyfaith
Administrator
0
02-17-2023, 10:50 PM
#12
Archived author: tester • Posted: 2023-02-17T22:50:49.237000+00:00
Original source

so yes, they hook the clientside then
rektbyfaith
02-17-2023, 10:50 PM #12

Archived author: tester • Posted: 2023-02-17T22:50:49.237000+00:00
Original source

so yes, they hook the clientside then

rektbyfaith
Administrator
0
02-17-2023, 10:51 PM
#13
Archived author: tester • Posted: 2023-02-17T22:51:09.080000+00:00
Original source

so i go back to the first comment
rektbyfaith
02-17-2023, 10:51 PM #13

Archived author: tester • Posted: 2023-02-17T22:51:09.080000+00:00
Original source

so i go back to the first comment

Pages (2): Previous 1 2
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)