diff --git a/README.txt b/README.txt index 6728d7c..39886c1 100644 --- a/README.txt +++ b/README.txt @@ -1,5 +1,5 @@ Turn In -v2.1 +v2.1 by Sabindeus of Smolderthorn/Andre of Argent Dawn (Alliance) DESCRIPTION diff --git a/TurnIn.lua b/TurnIn.lua index 32ae11b..6e0911d 100644 --- a/TurnIn.lua +++ b/TurnIn.lua @@ -258,7 +258,7 @@ function TI_IsNPCOn(npcname, type) end -function TI_OnEvent(event) +function TI_OnEvent(self, event, ...) if(event == "VARIABLES_LOADED") then TI_VarInit(); if(TI_status.state) then diff --git a/TurnIn.toc b/TurnIn.toc index 4f0fe0c..1bf3991 100644 --- a/TurnIn.toc +++ b/TurnIn.toc @@ -1,4 +1,5 @@ ## Interface: 30300 +## X-Compatible-With: 40000 ## Title: Turn In ## Notes: Automates the selection of quest and gossip options. ## SavedVariables: TI_status, TI_NPCDB, TI_NPCIndex diff --git a/TurnIn.xml b/TurnIn.xml index b70705e..1862cc7 100644 --- a/TurnIn.xml +++ b/TurnIn.xml @@ -63,13 +63,13 @@ - TI_OptionListCheckboxTooltip(); + TI_OptionListCheckboxTooltip(self); TI_TooltipHide(); - TI_OptionToggle(); + TI_OptionToggle(self); @@ -86,13 +86,13 @@ - TI_TooltipMessage("Decrease this option's priority."); + TI_TooltipMessage(self, "Decrease this option's priority."); TI_TooltipHide(); - TI_OptionMove(1); + TI_OptionMove(self, 1); @@ -113,10 +113,10 @@ - TI_OptionMove(-1); + TI_OptionMove(self, -1); - TI_TooltipMessage("Increase this option's priority."); + TI_TooltipMessage(self, "Increase this option's priority."); TI_TooltipHide(); @@ -199,11 +199,11 @@ - TI_NPCToggle(); - TI_NPCListCheckboxTooltip(); + TI_NPCToggle(self); + TI_NPCListCheckboxTooltip(self); - TI_NPCListCheckboxTooltip(); + TI_NPCListCheckboxTooltip(self); TI_TooltipHide(); @@ -223,13 +223,13 @@ - TI_TooltipMessage("Delete this NPC."); + TI_TooltipMessage(self, "Delete this NPC."); TI_TooltipHide(); - TI_DeleteNPCIndex(); + TI_DeleteNPCIndex(self); @@ -249,7 +249,7 @@ - TI_SelectNPCIndex(); + TI_SelectNPCIndex(self); @@ -260,7 +260,7 @@ - TI_TempNPCListTooltipShow(); + TI_TempNPCListTooltipShow(self); TI_TooltipHide(); @@ -300,7 +300,7 @@ TI_DeleteTempNPCIndex(self:GetParent():GetID()); - TI_TooltipMessage("Delete"); + TI_TooltipMessage(self, "Delete"); TI_TooltipHide(); @@ -323,7 +323,7 @@ TI_AddTempNPCIndex(self:GetParent():GetID()); - TI_TooltipMessage("Add this NPC to the database"); + TI_TooltipMessage(self, "Add this NPC to the database"); TI_TooltipHide(); @@ -422,7 +422,7 @@ end - if ( arg1 == "LeftButton" ) then + if ( button == "LeftButton" ) then self:StartMoving(); self.isMoving = true; end @@ -539,7 +539,7 @@ - TI_StatusIndicator_CheckFn(); + TI_StatusIndicator_CheckFn(self); @@ -601,7 +601,7 @@ - TI_SettingCheckboxFn("usedefault"); + TI_SettingCheckboxFn(self, "usedefault"); @@ -621,7 +621,7 @@ - TI_SettingCheckboxFn("autoadd"); + TI_SettingCheckboxFn(self, "autoadd"); @@ -987,12 +987,8 @@ - - TI_OnLoad(); - - - TI_OnEvent(event); - + + diff --git a/TurnInUI.lua b/TurnInUI.lua index d4a8dfb..e47cf94 100644 --- a/TurnInUI.lua +++ b/TurnInUI.lua @@ -118,8 +118,8 @@ function TI_NPCListScrollBarUpdate() end end -function TI_SelectNPCIndex() - local index = this:GetID(); +function TI_SelectNPCIndex(self) + local index = self:GetID(); if(TI_LoadedNPCIndex == index) then TI_LoadedNPCIndex = 0; else @@ -129,8 +129,8 @@ function TI_SelectNPCIndex() TI_PopulateOptions("select npc"); end -function TI_DeleteNPCIndex() - local index = this:GetParent():GetID(); +function TI_DeleteNPCIndex(self) + local index = self:GetParent():GetID(); TI_DeleteNPC(index); if(TI_LoadedNPCIndex == index) then TI_LoadedNPCIndex = 0; @@ -138,9 +138,9 @@ function TI_DeleteNPCIndex() TI_PopulateOptions("npclist update"); end -function TI_NPCToggle() - local index = this:GetParent():GetID(); - TI_NPCDB[TI_NPCIndex[index]].state = this:GetChecked(); +function TI_NPCToggle(self) + local index = self:GetParent():GetID(); + TI_NPCDB[TI_NPCIndex[index]].state = self:GetChecked(); if(TI_NPCDB[TI_NPCIndex[index]].state) then TI_LoadedNPCIndex = index; @@ -152,14 +152,14 @@ function TI_NPCToggle() TI_PopulateOptions("select npc"); end -function TI_OptionMove(offset) +function TI_OptionMove(self, offset) local CurrOpts; if(TI_LoadedNPCIndex > 0) then CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]]; else CurrOpts = TI_status.options; end - local id = this:GetParent():GetID(); + local id = self:GetParent():GetID(); local newid = id + offset; if(newid < 1 or newid > table.getn(CurrOpts)) then @@ -173,15 +173,15 @@ function TI_OptionMove(offset) TI_PopulateOptions("move"); end -function TI_OptionToggle() +function TI_OptionToggle(self) local CurrOpts; if(TI_LoadedNPCIndex > 0) then CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]]; else CurrOpts = TI_status.options; end - local id = this:GetParent():GetID(); - if(this:GetChecked()) then + local id = self:GetParent():GetID(); + if(self:GetChecked()) then CurrOpts[id].state=true; else CurrOpts[id].state=false; @@ -202,8 +202,8 @@ function TI_StatusIndicatorUpdate() end -function TI_StatusIndicator_CheckFn() - if(this:GetChecked()) then +function TI_StatusIndicator_CheckFn(self) + if(self:GetChecked()) then TI_Switch("on"); else TI_Switch("off"); @@ -211,10 +211,10 @@ function TI_StatusIndicator_CheckFn() end -function TI_TempNPCListTooltipShow() - TI_Tooltip:SetOwner(this, ANCHOR_PRESERVE); +function TI_TempNPCListTooltipShow(self) + TI_Tooltip:SetOwner(self, ANCHOR_PRESERVE); TI_Tooltip:ClearLines(); - local id = this:GetID(); + local id = self:GetID(); TI_Tooltip:AddLine(TI_TempNPCList[id].location); for i,v in ipairs(TI_TempNPCList[id].list) do TI_Tooltip:AddLine("- " .. v.name); @@ -228,8 +228,8 @@ function TI_TooltipHide() TI_Tooltip:Hide(); end -function TI_TooltipMessage(msg) - TI_Tooltip:SetOwner(this, ANCHOR_PRESERVE); +function TI_TooltipMessage(self, msg) + TI_Tooltip:SetOwner(self, ANCHOR_PRESERVE); TI_Tooltip:ClearLines(); TI_Tooltip:SetText(msg); TI_Tooltip:Show(); @@ -238,34 +238,34 @@ end function TI_TempNPCListUpdate() local last = 1; for i,v in ipairs(TI_TempNPCList) do - local tempbuttontext = getglobal("TI_TempNPCListWindow"..i.."_Text"); + local tempbuttontext = _G["TI_TempNPCListWindow"..i.."_Text"]; tempbuttontext:SetText(v.name); tempbuttontext:GetParent():Show(); last = last+1; end for j=last, TI_TempNPCListMaxSize, 1 do - getglobal("TI_TempNPCListWindow" .. j):Hide(); + _G["TI_TempNPCListWindow" .. j]:Hide(); end end -function TI_NPCListCheckboxTooltip() - if(this:GetChecked()) then - TI_TooltipMessage("NPC is using specific settings."); +function TI_NPCListCheckboxTooltip(self) + if(self:GetChecked()) then + TI_TooltipMessage(self, "NPC is using specific settings."); else - TI_TooltipMessage("NPC is using default settings."); + TI_TooltipMessage(self, "NPC is using default settings."); end end -function TI_OptionListCheckboxTooltip() - if(this:GetChecked()) then - TI_TooltipMessage("This option is enabled."); +function TI_OptionListCheckboxTooltip(self) + if(self:GetChecked()) then + TI_TooltipMessage(self, "This option is enabled."); else - TI_TooltipMessage("This option is disabled."); + TI_TooltipMessage(self, "This option is disabled."); end end -function TI_SettingCheckboxFn(var) - if(this:GetChecked()) then +function TI_SettingCheckboxFn(self, var) + if(self:GetChecked()) then TI_status[var] = true; else TI_status[var] = false;