Browse Source

tagging as 2.1 for reals

tags/2.1
SabinDeus 15 years ago
parent
commit
773639597c
5 changed files with 55 additions and 58 deletions
  1. 1
    1
      README.txt
  2. 1
    1
      TurnIn.lua
  3. 1
    0
      TurnIn.toc
  4. 21
    25
      TurnIn.xml
  5. 31
    31
      TurnInUI.lua

+ 1
- 1
README.txt View File

Turn In Turn In
v2.1
v2.1
by Sabindeus of Smolderthorn/Andre of Argent Dawn (Alliance) by Sabindeus of Smolderthorn/Andre of Argent Dawn (Alliance)


DESCRIPTION DESCRIPTION

+ 1
- 1
TurnIn.lua View File

end end




function TI_OnEvent(event)
function TI_OnEvent(self, event, ...)
if(event == "VARIABLES_LOADED") then if(event == "VARIABLES_LOADED") then
TI_VarInit(); TI_VarInit();
if(TI_status.state) then if(TI_status.state) then

+ 1
- 0
TurnIn.toc View File

## Interface: 30300 ## Interface: 30300
## X-Compatible-With: 40000
## Title: Turn In ## Title: Turn In
## Notes: Automates the selection of quest and gossip options. ## Notes: Automates the selection of quest and gossip options.
## SavedVariables: TI_status, TI_NPCDB, TI_NPCIndex ## SavedVariables: TI_status, TI_NPCDB, TI_NPCIndex

+ 21
- 25
TurnIn.xml View File

</Size> </Size>
<Scripts> <Scripts>
<OnEnter> <OnEnter>
TI_OptionListCheckboxTooltip();
TI_OptionListCheckboxTooltip(self);
</OnEnter> </OnEnter>
<OnLeave> <OnLeave>
TI_TooltipHide(); TI_TooltipHide();
</OnLeave> </OnLeave>
<OnClick> <OnClick>
TI_OptionToggle();
TI_OptionToggle(self);
</OnClick> </OnClick>
</Scripts> </Scripts>
</CheckButton> </CheckButton>
</Anchors> </Anchors>
<Scripts> <Scripts>
<OnEnter> <OnEnter>
TI_TooltipMessage("Decrease this option's priority.");
TI_TooltipMessage(self, "Decrease this option's priority.");
</OnEnter> </OnEnter>
<OnLeave> <OnLeave>
TI_TooltipHide(); TI_TooltipHide();
</OnLeave> </OnLeave>
<OnClick> <OnClick>
TI_OptionMove(1);
TI_OptionMove(self, 1);
</OnClick> </OnClick>
</Scripts> </Scripts>
<NormalTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up"/> <NormalTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up"/>
</Anchors> </Anchors>
<Scripts> <Scripts>
<OnClick> <OnClick>
TI_OptionMove(-1);
TI_OptionMove(self, -1);
</OnClick> </OnClick>
<OnEnter> <OnEnter>
TI_TooltipMessage("Increase this option's priority.");
TI_TooltipMessage(self, "Increase this option's priority.");
</OnEnter> </OnEnter>
<OnLeave> <OnLeave>
TI_TooltipHide(); TI_TooltipHide();
</Size> </Size>
<Scripts> <Scripts>
<OnClick> <OnClick>
TI_NPCToggle();
TI_NPCListCheckboxTooltip();
TI_NPCToggle(self);
TI_NPCListCheckboxTooltip(self);
</OnClick> </OnClick>
<OnEnter> <OnEnter>
TI_NPCListCheckboxTooltip();
TI_NPCListCheckboxTooltip(self);
</OnEnter> </OnEnter>
<OnLeave> <OnLeave>
TI_TooltipHide(); TI_TooltipHide();
</Size> </Size>
<Scripts> <Scripts>
<OnEnter> <OnEnter>
TI_TooltipMessage("Delete this NPC.");
TI_TooltipMessage(self, "Delete this NPC.");
</OnEnter> </OnEnter>
<OnLeave> <OnLeave>
TI_TooltipHide(); TI_TooltipHide();
</OnLeave> </OnLeave>
<OnClick> <OnClick>
TI_DeleteNPCIndex();
TI_DeleteNPCIndex(self);
</OnClick> </OnClick>
</Scripts> </Scripts>
</Button> </Button>
</Layers> </Layers>
<Scripts> <Scripts>
<OnClick> <OnClick>
TI_SelectNPCIndex();
TI_SelectNPCIndex(self);
</OnClick> </OnClick>
</Scripts> </Scripts>
<HighlightTexture file="Interface\QuestFrame\UI-QuestTitleHighlight" alphaMode="ADD"/> <HighlightTexture file="Interface\QuestFrame\UI-QuestTitleHighlight" alphaMode="ADD"/>
<Frame Name="TI_TempNPCListEntry" virtual="true" hidden="true"> <Frame Name="TI_TempNPCListEntry" virtual="true" hidden="true">
<Scripts> <Scripts>
<OnEnter> <OnEnter>
TI_TempNPCListTooltipShow();
TI_TempNPCListTooltipShow(self);
</OnEnter> </OnEnter>
<OnLeave> <OnLeave>
TI_TooltipHide(); TI_TooltipHide();
TI_DeleteTempNPCIndex(self:GetParent():GetID()); TI_DeleteTempNPCIndex(self:GetParent():GetID());
</OnClick> </OnClick>
<OnEnter> <OnEnter>
TI_TooltipMessage("Delete");
TI_TooltipMessage(self, "Delete");
</OnEnter> </OnEnter>
<OnLeave> <OnLeave>
TI_TooltipHide(); TI_TooltipHide();
TI_AddTempNPCIndex(self:GetParent():GetID()); TI_AddTempNPCIndex(self:GetParent():GetID());
</OnClick> </OnClick>
<OnEnter> <OnEnter>
TI_TooltipMessage("Add this NPC to the database");
TI_TooltipMessage(self, "Add this NPC to the database");
</OnEnter> </OnEnter>
<OnLeave> <OnLeave>
TI_TooltipHide(); TI_TooltipHide();
end end
</OnMouseUp> </OnMouseUp>
<OnMouseDown> <OnMouseDown>
if ( arg1 == "LeftButton" ) then
if ( button == "LeftButton" ) then
self:StartMoving(); self:StartMoving();
self.isMoving = true; self.isMoving = true;
end end
</Size> </Size>
<Scripts> <Scripts>
<OnClick> <OnClick>
TI_StatusIndicator_CheckFn();
TI_StatusIndicator_CheckFn(self);
</OnClick> </OnClick>
</Scripts> </Scripts>
</CheckButton> </CheckButton>
</Size> </Size>
<Scripts> <Scripts>
<OnClick> <OnClick>
TI_SettingCheckboxFn("usedefault");
TI_SettingCheckboxFn(self, "usedefault");
</OnClick> </OnClick>
</Scripts> </Scripts>
</CheckButton> </CheckButton>
</Size> </Size>
<Scripts> <Scripts>
<OnClick> <OnClick>
TI_SettingCheckboxFn("autoadd");
TI_SettingCheckboxFn(self, "autoadd");
</OnClick> </OnClick>
</Scripts> </Scripts>
</CheckButton> </CheckButton>
<Frame name="TurnIn" hidden="true" frameStrata="LOW" enableMouse="false"> <Frame name="TurnIn" hidden="true" frameStrata="LOW" enableMouse="false">
<Scripts> <Scripts>
<OnLoad>
TI_OnLoad();
</OnLoad>
<OnEvent>
TI_OnEvent(event);
</OnEvent>
<OnLoad function="TI_OnLoad"/>
<OnEvent function="TI_OnEvent"/>
</Scripts> </Scripts>
</Frame> </Frame>
</Ui> </Ui>

+ 31
- 31
TurnInUI.lua View File

end end
end end


function TI_SelectNPCIndex()
local index = this:GetID();
function TI_SelectNPCIndex(self)
local index = self:GetID();
if(TI_LoadedNPCIndex == index) then if(TI_LoadedNPCIndex == index) then
TI_LoadedNPCIndex = 0; TI_LoadedNPCIndex = 0;
else else
TI_PopulateOptions("select npc"); TI_PopulateOptions("select npc");
end end


function TI_DeleteNPCIndex()
local index = this:GetParent():GetID();
function TI_DeleteNPCIndex(self)
local index = self:GetParent():GetID();
TI_DeleteNPC(index); TI_DeleteNPC(index);
if(TI_LoadedNPCIndex == index) then if(TI_LoadedNPCIndex == index) then
TI_LoadedNPCIndex = 0; TI_LoadedNPCIndex = 0;
TI_PopulateOptions("npclist update"); TI_PopulateOptions("npclist update");
end 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 if(TI_NPCDB[TI_NPCIndex[index]].state) then
TI_LoadedNPCIndex = index; TI_LoadedNPCIndex = index;
TI_PopulateOptions("select npc"); TI_PopulateOptions("select npc");
end end


function TI_OptionMove(offset)
function TI_OptionMove(self, offset)
local CurrOpts; local CurrOpts;
if(TI_LoadedNPCIndex > 0) then if(TI_LoadedNPCIndex > 0) then
CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]]; CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]];
else else
CurrOpts = TI_status.options; CurrOpts = TI_status.options;
end end
local id = this:GetParent():GetID();
local id = self:GetParent():GetID();
local newid = id + offset; local newid = id + offset;
if(newid < 1 or newid > table.getn(CurrOpts)) then if(newid < 1 or newid > table.getn(CurrOpts)) then
TI_PopulateOptions("move"); TI_PopulateOptions("move");
end end


function TI_OptionToggle()
function TI_OptionToggle(self)
local CurrOpts; local CurrOpts;
if(TI_LoadedNPCIndex > 0) then if(TI_LoadedNPCIndex > 0) then
CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]]; CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]];
else else
CurrOpts = TI_status.options; CurrOpts = TI_status.options;
end end
local id = this:GetParent():GetID();
if(this:GetChecked()) then
local id = self:GetParent():GetID();
if(self:GetChecked()) then
CurrOpts[id].state=true; CurrOpts[id].state=true;
else else
CurrOpts[id].state=false; CurrOpts[id].state=false;
end end




function TI_StatusIndicator_CheckFn()
if(this:GetChecked()) then
function TI_StatusIndicator_CheckFn(self)
if(self:GetChecked()) then
TI_Switch("on"); TI_Switch("on");
else else
TI_Switch("off"); TI_Switch("off");
end end




function TI_TempNPCListTooltipShow()
TI_Tooltip:SetOwner(this, ANCHOR_PRESERVE);
function TI_TempNPCListTooltipShow(self)
TI_Tooltip:SetOwner(self, ANCHOR_PRESERVE);
TI_Tooltip:ClearLines(); TI_Tooltip:ClearLines();
local id = this:GetID();
local id = self:GetID();
TI_Tooltip:AddLine(TI_TempNPCList[id].location); TI_Tooltip:AddLine(TI_TempNPCList[id].location);
for i,v in ipairs(TI_TempNPCList[id].list) do for i,v in ipairs(TI_TempNPCList[id].list) do
TI_Tooltip:AddLine("- " .. v.name); TI_Tooltip:AddLine("- " .. v.name);
TI_Tooltip:Hide(); TI_Tooltip:Hide();
end 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:ClearLines();
TI_Tooltip:SetText(msg); TI_Tooltip:SetText(msg);
TI_Tooltip:Show(); TI_Tooltip:Show();
function TI_TempNPCListUpdate() function TI_TempNPCListUpdate()
local last = 1; local last = 1;
for i,v in ipairs(TI_TempNPCList) do 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:SetText(v.name);
tempbuttontext:GetParent():Show(); tempbuttontext:GetParent():Show();
last = last+1; last = last+1;
end end
for j=last, TI_TempNPCListMaxSize, 1 do for j=last, TI_TempNPCListMaxSize, 1 do
getglobal("TI_TempNPCListWindow" .. j):Hide();
_G["TI_TempNPCListWindow" .. j]:Hide();
end end
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 else
TI_TooltipMessage("NPC is using default settings.");
TI_TooltipMessage(self, "NPC is using default settings.");
end end
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 else
TI_TooltipMessage("This option is disabled.");
TI_TooltipMessage(self, "This option is disabled.");
end end
end end


function TI_SettingCheckboxFn(var)
if(this:GetChecked()) then
function TI_SettingCheckboxFn(self, var)
if(self:GetChecked()) then
TI_status[var] = true; TI_status[var] = true;
else else
TI_status[var] = false; TI_status[var] = false;

Loading…
Cancel
Save