All pastes #84203 Raw Edit

Tekkub

public lua v1 · immutable
·published 2006-07-10 18:26 UTC
rendered paste body
BigWigs = AceLibrary("AceAddon-2.0"):new("AceEvent-2.0", "AceDebug-2.0", "AceModuleCore-2.0", "AceConsole-2.0", "AceDB-2.0")BigWigsDebuggy = BigWigs:NewModule("Debuggy", "AceConsole-2.0", "AceEvent-2.0")function BigWigsDebuggy:OnInitialize()	BigWigs:ToggleModuleActive("Debuggy", false)endfunction BigWigsDebuggy:OnEnable()	self.prior, self.dis = nil, nil	self:Print("OnEnable")	self:RegisterEvent("PLAYER_TARGET_CHANGED")endfunction BigWigsDebuggy:OnDisable()	self:Print("OnDisable")endfunction BigWigsDebuggy:PLAYER_TARGET_CHANGED()	if self.dis then		self:Print("I should be disabled now...")	elseif self.prior then		self:Print("OnDisable should get called now")		self.core:ToggleModuleActive("Debuggy", false)		self.dis = true	else		self.prior = true		self:Print("Target changed")	endend-- During load: "OnEnable"-- Change target >> "Target changed"-- Change target >> "OnDisable should get called now"-- Change target >> "I should be disabled now..."-- Change target >> "I should be disabled now..."