Code cleanup

This commit is contained in:
chocochaos
2014-07-02 12:10:38 +02:00
parent 26fa297069
commit ccfd486645
16 changed files with 59 additions and 59 deletions

View File

@@ -167,7 +167,7 @@ function ChatFrame_MessageEventHandler(self, event, ...)
GMGenie.Macros.Discipline.IpBan.waitingForPin = false;
else
if GMGenie.Spy.waitingForPin then
local offline, name1, name2, guid = string.match(arg1, "Player ?(.*) %|cffffffff%|Hplayer:(.*)%|h%[(.*)%]%|h%|r %(guid: (.*)%)");
local offline, name1, _, guid = string.match(arg1, "Player ?(.*) %|cffffffff%|Hplayer:(.*)%|h%[(.*)%]%|h%|r %(guid: (.*)%)");
local phase = string.match(arg1, "Phase: (.*)");
local account, accountId, gmLevel = string.match(arg1, "Account: (.*) %(ID: (.*)%), GMLevel: (.*)");
local login, failedLogins = string.match(arg1, "Last Login: (.*) %(Failed Logins: (.*)%)");
@@ -297,4 +297,4 @@ function ChatFrame_MessageEventHandler(self, event, ...)
if not ActionTaken then
ORIG_ChatFrame_MessageEventHandler(self, event, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15);
end
end
end

View File

@@ -118,7 +118,7 @@
<BackgroundInsets>
<AbsInset left="3" right="3" top="3" bottom="3"/>
</BackgroundInsets>
<Color r="0" g="0" b="0" a="10"/>
<Color r="0" g="0" b="0" a="1"/>
</Backdrop>
<Scripts>
<OnLoad>
@@ -490,4 +490,4 @@
</Anchors>
</ButtonText>
</Button>
</Ui>
</Ui>

View File

@@ -19,7 +19,7 @@ function GMGenie.pairsByKeys(t, f)
table.insert(a, n);
end
table.sort(a, f);
for name, value in pairs(a) do
for value in pairs(a) do
table.insert(b, t[value]);
end
return b;
@@ -32,7 +32,7 @@ function GMGenie.pairsByKeys2(t, f)
table.insert(a, n);
end
table.sort(a, f);
for name, value in pairs(a) do
for value in pairs(a) do
table.insert(b, value);
end
return b;
@@ -124,4 +124,4 @@ function GMGenie.loadEditBox(window)
getglobal(name .. '_Frame'):SetHeight(window:GetHeight());
getglobal(name .. '_Frame_Text'):SetWidth(getglobal(name .. '_Frame'):GetWidth());
getglobal(name .. '_Frame_Text'):SetHeight(getglobal(name .. '_Frame'):GetHeight());
end
end

View File

@@ -91,7 +91,7 @@ function GMGenie.Hud.flyStatus(status)
end
end
function GMGenie.Hud.readNotice(self, event, notice)
function GMGenie.Hud.readNotice(_, event, notice)
if event == "UI_ERROR_MESSAGE" then
if notice == "GM mode is ON" then
GMGenie.Hud.gmStatus(true);
@@ -164,4 +164,4 @@ function GMGenie.Hud.setSpeed()
else
GMGenie.showGMMessage("Be sure to target yourself before setting the speed.");
end
end
end

View File

@@ -30,7 +30,7 @@ end
function GMGenie.Macros.Discipline.Mute.addToUnitMenu()
UnitPopupMenus["GMGenie_Mute"] = {};
local MuteTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.mute);
for index, name in pairs(MuteTemp) do
for name in pairs(MuteTemp) do
table.insert(UnitPopupMenus["GMGenie_Mute"], "GMGenie_Mute_" .. name);
UnitPopupButtons["GMGenie_Mute_" .. name] = { text = name, dist = 0, };
end
@@ -39,7 +39,7 @@ function GMGenie.Macros.Discipline.Mute.addToUnitMenu()
UnitPopupButtons["GMGenie_DisciplineOptions"] = { text = "Manage macros", dist = 0, };
end
function GMGenie.Macros.Discipline.Mute.loadDropdown(self, level)
function GMGenie.Macros.Discipline.Mute.loadDropdown(_, level)
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
@@ -48,7 +48,7 @@ function GMGenie.Macros.Discipline.Mute.loadDropdown(self, level)
UIDropDownMenu_AddButton(info, level);
local MuteTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.mute);
for index, name in pairs(MuteTemp) do
for name in pairs(MuteTemp) do
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
@@ -87,7 +87,7 @@ end
function GMGenie.Macros.Discipline.CharBan.addToUnitMenu()
UnitPopupMenus["GMGenie_CharBan"] = {};
local CharBanTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.charBan);
for index, name in pairs(CharBanTemp) do
for name in pairs(CharBanTemp) do
table.insert(UnitPopupMenus["GMGenie_CharBan"], "GMGenie_CharBan_" .. name);
UnitPopupButtons["GMGenie_CharBan_" .. name] = { text = name, dist = 0, };
end
@@ -96,7 +96,7 @@ function GMGenie.Macros.Discipline.CharBan.addToUnitMenu()
UnitPopupButtons["GMGenie_DisciplineOptions"] = { text = "Manage macros", dist = 0, };
end
function GMGenie.Macros.Discipline.CharBan.loadDropdown(self, level)
function GMGenie.Macros.Discipline.CharBan.loadDropdown(_, level)
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
@@ -105,7 +105,7 @@ function GMGenie.Macros.Discipline.CharBan.loadDropdown(self, level)
UIDropDownMenu_AddButton(info, level);
local CharBanTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.charBan);
for index, name in pairs(CharBanTemp) do
for name in pairs(CharBanTemp) do
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
@@ -144,7 +144,7 @@ end
function GMGenie.Macros.Discipline.AccBan.addToUnitMenu()
UnitPopupMenus["GMGenie_AccBan"] = {};
local AccBanTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.accBan);
for index, name in pairs(AccBanTemp) do
for name in pairs(AccBanTemp) do
table.insert(UnitPopupMenus["GMGenie_AccBan"], "GMGenie_AccBan_" .. name);
UnitPopupButtons["GMGenie_AccBan_" .. name] = { text = name, dist = 0, };
end
@@ -153,7 +153,7 @@ function GMGenie.Macros.Discipline.AccBan.addToUnitMenu()
UnitPopupButtons["GMGenie_DisciplineOptions"] = { text = "Manage macros", dist = 0, };
end
function GMGenie.Macros.Discipline.AccBan.loadDropdown(self, level)
function GMGenie.Macros.Discipline.AccBan.loadDropdown(_, level)
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
@@ -162,7 +162,7 @@ function GMGenie.Macros.Discipline.AccBan.loadDropdown(self, level)
UIDropDownMenu_AddButton(info, level);
local AccBanTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.accBan);
for index, name in pairs(AccBanTemp) do
for name in pairs(AccBanTemp) do
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
@@ -232,7 +232,7 @@ end
function GMGenie.Macros.Discipline.IpBan.addToUnitMenu()
UnitPopupMenus["GMGenie_IpBan"] = {};
local IpBanTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.ipBan);
for index, name in pairs(IpBanTemp) do
for name in pairs(IpBanTemp) do
table.insert(UnitPopupMenus["GMGenie_IpBan"], "GMGenie_IpBan_" .. name);
UnitPopupButtons["GMGenie_IpBan_" .. name] = { text = name, dist = 0, };
end
@@ -241,7 +241,7 @@ function GMGenie.Macros.Discipline.IpBan.addToUnitMenu()
UnitPopupButtons["GMGenie_DisciplineOptions"] = { text = "Manage macros", dist = 0, };
end
function GMGenie.Macros.Discipline.IpBan.loadDropdown(self, level)
function GMGenie.Macros.Discipline.IpBan.loadDropdown(_, level)
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
@@ -250,7 +250,7 @@ function GMGenie.Macros.Discipline.IpBan.loadDropdown(self, level)
UIDropDownMenu_AddButton(info, level);
local IpBanTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.ipBan);
for index, name in pairs(IpBanTemp) do
for name in pairs(IpBanTemp) do
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
@@ -266,4 +266,4 @@ function GMGenie.Macros.Discipline.IpBan.loadDropdown(self, level)
info.text = "Manage Macros";
info.func = GMGenie.Macros.Discipline.showOptions;
UIDropDownMenu_AddButton(info, level);
end
end

View File

@@ -36,7 +36,7 @@ end
function GMGenie.Macros.Mail.addToUnitMenu()
UnitPopupMenus["GMGenie_Mail"] = {};
local MailTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.mail);
for index, name in pairs(MailTemp) do
for name in pairs(MailTemp) do
table.insert(UnitPopupMenus["GMGenie_Mail"], "GMGenie_Mail_" .. name);
UnitPopupButtons["GMGenie_Mail_" .. name] = { text = name, dist = 0, };
end
@@ -45,7 +45,7 @@ function GMGenie.Macros.Mail.addToUnitMenu()
UnitPopupButtons["GMGenie_MailOptions"] = { text = "Manage macros", dist = 0, };
end
function GMGenie.Macros.Mail.loadDropdown(self, level)
function GMGenie.Macros.Mail.loadDropdown(_, level)
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
@@ -54,7 +54,7 @@ function GMGenie.Macros.Mail.loadDropdown(self, level)
UIDropDownMenu_AddButton(info, level);
local MailTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.mail);
for index, name in pairs(MailTemp) do
for name in pairs(MailTemp) do
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
@@ -70,4 +70,4 @@ function GMGenie.Macros.Mail.loadDropdown(self, level)
info.text = "Manage Macros";
info.func = GMGenie.Macros.Mail.showOptions;
UIDropDownMenu_AddButton(info, level);
end
end

View File

@@ -25,7 +25,7 @@ end
function GMGenie.Macros.Tele.addToUnitMenu()
UnitPopupMenus["GMGenie_Tele"] = {};
local TeleTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.tele);
for index, name in pairs(TeleTemp) do
for name in pairs(TeleTemp) do
table.insert(UnitPopupMenus["GMGenie_Tele"], "GMGenie_Tele_" .. name);
UnitPopupButtons["GMGenie_Tele_" .. name] = { text = name, dist = 0, };
end
@@ -34,7 +34,7 @@ function GMGenie.Macros.Tele.addToUnitMenu()
UnitPopupButtons["GMGenie_TeleOptions"] = { text = "Manage macros", dist = 0, };
end
function GMGenie.Macros.Tele.loadDropdown(self, level)
function GMGenie.Macros.Tele.loadDropdown(_, level)
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
@@ -43,7 +43,7 @@ function GMGenie.Macros.Tele.loadDropdown(self, level)
UIDropDownMenu_AddButton(info, level);
local TeleTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.tele);
for index, name in pairs(TeleTemp) do
for name in pairs(TeleTemp) do
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
@@ -59,4 +59,4 @@ function GMGenie.Macros.Tele.loadDropdown(self, level)
info.text = "Manage Macros";
info.func = GMGenie.Macros.Tele.showOptions;
UIDropDownMenu_AddButton(info, level);
end
end

View File

@@ -21,7 +21,7 @@ function GMGenie.Macros.Whispers.run(name, title)
GMGenie_Macros_Whispers_SubjectPopup_Subject:SetFocus();
else
local args = { strsplit("\n", msg) };
for index, text in pairs(args) do
for text in pairs(args) do
SendChatMessage(text, "WHISPER", nil, name);
end
end
@@ -41,7 +41,7 @@ function GMGenie.Macros.Whispers.sendWithSubject()
local msg = string.gsub(GMGenie.Macros.Whispers.curWhisperMessage, "SUBJECT", subject);
local args = { strsplit("\n", msg) };
for index, text in pairs(args) do
for text in pairs(args) do
SendChatMessage(text, "WHISPER", nil, GMGenie.Macros.Whispers.curName);
end
@@ -52,7 +52,7 @@ function GMGenie.Macros.Whispers.addToUnitMenu()
UnitPopupMenus["GMGenie_Whispers"] = {};
local whispersTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.whispers);
for index, name in pairs(whispersTemp) do
for name in pairs(whispersTemp) do
table.insert(UnitPopupMenus["GMGenie_Whispers"], "GMGenie_Whispers_" .. name);
UnitPopupButtons["GMGenie_Whispers_" .. name] = { text = name, dist = 0, };
end
@@ -61,7 +61,7 @@ function GMGenie.Macros.Whispers.addToUnitMenu()
UnitPopupButtons["GMGenie_WhisperOptions"] = { text = "Manage macros", dist = 0, };
end
function GMGenie.Macros.Whispers.loadDropdown(self, level)
function GMGenie.Macros.Whispers.loadDropdown(_, level)
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
@@ -70,7 +70,7 @@ function GMGenie.Macros.Whispers.loadDropdown(self, level)
UIDropDownMenu_AddButton(info, level);
local whispersTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.whispers);
for index, name in pairs(whispersTemp) do
for name in pairs(whispersTemp) do
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
@@ -86,4 +86,4 @@ function GMGenie.Macros.Whispers.loadDropdown(self, level)
info.text = "Manage Macros";
info.func = GMGenie.Macros.Whispers.showOptions;
UIDropDownMenu_AddButton(info, level);
end
end

View File

@@ -68,7 +68,7 @@ function GMGenie.Macros.onLoad()
table.insert(GMGenie.Macros.menuItems, "IpBan");
GMGenie.Macros.Discipline.IpBan.addToUnitMenu();
for i, button in ipairs(GMGenie.Macros.menuItems) do
for button in ipairs(GMGenie.Macros.menuItems) do
table.insert(UnitPopupMenus["PLAYER"], #UnitPopupMenus["PLAYER"] - 1, "GMGenie_" .. button);
table.insert(UnitPopupMenus["FRIEND"], #UnitPopupMenus["FRIEND"] - 1, "GMGenie_" .. button);
table.insert(UnitPopupMenus["PARTY"], #UnitPopupMenus["PARTY"] - 1, "GMGenie_" .. button);
@@ -293,4 +293,4 @@ end
function GMGenie.Macros.changerace(name)
SendChatMessage(".char changerace " .. name, "GUILD");
end
end

View File

@@ -30,7 +30,7 @@ GMGenie.Macros.Discipline.Mute.currentEditing = nil;
function GMGenie.Macros.Discipline.Mute.loadOptionsDropdown()
local MuteTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.mute);
for index, name in pairs(MuteTemp) do
for name in pairs(MuteTemp) do
local info = UIDropDownMenu_CreateInfo();
info.text = name;
info.value = name;
@@ -98,7 +98,7 @@ GMGenie.Macros.Discipline.CharBan.currentEditing = nil;
function GMGenie.Macros.Discipline.CharBan.loadOptionsDropdown()
local CharBanTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.charBan);
for index, name in pairs(CharBanTemp) do
for name in pairs(CharBanTemp) do
local info = UIDropDownMenu_CreateInfo();
info.text = name;
info.value = name;
@@ -166,7 +166,7 @@ GMGenie.Macros.Discipline.AccBan.currentEditing = nil;
function GMGenie.Macros.Discipline.AccBan.loadOptionsDropdown()
local AccBanTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.accBan);
for index, name in pairs(AccBanTemp) do
for name in pairs(AccBanTemp) do
local info = UIDropDownMenu_CreateInfo();
info.text = name;
info.value = name;
@@ -234,7 +234,7 @@ GMGenie.Macros.Discipline.IpBan.currentEditing = nil;
function GMGenie.Macros.Discipline.IpBan.loadOptionsDropdown()
local IpBanTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.ipBan);
for index, name in pairs(IpBanTemp) do
for name in pairs(IpBanTemp) do
local info = UIDropDownMenu_CreateInfo();
info.text = name;
info.value = name;
@@ -294,4 +294,4 @@ function GMGenie.Macros.Discipline.IpBan.cleanForm()
GMGenie_Macros_Discipline_OptionsWindow_IpBan_AnnounceToServer:SetChecked(false);
GMGenie_Macros_Discipline_OptionsWindow_IpBan_Save:SetText("Add");
GMGenie_Macros_Discipline_OptionsWindow_IpBan_Delete:Disable();
end
end

View File

@@ -35,7 +35,7 @@ function GMGenie.Macros.Mail.checkMacroLength()
if #lines > 1 then
maxlength = maxlength - 4;
end
for index, line in pairs(lines) do
for line in pairs(lines) do
if string.len(line) > maxlength then
GMGenie_Macros_Mail_OptionsWindow_Macro_Frame_Text:SetTextColor(255, 0, 0);
else
@@ -48,7 +48,7 @@ GMGenie.Macros.Mail.currentEditing = nil;
function GMGenie.Macros.Mail.loadOptionsDropdown()
local MailTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.mail);
for index, name in pairs(MailTemp) do
for name in pairs(MailTemp) do
local info = UIDropDownMenu_CreateInfo();
info.text = name;
info.value = name;
@@ -115,4 +115,4 @@ end
function GMGenie.Macros.Mail.showOptions()
InterfaceOptionsFrame_OpenToCategory("Mail Macros");
end
end

View File

@@ -24,7 +24,7 @@ GMGenie.Macros.Tele.currentEditing = nil;
function GMGenie.Macros.Tele.loadOptionsDropdown()
local TeleTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.tele);
for index, name in pairs(TeleTemp) do
for name in pairs(TeleTemp) do
local info = UIDropDownMenu_CreateInfo();
info.text = name;
info.value = name;
@@ -88,4 +88,4 @@ end
function GMGenie.Macros.Tele.showOptions()
InterfaceOptionsFrame_OpenToCategory("Teleport Macros");
end
end

View File

@@ -31,7 +31,7 @@ function GMGenie.Macros.Whispers.checkMacroLength()
local macro = string.gsub(macro, "NAME", "abcdefghijkl");
local lines = { strsplit("\n", macro) };
for index, line in pairs(lines) do
for line in pairs(lines) do
if string.len(line) > 255 then
GMGenie_Macros_Whispers_OptionsWindow_Macro_Frame_Text:SetTextColor(255, 0, 0);
else
@@ -45,7 +45,7 @@ GMGenie.Macros.Whispers.currentEditing = nil;
function GMGenie.Macros.Whispers.loadOptionsDropdown()
local whispersTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.whispers);
for index, name in pairs(whispersTemp) do
for name in pairs(whispersTemp) do
local info = UIDropDownMenu_CreateInfo();
info.text = name;
info.value = name;
@@ -109,4 +109,4 @@ function GMGenie.Macros.Whispers.test()
if GMGenie.Macros.Whispers.currentEditing then
GMGenie.Macros.Whispers.run(UnitName("player"), GMGenie.Macros.Whispers.currentEditing);
end
end
end

View File

@@ -27,7 +27,7 @@ GMGenie.Spawns.Objects = {};
function GMGenie.Spawns.Objects.loadOptionsDropdown()
local objectsTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.objects);
for index, name in pairs(objectsTemp) do
for name in pairs(objectsTemp) do
local info = UIDropDownMenu_CreateInfo();
info.text = name;
info.value = name;
@@ -85,7 +85,7 @@ GMGenie.Spawns.Npcs = {};
function GMGenie.Spawns.Npcs.loadOptionsDropdown()
local npcsTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.npcs);
for index, name in pairs(npcsTemp) do
for name in pairs(npcsTemp) do
local info = UIDropDownMenu_CreateInfo();
info.text = name;
info.value = name;
@@ -137,4 +137,4 @@ function GMGenie.Spawns.Npcs.cleanForm()
GMGenie_Spawns_OptionsWindow_Npcs_Name:SetText("");
GMGenie_Spawns_OptionsWindow_Npcs_Save:SetText("Add");
GMGenie_Spawns_OptionsWindow_Npcs_Delete:Disable();
end
end

View File

@@ -34,7 +34,7 @@ function GMGenie.loadSettings()
end
function GMGenie.setDefault(names)
for i, name in ipairs(names) do
for name in ipairs(names) do
GMGenie_SavedVars[name] = GMGenie.defaultSettings[name];
end
end
end

View File

@@ -171,7 +171,7 @@ function GMGenie.Spy.resetBoxes()
GMGenie_Spy_InfoWindow_Location_Location:SetCursorPosition(0);
end
function GMGenie.Spy.loadDropdown(self, level)
function GMGenie.Spy.loadDropdown(_, level)
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
@@ -255,7 +255,7 @@ end
local Saved_SetItemRef = SetItemRef;
function SetItemRef(link, text, button, chatFrame)
if (strsub(link, 1, 9) == "anticheat") then
local type, name = strsplit(":", link);
local name = strsplit(":", link);
if (button == "LeftButton") then
GMGenie.Spy.antiCheat(name);
elseif (button == "RightButton") then
@@ -264,4 +264,4 @@ function SetItemRef(link, text, button, chatFrame)
return;
end
Saved_SetItemRef(link, text, button, chatFrame);
end
end