WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   [BETA] Actionbar Range Help (https://www.wowinterface.com/forums/showthread.php?t=58166)

cokedrivers 08-22-20 09:39 PM

[BETA] Actionbar Range Help
 
I have been trying for serveral hours now and cannot seem to get this code to work .
Code:

local function UpdateRange( self, elapsed )
        local rangeTimer = self.rangeTimer
        local icon = self.icon;

        if( rangeTimer == TOOLTIP_UPDATE_TIME ) then
                local inRange = IsActionInRange( self.action );
                if( inRange == false ) then
                        -- Red Out Button
                        icon:SetVertexColor( 1, 0, 0 );
                else
                        local canUse, amountMana = IsUsableAction( self.action );
                        if( canUse ) then
                                icon:SetVertexColor( 1.0, 1.0, 1.0 );
                        elseif( amountMana ) then
                                icon:SetVertexColor( 0.5, 0.5, 1.0 );
                        else
                                icon:SetVertexColor( 0.4, 0.4, 0.4 );
                        end
                end
        end
end

do
        hooksecurefunc( "ActionButton_OnUpdate", UpdateRange );
end

Ive tried changing the *ActionButton_OnUpdate* to hooksecurefunc(ActionBarActionButtonMixin, "OnUpdate, UpdateRange) and it dont work.

The only way i got something to happen was by modifying this code:
Code:

function ActionButton_UpdateRangeIndicator(self, checksRange, inRange)
        if ( self.HotKey:GetText() == RANGE_INDICATOR ) then
                if ( checksRange ) then
                        self.HotKey:Show();
                        if ( inRange ) then
                                self.HotKey:SetVertexColor(LIGHTGRAY_FONT_COLOR:GetRGB());
                        else
                                self.HotKey:SetVertexColor(RED_FONT_COLOR:GetRGB());
                        end
                else
                        self.HotKey:Hide();
                end
        else
                if ( checksRange and not inRange ) then
                        self.HotKey:SetVertexColor(RED_FONT_COLOR:GetRGB());
                else
                        self.HotKey:SetVertexColor(LIGHTGRAY_FONT_COLOR:GetRGB());
                end
        end
end

and changing it to
Code:

function ActionButton_UpdateRangeIndicator(self, checksRange, inRange)
        if ( self.HotKey:GetText() == RANGE_INDICATOR ) then
                if ( checksRange ) then
                        self.icon:Show();
                        if ( inRange ) then
                                self.icon:SetVertexColor(LIGHTGRAY_FONT_COLOR:GetRGB());
                        else
                                self.icon:SetVertexColor(RED_FONT_COLOR:GetRGB());
                        end
                end
        else
                if ( checksRange and not inRange ) then
                        self.icon:SetVertexColor(RED_FONT_COLOR:GetRGB());
                else
                        self.icon:SetVertexColor(LIGHTGRAY_FONT_COLOR:GetRGB());
                end
        end
end

and then all the icon are light grey and look wierd.

If anyone could help with this that would be great if not i guess Ill keep trying till i hopefully get the right combo.

Thanks Coke

siweia 08-23-20 12:27 AM

You may have a look at Tukui.
https://git.tukui.org/Tukz/Tukui/-/c...55e180744636cb

cokedrivers 08-23-20 07:21 AM

Quote:

Originally Posted by siweia (Post 336664)

Thank you, this help me out alot.


All times are GMT -6. The time now is 10:27 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI