v9.7.2: Ebonhold Database integration and core logic refinements
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
<Ui>
|
||||
<Button name="QuestieWorldMapButtonTemplate" frameStrata="HIGH" mixin="QuestieWorldMapButtonMixin" motionScriptsWhileDisabled="true" virtual="true">
|
||||
<Size x="32" y="32"/>
|
||||
<Layers>
|
||||
<Layer level="BACKGROUND" textureSubLevel="-1">
|
||||
<Texture atlas="MapCornerShadow-Right" useAtlasSize="true" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="TOPRIGHT" x="4" y="1"/>
|
||||
</Anchors>
|
||||
<TexCoords left="0" right="1" top="1" bottom="0"/>
|
||||
</Texture>
|
||||
</Layer>
|
||||
<Layer level="BACKGROUND">
|
||||
<Texture parentKey="Background" file="Interface\Minimap\UI-Minimap-Background">
|
||||
<Size x="25" y="25"/>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" x="2" y="-4"/>
|
||||
</Anchors>
|
||||
</Texture>
|
||||
</Layer>
|
||||
<Layer level="ARTWORK">
|
||||
<Texture parentKey="Icon" file="Interface\Addons\Questie\Icons\complete.blp">
|
||||
<Size x="20" y="20"/>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" x="6" y="-5"/>
|
||||
</Anchors>
|
||||
</Texture>
|
||||
</Layer>
|
||||
<Layer level="OVERLAY">
|
||||
<Texture parentKey="IconOverlay" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeKey="$parent.Icon"/>
|
||||
<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Icon"/>
|
||||
</Anchors>
|
||||
<Color r="0.0" g="0.0" b="0.0" a="0.5"/>
|
||||
</Texture>
|
||||
</Layer>
|
||||
<Layer level="OVERLAY" textureSubLevel="1">
|
||||
<Texture parentKey="Border" file="Interface\Minimap\MiniMap-TrackingBorder">
|
||||
<Size x="54" y="54"/>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"/>
|
||||
</Anchors>
|
||||
</Texture>
|
||||
</Layer>
|
||||
<Layer level="OVERLAY" textureSubLevel="2">
|
||||
<Texture parentKey="ActiveTexture" file="Interface\Minimap\UI-Minimap-ZoomButton-Toggle" alphaMode="ADD" hidden="true" setAllPoints="true"/>
|
||||
</Layer>
|
||||
</Layers>
|
||||
<Frames>
|
||||
<Frame parentKey="DropDown" inherits="UIDropDownMenuTemplate" clampedToScreen="true" hidden="true"/>
|
||||
</Frames>
|
||||
<HighlightTexture alphaMode="ADD" file="Interface\Minimap\UI-Minimap-ZoomButton-Highlight"/>
|
||||
<Scripts>
|
||||
<OnLoad method="OnLoad"/>
|
||||
<OnMouseDown method="OnMouseDown"/>
|
||||
<OnMouseUp method="OnMouseUp"/>
|
||||
<OnClick method="OnClick"/>
|
||||
<OnEnter method="OnEnter"/>
|
||||
<OnLeave function="GameTooltip_Hide"/>
|
||||
<OnHide method="OnHide"/>
|
||||
</Scripts>
|
||||
</Button>
|
||||
</Ui>
|
||||
@@ -0,0 +1,59 @@
|
||||
---@class WorldMapButton
|
||||
---@field Initialize function
|
||||
local WorldMapButton = QuestieLoader:CreateModule("WorldMapButton")
|
||||
|
||||
---@type l10n
|
||||
local l10n = QuestieLoader:ImportModule("l10n")
|
||||
---@type QuestieLib
|
||||
local QuestieLib = QuestieLoader:ImportModule("QuestieLib")
|
||||
---@type QuestieQuest
|
||||
local QuestieQuest = QuestieLoader:ImportModule("QuestieQuest")
|
||||
---@type QuestieMenu
|
||||
local QuestieMenu = QuestieLoader:ImportModule("QuestieMenu")
|
||||
|
||||
local KButtons = QuestieCompat.KButtons or LibStub("Krowi_WorldMapButtons-1.4")
|
||||
|
||||
local mapButton
|
||||
|
||||
function WorldMapButton.Initialize()
|
||||
mapButton = KButtons:Add("QuestieWorldMapButtonTemplate", "BUTTON")
|
||||
|
||||
Questie.WorldMap = {
|
||||
Button = mapButton
|
||||
}
|
||||
end
|
||||
|
||||
---@param shouldShow boolean
|
||||
function WorldMapButton.Toggle(shouldShow)
|
||||
if shouldShow then
|
||||
mapButton:Show()
|
||||
else
|
||||
mapButton:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
QuestieWorldMapButtonMixin = {
|
||||
OnLoad = function() end,
|
||||
OnHide = function() end,
|
||||
OnMouseDown = function(_, button)
|
||||
if button == "LeftButton" then
|
||||
Questie.db.profile.enabled = (not Questie.db.profile.enabled)
|
||||
QuestieQuest:ToggleNotes(Questie.db.profile.enabled)
|
||||
elseif button == "RightButton" then
|
||||
QuestieMenu:Show()
|
||||
end
|
||||
end,
|
||||
OnMouseUp = function() end,
|
||||
OnEnter = function(self)
|
||||
local GameTooltip = QuestieCompat.SetupTooltip(self)
|
||||
GameTooltip:SetOwner(self, "ANCHOR_NONE");
|
||||
GameTooltip:SetPoint("TOPRIGHT", self, "BOTTOMRIGHT", 0, 0);
|
||||
GameTooltip:AddLine("Questie ".. QuestieLib:GetAddonVersionString(), 1, 1, 1)
|
||||
GameTooltip:AddLine(Questie:Colorize(l10n('Left Click') , 'gray') .. ": ".. l10n('Toggle Questie'))
|
||||
GameTooltip:AddLine(Questie:Colorize(l10n('Right Click') , 'gray') .. ": ".. l10n('Toggle Menu'))
|
||||
GameTooltip:Show()
|
||||
end,
|
||||
OnLeave = function() end,
|
||||
OnClick = function() end, -- Only fires on left click
|
||||
Refresh = function() end,
|
||||
}
|
||||
Reference in New Issue
Block a user