diff --git a/AddonComm.lua b/AddonComm.lua index d8c5b33..db449d9 100644 --- a/AddonComm.lua +++ b/AddonComm.lua @@ -25,6 +25,13 @@ local ipairs = ipairs local tostring = tostring local tonumber = tonumber +-- API Upvalues +local UnitName = UnitName +local SendAddonMessage = SendAddonMessage +local GetNumGuildMembers = GetNumGuildMembers +local GetGuildRosterInfo = GetGuildRosterInfo +local RegisterAddonMessagePrefix = RegisterAddonMessagePrefix + local C = Command local L = C.LocaleManager @@ -97,14 +104,6 @@ end function AC:Init() --self:LoadSavedVars() - --[[ - for _,v in pairs(self.Type) do - if not RegisterAddonMessagePrefix(v) then - log:Error(L("AC_ERR_PREFIX"):format(tostring(v))) - error(L("AC_ERR_PREFIX"):format(tostring(v))) - end - end - ]] if not RegisterAddonMessagePrefix(self.Prefix) then log:Error(L("AC_ERR_PREFIX"):format(tostring(self.Prefix))) error(L("AC_ERR_PREFIX"):format(tostring(self.Prefix))) diff --git a/BattleNetTools.lua b/BattleNetTools.lua index aff24c5..f4caaea 100644 --- a/BattleNetTools.lua +++ b/BattleNetTools.lua @@ -1,18 +1,18 @@ --[[ * Copyright (c) 2011-2012 by Adam Hellberg. - * + * * This file is part of Command. - * + * * Command is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * Command is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with Command. If not, see <http://www.gnu.org/licenses/>. --]] @@ -21,11 +21,17 @@ local select = select local tonumber = tonumber -local C = Command +-- API Upvalues +local BNGetToonInfo = BNGetToonInfo +local BNGetNumFriends = BNGetNumFriends +local BNGetFriendInfo = BNGetFriendInfo +local BNGetFriendInfoByID = BNGetFriendInfoByID +local BNGetFriendToonInfo = BNGetFriendToonInfo +local BNGetNumFriendToons = BNGetNumFriendToons -C.BattleNetTools = { +local C = Command -} +C.BattleNetTools = {} local BNT = C.BattleNetTools local CET = C.Extensions.Table diff --git a/ChatManager.lua b/ChatManager.lua index 740bf74..f9d92f9 100644 --- a/ChatManager.lua +++ b/ChatManager.lua @@ -23,6 +23,10 @@ local ipairs = ipairs local unpack = unpack local tostring = tostring +-- API Upvalues +local BNSendWhisper = BNSendWhisper +local SendChatMessage = SendChatMessage + local C = Command --- Table holding all ChatManager methods. diff --git a/CommandManager.lua b/CommandManager.lua index 92b3886..e5b157e 100644 --- a/CommandManager.lua +++ b/CommandManager.lua @@ -25,6 +25,22 @@ local unpack = unpack local tostring = tostring local tonumber = tonumber +-- API Upvalues +local SetCVar = SetCVar +local UnitName = UnitName +local ShowUIPanel = ShowUIPanel +local HideUIPanel = HideUIPanel +local AcceptGroup = AcceptGroup +local DoReadyCheck = DoReadyCheck +local ConvertToRaid = ConvertToRaid +local GetLFGProposal = GetLFGProposal +local ConvertToParty = ConvertToParty +local ConfirmReadyCheck = ConfirmReadyCheck +local StaticPopup_Visible = StaticPopup_Visible +local ClearAllLFGDungeons = ClearAllLFGDungeons +local GetReadyCheckStatus = GetReadyCheckStatus +local GetReadyCheckTimeLeft = GetReadyCheckTimeLeft + local C = Command --- Table holding all CommandManager methods. @@ -450,9 +466,9 @@ CM:Register({"kick"}, PM.Access.Groups.Op.Level, function(args, sender, isChat) return false, "CM_KICK_USAGE" end local player = PM:GetOrCreatePlayer(args[1]) - local reason = args[2] + local reason = (args[2] or ""):lower() local override = args[3] ~= nil - if ((reason or ""):lower() == "override" or (reason or ""):lower() == "true") and #args == 2 then + if (reason == "override" or reason == "true") and #args == 2 then reason = nil override = true end diff --git a/EventHandler.lua b/EventHandler.lua index b3dc25e..a7248e8 100644 --- a/EventHandler.lua +++ b/EventHandler.lua @@ -1,18 +1,18 @@ --[[ * Copyright (c) 2011-2012 by Adam Hellberg. - * + * * This file is part of Command. - * + * * Command is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * Command is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with Command. If not, see <http://www.gnu.org/licenses/>. --]] @@ -20,6 +20,9 @@ -- Upvalues local pairs = pairs +-- API Upvalues +local CreateFrame = CreateFrame + local C = Command local CES = C.Extensions.String diff --git a/Events.lua b/Events.lua index 3fd4c0e..684aa56 100644 --- a/Events.lua +++ b/Events.lua @@ -21,6 +21,11 @@ local select = select local tostring = tostring +-- API Upvalues +local StaticPopup_Hide = StaticPopup_Hide +local GetNumGuildMembers = GetNumGuildMembers +local StaticPopup_Visible = StaticPopup_Visible + local C = Command local L = C.LocaleManager diff --git a/Events_Chat.lua b/Events_Chat.lua index 611a0ef..22fe4de 100644 --- a/Events_Chat.lua +++ b/Events_Chat.lua @@ -1,18 +1,18 @@ --[[ * Copyright (c) 2011-2012 by Adam Hellberg. - * + * * This file is part of Command. - * + * * Command is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * Command is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with Command. If not, see <http://www.gnu.org/licenses/>. --]] @@ -20,6 +20,9 @@ -- Upvalues local select = select +-- API Upvalues +local BNET_CLIENT_WOW = BNET_CLIENT_WOW + local C = Command local CM = C.ChatManager local AC = C.AddonComm diff --git a/GroupTools.lua b/GroupTools.lua index c46b2f0..92fbd84 100644 --- a/GroupTools.lua +++ b/GroupTools.lua @@ -20,6 +20,22 @@ -- Upvalues local select = select +-- API Upvalues +local UnitExists = UnitExists +local GetLFGMode = GetLFGMode +local UnitInRaid = UnitInRaid +local UnitInParty = UnitInParty +local UnitIsConnected = UnitIsConnected +local GetRaidDifficulty = GetRaidDifficulty +local SetRaidDifficulty = SetRaidDifficulty +local GetNumRaidMembers = GetNumRaidMembers +local GetRaidRosterInfo = GetRaidRosterInfo +local UnitIsPartyLeader = UnitIsPartyLeader +local UnitIsRaidOfficer = UnitIsRaidOfficer +local GetNumPartyMembers = GetNumPartyMembers +local GetDungeonDifficulty = GetDungeonDifficulty +local SetDungeonDifficulty = SetDungeonDifficulty + local C = Command local L = C.LocaleManager diff --git a/LootManager.lua b/LootManager.lua index 53ac07d..f018a7d 100644 --- a/LootManager.lua +++ b/LootManager.lua @@ -1,18 +1,18 @@ --[[ * Copyright (c) 2011-2012 by Adam Hellberg. - * + * * This file is part of Command. - * + * * Command is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * Command is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with Command. If not, see <http://www.gnu.org/licenses/>. --]] @@ -20,6 +20,14 @@ -- Upvalues local type = type +-- API Upvalues +local UnitName = UnitName +local GetLootMethod = GetLootMethod +local SetLootMethod = SetLootMethod +local GetOptOutOfLoot = GetOptOutOfLoot +local SetOptOutOfLoot = SetOptOutOfLoot +local SetLootThreshold = SetLootThreshold + local C = Command --- Table holding all LootManager methods. @@ -27,8 +35,7 @@ local C = Command -- @name Command.LootManager -- @class table -- -C.LootManager = { -} +C.LootManager = {} local L = C.LocaleManager local LM = C.LootManager diff --git a/PlayerManager.lua b/PlayerManager.lua index d27c4c8..787fe7a 100644 --- a/PlayerManager.lua +++ b/PlayerManager.lua @@ -25,6 +25,22 @@ local ipairs = ipairs local select = select local tostring = tostring +-- API Upvalues +local UnitName = UnitName +local IsInGuild = IsInGuild +local UnitInRaid = UnitInRaid +local InviteUnit = InviteUnit +local UninviteUnit = UninviteUnit +local GetNumFriends = GetNumFriends +local GetFriendInfo = GetFriendInfo +local PromoteToLeader = PromoteToLeader +local DemoteAssistant = DemoteAssistant +local BNET_CLIENT_WOW = BNET_CLIENT_WOW +local StaticPopup_Show = StaticPopup_Show +local GetNumGuildMembers = GetNumGuildMembers +local GetGuildRosterInfo = GetGuildRosterInfo +local PromoteToAssistant = PromoteToAssistant + local MODE_BLACKLIST = 0 local MODE_WHITELIST = 1 diff --git a/QueueManager.lua b/QueueManager.lua index eb3b698..645a3db 100644 --- a/QueueManager.lua +++ b/QueueManager.lua @@ -1,18 +1,18 @@ --[[ * Copyright (c) 2011-2012 by Adam Hellberg. - * + * * This file is part of Command. - * + * * Command is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * Command is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with Command. If not, see <http://www.gnu.org/licenses/>. --]] @@ -23,6 +23,18 @@ local pairs = pairs local select = select local tostring = tostring +-- API Upvalues +local SetCVar = SetCVar +local JoinLFG = JoinLFG +local LeaveLFG = LeaveLFG +local GetLFGMode = GetLFGMode +local HideUIPanel = HideUIPanel +local SetLFGRoles = SetLFGRoles +local SetLFGDungeon = SetLFGDungeon +local AcceptProposal = AcceptProposal +local GetLFGDungeonInfo = GetLFGDungeonInfo +local GetRandomDungeonBestChoice = GetRandomDungeonBestChoice + local C = Command --- Table containing all QueueManager methods. diff --git a/RollManager.lua b/RollManager.lua index f6ae1d0..c5bc5f1 100644 --- a/RollManager.lua +++ b/RollManager.lua @@ -1,18 +1,18 @@ --[[ * Copyright (c) 2011-2012 by Adam Hellberg. - * + * * This file is part of Command. - * + * * Command is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * Command is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with Command. If not, see <http://www.gnu.org/licenses/>. --]] @@ -24,6 +24,9 @@ local pairs = pairs local tostring = tostring local tonumber = tonumber +-- API Upvalues +local RandomRoll = RandomRoll + local C = Command local L = C.LocaleManager local GT = C.GroupTools @@ -53,22 +56,22 @@ local function RollTimerUpdate(_, elapsed) RollTimer.LastWarning = 0 RollTimer.Current = 0 end - + RollTimer.Current = RollTimer.Current + elapsed - + local left = RollTimer.Time - RollTimer.Current if not RollTimer.LastWarning then RollTimer.LastWarning = 0 end if (left <= 10 and left > 0) and ceil(RollTimer.Current) - RollTimer.LastWarning >= 5 then CM:SendMessage(L("RM_UPDATE_TIMELEFT"):format(ceil(left)), "SMART") RollTimer.LastWarning = ceil(RollTimer.Current) end - + if RollTimer.Current < RollTimer.Time and RollCount < RM.NumGroupMembers then return end - + RollTimer.Frame:SetScript("OnUpdate", nil) RollTimer.Current = 0 RollTimer.LastWarning = 0 - + RM:StopRoll(true, RollCount < RM.NumGroupMembers) end