DuelInspect_ShowBuffTooltip(1);
GameTooltip:Hide();
DuelInspect_ShowBuffTooltip(2);
GameTooltip:Hide();
DuelInspect_ShowBuffTooltip(3);
GameTooltip:Hide();
DuelInspect_ShowBuffTooltip(4);
GameTooltip:Hide();
DuelInspect_ShowBuffTooltip(5);
GameTooltip:Hide();
DuelInspect_ShowBuffTooltip(6);
GameTooltip:Hide();
DuelInspect_ShowBuffTooltip(7);
GameTooltip:Hide();
DuelInspect_ShowBuffTooltip(8);
GameTooltip:Hide();
DuelInspect_ShowBuffTooltip(9);
GameTooltip:Hide();
DuelInspect_ShowBuffTooltip(10);
GameTooltip:Hide();
if ( this.tooltip ) then
GameTooltip:SetOwner(this,"ANCHOR_RIGHT");
GameTooltip:SetText(this.tooltip, 1.0,1.0,1.0);
GameTooltip:AddLine(this.tooltipSubtext, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1);
GameTooltip:Show();
end
GameTooltip:Hide();
this.tooltip = DI_RESISTANCES["ARCRES"];
this.tooltip = DI_RESISTANCES["FIRERES"];
this.tooltip = DI_RESISTANCES["NATRES"];
this.tooltip = DI_RESISTANCES["FROSTRES"];
this.tooltip = DI_RESISTANCES["SHADRES"];
DuelInspect_ShowItemTooltip(useItemLink[1]);GameTooltip:Hide();DuelInspect_ShowItemTooltip(useItemLink[2]);GameTooltip:Hide();DuelInspect_ShowItemTooltip(useItemLink[3]);GameTooltip:Hide();DuelInspect_ShowItemTooltip(useItemLink[4]);GameTooltip:Hide();
DuelInspect_OnLoad();
DuelInspect_OnEvent(event);
for index = 1, STATICPOPUP_NUMDIALOGS, 1 do
local frame = getglobal("StaticPopup"..index);
if ( frame:IsVisible() and (frame.which == "DUEL_REQUESTED" or frame.which == "DUEL_CHALLENGE") ) then
DuelInspect_UpdateStaticPopupSize(index);
DuelInspect_PrepareFrames(index,false);
local orig_text = getglobal("StaticPopup"..index.."Text"):GetText();
local textpos = string.find(orig_text, " ");
local name = string.sub(orig_text, 0, ( textpos - 1 ) );
if ( frame.which == "DUEL_CHALLENGE" and UnitName("target") == name ) then
if ( UnitAffectingCombat("target") ) then
getglobal("StaticPopup"..index.."Button1"):Disable();
getglobal("StaticPopup"..index.."Button1"):SetText(SPELL_FAILED_TARGET_AFFECTING_COMBAT);
elseif ( not CheckInteractDistance("target", 3) ) then
getglobal("StaticPopup"..index.."Button1"):Disable();
getglobal("StaticPopup"..index.."Button1"):SetText(strsub(ERR_OUT_OF_RANGE, 0, (strlen(ERR_OUT_OF_RANGE) - 1)));
else
getglobal("StaticPopup"..index.."Button1"):Enable();
getglobal("StaticPopup"..index.."Button1"):SetText(DUEL);
end
elseif ( frame.which == "DUEL_CHALLENGE" and UnitName("target") ~= name ) then
getglobal("StaticPopup"..index.."Button1"):Disable();
getglobal("StaticPopup"..index.."Button1"):SetText(SPELL_FAILED_BAD_TARGETS);
elseif ( frame.which == "DUEL_REQUESTED" ) then
getglobal("StaticPopup"..index.."Button1"):Enable();
getglobal("StaticPopup"..index.."Button1"):SetText(ACCEPT);
end
end
end
if ( this:GetChecked() ) then
PlaySound("igMainMenuOptionCheckBoxOff");
getglobal("DuelInspect_UnitBuffFrame"):Show();
DI_SAVE.ShowBuffs = true;
else
PlaySound("igMainMenuOptionCheckBoxOn");
getglobal("DuelInspect_UnitBuffFrame"):Hide();
DI_SAVE.ShowBuffs = false;
end
this:SetChecked(DI_SAVE.ShowBuffs);
if ( this:GetChecked() ) then
PlaySound("igMainMenuOptionCheckBoxOff");
getglobal("DuelInspect_ResistanceFrame"):Show();
DI_SAVE.ShowResistances = true;
else
PlaySound("igMainMenuOptionCheckBoxOn");
getglobal("DuelInspect_ResistanceFrame"):Hide();
DI_SAVE.ShowResistances = false;
end
this:SetChecked(DI_SAVE.ShowResistances);
if ( this:GetChecked() ) then
PlaySound("igMainMenuOptionCheckBoxOff");
DI_SAVE.ShowItemsQuality = true;
getglobal("DuelInspect_ItemQualityFrame"):Show();
else
PlaySound("igMainMenuOptionCheckBoxOn");
DI_SAVE.ShowItemsQuality = false;
getglobal("DuelInspect_ItemQualityFrame"):Hide();
end
this:SetChecked(DI_SAVE.ShowItemsQuality);
if ( this:GetChecked() ) then
PlaySound("igMainMenuOptionCheckBoxOff");
for cnt = 1, 4 do
getglobal("DuelInspect_UseItem"..cnt.."Frame"):Show();
end
DI_SAVE.ShowUsableItems = true;
else
PlaySound("igMainMenuOptionCheckBoxOn");
for cnt = 1, 4 do
getglobal("DuelInspect_UseItem"..cnt.."Frame"):Hide();
end
DI_SAVE.ShowUsableItems = false;
end
this:SetChecked(DI_SAVE.ShowUsableItems);
if ( this:GetChecked() ) then
PlaySound("igMainMenuOptionCheckBoxOff");
DI_SAVE.OutboundDuels = true;
else
PlaySound("igMainMenuOptionCheckBoxOn");
DI_SAVE.OutboundDuels = false;
end
this:SetChecked(DI_SAVE.OutboundDuels);
for index = 1, STATICPOPUP_NUMDIALOGS, 1 do
local frame = getglobal("StaticPopup"..index);
if ( frame:IsVisible() and (frame.which == "DUEL_REQUESTED" or frame.which == "DUEL_CHALLENGE") ) then
DuelInspect_UpdateOptionsFrame(this,index);
break;
end
end