From f71d9be51d65d208500d64eddbc3e30733531b10 Mon Sep 17 00:00:00 2001 From: merstrax Date: Fri, 12 Aug 2022 10:12:12 -0400 Subject: [PATCH] Added an animation when search is being populated --- AtlasLoot/AtlasLoot.toc | 6 +- AtlasLoot/Core/Search.lua | 12 + .../AtlasLootAdvancedSearchCreate.lua | 58 ++++- AtlasLoot/DefaultFrame/Frames.xml | 6 + AtlasLoot/Documentation/Release_Notes.txt | 112 +++++++++ AtlasLoot/Images/streambackground.blp | Bin 0 -> 6660 bytes AtlasLoot/Images/streamcircle.blp | Bin 0 -> 6660 bytes AtlasLoot/Images/streamframe.blp | Bin 0 -> 6660 bytes AtlasLoot/Images/streamspark.blp | Bin 0 -> 6660 bytes AtlasLoot/changelog.txt | 213 ++++++++---------- 10 files changed, 283 insertions(+), 124 deletions(-) create mode 100644 AtlasLoot/DefaultFrame/Frames.xml create mode 100644 AtlasLoot/Images/streambackground.blp create mode 100644 AtlasLoot/Images/streamcircle.blp create mode 100644 AtlasLoot/Images/streamframe.blp create mode 100644 AtlasLoot/Images/streamspark.blp diff --git a/AtlasLoot/AtlasLoot.toc b/AtlasLoot/AtlasLoot.toc index 32df086..b2f8a8c 100644 --- a/AtlasLoot/AtlasLoot.toc +++ b/AtlasLoot/AtlasLoot.toc @@ -28,18 +28,14 @@ ## SavedVariablesPerCharacter: AtlasLootCharDB, AtlasLootFilterDB ## OptionalDeps: LootLink, ItemSync, DewdropLib, FuBarPlugin-3.0, FuBar, Ace3, LibBabble-Boss-3.0, LibBabble-Faction-3.0, LibBabble-Inventory-3.0, LibBabble-Zone-3.0 - embeds.xml - Locales\Locales.xml Add_Ons\Addons.xml Core\AtlasLoot.xml Menus\Menus.xml -DefaultFrame\AtlaslootDefaultFrameCreate.lua -DefaultFrame\AtlaslootDefaultFrame.lua -DefaultFrame\AtlaslootAdvancedSearchCreate.lua +DefaultFrame\Frames.xml modules.xml diff --git a/AtlasLoot/Core/Search.lua b/AtlasLoot/Core/Search.lua index 46bde2a..f9ab73f 100644 --- a/AtlasLoot/Core/Search.lua +++ b/AtlasLoot/Core/Search.lua @@ -625,6 +625,11 @@ end local function DoSearch(searchText) AtlasLootCharDB["SearchResult"] = {Name = "Search Result" , Type = "Search", Back = true}; AtlasLootCharDB.LastSearchedText = searchText; + AtlasLoot_SearchProgress:Show(); + AtlasLoot_SearchProgress.Loop:Play(); + local items_total = 0; + local items_checked = 0; + local items_queried = false; local count = 0; local tablenum = 1; @@ -676,8 +681,14 @@ local function DoSearch(searchText) elseif ItemMatchesAllTerms(searchTerms, itemDetails) then AddItemToSearchResult(itemId, itemType, atlasName, dataID, itemIdBackup, AtlasLoot_Difficulty:getMaxDifficulty(data.Type), dataPage); end + items_checked = items_checked + 1; + if(items_checked >= items_total and items_queried) then + AtlasLoot_SearchProgress.Loop:Stop(); + AtlasLoot_SearchProgress:Hide() + end end end) + items_total = items_total + 1; elseif not equipableFilterOn and itemId and itemId ~= "" and string.sub(itemId, 1, 1) == "s" then local spellName = GetSpellName(itemId, atlasName) if nameMatches(spellName, searchText) then @@ -689,6 +700,7 @@ local function DoSearch(searchText) end end end + items_queried = true; end function AtlasLoot:ShowSearchResult() diff --git a/AtlasLoot/DefaultFrame/AtlasLootAdvancedSearchCreate.lua b/AtlasLoot/DefaultFrame/AtlasLootAdvancedSearchCreate.lua index 75ad523..e05e17a 100644 --- a/AtlasLoot/DefaultFrame/AtlasLootAdvancedSearchCreate.lua +++ b/AtlasLoot/DefaultFrame/AtlasLootAdvancedSearchCreate.lua @@ -221,4 +221,60 @@ clearbtn:SetScript("OnClick", function() AtlasLootDefaultFrame_AdvancedSearchPanel_SearchBox:ClearFocus(); end); -AtlasLoot_AdvancedSearchSetup() \ No newline at end of file +AtlasLoot_AdvancedSearchSetup() + +function StreamingIcon_UpdateIcon(status, tooltip) + if(status > 0) then + AtlasLoot_SearchProgressSpinner:SetVertexColor(0,1,0); + AtlasLoot_SearchProgressFrameBackground:SetVertexColor(0,1,0); + AtlasLoot_SearchProgress.tooltip = tooltip; + AtlasLoot_SearchProgress.Loop:Play(); + AtlasLoot_SearchProgress:Show(); + else + AtlasLoot_SearchProgress.Loop:Stop(); + AtlasLoot_SearchProgress:Hide(); + end +end + +local streamIcon = CreateFrame("Frame", "AtlasLoot_SearchProgress", AtlasLootDefaultFrame_LootBackground); +streamIcon:SetPoint("TOPRIGHT", AtlasLootDefaultFrame_LootBackground, "TOPRIGHT"); +streamIcon:SetSize(48, 48); +streamIcon.tooltip = "Searching..."; + +streamIcon.icon = streamIcon:CreateTexture("$parentSpinner", "BACKGROUND"); +streamIcon.icon:SetTexture("Interface\\Addons\\AtlasLoot\\Images\\streamcircle"); +streamIcon.icon:SetVertexColor(0,1,0); +streamIcon.icon:SetAllPoints(); +streamIcon.spark = streamIcon:CreateTexture("OVERLAY"); +streamIcon.spark:SetTexture("Interface\\Addons\\AtlasLoot\\Images\\streamspark"); +streamIcon.spark:SetAllPoints(); + +streamIcon.frame = CreateFrame("Frame", "$parentFrame", AtlasLoot_SearchProgress); +streamIcon.frame:SetAllPoints(); +streamIcon.frame.bg = streamIcon.frame:CreateTexture("$parentBackground", "BACKGROUND"); +streamIcon.frame.bg:SetTexture("Interface\\Addons\\AtlasLoot\\Images\\streambackground"); +streamIcon.frame.bg:SetVertexColor(0,1,0); +streamIcon.frame.bg:SetAllPoints(); +streamIcon.frame.alpha = streamIcon.frame:CreateTexture("$parentAlpha", "ARTWORK"); +streamIcon.frame.alpha:SetTexture("Interface\\Addons\\AtlasLoot\\Images\\streamframe"); +streamIcon.frame.alpha:SetAllPoints(); + +streamIcon.Loop = streamIcon:CreateAnimationGroup("$parentLoopAnim"); +streamIcon.Loop:SetLooping("REPEAT"); +local rotAnim = streamIcon.Loop:CreateAnimation("ROTATION"); +rotAnim:SetOrder(1); +rotAnim:SetDuration(8); +rotAnim:SetDegrees(-360); + +streamIcon:SetScript("OnEnter", + function(self) + if(self.tooltip ~= nil) then + GameTooltip:SetOwner(self, "ANCHOR_LEFT"); + GameTooltip:SetText(self.tooltip, nil, nil, nil, nil, true); + end + end); +streamIcon:SetScript("OnLeave", GameTooltip_Hide); +streamIcon:SetScript("OnShow", function(self) self:SetFrameLevel( (self:GetParent()):GetFrameLevel() + 1 ) end); + +streamIcon:SetPoint("TOPRIGHT", AtlasLootDefaultFrame_LootBackground, "TOPRIGHT"); +streamIcon:Hide(); \ No newline at end of file diff --git a/AtlasLoot/DefaultFrame/Frames.xml b/AtlasLoot/DefaultFrame/Frames.xml new file mode 100644 index 0000000..cfdc208 --- /dev/null +++ b/AtlasLoot/DefaultFrame/Frames.xml @@ -0,0 +1,6 @@ + +