Skip to content

Commit

Permalink
Clicking the world map button's mini list button now forces the mini …
Browse files Browse the repository at this point in the history
…list to show itself if it is hidden.
  • Loading branch information
DFortun81 committed Jan 4, 2025
1 parent 06c458b commit 9ad6da2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion AllTheThings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11143,7 +11143,7 @@ SlashCmdList.AllTheThings = function(cmd)
return true;
else
if cmd:sub(1, 6) == "mapid:" then
app:GetWindow("CurrentInstance"):SetMapID(tonumber(cmd:sub(7)));
app:GetWindow("CurrentInstance"):SetMapID(tonumber(cmd:sub(7)), true);
return true;
end
end
Expand Down
5 changes: 4 additions & 1 deletion src/UI/Windows/Mini List.lua
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,14 @@ app:CreateWindow("MiniList", {
wipe(CachedMapData);
self:Rebuild();
end
self.SetMapID = function(self, mapID)
self.SetMapID = function(self, mapID, show)
if mapID and mapID ~= self.mapID then
self.mapID = mapID;
self:Rebuild();
end
if show then
self:Show();
end
end
app.ToggleMiniListForCurrentZone = function()
if self:IsVisible() then
Expand Down
12 changes: 4 additions & 8 deletions src/UI/World Map Button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ local function CreateWorldMapButton()
texture:SetAllPoints();
texture:Show();
button.texture = texture;


local minilist = app:GetWindow(app.IsClassic and "MiniList" or "CurrentInstance");
button:SetScript("OnEnter", function(self)
local mapID = WorldMapFrame:GetMapID();
self.mapID = mapID;
Expand All @@ -44,15 +45,10 @@ local function CreateWorldMapButton()
GameTooltip:Hide();
GameTooltip:ClearLines();
end);
button:SetScript("OnClick", app.IsClassic and function(self)
local mapID = self.mapID;
if mapID and mapID > 0 then
app.Windows["MiniList"]:SetMapID(mapID);
end
end or function(self)
button:SetScript("OnClick", function(self)
local mapID = self.mapID;
if mapID and mapID > 0 then
app:GetWindow("CurrentInstance"):SetMapID(mapID);
minilist:SetMapID(mapID, true);
end
end);
return button;
Expand Down

0 comments on commit 9ad6da2

Please sign in to comment.