View Single Post
04/24/14, 10:05 PM   #7
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 665
I don't know how to do that, but I am trying...
Lua Code:
  1. function Initialize()
  2.     defaultValues = {
  3.         ["account"] = false,
  4.         ["verbose"] = false,
  5.         ["debug"] = false,
  6.        }
  7.  
  8.     Harvest.settings = defaultValues
  9. end
  10.  
  11. EVENT_MANAGER:RegisterForEvent("HarvestMap", EVENT_ADD_ON_LOADED, function Harvest.OnLoad(eventCode, addOnName)
  12.     if addon == ""HarvestMap"" then
  13.         Initialize()
  14.     end
  15. end)
That didn't quite work.

Then I tried this
Lua Code:
  1. function Initialize()
  2.     defaultValues = {
  3.         ["account"] = false,
  4.         ["verbose"] = false,
  5.         ["debug"] = false,
  6.        }
  7.  
  8.     Harvest.settings = defaultValues
  9. end
  10.  
  11. EVENT_MANAGER:RegisterForEvent("HarvestMap", EVENT_ADD_ON_LOADED, function (eventCode, addOnName)
  12.     if addon == "HarvestMap" then
  13.         Initialize()
  14.         OnLoad(eventCode, addOnName)
  15.     end
  16. end)

Then I tried and this
Lua Code:
  1. function Initialize()
  2.     defaultValues = {
  3.         ["account"] = false,
  4.         ["verbose"] = false,
  5.         ["debug"] = false,
  6.        }
  7.  
  8.     Harvest.settings = defaultValues
  9. end
  10.  
  11. EVENT_MANAGER:RegisterForEvent("HarvestMap", EVENT_ADD_ON_LOADED, function (eventCode, addOnName)
  12.     if addon == "HarvestMap" then
  13.         Initialize()
  14.         Harvest.OnLoad(eventCode, addOnName)
  15.     end
  16. end)
May I pretty please with sugar on top ask what I am missing? The last one I get no error but when I go to settings after my char loads, the mod does not show up anymore.

This is what it looks like in game.

HarvestMap is gone

EDIT: LOL! If I specify "addOnName" I can't use "addon"

Last edited by Sharlikran : 04/24/14 at 10:20 PM.
  Reply With Quote