• 0

    posted a message on Hidding bags and microbuttons

    Hello there! I'm trying to create my very first wow addon, something very very simple just to hide the bag and micro buttons frame.

    I used some other code as base and got this so far:

     

    local addon = CreateFrame("Frame", "Simple_HideMicroButtonAndBagsBar");
    addon:RegisterEvent("PLAYER_ENTERING_WORLD");
    addon:RegisterEvent("UNIT_ENTERING_VEHICLE");
    addon:RegisterEvent("UNIT_EXITING_VEHICLE");
    addon:SetScript("OnEvent", function(self, event)
    	if event == "PLAYER_ENTERING_WORLD" then
    		self:initialize();
    	elseif event == "UNIT_ENTERING_VEHICLE" then
    		self:initialize();
    	elseif event == "UNIT_EXITING_VEHICLE" then
    		self:initialize();
    	end
    end);
    
    StoreMicroButton:SetScript("OnShow",StoreMicroButton.Hide)
    StoreMicroButton.Show = function() end
    
    function addon:initialize()
    	MicroButtonAndBagsBar:Hide();
    	CharacterMicroButton:Hide();
    	SpellbookMicroButton:Hide();
    	TalentMicroButton:Hide();
    	AchievementMicroButton:Hide();
    	QuestLogMicroButton:Hide();
    	GuildMicroButton:Hide();
    	LFDMicroButton:Hide();
    	CollectionsMicroButton:Hide();
    	EJMicroButton:Hide();
    	StoreMicroButton:Hide();
    	MainMenuMicroButton:Hide();
    end
    

     But whenever I get an new Achievement I get this error:

     

     

    Message: ...ns\Blizzard_AchievementUI\Blizzard_AchievementUI.lua:847: attempt to call global 'AchievementMicroButton_Update' (a nil value)
    Time: Tue Oct 29 17:36:23 2019
    Count: 1
    Stack: ...ns\Blizzard_AchievementUI\Blizzard_AchievementUI.lua:847: attempt to call global 'AchievementMicroButton_Update' (a nil value)
    ...ns\Blizzard_AchievementUI\Blizzard_AchievementUI.lua:847: in function <...ns\Blizzard_AchievementUI\Blizzard_AchievementUI.lua:788>
    [C]: in function `LoadAddOn'
    Interface\FrameXML\UIParent.lua:448: in function `UIParentLoadAddOn'
    Interface\FrameXML\UIParent.lua:563: in function `AchievementFrame_LoadUI'
    Interface\FrameXML\AlertFrames.lua:469: in function <Interface\FrameXML\AlertFrames.lua:460>
    
    Locals: self = AchievementFrameAchievements {
     0 = <userdata>
     forceOnShow = <function> defined @Interface\AddOns\Blizzard_AchievementUI\Blizzard_AchievementUI.lua:697
    }
    event = "ADDON_LOADED"
    (*temporary) = nil
    (*temporary) = "attempt to call global 'AchievementMicroButton_Update' (a nil value)"
    updateTrackedAchievements = <function> defined @Interface\AddOns\Blizzard_AchievementUI\Blizzard_AchievementUI.lua:81
    IN_GUILD_VIEW = nil
    trackedAchievements = <table> {
     8454 = true
    }
    guildMemberRequestFrame = nil
    

     Any help, please?

    Posted in: AddOn HELP!
  • To post a comment, please or register a new account.