View Single Post
12-10-23, 08:44 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,894
I don't beleieve the library saves the settings for show/hide.

When the user runs one of the actions that shows/hides the button you have to set the .show value in the db eg.:
Lua Code:
  1. TestMMBicon:Hide("TestMiniMapButton")
  2. self.db.show = false
  3.  
  4. TestMMBicon:Show("TestMiniMapButton")
  5. self.db.show = true

When you create the MM Button you have to set its visible state to whatever was last saved in the db
Lua Code:
  1. local TestMiniButton = LibStub("AceAddon-3.0"):NewAddon("TestMiniMapButton", "AceConsole-3.0")
  2. TestMiniButton:SetShown(self.db.show) -- Assuming self.db has been initalised at this stage

You could use the buttons OnShow/OnHide scripts to do the setting of the db.show value.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote