Check boxes
Im wokring on my addon and here is one of the features I want.
On Death I want a message to be sent to a preset channel So I know I have to do this much register the event myaddon.xml <OnLoad> this:RegisterEvent("PLAYER_DEAD"); </OnLoad> <OnEvent> MyAddon_OnEvent(); </OnEvent> here is where im not sure what to do On my frame I have a checkbox I have named $parentHRFChkOnDeath Heres my function so far function MyAddon_Onevent() idplayer = UnitName("player"); if (event == "PLAYER_DEAD" and deadpc == idplayer) then DEFAULT_CHAT_FRAME:AddMessage("YOUR DEAD!!!.", 1, 1, 1); SendChatMessage("I'M DEAD!!!", "channel", "common", mychan); end end So i want the check box ($parentHRFCheckOnDeath) to act like a toggle, to turn this feature off an on. I thought something like if (event == "PLAYER_DEAD" and deadpc == idplayer and MyFormHRFChkOndeath:True) then Might do it but I really not sure. Can anyone assist here? please and thank you. |
There are these functions you can use:
Code:
state = checkbox:GetChecked() You could use the OnClick script of the checkbox to update your saved variable, and just reference your saved variable within the code. Code:
<OnClick>dead_SV.Enabled = MyFormHRFChkOndeath:GetChecked();</OnClick> |
All times are GMT -6. The time now is 02:47 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI