make things local as fuark

Pawkette [03-16-14 - 19:57]
make things local as fuark
Filename
PSBT.lua
PSBT_Auras.lua
PSBT_Combat.lua
PSBT_Experience.lua
PSBT_Label.lua
PSBT_LowSomething.lua
PSBT_Options.lua
PSBT_ScrollArea.lua
PSBT_Settings.lua
diff --git a/PSBT.lua b/PSBT.lua
index 6f18b4d..2ae4f74 100644
--- a/PSBT.lua
+++ b/PSBT.lua
@@ -31,7 +31,11 @@ local PSBT = ZO_ObjectPool:Subclass()
 PSBT._modules  = {}
 PSBT._areas    = {}

-local CBM = CALLBACK_MANAGER
+local CBM               = CALLBACK_MANAGER
+local PSBT_ScrollArea   = PSBT_ScrollArea
+local PSBT_AREAS        = PSBT_AREAS
+local PSBT_EVENTS       = PSBT_EVENTS
+local PSBT_MODULES      = PSBT_MODULES

 function PSBT:New( ... )
     local result = ZO_ObjectPool.New( self, PSBT.CreateLabel, function( ... ) self:ResetLabel( ... ) end )
diff --git a/PSBT_Auras.lua b/PSBT_Auras.lua
index 625864e..fecf234 100644
--- a/PSBT_Auras.lua
+++ b/PSBT_Auras.lua
@@ -1,5 +1,13 @@
-local PSBT_Auras = PSBT_Module:Subclass()
-local CBM = CALLBACK_MANAGER
+local PSBT_Module   = PSBT_Module
+local PSBT_Auras    = PSBT_Module:Subclass()
+local CBM           = CALLBACK_MANAGER
+
+local EFFECT_RESULT_FADED   = EFFECT_RESULT_FADED
+local EFFECT_RESULT_GAINED  = EFFECT_RESULT_GAINED
+
+local PSBT_EVENTS   = PSBT_EVENTS
+local PSBT_AREAS    = PSBT_AREAS
+local PSBT_MODULES  = PSBT_MODULES

 function PSBT_Auras:Initialize( ... )
     PSBT_Module.Initialize( self, ... )
diff --git a/PSBT_Combat.lua b/PSBT_Combat.lua
index 1f55836..1617687 100644
--- a/PSBT_Combat.lua
+++ b/PSBT_Combat.lua
@@ -1,11 +1,21 @@
-local PSBT_Combat = PSBT_Module:Subclass()
-PSBT_Combat._iconRegistry = setmetatable( {}, { __mode = 'kv' } )
+local PSBT_Module           = PSBT_Module
+local PSBT_Combat           = PSBT_Module:Subclass()
+PSBT_Combat._iconRegistry   = setmetatable( {}, { __mode = 'kv' } )
+local CBM                   = CALLBACK_MANAGER

-local CBM = CALLBACK_MANAGER
-local MAX_EVENTS = 15
+local MAX_EVENTS            = 15
+local PlayerName            = GetUnitName( 'player' )
+local PlayerNameRaw         = GetRawUnitName( 'player' )
+local COMBAT_UNIT_TYPE_PLAYER       = COMBAT_UNIT_TYPE_PLAYER
+local COMBAT_UNIT_TYPE_PLAYER_PET   = COMBAT_UNIT_TYPE_PLAYER_PET
+local COMBAT_UNIT_TYPE_NONE         = COMBAT_UNIT_TYPE_NONE

-local PlayerName = GetUnitName( 'player' )
-local PlayerNameRaw = GetRawUnitName( 'player' )
+local PSBT_AREAS            = PSBT_AREAS
+local PSBT_EVENTS           = PSBT_EVENTS
+
+local zo_strformat          = zo_strformat
+local GetString             = GetString
+local select                = select

 local function IsPlayerType( targetType )
     return targetType == COMBAT_UNIT_TYPE_PLAYER or
@@ -24,7 +34,6 @@ local function IsPlayer( targetType, targetName )
     return false
 end

-
 local combat_events =
 {
     [ ACTION_RESULT_ABSORBED ] = function( abilityName, abilityGraphic, abilityActionSlotType, sourceName, sourceType, targetName, targetType, hitValue, mechanicValue )
diff --git a/PSBT_Experience.lua b/PSBT_Experience.lua
index ca46f19..7210033 100644
--- a/PSBT_Experience.lua
+++ b/PSBT_Experience.lua
@@ -1,6 +1,13 @@
-local PSBT_Experience = PSBT_Module:Subclass()
-local CBM = CALLBACK_MANAGER
+local PSBT_Module       = PSBT_Module
+local PSBT_Experience   = PSBT_Module:Subclass()
+local CBM               = CALLBACK_MANAGER

+local zo_min            = zo_min
+local tostring          = tostring
+
+local PSBT_AREAS        = PSBT_AREAS
+local PSBT_EVENTS       = PSBT_EVENTS
+local PSBT_MODULES      = PSBT_MODULES

 function PSBT_Experience:Initialize( ... )
     PSBT_Module.Initialize( self, ... )
@@ -24,7 +31,10 @@ function PSBT_Experience:OnXPUpdated( tag, exp, maxExp, reason  )
     local gain = xp - self._currentExperience
     self._currentExperience = xp

-    if ( gain <= 0 ) then return end
+    if ( gain <= 0 ) then
+        return
+    end
+
     self:NewEvent( PSBT_AREAS.NOTIFICATION, true, nil, '+' .. tostring( gain ) .. ' XP' )
 end

diff --git a/PSBT_Label.lua b/PSBT_Label.lua
index 7ffd91c..8195199 100644
--- a/PSBT_Label.lua
+++ b/PSBT_Label.lua
@@ -1,7 +1,6 @@
 PSBT_Label = ZO_Object:Subclass()

-local LibAnim = LibStub( 'LibAnimation-1.0' )
-if ( not LibAnim ) then return end
+local CENTER = CENTER

 function PSBT_Label:New( ... )
     local result = ZO_Object.New( self )
diff --git a/PSBT_LowSomething.lua b/PSBT_LowSomething.lua
index f5e76a6..9a26824 100644
--- a/PSBT_LowSomething.lua
+++ b/PSBT_LowSomething.lua
@@ -1,8 +1,18 @@
+local PSBT_Module           = PSBT_Module
 local PSBT_LowSomething     = PSBT_Module:Subclass()
 PSBT_LowSomething._pools    = {}
 local CBM                   = CALLBACK_MANAGER

-local threshold = 0.33
+local threshold             = 0.33
+
+local PSBT_AREAS            = PSBT_AREAS
+local PSBT_MODULES          = PSBT_MODULES
+local PSBT_EVENTS           = PSBT_EVENTS
+
+local POWERTYPE_HEALTH      = POWERTYPE_HEALTH
+local POWERTYPE_MAGICKA     = POWERTYPE_MAGICKA
+local POWERTYPE_STAMINA     = POWERTYPE_STAMINA
+local POWERTYPE_MOUNT_STAMINA = POWERTYPE_MOUNT_STAMINA

 function PSBT_LowSomething:Initialize( ... )
     PSBT_Module.Initialize( self, ... )
diff --git a/PSBT_Options.lua b/PSBT_Options.lua
index 42c590b..9416666 100644
--- a/PSBT_Options.lua
+++ b/PSBT_Options.lua
@@ -4,8 +4,12 @@ if ( not LAM ) then return end
 local LMP = LibStub( 'LibMediaProvider-1.0' )
 if ( not LMP ) then return end

+local PSBT_Module       = PSBT_Module
 local PSBT_Options      = PSBT_Module:Subclass()
-local CBM = CALLBACK_MANAGER
+local CBM               = CALLBACK_MANAGER
+
+local PSBT_MODULES      = PSBT_MODULES
+local PSBT_EVENTS       = PSBT_EVENTS

 local decorations = { 'none', 'soft-shadow-thin', 'soft-shadow-thick', 'shadow' }

diff --git a/PSBT_ScrollArea.lua b/PSBT_ScrollArea.lua
index 9fcb65b..f6f120e 100644
--- a/PSBT_ScrollArea.lua
+++ b/PSBT_ScrollArea.lua
@@ -1,12 +1,13 @@
-local tinsert = table.insert
-local tremove = table.remove
-
-PSBT_ScrollArea                 = ZO_Object:Subclass()
-
 local LibAnim = LibStub( 'LibAnimation-1.0' )
 if ( not LibAnim ) then return end

-local NUM_STICKY = 4
+PSBT_ScrollArea     = ZO_Object:Subclass()
+local tinsert       = table.insert
+local tremove       = table.remove
+local NUM_STICKY    = 4
+
+local PSBT_Fifo     = PSBT_Fifo
+local CENTER        = CENTER

 function PSBT_ScrollArea:New( ... )
     local result = ZO_Object.New( self )
diff --git a/PSBT_Settings.lua b/PSBT_Settings.lua
index 1442b59..7b00180 100644
--- a/PSBT_Settings.lua
+++ b/PSBT_Settings.lua
@@ -1,5 +1,11 @@
+local PSBT_Module   = PSBT_Module
 local PSBT_Settings = PSBT_Module:Subclass()
-local CBM = CALLBACK_MANAGER
+local CBM           = CALLBACK_MANAGER
+
+local PSBT_MODULES  = PSBT_MODULES
+local PSBT_EVENTS   = PSBT_EVENTS
+
+local ZO_SavedVars  = ZO_SavedVars

 local defaults =
 {
@@ -10,7 +16,7 @@ function PSBT_Settings:Initialize( ... )
     PSBT_Module.Initialize( self, ... )

     self.db = ZO_SavedVars:New( 'PSBT_DB', 1.0, nil, defaults )
-    self.profile = self.db:GetInterfaceForCharacter( GetDisplayName(), GetUnitName('player') )
+    self.profile = self.db:GetInterfaceForCharacter( GetDisplayName(), GetUnitName( 'player' ) )
 end

 function PSBT_Settings:GetSetting( identity )