Johnny C. Lam [03-02-13 - 17:57]
diff --git a/Ovale.lua b/Ovale.lua
index 49ee079..f8354d9 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -7,12 +7,13 @@
file accompanying this program.
----------------------------------------------------------------------]]
-Ovale = LibStub("AceAddon-3.0"):NewAddon("Ovale", "AceEvent-3.0", "AceConsole-3.0")
+local _, Ovale = ...
+_G.Ovale = LibStub("AceAddon-3.0"):NewAddon(Ovale, "Ovale", "AceConsole-3.0", "AceEvent-3.0")
--<private-static-properties>
-local L = LibStub("AceLocale-3.0"):GetLocale("Ovale")
local Recount = Recount
local Skada = Skada
+local L = LibStub("AceLocale-3.0"):GetLocale("Ovale")
local ipairs, pairs, strsplit, tinsert, tsort = ipairs, pairs, string.split, table.insert, table.sort
local SendAddonMessage, UnitAura, UnitCanAttack = SendAddonMessage, UnitAura, UnitCanAttack
@@ -20,6 +21,7 @@ local UnitExists, UnitHasVehicleUI, UnitIsDead = UnitExists, UnitHasVehicleUI, U
--</private-static-properties>
--<public-static-properties>
+Ovale.L = L
--Default scripts (see "defaut" directory)
Ovale.defaut = {}
--The table of check boxes definition
diff --git a/OvaleActionBar.lua b/OvaleActionBar.lua
index 0f932ef..088deed 100644
--- a/OvaleActionBar.lua
+++ b/OvaleActionBar.lua
@@ -8,11 +8,10 @@
----------------------------------------------------------------------]]
-- Keep data about the player action bars (key bindings mostly)
-OvaleActionBar = LibStub("AceAddon-3.0"):NewAddon("OvaleActionBar", "AceEvent-3.0")
+local _, Ovale = ...
+OvaleActionBar = Ovale:NewModule("OvaleActionBar", "AceEvent-3.0")
--<private-static-properties>
-local Ovale = LibStub("AceAddon-3.0"):GetAddon("Ovale")
-
local GetActionInfo = GetActionInfo
local GetActionText = GetActionText
local tonumber = tonumber
diff --git a/OvaleAura.lua b/OvaleAura.lua
index e241bee..72c4385 100644
--- a/OvaleAura.lua
+++ b/OvaleAura.lua
@@ -10,7 +10,8 @@
-- This addon keep the list of all the aura for all the units
-- Fore each aura, it saves the state of the player when it was refreshed
-OvaleAura = LibStub("AceAddon-3.0"):NewAddon("OvaleAura", "AceEvent-3.0")
+local _, Ovale = ...
+OvaleAura = Ovale:NewModule("OvaleAura", "AceEvent-3.0")
--<public-static-properties>
OvaleAura.aura = {}
diff --git a/OvaleBestAction.lua b/OvaleBestAction.lua
index 7dc55f1..311675a 100644
--- a/OvaleBestAction.lua
+++ b/OvaleBestAction.lua
@@ -7,6 +7,7 @@
file accompanying this program.
----------------------------------------------------------------------]]
+local _, Ovale = ...
OvaleBestAction = {}
--<private-static-properties>
diff --git a/OvaleComboPoints.lua b/OvaleComboPoints.lua
index 361e056..7193b72 100644
--- a/OvaleComboPoints.lua
+++ b/OvaleComboPoints.lua
@@ -9,7 +9,8 @@
-- This addon tracks the number of combo points by the player on the current target.
-OvaleComboPoints = LibStub("AceAddon-3.0"):NewAddon("OvaleComboPoints", "AceEvent-3.0")
+local _, Ovale = ...
+OvaleComboPoints = Ovale:NewModule("OvaleComboPoints", "AceEvent-3.0")
--<private-static-properties>
local strfind = string.find
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index 5a4290b..e8c26c2 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -7,11 +7,11 @@
file accompanying this program.
----------------------------------------------------------------------]]
+local _, Ovale = ...
OvaleCompile = {}
--<private-static-properties>
-local Ovale = LibStub("AceAddon-3.0"):GetAddon("Ovale")
-local L = LibStub("AceLocale-3.0"):GetLocale("Ovale")
+local L = Ovale.L
local node={}
local defines = {}
diff --git a/OvaleCondition.lua b/OvaleCondition.lua
index b0c0ac0..7ff1d1a 100644
--- a/OvaleCondition.lua
+++ b/OvaleCondition.lua
@@ -7,10 +7,10 @@
file accompanying this program.
----------------------------------------------------------------------]]
+local _, Ovale = ...
OvaleCondition = {}
--<private-static-properties>
-
local LBCT = LibStub("LibBabble-CreatureType-3.0"):GetLookupTable()
local LRC = LibStub("LibRangeCheck-2.0", true)
diff --git a/OvaleData.lua b/OvaleData.lua
index 5efdb62..e1f6e15 100644
--- a/OvaleData.lua
+++ b/OvaleData.lua
@@ -7,11 +7,10 @@
file accompanying this program.
----------------------------------------------------------------------]]
-OvaleData = LibStub("AceAddon-3.0"):NewAddon("OvaleData", "AceEvent-3.0")
+local _, Ovale = ...
+OvaleData = Ovale:NewModule("OvaleData", "AceEvent-3.0")
--<private-static-properties>
-local Ovale = LibStub("AceAddon-3.0"):GetAddon("Ovale")
-
local ipairs, pairs, tinsert, tonumber, tostring, tsort = ipairs, pairs, table.insert, tonumber, tostring, table.sort
local GetNumGlyphSockets = GetNumGlyphSockets
local GetGlyphSocketInfo = GetGlyphSocketInfo
diff --git a/OvaleEnemies.lua b/OvaleEnemies.lua
index f43732f..fbf0f00 100644
--- a/OvaleEnemies.lua
+++ b/OvaleEnemies.lua
@@ -9,7 +9,8 @@
-- Gather information about ennemies
-OvaleEnemies = LibStub("AceAddon-3.0"):NewAddon("OvaleEnemies", "AceEvent-3.0")
+local _, Ovale = ...
+OvaleEnemies = Ovale:NewModule("OvaleEnemies", "AceEvent-3.0")
--<private-static-properties>
local bit_band, pairs, select, tostring = bit.band, pairs, select, tostring
diff --git a/OvaleEquipement.lua b/OvaleEquipement.lua
index 4571c33..42f0e76 100644
--- a/OvaleEquipement.lua
+++ b/OvaleEquipement.lua
@@ -7,11 +7,10 @@
file accompanying this program.
----------------------------------------------------------------------]]
-OvaleEquipement = LibStub("AceAddon-3.0"):NewAddon("OvaleEquipement", "AceEvent-3.0")
+local _, Ovale = ...
+OvaleEquipement = Ovale:NewModule("OvaleEquipement", "AceEvent-3.0")
--<private-static-properties>
-local Ovale = LibStub("AceAddon-3.0"):GetAddon("Ovale")
-
local pairs = pairs
local strfind = string.find
local tonumber = tonumber
diff --git a/OvaleFrame.lua b/OvaleFrame.lua
index 87f8962..d9684f9 100644
--- a/OvaleFrame.lua
+++ b/OvaleFrame.lua
@@ -7,18 +7,21 @@
file accompanying this program.
----------------------------------------------------------------------]]
+local _, Ovale = ...
+
--inherits Frame
do
--<private-static-properties>
local AceGUI = LibStub("AceGUI-3.0")
local Masque = LibStub("Masque", true)
- local GetTime = GetTime
+ local Ovale = LibStub("AceAddon-3.0"):GetAddon("Ovale")
local Type = "OvaleFrame"
local Version = 7
local pairs = pairs
local CreateFrame, GetSpellInfo = CreateFrame, GetSpellInfo
+ local GetTime = GetTime
--</private-static-properties>
--<public-methods>
diff --git a/OvaleFuture.lua b/OvaleFuture.lua
index 88af9bd..cbd9e32 100644
--- a/OvaleFuture.lua
+++ b/OvaleFuture.lua
@@ -9,7 +9,8 @@
-- The travelling missiles or spells that have been cast but whose effects were not still not applied
-OvaleFuture = LibStub("AceAddon-3.0"):NewAddon("OvaleFuture", "AceEvent-3.0")
+local _, Ovale = ...
+OvaleFuture = Ovale:NewModule("OvaleFuture", "AceEvent-3.0")
--<private-static-properties>
local ipairs = ipairs
diff --git a/OvaleGUID.lua b/OvaleGUID.lua
index 1ea9648..d5e2aa5 100644
--- a/OvaleGUID.lua
+++ b/OvaleGUID.lua
@@ -10,7 +10,8 @@
-- This addon translates a GUID to a target name
-- Usage: OvaleGUID:GetUnitId(guid)
-OvaleGUID = LibStub("AceAddon-3.0"):NewAddon("OvaleGUID", "AceEvent-3.0", "AceConsole-3.0")
+local _, Ovale = ...
+OvaleGUID = Ovale:NewModule("OvaleGUID", "AceEvent-3.0", "AceConsole-3.0")
--<private-static-properties>
local strfind, strsub = string.find, string.sub
diff --git a/OvaleIcone.lua b/OvaleIcone.lua
index 380923c..aafdac3 100644
--- a/OvaleIcone.lua
+++ b/OvaleIcone.lua
@@ -7,11 +7,12 @@
file accompanying this program.
----------------------------------------------------------------------]]
-local L = LibStub("AceLocale-3.0"):GetLocale("Ovale")
+local _, Ovale = ...
--inherits ActionButtonTemplate
--<private-static-properties>
+local L = Ovale.L
local strfind, strformat, strsub = string.find, string.format, string.sub
--</private-static-properties>
diff --git a/OvaleOptions.lua b/OvaleOptions.lua
index 09aa291..6a38025 100644
--- a/OvaleOptions.lua
+++ b/OvaleOptions.lua
@@ -9,7 +9,8 @@
-- Ovale options and UI
-OvaleOptions = LibStub("AceAddon-3.0"):NewAddon("OvaleOptions", "AceEvent-3.0", "AceConsole-3.0")
+local _, Ovale = ...
+OvaleOptions = Ovale:NewModule("OvaleOptions", "AceConsole-3.0")
--<private-static-properties>
local strgmatch, strgsub, tostring = string.gmatch, string.gsub, tostring
diff --git a/OvalePaperDoll.lua b/OvalePaperDoll.lua
index 8af05ed..3dd8822 100644
--- a/OvalePaperDoll.lua
+++ b/OvalePaperDoll.lua
@@ -9,11 +9,10 @@
-- This addon tracks the player's stats as available on the in-game paper doll.
-OvalePaperDoll = LibStub("AceAddon-3.0"):NewAddon("OvalePaperDoll", "AceEvent-3.0")
+local _, Ovale = ...
+OvalePaperDoll = Ovale:NewModule("OvalePaperDoll", "AceEvent-3.0")
--<private-static-properties>
-local Ovale = LibStub("AceAddon-3.0"):GetAddon("Ovale")
-
local GetMasteryEffect = GetMasteryEffect
local GetMeleeHaste = GetMeleeHaste
local GetSpellBonusDamage = GetSpellBonusDamage
diff --git a/OvaleSpellDamage.lua b/OvaleSpellDamage.lua
index 208f6ac..1a72de5 100644
--- a/OvaleSpellDamage.lua
+++ b/OvaleSpellDamage.lua
@@ -9,7 +9,8 @@
-- Add-on that registers how many damage made the last spell cast by the player
-OvaleSpellDamage = LibStub("AceAddon-3.0"):NewAddon("OvaleSpellDamage", "AceEvent-3.0")
+local _, Ovale = ...
+OvaleSpellDamage = Ovale:NewModule("OvaleSpellDamage", "AceEvent-3.0")
--<private-static-properties>
local select, strfind = select, string.find
diff --git a/OvaleStance.lua b/OvaleStance.lua
index cbef216..100ed59 100644
--- a/OvaleStance.lua
+++ b/OvaleStance.lua
@@ -9,11 +9,10 @@
-- This addon tracks the player's current stance.
-OvaleStance = LibStub("AceAddon-3.0"):NewAddon("OvaleStance", "AceEvent-3.0")
+local _, Ovale = ...
+OvaleStance = Ovale:NewModule("OvaleStance", "AceEvent-3.0")
--<private-static-properties>
-local Ovale = LibStub("AceAddon-3.0"):GetAddon("Ovale")
-
local ipairs = ipairs
local pairs = pairs
local strfind = string.find
diff --git a/OvaleState.lua b/OvaleState.lua
index c229943..302d2e4 100644
--- a/OvaleState.lua
+++ b/OvaleState.lua
@@ -9,6 +9,7 @@
-- Keep the current state in the simulation
+local Ovale = LibStub("AceAddon-3.0"):GetAddon("Ovale")
OvaleState = {}
--<public-static-properties>
diff --git a/OvaleSwing.lua b/OvaleSwing.lua
index 329e257..5bee842 100644
--- a/OvaleSwing.lua
+++ b/OvaleSwing.lua
@@ -18,7 +18,8 @@
Modifed for Ovale
]]
-OvaleSwing = LibStub("AceAddon-3.0"):NewAddon("OvaleSwing", "AceEvent-3.0")
+local _, Ovale = ...
+OvaleSwing = Ovale:NewModule("OvaleSwing", "AceEvent-3.0")
--<public-static-properties>
OvaleSwing.ohNext = nil
diff --git a/compiler.pl b/compiler.pl
index 5b8df95..9188a1f 100644
--- a/compiler.pl
+++ b/compiler.pl
@@ -100,6 +100,7 @@ while (defined($r = readdir(DIR)))
{
if ($1 =~ m/AceAddon/)
{
+ $m{$class}{NewModule} = true;
$m{$class}{Print} = true;
$m{$class}{RegisterEvent} = true;
$m{$class}{UnregisterEvent} = true;
@@ -109,6 +110,16 @@ while (defined($r = readdir(DIR)))
}
}
+ if ($content =~ m/$class\s*=\s*Ovale:NewModule\(([^)]+)\)/)
+ {
+ $m{$class}{Print} = true;
+ $m{$class}{RegisterEvent} = true;
+ $m{$class}{UnregisterEvent} = true;
+ $m{$class}{RegisterMessage} = true;
+ $m{$class}{UnregisterMessage} = true;
+ $m{$class}{SendMessage} = true;
+ }
+
if ($content =~ m/<private-static-properties>(.*)<\/private-static-properties>/s)
{
my $psp = $1;