-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmixins.lua
More file actions
129 lines (112 loc) · 3.64 KB
/
Copy pathmixins.lua
File metadata and controls
129 lines (112 loc) · 3.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
OM_QuestLogOwnerMixin = CreateFromMixins(QuestLogOwnerMixin);
local DISPLAY_STATE_CLOSED = 1;
local DISPLAY_STATE_OPEN_MINIMIZED_NO_LOG = 2;
local DISPLAY_STATE_OPEN_MINIMIZED_WITH_LOG = 3;
local DISPLAY_STATE_OPEN_MAXIMIZED = 4;
function OM_QuestLogOwnerMixin:HandleUserActionToggleSelf()
local displayState;
if self:IsShown() then
displayState = DISPLAY_STATE_CLOSED;
else
self.wasShowingQuestLog = nil;
displayState = DISPLAY_STATE_OPEN_MAXIMIZED;
end
self:SetDisplayState(displayState);
end
function OM_QuestLogOwnerMixin:SetDisplayState(displayState)
if displayState == DISPLAY_STATE_CLOSED then
OmegaMapFrame:Hide();
else
OmegaMapFrame:Show();
local hasSynchronizedDisplayState = false;
if displayState == DISPLAY_STATE_OPEN_MAXIMIZED then
if not self:IsMaximized() then
--self:SetQuestLogPanelShown(false);
--self:Maximize();
hasSynchronizedDisplayState = true;
end
elseif displayState == DISPLAY_STATE_OPEN_MINIMIZED_NO_LOG then
if self:IsMaximized() then
--self:Minimize();
hasSynchronizedDisplayState = true;
end
self:SetQuestLogPanelShown(false);
elseif displayState == DISPLAY_STATE_OPEN_MINIMIZED_WITH_LOG then
if self:IsMaximized() then
--self:Minimize();
hasSynchronizedDisplayState = true;
end
--self:SetQuestLogPanelShown(true);
end
end
--self:2();
self:UpdateSpacerFrameAnchoring();
if not hasSynchronizedDisplayState then
self:SynchronizeDisplayState();
end
end
function OM_QuestLogOwnerMixin:HandleUserActionToggleSidePanel()
--local displayState;
if self.QuestLog:IsShown() then
OM_QuestMapFrame:Hide()
--displayState = DISPLAY_STATE_OPEN_MINIMIZED_NO_LOG;
else
OM_QuestMapFrame:Show()
--displayState = DISPLAY_STATE_OPEN_MINIMIZED_WITH_LOG;
end
--self:SetDisplayState(displayState);
self:RefreshQuestLog();
end
OmegaMapNavBarMixin = CreateFromMixins(WorldMapNavBarMixin);
function OmegaMapNavBarMixin:OnLoad()
local homeData = {
name = WORLD,
OnClick = function(button)
local TOPMOST = true;
local cosmicMapInfo = MapUtil.GetMapParentInfo(self:GetParent():GetMapID(), Enum.UIMapType.Cosmic, TOPMOST);
if cosmicMapInfo then
self:GoToMap(cosmicMapInfo.mapID)
end
end,
}
OM_NavBar_Initialize(self, "OM_NavButtonTemplate", homeData, self.home, self.overflow);
end
function OmegaMapNavBarMixin:OnMouseUp()
OmegaMapFrame:StopMovingOrSizing()
end
function OmegaMapNavBarMixin:OnMouseDown()
OmegaMapFrame:StartMoving()
OmegaMapFrame:SetUserPlaced(true);
end
function OmegaMapNavBarMixin:Refresh()
local hierarchy = { };
local mapInfo = C_Map.GetMapInfo(self:GetParent():GetMapID());
while mapInfo and mapInfo.parentMapID > 0 do
local buttonData = {
name = mapInfo.name,
id = mapInfo.mapID,
OnClick = WorldMapNavBarButtonMixin.OnClick,
};
-- Check if we are on a multifloor map belonging to a UIMapGroup, and if any map within the group should populate a dropdown
local mapGroupID = C_Map.GetMapGroupID(mapInfo.mapID);
if ( mapGroupID ) then
local mapGroupMembersInfo = C_Map.GetMapGroupMembersInfo(mapGroupID);
if ( mapGroupMembersInfo ) then
for i, mapGroupMemberInfo in ipairs(mapGroupMembersInfo) do
if ( C_Map.IsMapValidForNavBarDropDown(mapGroupMemberInfo.mapID) ) then
buttonData.listFunc = WorldMapNavBarButtonMixin.GetDropDownList;
break;
end
end
end
elseif ( C_Map.IsMapValidForNavBarDropDown(mapInfo.mapID) ) then
buttonData.listFunc = WorldMapNavBarButtonMixin.GetDropDownList;
end
tinsert(hierarchy, 1, buttonData);
mapInfo = C_Map.GetMapInfo(mapInfo.parentMapID);
end
OM_NavBar_Reset(self);
for i, buttonData in ipairs(hierarchy) do
OM_NavBar_AddButton(self, buttonData);
end
end