Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 298424ebdf | |||
| 6926a59e8e | |||
| 8d6c686692 | |||
| 115dc0c7e9 | |||
| 45a287e7cc |
+188
-23
@@ -1,3 +1,5 @@
|
||||
local MM_Initialized = false
|
||||
|
||||
--
|
||||
-- Global variable for storage of settings/options
|
||||
--
|
||||
@@ -16,6 +18,8 @@ function class_OnLoad()
|
||||
end
|
||||
|
||||
function MM_Initialize()
|
||||
if MM_Initialized then return end
|
||||
MM_Initialized = true
|
||||
MM_fac = UnitFactionGroup('player');
|
||||
M_class = UnitClass("player");
|
||||
if (M_class == "Mage") then
|
||||
@@ -56,9 +60,8 @@ end
|
||||
|
||||
--
|
||||
-- Minimap button drag/drop functions
|
||||
--
|
||||
|
||||
-- Thanks to Atlas for the button dragging code
|
||||
--
|
||||
|
||||
function MM_Button_BeingDragged()
|
||||
local xpos,ypos = GetCursorPosition();
|
||||
@@ -126,6 +129,11 @@ function MM_DropDown_InitButtons()
|
||||
info.isTitle = 1;
|
||||
info.justifyH = "CENTER";
|
||||
info.notCheckable = 1;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Click to cast"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
local fact = UnitFactionGroup('player');
|
||||
@@ -139,12 +147,16 @@ end
|
||||
function MM_DropDown_ForTheHorde()
|
||||
local appender = ': ';
|
||||
|
||||
-- PORTAL SECTION (hidden if HidePortals is true)
|
||||
if not MiniMageOptions.HidePortals then
|
||||
local info = { };
|
||||
info.text = MINIMAGE_LABEL_PORTAL;
|
||||
info.isTitle = 1;
|
||||
info.notCheckable = 1;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Portal spells"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- ORG PORTAL
|
||||
@@ -153,9 +165,14 @@ function MM_DropDown_ForTheHorde()
|
||||
info.disabled = not MM_CanCastPortal();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastPortal() then
|
||||
CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_ORG);
|
||||
MM_TryCast(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_ORG);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Portal to Orgrimmar"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- STONARD PORTAL
|
||||
@@ -164,9 +181,14 @@ function MM_DropDown_ForTheHorde()
|
||||
info.disabled = not MM_CanCastPortal();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastPortal() then
|
||||
CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_STONARD);
|
||||
MM_TryCast(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_STONARD);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Portal to Stonard"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- TB PORTAL
|
||||
@@ -175,9 +197,14 @@ function MM_DropDown_ForTheHorde()
|
||||
info.disabled = not MM_CanCastPortal();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastPortal() then
|
||||
CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_TB);
|
||||
MM_TryCast(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_TB);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Portal to Thunder Bluff"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- UC PORTAL
|
||||
@@ -186,9 +213,14 @@ function MM_DropDown_ForTheHorde()
|
||||
info.disabled = not MM_CanCastPortal();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastPortal() then
|
||||
CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_UC);
|
||||
MM_TryCast(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_UC);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Portal to Undercity"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
end
|
||||
|
||||
@@ -197,6 +229,11 @@ function MM_DropDown_ForTheHorde()
|
||||
info.text = MINIMAGE_LABEL_TELEPORT;
|
||||
info.isTitle = 1;
|
||||
info.notCheckable = 1;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Teleport spells"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- ORG TELEPORT
|
||||
@@ -205,9 +242,14 @@ function MM_DropDown_ForTheHorde()
|
||||
info.disabled = not MM_CanCastTeleport();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastTeleport() then
|
||||
CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_ORG);
|
||||
MM_TryCast(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_ORG);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Teleport to Orgrimmar"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- STONARD TELEPORT
|
||||
@@ -216,9 +258,14 @@ function MM_DropDown_ForTheHorde()
|
||||
info.disabled = not MM_CanCastTeleport();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastTeleport() then
|
||||
CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_STONARD);
|
||||
MM_TryCast(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_STONARD);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Teleport to Stonard"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- TB TELEPORT
|
||||
@@ -227,9 +274,14 @@ function MM_DropDown_ForTheHorde()
|
||||
info.disabled = not MM_CanCastTeleport();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastTeleport() then
|
||||
CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_TB);
|
||||
MM_TryCast(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_TB);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Teleport to Thunder Bluff"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- UC TELEPORT
|
||||
@@ -238,21 +290,30 @@ function MM_DropDown_ForTheHorde()
|
||||
info.disabled = not MM_CanCastTeleport();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastTeleport() then
|
||||
CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_UC);
|
||||
MM_TryCast(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_UC);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Teleport to Undercity"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
end
|
||||
|
||||
function MM_DropDown_ForTheAlliance()
|
||||
local appender = ': ';
|
||||
|
||||
-- PORTAL SECTION (hidden if HidePortals is true)
|
||||
if not MiniMageOptions.HidePortals then
|
||||
local info = { };
|
||||
info.text = MINIMAGE_LABEL_PORTAL;
|
||||
info.isTitle = 1;
|
||||
info.notCheckable = 1;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Portal spells"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- ALAH PORTAL
|
||||
@@ -261,9 +322,14 @@ function MM_DropDown_ForTheAlliance()
|
||||
info.disabled = not MM_CanCastPortal();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastPortal() then
|
||||
CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_ALAH);
|
||||
MM_TryCast(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_ALAH);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Portal to Aerie Peak"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- DARNASSUS PORTAL
|
||||
@@ -272,9 +338,14 @@ function MM_DropDown_ForTheAlliance()
|
||||
info.disabled = not MM_CanCastPortal();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastPortal() then
|
||||
CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_DARNASSUS);
|
||||
MM_TryCast(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_DARNASSUS);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Portal to Darnassus"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- IF PORTAL
|
||||
@@ -283,9 +354,14 @@ function MM_DropDown_ForTheAlliance()
|
||||
info.disabled = not MM_CanCastPortal();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastPortal() then
|
||||
CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_IF);
|
||||
MM_TryCast(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_IF);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Portal to Ironforge"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- SW PORTAL
|
||||
@@ -294,9 +370,14 @@ function MM_DropDown_ForTheAlliance()
|
||||
info.disabled = not MM_CanCastPortal();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastPortal() then
|
||||
CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_SW);
|
||||
MM_TryCast(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_SW);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Portal to Stormwind"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- THERAMORE PORTAL
|
||||
@@ -305,17 +386,27 @@ function MM_DropDown_ForTheAlliance()
|
||||
info.disabled = not MM_CanCastPortal();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastPortal() then
|
||||
CastSpellByName(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_THERAMORE);
|
||||
MM_TryCast(MINIMAGE_LABEL_PORTAL..appender..MINIMAGE_LABEL_THERAMORE);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Portal to Theramore"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
end
|
||||
|
||||
-- TELEPORT SECTION
|
||||
-- TELEPORT TITLE
|
||||
local info = { };
|
||||
info.text = MINIMAGE_LABEL_TELEPORT;
|
||||
info.isTitle = 1;
|
||||
info.notCheckable = 1;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Teleport spells"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- ALAH TELEPORT
|
||||
@@ -324,9 +415,14 @@ function MM_DropDown_ForTheAlliance()
|
||||
info.disabled = not MM_CanCastTeleport();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastTeleport() then
|
||||
CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_ALAH);
|
||||
MM_TryCast(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_ALAH);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Teleport to Aerie Peak"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- DARN TELEPORT
|
||||
@@ -335,9 +431,14 @@ function MM_DropDown_ForTheAlliance()
|
||||
info.disabled = not MM_CanCastTeleport();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastTeleport() then
|
||||
CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_DARNASSUS);
|
||||
MM_TryCast(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_DARNASSUS);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Teleport to Darnassus"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- IF TELEPORT
|
||||
@@ -346,9 +447,14 @@ function MM_DropDown_ForTheAlliance()
|
||||
info.disabled = not MM_CanCastTeleport();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastTeleport() then
|
||||
CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_IF);
|
||||
MM_TryCast(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_IF);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Teleport to Ironforge"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- SW TELEPORT
|
||||
@@ -357,9 +463,14 @@ function MM_DropDown_ForTheAlliance()
|
||||
info.disabled = not MM_CanCastTeleport();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastTeleport() then
|
||||
CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_SW);
|
||||
MM_TryCast(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_SW);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Teleport to Stormwind"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
|
||||
-- THERAMORE TELEPORT
|
||||
@@ -368,9 +479,14 @@ function MM_DropDown_ForTheAlliance()
|
||||
info.disabled = not MM_CanCastTeleport();
|
||||
info.func = function(msg)
|
||||
if MM_CanCastTeleport() then
|
||||
CastSpellByName(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_THERAMORE);
|
||||
MM_TryCast(MINIMAGE_LABEL_TELEPORT..appender..MINIMAGE_LABEL_THERAMORE);
|
||||
end
|
||||
end;
|
||||
|
||||
info.tooltipTitle = info.text
|
||||
info.tooltipText = "Teleport to Theramore"
|
||||
info.tooltipOnButton = true
|
||||
|
||||
UIDropDownMenu_AddButton(info);
|
||||
end
|
||||
|
||||
@@ -417,3 +533,52 @@ SlashCmdList["MINIMAGE"] = function(msg)
|
||||
DEFAULT_CHAT_FRAME:AddMessage("Type /mmage help for options.")
|
||||
end
|
||||
end
|
||||
|
||||
-- ===== ADDED: Minimal cast tracking + wrapper + error listener + spell check =====
|
||||
|
||||
-- Track last attempted spell cast
|
||||
local MM_LastAttemptedSpell = nil
|
||||
local MM_LastAttemptTime = 0
|
||||
|
||||
-- Check if player knows the spell
|
||||
function MM_HasSpell(spellName)
|
||||
for i=1, GetNumSpellTabs() do
|
||||
local _, _, offset, numSpells = GetSpellTabInfo(i)
|
||||
for j=1, numSpells do
|
||||
local name = GetSpellName(j + offset, BOOKTYPE_SPELL)
|
||||
if name == spellName then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- Wrapper to track attempts and check if learned
|
||||
function MM_TryCast(spellName)
|
||||
if not MM_HasSpell(spellName) then
|
||||
DEFAULT_CHAT_FRAME:AddMessage("|cffff0000You Have Not Learned " .. spellName .. ".|r")
|
||||
return
|
||||
end
|
||||
MM_LastAttemptedSpell = spellName
|
||||
MM_LastAttemptTime = GetTime()
|
||||
CastSpellByName(spellName)
|
||||
end
|
||||
|
||||
-- Event frame to listen for UI error messages and show custom text
|
||||
local MM_EventFrame = CreateFrame("Frame")
|
||||
MM_EventFrame:RegisterEvent("UI_ERROR_MESSAGE")
|
||||
|
||||
MM_EventFrame:SetScript("OnEvent", function(self, event, message)
|
||||
local now = GetTime()
|
||||
|
||||
-- Only react if the error happens within 1 second of our own click
|
||||
if MM_LastAttemptedSpell and (now - MM_LastAttemptTime) < 1.0 then
|
||||
-- Any standard "failed" message triggers custom output
|
||||
if message then
|
||||
DEFAULT_CHAT_FRAME:AddMessage("|cffff0000You Have Not Learned " .. MM_LastAttemptedSpell .. ".|r")
|
||||
end
|
||||
MM_LastAttemptedSpell = nil
|
||||
MM_LastAttemptTime = 0
|
||||
end
|
||||
end)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
## Interface: 11200
|
||||
## Title: MiniMage_TWOW
|
||||
## Version: 1.1
|
||||
## Version: 1.2
|
||||
## Notes: Forked version of MiniMage 1.2b. No original GitHub Repo found, only found in Wow1.12.1_Addons_Collection
|
||||
## SavedVariables: MiniMageOptions
|
||||
localization.lua
|
||||
|
||||
@@ -7,7 +7,7 @@ MiniMage_TWOW is a lightweight World of Warcraft addon designed for Mages, provi
|
||||
* I do not take credit for creating this addon, only modifying it to include TurtleWoW specific features
|
||||
|
||||
|
||||
# Version 1.1
|
||||
# Version 1.2
|
||||
## TurtleWoW Specific Features
|
||||
* Includes Alah'Thalas and Theramore for Alliance characters.
|
||||
* Includes Stonard for Horde characters.
|
||||
@@ -19,6 +19,7 @@ MiniMage_TWOW is a lightweight World of Warcraft addon designed for Mages, provi
|
||||
* **Faction Support**: Automatically shows relevant portal and teleport spells for Horde or Alliance Mages.
|
||||
* Teleport Section Greyed out Until Level 20
|
||||
* Portals Section Greyed out Until Level 40
|
||||
* "Haven't Learned Spell" Message when trying to cast a Teleport/Portal you don't have trained.
|
||||
|
||||
|
||||
## Installation
|
||||
@@ -52,4 +53,4 @@ Let me know if you have any issues, I'll fix it if I am able to.
|
||||
|
||||
## Screenshots
|
||||
|
||||
 
|
||||
<img width="800" height="600" alt="ss1" src="https://github.com/user-attachments/assets/e1344159-2bd9-43a1-8edb-9b16e123d022" />
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
|
||||
--the only place MINIMAGE_VERSION should be set
|
||||
MINIMAGE_VERSION = "1.1";
|
||||
MINIMAGE_VERSION = "1.2";
|
||||
|
||||
|
||||
--[[
|
||||
|
||||
Reference in New Issue
Block a user