HotKey.SetPoint #22


Closed
  • StormFX created this issue Jun 9, 2017

    I wasn't sure if you knew this or not, but Blizzard stopped adjusting the position of the HotKey text in the ActionButton_UpdateHotkeys function. Here's the snippet from the relevant function in ActionButton.lua:

     

        if ( text == "" ) then
            hotkey:SetText(RANGE_INDICATOR);
            hotkey:Hide();
        else
            hotkey:SetText(text);
            hotkey:Show();
        end

     In LibActionButton, however, that method is still being called:

     

    	if not key or key == "" or self.config.hideElements.hotkey then
    		self.HotKey:SetText(RANGE_INDICATOR)
    		self.HotKey:SetPoint("TOPLEFT", self, "TOPLEFT", 1, - 2)
    		self.HotKey:Hide()
    	else
    		self.HotKey:SetText(key)
    		self.HotKey:SetPoint("TOPLEFT", self, "TOPLEFT", - 2, - 2)
    		self.HotKey:Show()
    	end

     The problem is that this overwrites Masque's placement of the HotKey region. In the previous version of Masque, I overwrote the SetPoint method of the region but this is bad practice and could potential cause taint so I removed it since Blizzard wasn't using it. I'm not sure if this is something you'd want to address in LAB or if I need to secure-hook the HotKey to make sure Masque can counter it. Figured I'd ask first before I put something in that I'll have to remove later (though I may have to do that anyhow :p).

  • StormFX edited description Jun 9, 2017
  • StormFX posted a comment Jun 9, 2017

    Actually, looking at the code the SetPoint doesn't even need to be called in the UpdateHotkeys function as it's only visible in one position and that position can be set in the CreateButton method. I think this is why Blizzard removed it.


    Edited Jun 9, 2017
  • StormFX edited description Jun 9, 2017
  • StormFX posted a comment Mar 21, 2019

    Without SetPoint @L1312

     

    function UpdateHotkeys(self)
    	local key = self:GetHotkey()
    	if not key or key == "" or self.config.hideElements.hotkey then
    		self.HotKey:SetText(RANGE_INDICATOR)
    		self.HotKey:Hide()
    	else
    		self.HotKey:SetText(key)
    		self.HotKey:Show()
    	end
    end
    

    Or check for Masque first:

     

    function UpdateHotkeys(self)
    	local key = self:GetHotkey()
    	if not key or key == "" or self.config.hideElements.hotkey then
    		self.HotKey:SetText(RANGE_INDICATOR)
    		if not self.MasqueSkinned then
    			self.HotKey:SetPoint("TOPLEFT", self, "TOPLEFT", 1, - 2)
    		end
    		self.HotKey:Hide()
    	else
    		self.HotKey:SetText(key)
    		if not self.MasqueSkinned then
    			self.HotKey:SetPoint("TOPLEFT", self, "TOPLEFT", - 2, - 2)
    		end
    		self.HotKey:Show()
    	end
    end
    

     


    Edited Mar 21, 2019
  • nevcairiel closed issue Aug 28, 2020

To post a comment, please login or register a new account.