Quantcast Help fixing simple addon - WoWInterface
Thread Tools Display Modes
01-26-18, 12:29 PM   #1
X33STORM
A Murloc Raider
Join Date: Sep 2017
Posts: 9
Help fixing simple addon

Forgive me for making a new thread.
I have a problem with my personal addon, if anyone can help fix it real quick.
I've added options to my addon to enable a few action cam features, and need to disable the "experimental features bla bla" warning that pops up every time i login. I know the code to do so, but can't seem to get the disable code to work within my addon.
Maybe it's because the events my addon applies the settings at a wrong time or something..
So maybe add some login event code, or....?

Code in question:
UIParent:UnregisterEvent("EXPERIMENTAL_CVAR_CONFIRMATION_NEEDED")
The lua:
local function eventHandler(self,event,...)

UIParent:UnregisterEvent("EXPERIMENTAL_CVAR_CONFIRMATION_NEEDED")

-- Floating Combat Text
SetCVar("enableFloatingCombatText", 1)
SetCVar("floatingCombatTextFloatMode", 1)
SetCVar("floatingCombatTextAllSpellMechanics", 0)
SetCVar("floatingCombatTextAuras", 0)
SetCVar("floatingCombatTextCombatDamageStyle", 1)
SetCVar("floatingCombatTextCombatDamage", 1)
SetCVar("floatingCombatTextCombatHealing", 1)
SetCVar("floatingCombatTextCombatDamageAllAutos", 1)
SetCVar("floatingCombatTextCombatDamageDirectionalScale", 0.3)
SetCVar("floatingCombatTextCombatDamageDirectionalOffset", 13)
SetCVar("floatingCombatTextCombatHealingAbsorbSelf", 1)
SetCVar("floatingCombatTextCombatHealingAbsorbTarget", 1)
SetCVar("floatingCombatTextCombatLogPeriodicSpells", 1)
SetCVar("floatingCombatTextCombatState", 1)
SetCVar("floatingCombatTextComboPoints", 1)
SetCVar("floatingCombatTextDamageReduction", 0)
SetCVar("floatingCombatTextDodgeParryMiss", 1)
SetCVar("floatingCombatTextFriendlyHealers", 0)
SetCVar("floatingCombatTextHonorGains", 1)
SetCVar("floatingCombatTextLowManaHealth", 0)
SetCVar("floatingCombatTextEnergyGains", 0)
SetCVar("floatingCombatTextPeriodicEnergyGains", 0)
SetCVar("floatingCombatTextPetMeleeDamage", 1)
SetCVar("floatingCombatTextPetSpellDamage", 1)
SetCVar("floatingCombatTextReactives", 0)
SetCVar("floatingCombatTextRepChanges", 0)
SetCVar("floatingCombatTextSpellMechanics", 1)
SetCVar("floatingCombatTextSpellMechanicsOther", 1)

-- Nameplate Settings
SetCVar("ShowClassColorInFriendlyNameplate", 1)
SetCVar("nameplateMaxDistance", 65)
SetCVar("nameplateShowAll", 1)
SetCVar("nameplateShowSelf", 0)
SetCVar("nameplateShowOnlyNames", 0)
SetCVar("nameplateShowDebuffsOnFriendly", 1)
--SetCVar("nameplateShowFriendlyNPCs", 1)
SetCVar("nameplateShowEnemies", 1)
SetCVar("nameplateShowFriends", 1)
SetCVar("NameplateMotion", 1)
SetCVar("nameplateLargeTopInset", -1)
SetCVar("nameplateOtherTopInset", -1)
SetCVar("nameplateLargeBottomInset", -1)
SetCVar("nameplateOtherBottomInset", -1)
SetCVar("nameplateHorizontalScale", 1)
SetCVar("nameplateOverlapV", 0.45)
SetCVar("nameplateOverlapH", 0.8)

-- Misc
SetCVar("autoLootDefault", 1)
SetCVar("TargetNearestUseNew", 0)
SetCVar("showQuestTrackingTooltips", 1)

-- Camera
SetCVar("cameraDistanceMaxZoomFactor", 2)
SetCVar("test_cameraDynamicPitch", 1)
SetCVar("test_cameraTargetFocusEnemyEnable", 0)
SetCVar("test_cameraDynamicPitchBaseFovPad", 0.5)
SetCVar("test_cameraDynamicPitchBaseFovPadDownScale", 0.15)
SetCVar("test_cameraDynamicPitchBaseFovPadFlying", 0.65)
SetCVar("test_cameraHeadMovementDeadZone", 0.01)



end

local frame = CreateFrame("Frame","CVarSet")
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
frame:SetScript("OnEvent",eventHandler)

Last edited by X33STORM : 01-26-18 at 12:56 PM.
  Reply With Quote
01-26-18, 01:14 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 875
Try unregistering the event when you create the frame rather than waiting for the OnEvent handler.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle and Move Pad Plus.
  Reply With Quote
01-26-18, 02:11 PM   #3
X33STORM
A Murloc Raider
Join Date: Sep 2017
Posts: 9
Originally Posted by Fizzlemizz View Post
Try unregistering the event when you create the frame rather than waiting for the OnEvent handler.
So..

...
local frame = CreateFrame("Frame","CVarSet")
UIParent:UnregisterEvent("EXPERIMENTAL_CVAR_CONFIRMATION_NEEDED")
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
frame:SetScript("OnEvent",eventHandler)


?
  Reply With Quote
01-26-18, 02:22 PM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 875
Yes. That will unregister the event when your addon loads rather than waiting for the PLAYER_ENTERING_WORLD event.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle and Move Pad Plus.
  Reply With Quote
01-26-18, 03:09 PM   #5
X33STORM
A Murloc Raider
Join Date: Sep 2017
Posts: 9
Sure enough, that did it. Thanks
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Help fixing simple addon

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off