Thread Tools Display Modes
Prev Previous Post   Next Post Next
07/08/16, 05:19 PM   #1
Lagencie
AddOn Author - Click to view addons
Join Date: Jul 2016
Posts: 7
Help for a new Addon Programmer

Hello Guys,

i feel kind of stupid ... i dont even get the "Writing_your_first_addon" to work ...

Code:
LempsAddon = {}
LempsAddon.name = "LempsAddon"
LempsAddon.version = "1.0"
local LempsAddon.inCombat = false

local function LempsAddon.CombatStateChanged(combatState)
	self.inCombat = combatState
	if self.inCombat then
		d("fight")
	else
		d("no fight")
	end
end

local function LempsAddon:Initialize(event, addon)
	self.inCombat = IsUnitInCombat("player")
	EVENT_MANAGER:RegisterForEvent("LempsAddon", EVENT_PLAYER_COMBAT_STATE, LempsAddon.CombatStateChanged)
end

local function LempsAddon.OnAddOnLoaded(event, addonName)
  if addonName == LempsAddon.name then
    LempsAddon:Initialize()
  end
end

EVENT_MANAGER:RegisterForEvent("LempsAddon", EVENT_ADD_ON_LOADED, LempsAddon.OnAddOnLoaded)
This is my code but it just doesnt work ... I dont even get where this code would be able to not work ... I see no Text output to the chat (debug) at all
  Reply With Quote
 

ESOUI » Developer Discussions » General Authoring Discussion » Help for a new Addon Programmer


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off