diff --git a/ElvUI_SLE/core/media.lua b/ElvUI_SLE/core/media.lua index b05be59..48a98bd 100644 --- a/ElvUI_SLE/core/media.lua +++ b/ElvUI_SLE/core/media.lua @@ -47,8 +47,6 @@ local Colors = { [5] = {1.0, 0.9294, 0.7607}, --white } - - local function ZoneTextPos() if ( PVPInfoTextString:GetText() == "" ) then SubZoneTextString:SetPoint("TOP", "ZoneTextString", "BOTTOM", 0, -E.db.sle.media.fonts.subzone.offset); diff --git a/ElvUI_SLE/core/modules.lua b/ElvUI_SLE/core/modules.lua index 8dc28e2..2a246c7 100644 --- a/ElvUI_SLE/core/modules.lua +++ b/ElvUI_SLE/core/modules.lua @@ -20,6 +20,7 @@ local modules = { ['SLE_EnhancedVehicleBar'] = {}, ['SLE_Test'] = { 'AceHook-3.0', 'AceEvent-3.0'}, --Testing module in dev folder ['SLE_Media'] = { 'AceHook-3.0' }, + ['SLE_InstDif'] = { 'AceHook-3.0', 'AceEvent-3.0'}, ['SLE'] = { 'AceHook-3.0', 'AceEvent-3.0' }, } diff --git a/ElvUI_SLE/core/test.lua b/ElvUI_SLE/core/test.lua index b97c397..30f7ada 100644 --- a/ElvUI_SLE/core/test.lua +++ b/ElvUI_SLE/core/test.lua @@ -1,48 +1,2 @@ local E, L, V, P, G, _ = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local T = E:GetModule('SLE_Test'); -local LSM = LibStub("LibSharedMedia-3.0") - --- local f1, f2, b1, b2 - --- function T:Load(event, addon) - -- if addon ~= "ElvUI_Config" then return end - -- T:UnregisterEvent("ADDON_LOADED") - - -- E.Options.args.actionbar.args.enable.name = '|cff30ee30'..L["Enable"]..'|r' - --- end - --- function T:Initialize() - -- self:RegisterEvent("ADDON_LOADED", "Load") - --[[f1 = CreateFrame("PlayerModel") - f1:SetPoint("TOPLEFT", LeftChatPanel,"TOPLEFT",0,0) - f1:SetHeight(E.db.chat.panelHeight) - f1:SetWidth(E.db.chat.panelWidth) - - f1:SetFrameStrata(LeftChatPanel:GetFrameStrata()) - f1:SetFrameLevel(LeftChatPanel:GetFrameLevel() - 2) - f1:SetScale(0.71) - f1:SetUnit("player") - - f1:SetPosition(2.5,0,-0.9) - f1:SetFacing(0.5)]] --- end - --- local function SetFont(obj, font, size, style, r, g, b, sr, sg, sb, sox, soy) - -- obj:SetFont(font, size, style) - -- if sr and sg and sb then obj:SetShadowColor(sr, sg, sb) end - -- if sox and soy then obj:SetShadowOffset(sox, soy) end - -- if r and g and b then obj:SetTextColor(r, g, b) - -- elseif r then obj:SetAlpha(r) end --- end - --- function T:Set() - -- local NORMAL = E["media"].normFont - -- local NUMBER = E["media"].normFont - -- SetFont(ZoneTextString, LSM:Fetch('font', 'ElvUI Pixel'), 36, 'MONOCHROMEOUTLINE') - -- SetFont(SubZoneTextString, NORMAL, 13, "OUTLINE") --- end - --- E:RegisterModule(T:GetName()) - --- hooksecurefunc(E, "UpdateBlizzardFonts", T.Set) \ No newline at end of file diff --git a/ElvUI_SLE/core/toolkit.lua b/ElvUI_SLE/core/toolkit.lua index 2a0b2a0..c3d196a 100644 --- a/ElvUI_SLE/core/toolkit.lua +++ b/ElvUI_SLE/core/toolkit.lua @@ -10,6 +10,7 @@ local F = E:GetModule('SLE_Farm') local LT = E:GetModule('SLE_Loot') local UF = E:GetModule('UnitFrames') local M = E:GetModule('SLE_Media') +local I = E:GetModule('SLE_InstDif') --test local GetContainerNumSlots, GetContainerItemID = GetContainerNumSlots, GetContainerItemID @@ -61,4 +62,5 @@ function E:UpdateAll() F:UpdateLayout() CH:GMIconUpdate() M:TextWidth() + I:UpdateFrame() end \ No newline at end of file diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua index e56471e..ba9de58 100644 --- a/ElvUI_SLE/defaults/profile.lua +++ b/ElvUI_SLE/defaults/profile.lua @@ -262,6 +262,12 @@ P['sle'] = { ['pethide'] = false, ['skindungeon'] = false, }, + ['instance'] = { + ['enable'] = false, + ['flag'] = true, + ['xoffset'] = -10, + ['yoffset'] = 0, + }, }, --Nameplate Options diff --git a/ElvUI_SLE/modules/marks/load_marks.xml b/ElvUI_SLE/modules/marks/load_marks.xml index 248f4e3..289c801 100644 --- a/ElvUI_SLE/modules/marks/load_marks.xml +++ b/ElvUI_SLE/modules/marks/load_marks.xml @@ -1,5 +1,4 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> <Script file='flares.lua'/> <Script file='marks.lua'/> - <Script file='options.lua'/> </Ui> \ No newline at end of file diff --git a/ElvUI_SLE/modules/minimap/instance.lua b/ElvUI_SLE/modules/minimap/instance.lua new file mode 100644 index 0000000..fb1d39d --- /dev/null +++ b/ElvUI_SLE/modules/minimap/instance.lua @@ -0,0 +1,83 @@ +local E, L, V, P, G, _ = unpack(ElvUI); +local I = E:GetModule('SLE_InstDif') +local GetInstanceInfo = GetInstanceInfo +local sub = string.sub +local IsInInstance, IsInGuild = IsInInstance, IsInGuild +local f + +local function CreateText() +f = CreateFrame("Frame", "MiniMapDifFrame", Minimap) +f:Size(50, 20) + +-- f:Point("CENTER", UIParent) + +f.text = f:CreateFontString(nil, 'OVERLAY') +f.text:SetFont(E["media"].normFont, 12) +f.text:SetPoint("CENTER", f, "CENTER") +end + + +local function InstanceCheck() + local isInstance, InstanseType = IsInInstance() + local s = false + if isInstance and InstanseType ~= "pvp" then + if InstanseType ~= "arena" then + s = true + end + end + + return s +end + +local function GuildEmblem() + -- table + local char = {} + -- check if Blizzard_GuildUI is loaded + if GuildFrameTabardEmblem then + char.guildTexCoord = {GuildFrameTabardEmblem:GetTexCoord()} + end + if IsInGuild() and char.guildTexCoord then + return "|TInterface\\GuildFrame\\GuildEmblemsLG_01:24:24:-4:1:32:32:"..(char.guildTexCoord[1]*32)..":"..(char.guildTexCoord[7]*32)..":"..(char.guildTexCoord[2]*32)..":"..(char.guildTexCoord[8]*32).."|t" + else + return "" + end +end + +function I:UpdateFrame() + local db = E.db.sle.minimap.instance + if IsInInstance() then + if db.flag then + MiniMapInstanceDifficulty:Show() + else + MiniMapInstanceDifficulty:Hide() + end + end + f:Point("TOPLEFT", MiniMapInstanceDifficulty, "TOPLEFT", db.xoffset, db.yoffset) + if db.enable then + f.text:Show() + else + f.text:Hide() + end +end + +local function GenerateText(self, event, guild) + if not InstanceCheck() then + f.text:SetText("") + else + local _, _, _, difficultyName, _, _, _, _, instanceGroupSize = GetInstanceInfo() + difficultyName = sub(difficultyName, 1 , 2) + f.text:SetText(instanceGroupSize.." ("..difficultyName..")") + if guild then + local logo = GuildEmblem() + f.text:SetText(instanceGroupSize.." ("..difficultyName..")"..logo) + end + end +end + +function I:Initialize() + CreateText() + MiniMapInstanceDifficulty:HookScript("OnShow", function(self) if not E.db.sle.minimap.instance.flag then self:Hide() end end) + self:RegisterEvent("PLAYER_ENTERING_WORLD", GenerateText) + self:RegisterEvent("GUILD_PARTY_STATE_UPDATED", GenerateText) + I:UpdateFrame() +end \ No newline at end of file diff --git a/ElvUI_SLE/modules/minimap/load_minimap.xml b/ElvUI_SLE/modules/minimap/load_minimap.xml index a1cd949..947a16d 100644 --- a/ElvUI_SLE/modules/minimap/load_minimap.xml +++ b/ElvUI_SLE/modules/minimap/load_minimap.xml @@ -1,5 +1,5 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> <Script file='minimapcoords.lua'/> <Script file='minimapicons.lua'/> - <Script file='options.lua'/> + <Script file='instance.lua'/> </Ui> \ No newline at end of file diff --git a/ElvUI_SLE/modules/sledatatexts/load_datatexts.xml b/ElvUI_SLE/modules/sledatatexts/load_datatexts.xml index 13c2bf0..da5babc 100644 --- a/ElvUI_SLE/modules/sledatatexts/load_datatexts.xml +++ b/ElvUI_SLE/modules/sledatatexts/load_datatexts.xml @@ -1,5 +1,4 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> - <!--<Script file='datatexts.lua'/>--> <Script file='lfr.lua'/> <Script file='version.lua'/> <Script file='regen.lua'/> diff --git a/ElvUI_SLE/options/minimap_c.lua b/ElvUI_SLE/options/minimap_c.lua index dbc772b..1a70116 100644 --- a/ElvUI_SLE/options/minimap_c.lua +++ b/ElvUI_SLE/options/minimap_c.lua @@ -131,6 +131,44 @@ local function configTable() }, }, }, + instance = { + type = "group", + name = L["Instance indication"], + order = 7, + guiInline = true, + get = function(info) return E.db.sle.minimap.instance[ info[#info] ] end, + set = function(info, value) E.db.sle.minimap.instance[ info[#info] ] = value; E:GetModule('SLE_InstDif'):UpdateFrame() end, + args = { + enable = { + order = 1, + type = 'toggle', + name = L['Enable'], + desc = L['Show instance difficulty info as text.'], + disabled = function() return not E.private.general.minimap.enable end, + }, + flag = { + order = 2, + type = 'toggle', + name = L['Show texture'], + desc = L['Show instance difficulty info as default texture.'], + disabled = function() return not E.private.general.minimap.enable end, + }, + xoffset = { + order = 3, + type = 'range', + name = L['X-Offset'], + min = -50, max = 100, step = 1, + disabled = function() return not E.private.general.minimap.enable or not E.db.sle.minimap.instance.enable end, + }, + yoffset = { + order = 4, + type = 'range', + name = L['Y-Offset'], + min = -50, max = 100, step = 1, + disabled = function() return not E.private.general.minimap.enable or not E.db.sle.minimap.instance.enable end, + }, + }, + }, }, } end