From ffeb1f55dedc459daee48ab72a7c5bd46856979e Mon Sep 17 00:00:00 2001 From: d87 Date: Sun, 16 May 2021 10:39:51 +0700 Subject: [PATCH] Added back Blizz options panel entry --- Aptechka.lua | 27 +++++++++++++++++++++++++++ launcher.lua | 4 +++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Aptechka.lua b/Aptechka.lua index eb6ba9a..7b65dc3 100644 --- a/Aptechka.lua +++ b/Aptechka.lua @@ -643,6 +643,7 @@ function Aptechka.PLAYER_LOGIN(self,event,arg1) Aptechka:CreteMinimapIcon() end + Aptechka:CreateBlizzOptionsPanel() --[[ local f = CreateFrame('Frame', nil, InterfaceOptionsFrame) f:SetScript('OnShow', function(self) @@ -4110,3 +4111,29 @@ function Aptechka.UNIT_SPELLCAST_FAILED(self, event, unit, castID) Aptechka:ForEachUnitFrame(unit, Frame_CastFailed, castID) end Aptechka.UNIT_SPELLCAST_INTERRUPTED = Aptechka.UNIT_SPELLCAST_FAILED + + +function Aptechka:CreateBlizzOptionsPanel() + local f = CreateFrame('Frame', "AptechkaBlizzOptionsPanel", InterfaceOptionsFrame) + f.name = "Aptechka" + InterfaceOptions_AddCategory(f); + + local content = CreateFrame("Frame", "$parentContent", f) + content:SetPoint("TOPLEFT", 10, -10) + content:SetPoint("BOTTOMRIGHT", -10, 10) + + local label = content:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge") + label:SetPoint("TOPLEFT", 10, -15) + label:SetPoint("BOTTOMRIGHT", content, "TOPRIGHT", 10, -45) + label:SetJustifyH("LEFT") + label:SetText("Aptechka Options") + + local optionsButton = CreateFrame("Button", nil, content, "UIPanelButtonTemplate") + optionsButton:SetSize(200, 30) + optionsButton:SetPoint("TOPLEFT", 10, -60) + optionsButton:GetFontString():SetText("Open Options Panel") + optionsButton:SetScript("OnClick", function() + LoadAddOn('AptechkaOptions') + Aptechka:OpenGUI() + end) +end diff --git a/launcher.lua b/launcher.lua index 7400354..eec1a62 100644 --- a/launcher.lua +++ b/launcher.lua @@ -59,10 +59,12 @@ function Aptechka:CreteMinimapIcon() GameTooltip_SetTitle(tooltip, string.format("%s %s",addonName, GetAddOnMetadata(addonName, "version"))) GameTooltip_AddInstructionLine(tooltip, string.format("LeftClick - %s", L"Profile Settings")) - GameTooltip_AddInstructionLine(tooltip, string.format("Shift-LeftClick - %s", L"Widgets")) GameTooltip_AddInstructionLine(tooltip, string.format("|cffc9e06cCtrl-LeftClick - %s|r", L"Unlock")) + --[[ + GameTooltip_AddInstructionLine(tooltip, string.format("Shift-LeftClick - %s", L"Widgets")) GameTooltip_AddInstructionLine(tooltip, string.format("RightClick - %s", L"Spell List")) GameTooltip_AddInstructionLine(tooltip, string.format("Shift-RightClick - %s", L"Status List")) + ]] GameTooltip_AddInstructionLine(tooltip, string.format("|cffe0896cMiddleClick - %s|r", L"Hide Icon")) end })