Skip to content

Commit

Permalink
Merge pull request #11 from iLPdev/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
iLPdev committed Mar 4, 2022
2 parents 65d229f + ed4fd09 commit 18d182c
Showing 1 changed file with 88 additions and 29 deletions.
117 changes: 88 additions & 29 deletions prs-stats.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
PRSstats = PRSstats or {}
function PRSstats.stats()
-- local level = tonumber(gmcp.Char.Vitals.level)
local SUG = require("PRS.sug")
PRSstats.UW = Geyser.UserWindow:new({name = "Stats", titleText ="Vitals", x = "75%", y = "100", docked = true})

-- the following will watch "gmcp.Char.Vitals.hp" and "gmcp.Char.Vitals.maxhp"
-- and update itself every 250 milliseconds
-- Experience Points Gauge
XPbar = SUG:new({
name = "XP",
height = 50,
width = "95%",
updateTime = 250,
textTemplate = "  XP: |c / |m",
currentVariable = "gmcp.Char.Vitals.xp",
maxVariable = "gmcp.Char.Vitals.nl",
}, PRSstats.UW)
XPbar.front:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #3399ff, stop: 0.1 #0080ff, stop: 0.49 #0000ff, stop: 0.5 #0000cc, stop: 1 #0000ff);
border-top: 1px black solid;
border-left: 1px black solid;
border-bottom: 1px black solid;
border-radius: 7;
padding: 3px;
]])
XPbar.back:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #0066cc, stop: 0.1 #004c99, stop: 0.49 #000099, stop: 0.5 #000066, stop: 1 #000099);
border-width: 1px;
border-color: black;
border-style: solid;
border-radius: 7;
padding: 3px;
]])
XPbar.text:setStyleSheet([[
font-weight: bold;
]])

-- Hit Points Gauge
HPbar = SUG:new({
name = "HP",
y = "70",
height = 50,
width = "95%", -- everything up to here is standard Geyser.Gauge
updateTime = 250, -- this timer will update every 250ms, or 4 times a second
Expand All @@ -32,9 +59,11 @@ function PRSstats.stats()
HPbar.text:setStyleSheet([[
font-weight: bold;
]])

-- Energy Points Gauge
ENbar = SUG:new({
name = "EN",
y = 70,
y = 130,
height = 50,
width = "95%",
updateTime = 250,
Expand All @@ -59,9 +88,11 @@ function PRSstats.stats()
ENbar.text:setStyleSheet([[
font-weight: bold;
]])

-- Stamina Points Gauge
STbar = SUG:new({
name = "ST",
y = 130,
y = 190,
height = 50,
width = "95%",
updateTime = 250,
Expand All @@ -84,32 +115,60 @@ function PRSstats.stats()
STbar.text:setStyleSheet([[
font-weight: bold;
]])
XPbar = SUG:new({
name = "XP",
y = "190",
height = 50,
width = "95%",

-- Combo Points Gauge
CPbar = SUG:new({
name="CP",
y="250",
height=25,
width="95%",
updateTime = 250,
-- textTemplate = "  Level "..level.." XP: |c / |m",
textTemplate = " XP: |c / |m",
currentVariable = "gmcp.Char.Vitals.xp",
maxVariable = "gmcp.Char.Vitals.nl",
textTemplate = "  Combo: |c / |m (|p%)",
currentVariable = "gmcp.Char.Vitals.combo",
maxcombo = 100,
maxVariable = "maxcombo",
}, PRSstats.UW)
XPbar.front:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #3399ff, stop: 0.1 #0080ff, stop: 0.49 #0000ff, stop: 0.5 #0000cc, stop: 1 #0000ff);
border-top: 1px black solid;
border-left: 1px black solid;
border-bottom: 1px black solid;
border-radius: 7;
padding: 3px;
]])
XPbar.back:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #0066cc, stop: 0.1 #004c99, stop: 0.49 #000099, stop: 0.5 #000066, stop: 1 #000099);
border-width: 1px;
border-color: black;
border-style: solid;
border-radius: 7;
padding: 3px;
CPbar.front:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #f04141, stop: 0.1 #ef2929, stop: 0.49 #cc0000, stop: 0.5 #a40000, stop: 1 #cc0000);
border-top: 1px black solid;
border-left: 1px black solid;
border-bottom: 1px black solid;
border-radius: 7;
padding: 3px;]])
CPbar.back:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bd3333, stop: 0.1 #bd2020, stop: 0.49 #990000, stop: 0.5 #700000, stop: 1 #990000);
border-width: 1px;
border-color: black;
border-style: solid;
border-radius: 7;
padding: 3px;]])
CPbar.text:setStyleSheet([[
font-weight: bold;
]])
XPbar.text:setStyleSheet([[

-- Rage Points Gauge
RPbar = SUG:new({
name="RP",
y="280",
height=25,
width="95%",
updateTime = 250,
textTemplate = "  Rage: |c / |m (|p%)",
currentVariable = "gmcp.Char.Vitals.rage",
maxrage = 100,
maxVariable = "maxrage",
}, PRSstats.UW)
RPbar.front:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #f04141, stop: 0.1 #ef2929, stop: 0.49 #cc0000, stop: 0.5 #a40000, stop: 1 #cc0000);
border-top: 1px black solid;
border-left: 1px black solid;
border-bottom: 1px black solid;
border-radius: 7;
padding: 3px;]])
RPbar.back:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bd3333, stop: 0.1 #bd2020, stop: 0.49 #990000, stop: 0.5 #700000, stop: 1 #990000);
border-width: 1px;
border-color: black;
border-style: solid;
border-radius: 7;
padding: 3px;]])
RPbar.text:setStyleSheet([[
font-weight: bold;
]])
]])
end

0 comments on commit 18d182c

Please sign in to comment.