WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Very simple poison reminder, complete? (https://www.wowinterface.com/forums/showthread.php?t=38546)

Haleth 01-23-11 01:15 PM

Very simple poison reminder, complete?
 
I got tired of always forgetting to poison my weapons on my rogue so I wrote this.

Code:

local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_REGEN_DISABLED")
f:SetScript("OnEvent", function()
        local hasMainHandEnchant, _, _, hasOffHandEnchant = GetWeaponEnchantInfo()
        if not hasMainHandEnchant or not hasOffHandEnchant then
                DEFAULT_CHAT_FRAME:AddMessage("FreeUI: |cffffffffReapply poisons.|r", FreeUI.class.r, FreeUI.class.g, FreeUI.class.b)
        end
end)

It's working just fine, but I'm wondering if it's missing anything obvious before I upload it. I know it's not checking for fishing poles but hey, who fights with their fishing pole equipped.

nightcracker 01-23-11 07:05 PM

Since when do all classes use poisons? I would put the block of code in an if checking for the players class.

Also no need for FreeUI.class.r, FreeUI.class.g, FreeUI.class.b, since the player will always be a rogue (just hardcode them color values).


All times are GMT -6. The time now is 03:41 PM.

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