From 5ca0cb7dc62e0725e95d99f996bd2936b54df042 Mon Sep 17 00:00:00 2001 From: MilleXIV Date: Sat, 27 Aug 2016 19:09:23 -0400 Subject: [PATCH] System module, fixing some incombat errors --- locales/enUS.lua | 8 + modules/clock.lua | 7 +- modules/currency.lua | 20 +- modules/load_modules.xml | 1 + modules/micromenu.lua | 21 ++ modules/old/system.lua | 228 +++++++++++++++++++++ modules/system.lua | 509 +++++++++++++++++++++++++++------------------- modules/travel.lua | 7 + 8 files changed, 584 insertions(+), 217 deletions(-) create mode 100644 modules/old/system.lua diff --git a/locales/enUS.lua b/locales/enUS.lua index 4077283..352e358 100644 --- a/locales/enUS.lua +++ b/locales/enUS.lua @@ -83,3 +83,11 @@ L['Currency Select'] = true; L['First Currency'] = true; L['Second Currency'] = true; L['Third Currency'] = true; + +L['System'] = true; +L['Show World Ping'] = true; +L['Number of Addons To Show'] = true; +L['Addons to Show in Tooltip'] = true; +L['Show All Addons in Tooltip with Shift'] = true; +L['Memory Usage'] = true; +L['Garbage Collect'] = true; diff --git a/modules/clock.lua b/modules/clock.lua index 0835524..ab3efe9 100644 --- a/modules/clock.lua +++ b/modules/clock.lua @@ -65,8 +65,13 @@ function ClockModule:Refresh() if self.clockFrame == nil then return; end if not db.modules.clock.enabled then return; end + if InCombatLockdown() then + self:SetClockColor() + return + end + self.clockText:SetFont(xb.LSM:Fetch(xb.LSM.MediaType.FONT, db.text.font), db.modules.clock.fontSize) - ClockModule:SetClockColor() + self:SetClockColor() self.clockFrame:SetSize(self.clockText:GetStringWidth(), self.clockText:GetStringHeight()) self.clockFrame:SetPoint('CENTER') diff --git a/modules/currency.lua b/modules/currency.lua index 2dd4f2b..08f774e 100644 --- a/modules/currency.lua +++ b/modules/currency.lua @@ -32,7 +32,7 @@ end function CurrencyModule:OnEnable() if self.currencyFrame == nil then - self.currencyFrame = CreateFrame("FRAME", 'XIV_currencyFrame', xb:GetFrame('goldFrame')) + self.currencyFrame = CreateFrame("FRAME", 'XIV_currencyFrame', xb:GetFrame('clockFrame')) xb:RegisterFrame('currencyFrame', self.currencyFrame) end @@ -49,6 +49,18 @@ function CurrencyModule:OnDisable() end function CurrencyModule:Refresh() + + xb.constants.playerLevel = UnitLevel("player") + if InCombatLockdown() then + self.xpBar:SetMinMaxValues(0, UnitXPMax('player')) + self.xpBar:SetValue(UnitXP('player')) + self.xpText:SetText(string.upper(LEVEL..' '..UnitLevel("player")..' '..UnitClass('player'))) + self:RegisterEvent('PLAYER_REGEN_ENABLED', function() + self:Refresh() + self:UnregisterEvent('PLAYER_REGEN_ENABLED') + end) + return + end local db = xb.db.profile if self.currencyFrame == nil then return; end if not db.modules.currency.enabled then return; end @@ -70,7 +82,7 @@ function CurrencyModule:Refresh() self.xpText:SetFont(xb.LSM:Fetch(xb.LSM.MediaType.FONT, db.text.font), textHeight) self.xpText:SetTextColor(db.color.inactive.r, db.color.inactive.g, db.color.inactive.b, db.color.inactive.a) - self.xpText:SetText(string.upper(LEVEL..' '..tostring(xb.constants.playerLevel)..' '..UnitClass('player'))) + self.xpText:SetText(string.upper(LEVEL..' '..UnitLevel("player")..' '..UnitClass('player'))) self.xpText:SetPoint('TOPLEFT', self.xpIcon, 'TOPRIGHT', 5, 0) self.xpBar:SetStatusBarTexture(1, 1, 1) @@ -86,8 +98,6 @@ function CurrencyModule:Refresh() self.xpBarBg:SetAllPoints() self.xpBarBg:SetColorTexture(db.color.inactive.r, db.color.inactive.g, db.color.inactive.b, db.color.inactive.a) - --self.xpBar = self.xpBar or CreateFrame('STATUSBAR', nil, self.xpFrame) - --self.xpBarBg = self.xpBarBg or self.xpBar:CreateTexture(nil, 'BACKGROUND') self.currencyFrame:SetSize(iconSize + self.xpText:GetStringWidth() + 5, xb:GetHeight()) self.xpFrame:SetAllPoints() self.xpFrame:Show() @@ -105,7 +115,7 @@ function CurrencyModule:Refresh() end -- show currencies --self.currencyFrame:SetSize(self.goldButton:GetSize()) - self.currencyFrame:SetPoint('RIGHT', self.currencyFrame:GetParent(), 'LEFT', -(db.general.moduleSpacing), 0) + self.currencyFrame:SetPoint('LEFT', self.currencyFrame:GetParent(), 'RIGHT', db.general.moduleSpacing, 0) end function CurrencyModule:StyleCurrencyFrame(curId, i) diff --git a/modules/load_modules.xml b/modules/load_modules.xml index 9b18e8a..df85e5f 100644 --- a/modules/load_modules.xml +++ b/modules/load_modules.xml @@ -6,4 +6,5 @@