converted the reset of atlasloot xml to lua removed old atlas intergration code

This commit is contained in:
Anch
2022-08-10 17:36:49 +12:00
parent 0978521b3c
commit 5f91be1485
22 changed files with 747 additions and 5910 deletions
+165 -79
View File
@@ -12,7 +12,6 @@ AtlasLootOptions_ItemSyncTTToggle()
AtlasLootOptions_EquipCompareToggle()
AtlasLootOptions_OpaqueToggle()
AtlasLootOptions_ItemIDToggle()
AtlasLootOptions_ItemSpam()
AtlasLootOptions_MinimapToggle()
AtlasLootOptions_LoDSpam()
AtlasLootOptions_LoDStartup()
@@ -47,9 +46,7 @@ function AtlasLootOptions_Init()
AtlasLootOptionsFrameEquipCompare:SetChecked(AtlasLoot.db.profile.EquipCompare);
AtlasLootOptionsFrameOpaque:SetChecked(AtlasLoot.db.profile.Opaque);
AtlasLootOptionsFrameItemID:SetChecked(AtlasLoot.db.profile.ItemIDs);
AtlasLootOptionsFrameItemSpam:SetChecked(AtlasLoot.db.profile.ItemSpam);
AtlasLootOptionsFrameLoDStartup:SetChecked(AtlasLoot.db.profile.LoadAllLoDStartup);
AtlasLootOptionsFrameHidePanel:SetChecked(AtlasLoot.db.profile.HidePanel);
AtlasLootOptionsFrameLootBrowserScale:SetValue(AtlasLoot.db.profile.LootBrowserScale);
end
@@ -64,7 +61,6 @@ function AtlasLootOptions_OnLoad()
AtlasLootOptionsFrameItemSyncTTText:SetText(AL["|cff9d9d9dItemSync Tooltips|r"]);
end
AtlasLootOptions_Init();
AtlasLootOptions_SubtablePositionToggle()
temp=AtlasLoot.db.profile.SafeLinks;
end
@@ -110,15 +106,6 @@ function AtlasLootOptions_OpaqueToggle()
AtlasLootOptions_Init();
end
function AtlasLootOptions_ItemSpam()
if (AtlasLoot.db.profile.ItemSpam) then
AtlasLoot.db.profile.ItemSpam = false;
else
AtlasLoot.db.profile.ItemSpam = true;
end
AtlasLootOptions_Init();
end
function AtlasLootOptions_LoDStartup()
if (AtlasLoot.db.profile.LoadAllLoDStartup) then
AtlasLoot.db.profile.LoadAllLoDStartup = false;
@@ -133,10 +120,6 @@ function AtlasLootOptions_ItemIDToggle()
AtlasLootOptions_Init();
end
function AtlasLootOptions_SubtablePositionToggle()
AtlasLootOptions_Init();
end
function AtlasLoot_SetupLootBrowserSlider(frame, mymin, mymax, step)
getglobal(frame:GetName().."Text"):SetText(AL["Loot Browser Scale: "].." ("..frame:GetValue()..")");
frame:SetMinMaxValues(mymin, mymax);
@@ -185,8 +168,6 @@ function AtlasLoot_DisplayHelp()
WHITE..AL["If you have AtlasLootFu enabled, click the minimap button, or alternatively a button generated by a mod like Titan or FuBar. Finally, you can type '/al' in the chat window."].."\n\n"..
ORANGE..AL["How to link an item to someone else:"].."\n"..
WHITE..AL["Shift+Left Click the item like you would for any other in-game item"].."\n\n"..
ORANGE..AL["How to view an 'unsafe' item:"].."\n"..
WHITE..AL["Unsafe items have a red border around the icon and are marked because you have not seen the item since the last patch or server restart. Right-click the item, then move your mouse back over the item or click the 'Query Server' button at the bottom of the loot page. This will also load any Bloodforged items."].."\n\n"..
ORANGE..AL["How to view an item in the Dressing Room:"].."\n"..
WHITE..AL["Simply Ctrl+Left Click on the item. Sometimes the dressing room window is hidden behind the Atlas or AtlasLoot windows, so if nothing seems to happen move your Atlas or AtlasLoot windows and see if anything is hidden."].."\n\n"..
ORANGE..AL["How to add an item to the wishlist:"].."\n"..
@@ -197,8 +178,6 @@ function AtlasLoot_DisplayHelp()
WHITE..AL["If you Left Click any item on the wishlist, you can jump to the loot page the item comes from. Also, on a loot page any item already in your wishlist is marked with a yellow star."].."\n\n"..
ORANGE..AL["HELP!! I have broken the mod somehow!"].."\n"..
WHITE..AL["Use the reset buttons available in the options menu, or type '/al reset' in your chat window."].."\n\n"..
ORANGE..AL["How do I view Bloodforged items?"].."\n"..
WHITE..AL["You must have 'Safe Chat Links' enabled in your options, and the Bloodforged item in your item cache. When viewing a page, click the 'Query Server' button to load the items and Bloodforged equivalents, then right click on an item to display item links for the original and Bloodforged versions in your chat."].."\n\n"..
GREY..AL["For further help, see our website and forums: "]..GREEN.."https://discord.gg/uYCE2X2FgA"
);
Text:SetWidth(framewidht-80)
@@ -212,38 +191,25 @@ AtlasLoot_CreateOptionsInfoTooltips()
Adds explanatory tooltips to Atlasloot options
]]
function AtlasLoot_CreateOptionsInfoTooltips()
local AL = LibStub("AceLocale-3.0"):GetLocale("AtlasLoot");
AtlasLoot_AddTooltip("AtlasLootOptionsFrameDefaultTT", nil) -- AL["Default Tooltips"]
AtlasLoot_AddTooltip("AtlasLootOptionsFrameLootlinkTT", nil) -- AL["Lootlink Tooltips"]
AtlasLoot_AddTooltip("AtlasLootOptionsFrameItemSyncTT", nil) -- AL["ItemSync Tooltips"]
AtlasLoot_AddTooltip("AtlasLootOptionsFrameOpaque", nil) -- AL["Make Loot Table Opaque"]
AtlasLoot_AddTooltip("AtlasLootOptionsFrameItemID", nil) -- AL["Show itemIDs at all times"]
AtlasLoot_AddTooltip("AtlasLootOptionsFrameSafeLinks", nil) -- AL["Safe Chat Links |cff1eff00(recommended)|r"]
AtlasLoot_AddTooltip("AtlasLootOptionsFrameEquipCompare", nil) -- AL["Show Comparison Tooltips"]
AtlasLoot_AddTooltip("AtlasLootOptionsFrameHidePanel", nil) -- AL["Hide AtlasLoot Panel"]
AtlasLoot_AddTooltip("AtlasLootOptionsFrameItemSpam", nil) -- AL["Suppress Item Query Text"]
AtlasLoot_AddTooltip("AtlasLootOptionsFrameLoDSpam", nil) -- AL["Notify on LoD Module Load"]
AtlasLoot_AddTooltip("AtlasLootOptionsFrameLootBrowserScale", nil) -- Scale SLIDER
AtlasLoot_AddTooltip("AtlasLootOptionsFrame_ResetAtlasLoot", nil) -- AL["Reset Frames"]
AtlasLoot_AddTooltip("AtlasLootOptionsFrame_ResetWishlist", nil) -- AL["Reset Wishlist"]
AtlasLoot_AddTooltip("AtlasLootOptionsFrame_ResetQuicklooks", nil) -- AL["Reset Quicklooks"]
AtlasLoot_AddTooltip("AtlasLootOptionsFrame_FuBarShow", nil) -- AL["Show FuBar Plugin"]
AtlasLoot_AddTooltip("AtlasLootOptionsFrame_FuBarHide", nil) -- AL["Hide FuBar Plugin"]
AtlasLoot_AddTooltip("AtlasLoot_SelectLootBrowserStyle", nil)
AtlasLoot:AddTooltip("AtlasLootOptionsFrameDefaultTT", nil) -- AL["Default Tooltips"]
AtlasLoot:AddTooltip("AtlasLootOptionsFrameLootlinkTT", nil) -- AL["Lootlink Tooltips"]
AtlasLoot:AddTooltip("AtlasLootOptionsFrameItemSyncTT", nil) -- AL["ItemSync Tooltips"]
AtlasLoot:AddTooltip("AtlasLootOptionsFrameOpaque", nil) -- AL["Make Loot Table Opaque"]
AtlasLoot:AddTooltip("AtlasLootOptionsFrameItemID", nil) -- AL["Show itemIDs at all times"]
AtlasLoot:AddTooltip("AtlasLootOptionsFrameSafeLinks", nil) -- AL["Safe Chat Links |cff1eff00(recommended)|r"]
AtlasLoot:AddTooltip("AtlasLootOptionsFrameEquipCompare", nil) -- AL["Show Comparison Tooltips"]
AtlasLoot:AddTooltip("AtlasLootOptionsFrameLoDSpam", nil) -- AL["Notify on LoD Module Load"]
AtlasLoot:AddTooltip("AtlasLootOptionsFrameLootBrowserScale", nil) -- Scale SLIDER
AtlasLoot:AddTooltip("AtlasLootOptionsFrame_ResetAtlasLoot", nil) -- AL["Reset Frames"]
AtlasLoot:AddTooltip("AtlasLootOptionsFrame_ResetWishlist", nil) -- AL["Reset Wishlist"]
AtlasLoot:AddTooltip("AtlasLootOptionsFrame_ResetQuicklooks", nil) -- AL["Reset Quicklooks"]
AtlasLoot:AddTooltip("AtlasLootOptionsFrame_FuBarShow", nil) -- AL["Show FuBar Plugin"]
AtlasLoot:AddTooltip("AtlasLootOptionsFrame_FuBarHide", nil) -- AL["Hide FuBar Plugin"]
AtlasLoot:AddTooltip("AtlasLoot_SelectLootBrowserStyle", nil)
end
function AtlasLoot_OptionsOnShow()
AtlasLoot_SelectLootBrowserStyle_Label:SetText(AL["Loot Browser Style:"]);
UIDropDownMenu_Initialize(AtlasLoot_SelectLootBrowserStyle, AtlasLoot_SelectLootBrowserStyle_Initialize);
UIDropDownMenu_SetSelectedID(AtlasLoot_SelectLootBrowserStyle, AtlasLoot.db.profile.LootBrowserStyle);
UIDropDownMenu_SetWidth(AtlasLoot_SelectLootBrowserStyle, 150);
AtlasLoot_CraftingLink_Label:SetText(AL["Treat Crafted Items:"]);
UIDropDownMenu_Initialize(AtlasLoot_CraftingLink, AtlasLoot_CraftingLink_Initialize);
UIDropDownMenu_SetSelectedID(AtlasLoot_CraftingLink, AtlasLoot.db.profile.CraftingLink);
UIDropDownMenu_SetWidth(AtlasLoot_CraftingLink, 150);
end
function AtlasLoot_SelectLootBrowserStyle_Initialize()
local function AtlasLoot_SelectLootBrowserStyle_Initialize()
local info;
info = {
text = AL["New Style"];
@@ -257,38 +223,23 @@ function AtlasLoot_SelectLootBrowserStyle_Initialize()
UIDropDownMenu_AddButton(info);
end
function AtlasLoot_OptionsOnShow()
AtlasLoot_SelectLootBrowserStyle_Label:SetText(AL["Loot Browser Style:"]);
UIDropDownMenu_Initialize(AtlasLoot_SelectLootBrowserStyle, AtlasLoot_SelectLootBrowserStyle_Initialize);
UIDropDownMenu_SetSelectedID(AtlasLoot_SelectLootBrowserStyle, AtlasLoot.db.profile.LootBrowserStyle);
UIDropDownMenu_SetWidth(AtlasLoot_SelectLootBrowserStyle, 150);
end
function AtlasLoot_SelectLootBrowserStyle_OnClick()
local thisID = this:GetID();
UIDropDownMenu_SetSelectedID(AtlasLoot_SelectLootBrowserStyle, thisID);
AtlasLoot.db.profile.LootBrowserStyle = thisID;
if( AtlasLoot.db.profile.LootBrowserStyle == 1 ) then
AtlasLoot_SetNewStyle("new");
AtlasLoot:SetNewStyle("new");
else
AtlasLoot_SetNewStyle("old");
end
AtlasLoot_OptionsOnShow();
end
function AtlasLoot_CraftingLink_Initialize()
local info;
info = {
text = AL["As Crafting Spells"];
func = AtlasLoot_CraftingLink_OnClick;
};
UIDropDownMenu_AddButton(info);
info = {
text = AL["As Items"];
func = AtlasLoot_CraftingLink_OnClick;
};
UIDropDownMenu_AddButton(info);
end
function AtlasLoot_CraftingLink_OnClick()
local thisID = this:GetID();
UIDropDownMenu_SetSelectedID(AtlasLoot_CraftingLink, thisID);
AtlasLoot.db.profile.CraftingLink = thisID;
if AtlasLootItemsFrame:IsVisible() and AtlasLootItemsFrame.refresh then
AtlasLoot_ShowItemsFrame(AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3], AtlasLootItemsFrame.refresh[4]);
AtlasLoot:SetNewStyle("old");
end
AtlasLoot_OptionsOnShow();
end
@@ -303,7 +254,7 @@ local Authors = {
function AtlasLoot_UnitTarget()
local name = GameTooltip:GetUnit()
if UnitName("mouseover") == name then
if UnitName("mouseover") == name then
local _, realm = UnitName("mouseover")
if not realm then
realm = GetRealmName()
@@ -315,4 +266,139 @@ function AtlasLoot_UnitTarget()
end
end
end
GameTooltip:HookScript("OnTooltipSetUnit", AtlasLoot_UnitTarget)
GameTooltip:HookScript("OnTooltipSetUnit", AtlasLoot_UnitTarget)
local helpframe = CreateFrame("Frame", "AtlasLootHelpFrame")
helpframe:SetSize(425,450);
helpframe:Hide();
helpframe:SetPoint("CENTER");
helpframe.title = helpframe:CreateFontString("AtlasLootHelpFrame_Title", "OVERLAY", "GameFontHighlightLarge");
helpframe.title:SetJustifyH("CENTER");
helpframe.title:SetSize(400,30);
helpframe.title:SetPoint("TOP", "AtlasLootHelpFrame","TOP");
helpframe.title:SetText(AL["AtlasLoot Help"]);
helpframe:SetScript("OnShow", function() AtlasLoot_DisplayHelp() end);
local optframe = CreateFrame("Frame", "AtlasLootOptionsFrame");
optframe:Hide();
optframe:SetSize(425,405);
optframe:SetPoint("CENTER");
optframe.title = optframe:CreateFontString("AtlasLoot_OptionsTitle", "OVERLAY", "GameFontHighlightLarge");
optframe.title:SetJustifyH("CENTER");
optframe.title:SetSize(400,30);
optframe.title:SetPoint("TOP", "AtlasLootOptionsFrame","TOP");
optframe.title:SetText(ATLASLOOT_VERSION);
optframe.foobar = optframe:CreateFontString("AtlasLootOptionsFrame_FuBarNotice", "OVERLAY", "GameFontNormal");
optframe.foobar:SetPoint("BOTTOM",0,45);
optframe.foobar:SetText(AL["The Minimap Button is generated by the FuBar Plugin."].."\n"..AL["This is automatic, you do not need FuBar installed."]);
optframe:SetScript("OnShow", function() AtlasLoot_OptionsOnShow() end);
local deftt = CreateFrame("CheckButton", "AtlasLootOptionsFrameDefaultTT", AtlasLootOptionsFrame, "OptionsCheckButtonTemplate");
deftt:SetPoint("TOPLEFT",5,-40);
AtlasLootOptionsFrameDefaultTTText:SetText(AL["Default Tooltips"]);
deftt:SetScript("OnClick", function() AtlasLootOptions_DefaultTTToggle() end);
local lootlnk = CreateFrame("CheckButton", "AtlasLootOptionsFrameLootlinkTT", AtlasLootOptionsFrame, "OptionsCheckButtonTemplate");
lootlnk:SetPoint("TOPLEFT",5,-70);
AtlasLootOptionsFrameLootlinkTTText:SetText(AL["Lootlink Tooltips"]);
lootlnk:SetScript("OnClick", function() AtlasLootOptions_LootlinkTTToggle() end);
local itemsync = CreateFrame("CheckButton", "AtlasLootOptionsFrameItemSyncTT", AtlasLootOptionsFrame, "OptionsCheckButtonTemplate");
itemsync:SetPoint("TOPLEFT",5,-100);
AtlasLootOptionsFrameItemSyncTTText:SetText(AL["ItemSync Tooltips"]);
itemsync:SetScript("OnClick", function() AtlasLootOptions_ItemSyncTTToggle() end);
local opaque = CreateFrame("CheckButton", "AtlasLootOptionsFrameOpaque", AtlasLootOptionsFrame, "OptionsCheckButtonTemplate");
opaque:SetPoint("TOPLEFT",5,-130);
AtlasLootOptionsFrameOpaqueText:SetText(AL["Make Loot Table Opaque"]);
opaque:SetScript("OnClick", function() AtlasLootOptions_OpaqueToggle() end);
local itemid = CreateFrame("CheckButton", "AtlasLootOptionsFrameItemID", AtlasLootOptionsFrame, "OptionsCheckButtonTemplate");
itemid:SetPoint("TOP",5,-130);
AtlasLootOptionsFrameItemIDText:SetText(AL["Show itemIDs at all times"]);
itemid:SetScript("OnClick", function() AtlasLootOptions_ItemIDToggle() end);
local lod = CreateFrame("CheckButton", "AtlasLootOptionsFrameLoDStartup", AtlasLootOptionsFrame, "OptionsCheckButtonTemplate");
lod:SetPoint("TOP",5,-40);
AtlasLootOptionsFrameLoDStartupText:SetText(AL["Load Loot Modules at Startup"]);
lod:SetScript("OnClick", function() AtlasLootOptions_LoDStartup() end);
local safe = CreateFrame("CheckButton", "AtlasLootOptionsFrameSafeLinks", AtlasLootOptionsFrame, "OptionsCheckButtonTemplate");
safe:SetPoint("TOP",5,-70);
AtlasLootOptionsFrameSafeLinksText:SetText(AL["Safe Chat Links"]);
safe:SetScript("OnClick", function() AtlasLootOptions_SafeLinksToggle() end);
local equip = CreateFrame("CheckButton", "AtlasLootOptionsFrameEquipCompare", AtlasLootOptionsFrame, "OptionsCheckButtonTemplate");
equip:SetPoint("TOP",5,-100);
AtlasLootOptionsFrameEquipCompareText:SetText(AL["Show Comparison Tooltips"]);
equip:SetScript("OnClick", function()
if(AtlasLoot.db.profile.EquipCompare) then
AtlasLoot.db.profile.EquipCompare = false;
if (EquipCompare_UnregisterTooltip) then
EquipCompare_UnregisterTooltip(AtlasLootTooltip);
end
else
AtlasLoot.db.profile.EquipCompare = true;
if (EquipCompare_RegisterTooltip) then
EquipCompare_RegisterTooltip(AtlasLootTooltip);
end
end
end);
local sStyle = CreateFrame("Button", "AtlasLoot_SelectLootBrowserStyle", AtlasLootOptionsFrame, "UIDropDownMenuTemplate");
sStyle.lable = sStyle:CreateFontString("AtlasLoot_SelectLootBrowserStyle_Label", "BACKGROUND", "GameFontNormalSmall");
sStyle.lable:SetPoint("RIGHT", "AtlasLoot_SelectLootBrowserStyle", "LEFT",15,2);
sStyle:SetPoint("TOP",30,-220);
local bscale = CreateFrame("Slider", "AtlasLootOptionsFrameLootBrowserScale", AtlasLootOptionsFrame,"OptionsSliderTemplate");
bscale:SetSize(240,16);
bscale:SetPoint("TOP", 0,-300);
bscale:SetScript("OnLoad", function(self) AtlasLoot_SetupLootBrowserSlider(self, 0.25, 1.5, 0.01) end);
bscale:SetScript("OnValueChanged", function(self)
AtlasLoot_UpdateLootBrowserSlider(self);
AtlasLoot.db.profile.LootBrowserScale = self:GetValue();
AtlasLoot_UpdateLootBrowserScale();
end);
local resetwish = CreateFrame("Button", "AtlasLootOptionsFrame_ResetWishlist", AtlasLootOptionsFrame, "OptionsButtonTemplate");
resetwish:SetSize(130,25);
resetwish:SetPoint("TOP", 0, -325);
resetwish:SetText(AL["Reset Wishlist"]);
resetwish:SetScript("OnClick", function() AtlasLoot_Reset("wishlist") end);
resetwish:SetScript("OnShow", function() resetwish:SetWidth(AtlasLootOptionsFrame_ResetWishlist:GetTextWidth()+20) end);
local resetAtlas = CreateFrame("Button", "AtlasLootOptionsFrame_ResetAtlasLoot", AtlasLootOptionsFrame, "OptionsButtonTemplate");
resetAtlas:SetSize(130,25);
resetAtlas:SetText(AL["Reset Frames"]);
resetAtlas:SetPoint("RIGHT", "AtlasLootOptionsFrame_ResetWishlist", "LEFT", -10, 0);
resetAtlas:SetScript("OnClick", function() AtlasLoot_Reset("frames") end);
resetAtlas:SetScript("OnShow", function() resetAtlas:SetWidth(AtlasLootOptionsFrame_ResetAtlasLoot:GetTextWidth()+20) end)
local resetquick = CreateFrame("Button", "AtlasLootOptionsFrame_ResetQuicklooks", AtlasLootOptionsFrame, "OptionsButtonTemplate");
resetquick:SetSize(130,25);
resetquick:SetText(AL["Reset Quicklooks"]);
resetquick:SetPoint("LEFT", "AtlasLootOptionsFrame_ResetWishlist", "RIGHT", 10, 0);
resetquick:SetScript("OnClick", function() AtlasLoot_Reset("quicklooks") end);
resetquick:SetScript("OnShow", function() resetquick:SetWidth(AtlasLootOptionsFrame_ResetQuicklooks:GetTextWidth()+20) end)
local fooshow = CreateFrame("Button", "AtlasLootOptionsFrame_FuBarShow", AtlasLootOptionsFrame, "OptionsButtonTemplate");
fooshow:SetSize(150,25);
fooshow:SetText(AL["Show FuBar Plugin"]);
fooshow:SetPoint("TOP", "AtlasLootOptionsFrame", "TOP", -85, -390);
fooshow:SetScript("OnClick", function()
if AtlasLootFu then
AtlasLootFu:Show();
end
end);
local foohide = CreateFrame("Button", "AtlasLootOptionsFrame_FuBarShow", AtlasLootOptionsFrame, "OptionsButtonTemplate");
foohide:SetSize(150,25);
foohide:SetText(AL["Hide FuBar Plugin"]);
foohide:SetPoint("TOP", "AtlasLootOptionsFrame", "TOP", 85, -390);
foohide:SetScript("OnClick", function()
if AtlasLootFu then
AtlasLootFu:Hide();
end
end);