So im trying to make a core function that would make it easy to have it check the build and version data then run functions accordingly. This is what i have so far but it does not work... i cant figure out why.
first this piece makes the function to do the comparing of later functions
Code:
local addonName, addon = ...
_G[addonName] = addon
--[[-----------------------------------------------------------------------------
Blizzard Build comparisonn for ptr/beta/live compatible versions
-------------------------------------------------------------------------------]]
function addon:CompareBuild(comver, combuild, comref, lowcomref, highcomref)
local version, build, bdate, toc = GetBuildInfo()
if version >= comver and build >= combuild then
addon[highcomref]()
elseif version <= comver and build <= combuild then
addon[lowcomref]()
elseif version == comver and build == combuild then
addon[comref]()
end
end
this piece actually uses it on the two functions i hav emade or at lest its supposed to it gives me an error.
Code:
function addon:MicroButtonsCatVer()
local buttons = { CharacterMicroButton, SpellbookMicroButton, TalentMicroButton, AchievementMicroButton, QuestLogMicroButton, FriendsMicroButton, GuildMicroButton, PVPMicroButton, LFDMicroButton, MainMenuMicroButton, HelpMicroButton }
end
function addon:MicroButtonsPreCatVer()
local buttons = { CharacterMicroButton, SpellbookMicroButton, TalentMicroButton, AchievementMicroButton, QuestLogMicroButton, FriendsMicroButton, PVPMicroButton, LFDMicroButton, MainMenuMicroButton, HelpMicroButton }
addon:HideFrame(SocialMicroButton)
end
addon:CompareBuild("3.3.5", "12340", addon:MicroButtonsPreCatVer(), addon:MicroButtonsPreCatVer(), addon:MicroButtonsCatVer())
any ideas?