Thread: darn taint
View Single Post
01-25-10, 08:05 PM   #21
Dayve
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 15
For the user setting to work the code snippet that runs in response to state change needs to reference the setting in a variable in its restricted environment; in the code I provided it is stored in "raidhideparty". After initialization and whenever the user setting changes it must be propagated into the restricted enviroment using :Execute, which is the purpose of the 3rd code extract in my first post, which effectively sets "ridehideparty" to be equal to the value in the user setting variable. That part could also be written like this for clarity (with the appropriate CVar used):
lua Code:
  1. RaidPartyHandler:Execute("raidhideparty = " .. tostring(GetCVarBool("hidePartyInRaid")));
  2. RaidPartyHandler:SetAttribute("state-unitexists", UnitExists("raid1"));
  Reply With Quote