Add files via upload

This commit is contained in:
totalllyswede
2025-11-22 07:27:04 -08:00
committed by GitHub
parent 91dab47f20
commit f7f4563519
2 changed files with 206 additions and 150 deletions
+203 -148
View File
@@ -9,46 +9,49 @@ MiniMageOptions = { };
-- --
function class_OnLoad() function class_OnLoad()
MM_class = UnitClass("player"); MM_class = UnitClass("player");
if (MM_class ~= "Mage") then if (MM_class ~= "Mage") then
this:Hide(); this:Hide();
end end
end end
function MM_Initialize() function MM_Initialize()
MM_fac = UnitFactionGroup('player'); MM_fac = UnitFactionGroup('player');
M_class = UnitClass("player"); M_class = UnitClass("player");
if (M_class == "Mage") then if (M_class == "Mage") then
if (DEFAULT_CHAT_FRAME) then if (DEFAULT_CHAT_FRAME) then
DEFAULT_CHAT_FRAME:AddMessage(MINIMAGE_ANNOUNCE_GREETING..M_class..MINIMAGE_ANNOUNCE_ENABLED); DEFAULT_CHAT_FRAME:AddMessage(MINIMAGE_ANNOUNCE_GREETING..M_class..MINIMAGE_ANNOUNCE_ENABLED);
end end
else else
if (DEFAULT_CHAT_FRAME) then if (DEFAULT_CHAT_FRAME) then
DEFAULT_CHAT_FRAME:AddMessage(MINIMAGE_ANNOUNCE_GREETING..M_class..MINIMAGE_ANNOUNCE_DISABLED); DEFAULT_CHAT_FRAME:AddMessage(MINIMAGE_ANNOUNCE_GREETING..M_class..MINIMAGE_ANNOUNCE_DISABLED);
end end
end end
end end
function MM_Button_Initialize() function MM_Button_Initialize()
if(event == "VARIABLES_LOADED") then if(event == "VARIABLES_LOADED") then
if (MiniMageOptions.MMButtonPosition == nil) then if (MiniMageOptions.MMButtonPosition == nil) then
MiniMageOptions.MMButtonPosition = 0; MiniMageOptions.MMButtonPosition = 0;
end end
end if (MiniMageOptions.HidePortals == nil) then
MiniMageOptions.HidePortals = false;
end
end
end end
function MM_DropDown_Initialize() function MM_DropDown_Initialize()
local dropdown; local dropdown;
if ( UIDROPDOWNMENU_OPEN_MENU ) then if ( UIDROPDOWNMENU_OPEN_MENU ) then
dropdown = getglobal(UIDROPDOWNMENU_OPEN_MENU); dropdown = getglobal(UIDROPDOWNMENU_OPEN_MENU);
else else
dropdown = this; dropdown = this;
end end
MM_DropDown_InitButtons(); MM_DropDown_InitButtons();
end end
function MM_DropDown_OnLoad() function MM_DropDown_OnLoad()
UIDropDownMenu_Initialize(this, MM_DropDown_Initialize, "MENU"); UIDropDownMenu_Initialize(this, MM_DropDown_Initialize, "MENU");
end end
-- --
@@ -66,7 +69,7 @@ function MM_Button_BeingDragged()
end end
function MM_Button_OnClick() function MM_Button_OnClick()
MM_ToggleDropDown(); MM_ToggleDropDown();
end end
function MM_Button_OnEnter() function MM_Button_OnEnter()
@@ -86,13 +89,13 @@ function MM_Button_SetPosition(v)
end end
function MM_Button_UpdatePosition() function MM_Button_UpdatePosition()
MM_ButtonFrame:SetPoint( MM_ButtonFrame:SetPoint(
"TOPLEFT", "TOPLEFT",
"Minimap", "Minimap",
"TOPLEFT", "TOPLEFT",
54 - (78 * cos(MiniMageOptions.MMButtonPosition)), 54 - (78 * cos(MiniMageOptions.MMButtonPosition)),
(78 * sin(MiniMageOptions.MMButtonPosition)) - 55 (78 * sin(MiniMageOptions.MMButtonPosition)) - 55
); );
end end
-- --
@@ -100,145 +103,197 @@ end
-- --
function MM_ToggleDropDown() function MM_ToggleDropDown()
MM_DropDownFrame.point = "TOPRIGHT"; MM_DropDownFrame.point = "TOPRIGHT";
MM_DropDownFrame.relativePoint = "BOTTOMLEFT"; MM_DropDownFrame.relativePoint = "BOTTOMLEFT";
ToggleDropDownMenu(1, nil, MM_DropDownFrame); ToggleDropDownMenu(1, nil, MM_DropDownFrame);
end end
function MM_DropDown_InitButtons() function MM_DropDown_InitButtons()
local info = {}; local info = {};
info.text = MINIMAGE_LABEL_TITLE; info.text = MINIMAGE_LABEL_TITLE;
info.isTitle = 1; info.isTitle = 1;
info.justifyH = "CENTER"; info.justifyH = "CENTER";
info.notCheckable = 1; info.notCheckable = 1;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
local fact = UnitFactionGroup('player'); local fact = UnitFactionGroup('player');
if (fact == "Horde") then if (fact == "Horde") then
MM_DropDown_ForTheHorde(); MM_DropDown_ForTheHorde();
else else
MM_DropDown_ForTheAlliance(); MM_DropDown_ForTheAlliance();
end end
end end
function MM_DropDown_ForTheHorde() function MM_DropDown_ForTheHorde()
local appender = ': '; local appender = ': ';
local info = { }; -- PORTAL SECTION (hidden if HidePortals is true)
info.text = MINIMAGE_LABEL_PORTAL; if not MiniMageOptions.HidePortals then
info.isTitle = 1; local info = { };
info.notCheckable = 1; info.text = MINIMAGE_LABEL_PORTAL;
UIDropDownMenu_AddButton(info); info.isTitle = 1;
info.notCheckable = 1;
UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_ORG; info.text = MINIMAGE_LABEL_ORG;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_ORG); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_ORG); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_STONARD; info.text = MINIMAGE_LABEL_STONARD;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_STONARD); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_STONARD); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_TB; info.text = MINIMAGE_LABEL_TB;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_TB); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_TB); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_UC; info.text = MINIMAGE_LABEL_UC;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_UC); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_UC); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
end
info = { }; -- TELEPORT SECTION
info.text = MINIMAGE_LABEL_TELEPORT; local info = { };
info.isTitle = 1; info.text = MINIMAGE_LABEL_TELEPORT;
info.notCheckable = 1; info.isTitle = 1;
UIDropDownMenu_AddButton(info); info.notCheckable = 1;
UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_ORG; info.text = MINIMAGE_LABEL_ORG;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_ORG); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_ORG); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_STONARD; info.text = MINIMAGE_LABEL_STONARD;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_STONARD); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_STONARD); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_TB; info.text = MINIMAGE_LABEL_TB;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_TB); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_TB); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_UC; info.text = MINIMAGE_LABEL_UC;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_UC); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_UC); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
end end
function MM_DropDown_ForTheAlliance() function MM_DropDown_ForTheAlliance()
local appender = ': '; local appender = ': ';
local info = { }; -- PORTAL SECTION (hidden if HidePortals is true)
info.text = MINIMAGE_LABEL_PORTAL; if not MiniMageOptions.HidePortals then
info.isTitle = 1; local info = { };
info.notCheckable = 1; info.text = MINIMAGE_LABEL_PORTAL;
UIDropDownMenu_AddButton(info); info.isTitle = 1;
info.notCheckable = 1;
info = { }; UIDropDownMenu_AddButton(info);
info.text = MINIMAGE_LABEL_ALAH;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_ALAH); end;
UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_DARNASSUS; info.text = MINIMAGE_LABEL_ALAH;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_DARNASSUS); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_ALAH); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_IF; info.text = MINIMAGE_LABEL_DARNASSUS;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_IF); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_DARNASSUS); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_SW; info.text = MINIMAGE_LABEL_IF;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_SW); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_IF); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_THERAMORE; info.text = MINIMAGE_LABEL_SW;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_THERAMORE); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_SW); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_TELEPORT; info.text = MINIMAGE_LABEL_THERAMORE;
info.isTitle = 1; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_THERAMORE); end;
info.notCheckable = 1; UIDropDownMenu_AddButton(info);
UIDropDownMenu_AddButton(info); end
info = { }; -- TELEPORT SECTION
info.text = MINIMAGE_LABEL_ALAH; local info = { };
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_ALAH); end; info.text = MINIMAGE_LABEL_TELEPORT;
UIDropDownMenu_AddButton(info); info.isTitle = 1;
info.notCheckable = 1;
UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_DARNASSUS; info.text = MINIMAGE_LABEL_ALAH;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_DARNASSUS); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_ALAH); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_IF; info.text = MINIMAGE_LABEL_DARNASSUS;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_IF); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_DARNASSUS); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_SW; info.text = MINIMAGE_LABEL_IF;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_SW); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_IF); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
info = { }; info = { };
info.text = MINIMAGE_LABEL_THERAMORE; info.text = MINIMAGE_LABEL_SW;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_THERAMORE); end; info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_SW); end;
UIDropDownMenu_AddButton(info); UIDropDownMenu_AddButton(info);
end
info = { };
info.text = MINIMAGE_LABEL_THERAMORE;
info.func = function(msg) CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_THERAMORE); end;
UIDropDownMenu_AddButton(info);
end
--
-- Slash Commands
--
SLASH_MINIMAGE1 = "/mmage"
SlashCmdList["MINIMAGE"] = function(msg)
msg = string.lower(msg or "")
if msg == "reset" then
MiniMageOptions = {}
DEFAULT_CHAT_FRAME:AddMessage("|cffffff00MiniMage: options reset.|r")
elseif msg == "icon" then
if MM_ButtonFrame:IsShown() then
MM_ButtonFrame:Hide()
DEFAULT_CHAT_FRAME:AddMessage("|cffffff00MiniMage: minimap button hidden.|r")
else
MM_ButtonFrame:Show()
DEFAULT_CHAT_FRAME:AddMessage("|cffffff00MiniMage: minimap button shown.|r")
end
elseif msg == "portals" then
MiniMageOptions.HidePortals = not MiniMageOptions.HidePortals
if MiniMageOptions.HidePortals then
DEFAULT_CHAT_FRAME:AddMessage("|cffffff00MiniMage: Portal hidden.|r")
else
DEFAULT_CHAT_FRAME:AddMessage("|cffffff00MiniMage: Portal shown.|r")
end
elseif msg == "help" or msg == "" then
DEFAULT_CHAT_FRAME:AddMessage("|cffffff00MiniMage commands:|r")
DEFAULT_CHAT_FRAME:AddMessage("/mmage help - Show this help")
DEFAULT_CHAT_FRAME:AddMessage("/mmage icon - Show/Hide minimap button")
DEFAULT_CHAT_FRAME:AddMessage("/mmage reset - Reset addon saved options")
DEFAULT_CHAT_FRAME:AddMessage("/mmage portals - Show/Hide portal in dropdown")
else
DEFAULT_CHAT_FRAME:AddMessage("|cffff0000MiniMage: unknown command.|r")
DEFAULT_CHAT_FRAME:AddMessage("Type /mmage help for options.")
end
end
+3 -2
View File
@@ -3,5 +3,6 @@
## Version: 1.0 ## Version: 1.0
## Notes: Forked version of MiniMage 1.2b. No original GitHub Repo found, only found in Wow1.12.1_Addons_Collection ## Notes: Forked version of MiniMage 1.2b. No original GitHub Repo found, only found in Wow1.12.1_Addons_Collection
## SavedVariables: MiniMageOptions ## SavedVariables: MiniMageOptions
MiniMage_TWOW.xml localization.lua
localization.lua MiniMage_TWOW.lua
MiniMage_TWOW.xml