Minor UI tweaks

Sasky [04-03-15 - 06:55]
Minor UI tweaks
Filename
ChampionBar.lua
EnlightenmentPoolBar.lua
diff --git a/ChampionBar.lua b/ChampionBar.lua
index 1fc237e..a5365f8 100644
--- a/ChampionBar.lua
+++ b/ChampionBar.lua
@@ -17,6 +17,25 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
   ============================================================================]]

+--[[============================================================================
+  This file is a part of ChampionBar
+
+  Copyright (C) 2015 Scott Yeskie (Sasky)
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  ============================================================================]]
+
 --[[TODO: Fix animation at beginning
 Old VPbar values get cached from the initial and show a levelup to the value.

@@ -101,10 +120,10 @@ function ChampionBar.addLines()
     ChampionBar.lines = {}
     for i=1,11 do
         local line = WINDOW_MANAGER:CreateControl("ChampionBar_CPLine"..i, parent, CT_LINE)
-        local offset = ChampionBar.cpCurve(i*100000, ENLIGHTENMENT_MAX)/ENLIGHTENMENT_MAX*maxwidth-1
+        local offset = ChampionBar.cpCurve(i*100000, ENLIGHTENMENT_MAX)/ENLIGHTENMENT_MAX*maxwidth-3
         line:SetAnchor(TOPLEFT, parent, TOPLEFT, offset, 0)
         line:SetAnchor(BOTTOMLEFT, parent, BOTTOMLEFT, offset, 0)
-        line:SetThickness(1)
+        line:SetThickness(2)
         line:SetColor(linecolor:UnpackRGBA())
         line:SetDrawLayer(DL_OVERLAY)
         table.insert(ChampionBar.lines, line)
@@ -112,10 +131,16 @@ function ChampionBar.addLines()

 end

+function ChampionBar.onLevelup(_, unit, vr)
+    if unit == "player" and vr == 14 then
+        ChampionBar.init()
+    end
+end
+
 function ChampionBar.init()
     --Only show for max VR characters
     if GetUnitLevel("player") ~= 50 or GetUnitVeteranRank("player") ~= 14 then
-        --TODO: Add handler for levelup for if hit VR14
+        EVENT_MANAGER:RegisterForEvent("ChampionBar", EVENT_VETERAN_RANK_UPDATE, ChampionBar.onLevelup)
         return
     end
     if PLAYER_PROGRESS_BAR.barTypeClasses then
diff --git a/EnlightenmentPoolBar.lua b/EnlightenmentPoolBar.lua
index 767b34e..5b78c04 100644
--- a/EnlightenmentPoolBar.lua
+++ b/EnlightenmentPoolBar.lua
@@ -17,6 +17,25 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
   ============================================================================]]

+--[[============================================================================
+  This file is a part of ChampionBar
+
+  Copyright (C) 2015 Scott Yeskie (Sasky)
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  ============================================================================]]
+
 ---
 --- Create new type for Enlightenment Pool
 ---
@@ -38,7 +57,7 @@ end
 function EPBarType:Initialize()
     self.barGradient = { ZO_ColorDef:New("EEFF66"), ZO_ColorDef:New("EEFF00") }
     self.levelTypeText = GetString(SI_EXPERIENCE_CHAMPION_RANK_LABEL)
-    self.tooltipCurrentMaxFormat = ZO_CommaDelimitNumber(ENLIGHTENMENT_MAX)
+    self.tooltipCurrentMaxFormat = ""--ZO_CommaDelimitNumber(ENLIGHTENMENT_MAX)
     self.icon = "EsoUI/Art/Champion/champion_points_health_icon-HUD-32.dds"
 end

@@ -77,7 +96,7 @@ function EPBarType:GetEnlightenedTooltip()
         "/",
         ZO_CommaDelimitNumber(self:GetLevelSize()),
         "\n(",
-        math.floor(ep/EP_PER_CHAMPION_POINT)/10, --CP
+        math.floor(ep/10000)/10, --CP
         " ",
         GetString(SI_CHAMPION_POINTS),
         ")"