View Single Post
01-10-18, 08:40 AM   #1
X33STORM
A Murloc Raider
Join Date: Sep 2017
Posts: 9
Exclamation Help with simple addon - enforcing cvars

So i'm looking for a little help with this personal addon i made to enforce a list of cvars, keybinds and other fixes across all characters.
I am not really a coder, so i don't know much about this other than the most basic principles.

This mod should run these cvars when i log on a character as is.
Problem is that both config-cache.wtf and AdvancedInterfaceOptions has some of these cvars, and i want this to override any other settings set by either the game or other addons.
I'm not sure if this already does that by running on every character login entering the world, either way i want to be sure this works as intended.

Now i' thinking maybe i need either to name the mod so it is loaded after? before? all other mods, like calling it !MyCvars.
Or the code needs to be executed at a point later than what the game config and AdvancedInterfaceOptions does.

Anyone maybe able to help me with this?

X33STORM.lua
Code:
local function eventHandler(self,event,...)

-- 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", 1)
SetCVar("floatingCombatTextCombatDamageDirectionalOffset", 1)
SetCVar("floatingCombatTextCombatHealingAbsorbSelf", 1)
SetCVar("floatingCombatTextCombatHealingAbsorbTarget", 1)
SetCVar("floatingCombatTextCombatLogPeriodicSpells", 1)
SetCVar("floatingCombatTextCombatState", 1)
SetCVar("floatingCombatTextComboPoints", 1)
SetCVar("floatingCombatTextDamageReduction", 0)
SetCVar("floatingCombatTextDodgeParryMiss", 1)
SetCVar("floatingCombatTextEnergyGains", 1)
SetCVar("floatingCombatTextFriendlyHealers", 1)
SetCVar("floatingCombatTextHonorGains", 0)
SetCVar("floatingCombatTextLowManaHealth", 1)
SetCVar("floatingCombatTextPeriodicEnergyGains", 0)
SetCVar("floatingCombatTextPetMeleeDamage", 1)
SetCVar("floatingCombatTextPetSpellDamage", 1)
SetCVar("floatingCombatTextReactives", 1)
SetCVar("floatingCombatTextRepChanges", 0)
SetCVar("floatingCombatTextSpellMechanics", 1)
SetCVar("floatingCombatTextSpellMechanicsOther", 1)

-- Nameplate Settings
SetCVar("nameplateShowSelf", 0)
SetCVar("nameplateShowAll", 1)
SetCVar("nameplateShowEnemies", 1)
SetCVar("nameplateShowFriends", 1)
SetCVar("nameplateMaxDistance", 75)

-- Nameplate Fixes
SetCVar("nameplateLargeTopInset", -1)
SetCVar("nameplateOtherTopInset", -1)
SetCVar("nameplateLargeBottomInset", -1)
SetCVar("nameplateOtherBottomInset", -1)
SetCVar("nameplateHorizontalScale", 1)

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

end

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

Last edited by X33STORM : 01-26-18 at 10:58 AM.
  Reply With Quote