Skip to content

Commit

Permalink
Added an option.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oz committed May 26, 2013
1 parent d033aa9 commit c103760
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 83 deletions.
1 change: 1 addition & 0 deletions ShestakUI/Config/Settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ C["general"] = {
----------------------------------------------------------------------------------------
C["misc"] = {
["hide_button"] = true, -- Button to hide chat and minimap
["mage_portals"] = false, -- Enable a hidden button on the minimap to show a list of teleports and portals (only for mages)
["shift_marking"] = true, -- Marks target when you push "shift"
["invite_keyword"] = "inv", -- Short keyword for invite(for enable - in game type /ainv)
["afk_spin_camera"] = false, -- Spin camera while afk
Expand Down
162 changes: 80 additions & 82 deletions ShestakUI/Modules/Misc/MagePortals.lua
Original file line number Diff line number Diff line change
@@ -1,101 +1,99 @@
local T, C, L, _ = unpack(select(2, ...))
if T.class ~= "MAGE" or T.level < 17 then return end
if C.misc.mage_portals ~= true then return end

----------------------------------------------------------------------------------------
-- Mage portals menu(by Foof and Tohveli)
----------------------------------------------------------------------------------------
local spells = (UnitFactionGroup("player") == "Horde") and {
[1] = {3567,11417}, -- Orgrimmar
[2] = {3563,11418}, -- Undercity
[3] = {3566,11420}, -- Thunder Bluff
[4] = {32272,32267}, -- Silvermoon
[5] = {49358,49361}, -- Stonard
[6] = {35715,35717}, -- Shattrath
[7] = {53140,53142}, -- Dalaran
[8] = {88344,88346}, -- Tol Barad
[9] = {132627,132626}, -- Vale of Eternal Blossoms
} or { -- Alliance
[1] = {3561,10059}, -- Stormwind
[2] = {3562,11416}, -- Ironforge
[3] = {3565,11419}, -- Darnassus
[4] = {32271,32266}, -- Exodar
[5] = {49359,49360}, -- Theramore
[6] = {33690,33691}, -- Shattrath
[7] = {53140,53142}, -- Dalaran
[8] = {88342,88345}, -- Tol Barad
[9] = {132621,132620}, -- Vale of Eternal Blossoms
}
if T.class == "MAGE" and T.level > 16 then
local spells = (UnitFactionGroup("player") == "Horde") and {
[1] = {3567,11417}, -- Orgrimmar
[2] = {3563,11418}, -- Undercity
[3] = {3566,11420}, -- Thunder Bluff
[4] = {32272,32267}, -- Silvermoon
[5] = {49358,49361}, -- Stonard
[6] = {35715,35717}, -- Shattrath
[7] = {53140,53142}, -- Dalaran
[8] = {88344,88346}, -- Tol Barad
[9] = {132627,132626}, -- Vale of Eternal Blossoms
} or { -- Alliance
[1] = {3561,10059}, -- Stormwind
[2] = {3562,11416}, -- Ironforge
[3] = {3565,11419}, -- Darnassus
[4] = {32271,32266}, -- Exodar
[5] = {49359,49360}, -- Theramore
[6] = {33690,33691}, -- Shattrath
[7] = {53140,53142}, -- Dalaran
[8] = {88342,88345}, -- Tol Barad
[9] = {132621,132620}, -- Vale of Eternal Blossoms
}

local frame = CreateFrame("Frame", "TeleportMenu", UIParent)
if C.skins.tiny_dps_layout_two == true then
frame:CreatePanel("Invisible", C.minimap.size, (#spells) * 20 + 4, "BOTTOMLEFT", Minimap, "TOPLEFT", -2, 3)
else
local frame = CreateFrame("Frame", "TeleportMenu", UIParent)
frame:CreatePanel("Invisible", C.minimap.size, (#spells) * 20 + 4, "TOPLEFT", Minimap, "BOTTOMLEFT", -2, -8)
end
frame:RegisterEvent("UNIT_SPELLCAST_START")
frame:SetScript("OnEvent", function(self)
if self:IsShown() then
self:Hide()
end
end)
frame:Hide()
tinsert(UISpecialFrames, "TeleportMenu")
frame:RegisterEvent("UNIT_SPELLCAST_START")
frame:SetScript("OnEvent", function(self)
if self:IsShown() then
self:Hide()
end
end)
frame:Hide()
tinsert(UISpecialFrames, "TeleportMenu")

for i, spell in pairs(spells) do
local teleport = GetSpellInfo(spell[1])
for i, spell in pairs(spells) do
local teleport = GetSpellInfo(spell[1])

local b = CreateFrame("Button", nil, frame, "SecureActionButtonTemplate")
b:CreatePanel("Transparent", C.minimap.size, 20, "BOTTOMLEFT", frame, "BOTTOMLEFT", 0, ((i - 1) * 21))
b:SetBackdropBorderColor(T.color.r, T.color.g, T.color.b)
b:SetFrameStrata("HIGH")
local b = CreateFrame("Button", nil, frame, "SecureActionButtonTemplate")
b:CreatePanel("Transparent", C.minimap.size, 20, "BOTTOMLEFT", frame, "BOTTOMLEFT", 0, ((i - 1) * 21))
b:SetBackdropBorderColor(T.color.r, T.color.g, T.color.b)
b:SetFrameStrata("HIGH")

local l = b:CreateFontString(nil, "OVERLAY")
l:SetFont(C.media.pixel_font, C.media.pixel_font_size, C.media.pixel_font_style)
l:SetText(string.sub(teleport, string.find(teleport, ":") + 1))
b:SetFontString(l)
local l = b:CreateFontString(nil, "OVERLAY")
l:SetFont(C.media.pixel_font, C.media.pixel_font_size, C.media.pixel_font_style)
l:SetText(string.sub(teleport, string.find(teleport, ":") + 1))
b:SetFontString(l)

b:RegisterForClicks("LeftButtonDown", "RightButtonDown")
b:SetAttribute("type1", "spell")
b:SetAttribute("spell1", teleport)
b:SetAttribute("type2", "spell")
b:SetAttribute("spell2", GetSpellInfo(spell[2]))
end
b:RegisterForClicks("LeftButtonDown", "RightButtonDown")
b:SetAttribute("type1", "spell")
b:SetAttribute("spell1", teleport)
b:SetAttribute("type2", "spell")
b:SetAttribute("spell2", GetSpellInfo(spell[2]))
end

local button = CreateFrame("Button", nil, UIParent)
button:SetTemplate("ClassColor")
button:SetPoint("BOTTOMLEFT", Minimap, "BOTTOMLEFT")
button:SetSize(20, 20)
button:SetAlpha(0)
local button = CreateFrame("Button", nil, UIParent)
button:SetTemplate("ClassColor")
button:SetPoint("BOTTOMLEFT", Minimap, "BOTTOMLEFT")
button:SetSize(20, 20)
button:SetAlpha(0)

button.t = button:CreateTexture(nil, "OVERLAY")
button.t:SetTexture("Interface\\Icons\\Spell_Arcane_TeleportStormwind")
button.t:SetTexCoord(0.1, 0.9, 0.1, 0.9)
button.t:SetPoint("TOPLEFT", button, 2, -2)
button.t:SetPoint("BOTTOMRIGHT", button, -2, 2)
button.t = button:CreateTexture(nil, "OVERLAY")
button.t:SetTexture("Interface\\Icons\\Spell_Arcane_TeleportStormwind")
button.t:SetTexCoord(0.1, 0.9, 0.1, 0.9)
button.t:SetPoint("TOPLEFT", button, 2, -2)
button.t:SetPoint("BOTTOMRIGHT", button, -2, 2)

button:SetScript("OnClick", function(self)
if not InCombatLockdown() then
if _G["TeleportMenu"]:IsShown() then
_G["TeleportMenu"]:Hide()
else
_G["TeleportMenu"]:Show()
button:SetScript("OnClick", function(self)
if not InCombatLockdown() then
if _G["TeleportMenu"]:IsShown() then
_G["TeleportMenu"]:Hide()
else
_G["TeleportMenu"]:Show()
end
if C.minimap.toggle_menu and _G["TTMenuAddOnBackground"]:IsShown() then
_G["TTMenuAddOnBackground"]:Hide()
end
if C.minimap.toggle_menu and _G["TTMenuBackground"]:IsShown() then
_G["TTMenuBackground"]:Hide()
end
end
if C.minimap.toggle_menu and _G["TTMenuAddOnBackground"]:IsShown() then
_G["TTMenuAddOnBackground"]:Hide()
end
if C.minimap.toggle_menu and _G["TTMenuBackground"]:IsShown() then
_G["TTMenuBackground"]:Hide()
end
end
end)
end)

button:SetScript("OnEnter", function()
if InCombatLockdown() then return end
button:FadeIn()
end)
button:SetScript("OnEnter", function()
if InCombatLockdown() then return end
button:FadeIn()
end)

button:SetScript("OnLeave", function()
button:FadeOut()
end)
button:SetScript("OnLeave", function()
button:FadeOut()
end)
end

-- Edit by Oz of shestakdotorg --
1 change: 1 addition & 0 deletions ShestakUI_Config/Locales/Chinese.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ L_GUI_GENERAL_LAG_TOLERANCE = "自动更新自定延迟容许值"

-- Miscellaneous options
L_GUI_MISC_HIDE_BUTTON = "按钮,隐藏聊天和小地图" -- Goooooooooogle translated
L_GUI_MISC_MAGE_PORTALS = "启用一个隐藏的按钮,在小地图上显示一个列表的地面站和门户(仅适用于法师)" -- Goooooooooogle translated
L_GUI_MISC_MARKING = "点击shift显示团队标记图示菜单"
L_GUI_MISC_INVKEYWORD = "自动邀请关键字(/ainv)"
L_GUI_MISC_SPIN_CAMERA = "afk时旋转镜头"
Expand Down
1 change: 1 addition & 0 deletions ShestakUI_Config/Locales/English.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ L_GUI_GENERAL_LAG_TOLERANCE = "Automatically update the Blizzard Custom Lag Tole

-- Miscellaneous options
L_GUI_MISC_HIDE_BUTTON = "Button to hide chat and minimap"
L_GUI_MISC_MAGE_PORTALS = "Enable a hidden button on the minimap to show a list of teleports and portals (only for mages)"
L_GUI_MISC_MARKING = "Marks target when you push 'shift'"
L_GUI_MISC_INVKEYWORD = "Short keyword for invite (/ainv)"
L_GUI_MISC_SPIN_CAMERA = "Spin camera while afk"
Expand Down
1 change: 1 addition & 0 deletions ShestakUI_Config/Locales/French.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ L_GUI_GENERAL_LAG_TOLERANCE = "Ajuste automatiquement la barre de latence Blizza

-- Miscellaneous options
L_GUI_MISC_HIDE_BUTTON = "Bouton pour masquer le chat et minicarte" -- Goooooooooogle translated
L_GUI_MISC_MAGE_PORTALS = "Activer un bouton caché sur la minicarte pour afficher une liste de téléports et de portails (uniquement pour les mages)" -- Goooooooooogle translated
L_GUI_MISC_MARKING = "Marque la cible quand vous appuyez sur MAJ"
L_GUI_MISC_INVKEYWORD = "Mot clé pour inviter (/ainv)"
L_GUI_MISC_SPIN_CAMERA = "Faire tourner la caméra quand absent"
Expand Down
1 change: 1 addition & 0 deletions ShestakUI_Config/Locales/German.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ L_GUI_GENERAL_LAG_TOLERANCE = "Automatische Anpassung der Blizzard Custom Lag To

-- Miscellaneous options
L_GUI_MISC_HIDE_BUTTON = "Taste, um Chat und Minimap ausgeblendet" -- Goooooooooogle translated
L_GUI_MISC_MAGE_PORTALS = "Aktivieren Sie eine versteckte Schaltfläche auf der Minikarte, um eine Liste von teleportiert und Portale (nur für Magier) zeigen" -- Goooooooooogle translated
L_GUI_MISC_MARKING = "Ziele markieren wenn 'Umschalttaste' gedürckt wird"
L_GUI_MISC_INVKEYWORD = "Kurzes Schlüsselwort für Einladungen (/ainv)"
L_GUI_MISC_SPIN_CAMERA = "Kamera drehen während du afk bist"
Expand Down
1 change: 1 addition & 0 deletions ShestakUI_Config/Locales/Italian.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ L_GUI_GENERAL_LAG_TOLERANCE = "Allinea automaticamente la tolleranza automatica

-- Miscellaneous options
L_GUI_MISC_HIDE_BUTTON = "Pulsante per nascondere chat e minimappa"
L_GUI_MISC_MAGE_PORTALS = "Attiva un pulsante nascosto sulla minimappa per visualizzare un elenco dei teletrasporti e dei portali (solo per maghi)"
L_GUI_MISC_MARKING = "Marca il bersaglio quando premi Shift"
L_GUI_MISC_INVKEYWORD = "Parola chiave per invitare (/ainv)"
L_GUI_MISC_SPIN_CAMERA = "Ruota la camera mentre sei assente"
Expand Down
1 change: 1 addition & 0 deletions ShestakUI_Config/Locales/Korean.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ L_GUI_GENERAL_LAG_TOLERANCE = "Automatically update the Blizzard Custom Lag Tole

-- Miscellaneous options
L_GUI_MISC_HIDE_BUTTON = "채팅과 minimap을 숨길 버튼" -- Goooooooooogle translated
L_GUI_MISC_MAGE_PORTALS = "텔레포트와 포털의 목록 (만 마법사)를 표시하는 미니의 숨겨진 버튼을 사용" -- Goooooooooogle translated
L_GUI_MISC_MARKING = "Marks target when you push 'shift'"
L_GUI_MISC_INVKEYWORD = "Short keyword for invite (/ainv)"
L_GUI_MISC_SPIN_CAMERA = "Spin camera while afk"
Expand Down
1 change: 1 addition & 0 deletions ShestakUI_Config/Locales/Portuguese.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ L_GUI_GENERAL_LAG_TOLERANCE = "Automatically update the Blizzard Custom Lag Tole

-- Miscellaneous options
L_GUI_MISC_HIDE_BUTTON = "Botão para ocultar chat e minimap" -- Goooooooooogle translated
L_GUI_MISC_MAGE_PORTALS = "Habilitar um botão escondido no mini-mapa para mostrar uma lista de teleports e portais (somente para magos)" -- Goooooooooogle translated
L_GUI_MISC_MARKING = "Marks target when you push 'shift'"
L_GUI_MISC_INVKEYWORD = "Short keyword for invite (/ainv)"
L_GUI_MISC_SPIN_CAMERA = "Spin camera while afk"
Expand Down
1 change: 1 addition & 0 deletions ShestakUI_Config/Locales/Russian.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ L_GUI_GENERAL_LAG_TOLERANCE = "Автоматическое обновление

-- Miscellaneous options
L_GUI_MISC_HIDE_BUTTON = "Кнопка для скрытия чата и миникарты" -- Goooooooooogle translated
L_GUI_MISC_MAGE_PORTALS = "Включить скрытые кнопки на мини-карте, чтобы показать список телепортов и порталов (только для магов)" -- Goooooooooogle translated
L_GUI_MISC_MARKING = "Меню с метками при нажатии 'shift'"
L_GUI_MISC_INVKEYWORD = "Ключевое слово для автоматического приглашения (/ainv)"
L_GUI_MISC_SPIN_CAMERA = "Вращать камеру во время афк"
Expand Down
1 change: 1 addition & 0 deletions ShestakUI_Config/Locales/Spanish.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ L_GUI_GENERAL_LAG_TOLERANCE = "Actualizar automaticamente la opción de Toleranc

-- Miscellaneous options
L_GUI_MISC_HIDE_BUTTON = "Botón para ocultar el chat y el minimapa" -- Goooooooooogle translated
L_GUI_MISC_MAGE_PORTALS = "Activar un botón oculto en el minimapa para mostrar una lista de telepuertos y portales (sólo para magos)" -- Goooooooooogle translated
L_GUI_MISC_MARKING = "Marca el objetivo cuando pulsas 'shift'"
L_GUI_MISC_INVKEYWORD = "Acrónimo para invitaciones (/ainv)"
L_GUI_MISC_SPIN_CAMERA = "Rotar cámara mientras estás ausente"
Expand Down
1 change: 1 addition & 0 deletions ShestakUI_Config/Locales/Taiwan.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ L_GUI_GENERAL_LAG_TOLERANCE = "自動更新自訂延遲容許值"

-- Miscellaneous options
L_GUI_MISC_HIDE_BUTTON = "按鈕,隱藏聊天和小地圖" -- Goooooooooogle translated
L_GUI_MISC_MAGE_PORTALS = "啟用一個隱藏的按鈕,在小地圖上顯示一個列表地面站和門戶(僅適用於法師)" -- Goooooooooogle translated
L_GUI_MISC_MARKING = "點擊Shift顯示團隊標記圖示菜單"
L_GUI_MISC_INVKEYWORD = "自動邀請關鍵字 (/ainv)"
L_GUI_MISC_SPIN_CAMERA = "AFK時旋轉鏡頭"
Expand Down
2 changes: 1 addition & 1 deletion ShestakUI_Config/ShestakUI_Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ local function Local(o)
-- Miscellaneous options
if o == "UIConfigmisc" then o = OTHER end
if o == "UIConfigmischide_button" then o = L_GUI_MISC_HIDE_BUTTON end
if o == "UIConfigmischide_button_mouseover" then o = L_GUI_MISC_HIDE_BUTTON_MOUSEOVER end
if o == "UIConfigmiscmage_portals" then o = L_GUI_MISC_MAGE_PORTALS end
if o == "UIConfigmiscshift_marking" then o = L_GUI_MISC_MARKING end
if o == "UIConfigmiscinvite_keyword" then o = L_GUI_MISC_INVKEYWORD end
if o == "UIConfigmiscafk_spin_camera" then o = L_GUI_MISC_SPIN_CAMERA end
Expand Down

0 comments on commit c103760

Please sign in to comment.