From d3aad82ba37fd70fdbf3b311d0085ce93f3a8a18 Mon Sep 17 00:00:00 2001 From: Darthpred Date: Mon, 29 Oct 2012 22:44:30 +0400 Subject: [PATCH] Moved boss status calculations out of time.lua Also changed the way this stuff is shown as i mentioned in PMs Feel free to test this and say if you like it or not. For lvl 80-85 DS is shown, for lvl 86-90 3 MoP raids --- ElvUI_SLE/locales/english.lua | 3 + ElvUI_SLE/locales/russian.lua | 3 + ElvUI_SLE/modules/datatexts/lfr.lua | 158 ++++++++++++++++++++++++ ElvUI_SLE/modules/datatexts/load_datatexts.xml | 1 + ElvUI_SLE/modules/datatexts/time.lua | 63 ++-------- 5 files changed, 172 insertions(+), 56 deletions(-) create mode 100644 ElvUI_SLE/modules/datatexts/lfr.lua diff --git a/ElvUI_SLE/locales/english.lua b/ElvUI_SLE/locales/english.lua index 672f3dd..cfbb1b2 100644 --- a/ElvUI_SLE/locales/english.lua +++ b/ElvUI_SLE/locales/english.lua @@ -75,6 +75,9 @@ L["Select if the editbox will be above or below chat."] = true --Datatexts-- L["LFR Dragon Soul"] = true L["LFR Mogu'shan Vaults"] = true +L["LFR Heart of Fear"] = true +L["LFR Terrace of Endless Spring"] = true +L["Bosses killed: "] = true L["SLE_AUTHOR_INFO"] = "Shadow & Light Edit by Darth Predator & Repooc" L["SLE_CONTACTS"] = [=[Bug reports, suggestions and other stuff accepted via: - Private Massage on TukUI.org to Darth Predator or Repooc diff --git a/ElvUI_SLE/locales/russian.lua b/ElvUI_SLE/locales/russian.lua index 7b02ed1..e183e9b 100644 --- a/ElvUI_SLE/locales/russian.lua +++ b/ElvUI_SLE/locales/russian.lua @@ -75,6 +75,9 @@ L["Select if the editbox will be above or below chat."] = "Определяет --Datatexts-- L["LFR Dragon Soul"] = "Душа Дракона ЛФР" L["LFR Mogu'shan Vaults"] = "Подземелья Могу'шан ЛФР" +L["LFR Heart of Fear"] = "Сердце Страха ЛФР" +L["LFR Terrace of Endless Spring"] = "Терраса Вечной Весны ЛФР" +L["Bosses killed: "] = "Боссов убито: " L["SLE_AUTHOR_INFO"] = "Редакция \"Тень и Свет\" от Darth Predator и Repooc" L["SLE_CONTACTS"] = [=[При возникновении вопросов, предложений и прочего обращаться: - Личное сообщение на форуме TukUI (tukui.org), ник Darth Predator или Repooc diff --git a/ElvUI_SLE/modules/datatexts/lfr.lua b/ElvUI_SLE/modules/datatexts/lfr.lua new file mode 100644 index 0000000..40f51f4 --- /dev/null +++ b/ElvUI_SLE/modules/datatexts/lfr.lua @@ -0,0 +1,158 @@ +--LFR boss status calculations-- +local E, L, V, P, G, _ = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB, Localize Underscore +local DT = E:GetModule('DataTexts') + +--For 4 boss raid +function DT:FourKill(id) + local killNum = 0 + for i =1,4 do + _, _, isKilled = GetLFGDungeonEncounterInfo(id, i); + if ( isKilled ) then + killNum = killNum + 1 + end + end + if killNum == 4 then + GameTooltip:AddLine(L["Bosses killed: "]..killNum.."/4", RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b) + else + GameTooltip:AddLine(L["Bosses killed: "]..killNum.."/4", GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b) + end +end + +function DT:FourShift(id) + for i =1,4 do --1st part + bossName, _, isKilled, isIneligible = GetLFGDungeonEncounterInfo(id, i); + if ( isKilled ) then + GameTooltip:AddDoubleLine(bossName, BOSS_DEAD, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b); + elseif ( isIneligible ) then + GameTooltip:AddDoubleLine(bossName, BOSS_ALIVE_INELIGIBLE, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b); + else + GameTooltip:AddDoubleLine(bossName, BOSS_ALIVE, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b); + end + end +end + +--For 6 boss raid +function DT:SixKill(id1, id2) + local killNum = 0 + for i =1,3 do --1st part + _, _, isKilled = GetLFGDungeonEncounterInfo(id1, i); + if ( isKilled ) then + killNum = killNum + 1 + end + end + for i =4,6 do --2nd part + _, _, isKilled = GetLFGDungeonEncounterInfo(id2, i); + if ( isKilled ) then + killNum = killNum + 1 + end + end + if killNum == 6 then + GameTooltip:AddLine(L["Bosses killed: "]..killNum.."/6", RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b) + else + GameTooltip:AddLine(L["Bosses killed: "]..killNum.."/6", GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b) + end +end + +function DT:SixShift(id1, id2) + for i =1,3 do --1st part + bossName, _, isKilled, isIneligible = GetLFGDungeonEncounterInfo(id1, i); + if ( isKilled ) then + GameTooltip:AddDoubleLine(bossName, BOSS_DEAD, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b); + elseif ( isIneligible ) then + GameTooltip:AddDoubleLine(bossName, BOSS_ALIVE_INELIGIBLE, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b); + else + GameTooltip:AddDoubleLine(bossName, BOSS_ALIVE, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b); + end + end + for i =4,6 do --2nd part + bossName, _, isKilled, isIneligible = GetLFGDungeonEncounterInfo(id2, i); + if ( isKilled ) then + GameTooltip:AddDoubleLine(bossName, BOSS_DEAD, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b); + elseif ( isIneligible ) then + GameTooltip:AddDoubleLine(bossName, BOSS_ALIVE_INELIGIBLE, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b); + else + GameTooltip:AddDoubleLine(bossName, BOSS_ALIVE, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b); + end + end +end + +--For 8 boss raid +function DT:EightKill(id1, id2) + local killNum = 0 + for i =1,4 do --1st part + _, _, isKilled = GetLFGDungeonEncounterInfo(id1, i); + if ( isKilled ) then + killNum = killNum + 1 + end + end + for i =5,8 do --2nd part + _, _, isKilled = GetLFGDungeonEncounterInfo(id2, i); + if ( isKilled ) then + killNum = killNum + 1 + end + end + if killNum == 8 then + GameTooltip:AddLine(L["Bosses killed: "]..killNum.."/8", RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b) + else + GameTooltip:AddLine(L["Bosses killed: "]..killNum.."/8", GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b) + end +end + +function DT:EightShift(id1, id2) + for i =1,4 do --1st part + bossName, _, isKilled, isIneligible = GetLFGDungeonEncounterInfo(id1, i); + if ( isKilled ) then + GameTooltip:AddDoubleLine(bossName, BOSS_DEAD, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b); + elseif ( isIneligible ) then + GameTooltip:AddDoubleLine(bossName, BOSS_ALIVE_INELIGIBLE, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b); + else + GameTooltip:AddDoubleLine(bossName, BOSS_ALIVE, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b); + end + end + for i =5,8 do --2nd part + bossName, _, isKilled, isIneligible = GetLFGDungeonEncounterInfo(id2, i); + if ( isKilled ) then + GameTooltip:AddDoubleLine(bossName, BOSS_DEAD, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b); + elseif ( isIneligible ) then + GameTooltip:AddDoubleLine(bossName, BOSS_ALIVE_INELIGIBLE, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b); + else + GameTooltip:AddDoubleLine(bossName, BOSS_ALIVE, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b); + end + end +end + +function DT:DragonSoul(id1, id2) + GameTooltip:AddLine(L["LFR Dragon Soul"]) --Instance name + if IsShiftKeyDown() then + DT:EightShift(id1, id2) + else + DT:EightKill(id1, id2) + end +end + +function DT:Mogushan(id1, id2) + GameTooltip:AddLine(L["LFR Mogu'shan Vaults"]) --Instance name + if IsShiftKeyDown() then + DT:SixShift(id1, id2) + else + DT:SixKill(id1, id2) + end +end + +function DT:HoF(id1, id2) + GameTooltip:AddLine(L["LFR Heart of Fear"]) --Instance name + if IsShiftKeyDown() then + DT:SixShift(id1, id2) + else + DT:SixKill(id1, id2) + end +end + +function DT:ToES(id) + GameTooltip:AddLine(L["LFR Terrace of Endless Spring"]) --Instance name + if IsShiftKeyDown() then + DT:FourShift(id) + else + DT:FourKill(id) + end +end \ No newline at end of file diff --git a/ElvUI_SLE/modules/datatexts/load_datatexts.xml b/ElvUI_SLE/modules/datatexts/load_datatexts.xml index be0012f..919154a 100644 --- a/ElvUI_SLE/modules/datatexts/load_datatexts.xml +++ b/ElvUI_SLE/modules/datatexts/load_datatexts.xml @@ -1,4 +1,5 @@ +