Skip to content

Commit

Permalink
Merge branch 'shagu:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Gescht authored Jul 14, 2024
2 parents fea2552 + 3e19e5b commit 5797f38
Show file tree
Hide file tree
Showing 36 changed files with 1,376 additions and 831 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/close-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Close inactive issues
on:
workflow_dispatch:
schedule:
- cron: "30 1 * * *"

jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
operations-per-run: 100
days-before-issue-stale: 30
days-before-issue-close: 14
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}
68 changes: 53 additions & 15 deletions api/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1212,26 +1212,64 @@ end
-- [ GetColoredTime ] --
-- 'remaining' the time in seconds that should be converted
-- return a colored string including a time unit (m/h/d)
local color_day, color_hour, color_minute, color_low, color_normal
function pfUI.api.GetColoredTimeString(remaining)
if not remaining then return "" end
if remaining > 356400 then -- Show days if remaining is > 99 Hours (99 * 60 * 60)
local r,g,b,a = pfUI.api.GetStringColor(C.appearance.cd.daycolor)
return pfUI.api.rgbhex(r,g,b) .. round(remaining / 86400) .. "|rd"
elseif remaining > 5940 then -- Show hours if remaining is > 99 Minutes (99 * 60)
local r,g,b,a = pfUI.api.GetStringColor(C.appearance.cd.hourcolor)
return pfUI.api.rgbhex(r,g,b) .. round(remaining / 3600) .. "|rh"
elseif remaining > 99 then -- Show minutes if remaining is > 99 Seconds (99)
local r,g,b,a = pfUI.api.GetStringColor(C.appearance.cd.minutecolor)
return pfUI.api.rgbhex(r,g,b) .. round(remaining / 60) .. "|rm"

-- Show days if remaining is > 99 Hours (99 * 60 * 60)
if remaining > 356400 then
if not color_day then
local r,g,b,a = pfUI.api.GetStringColor(C.appearance.cd.daycolor)
color_day = pfUI.api.rgbhex(r,g,b)
end

return color_day .. round(remaining / 86400) .. "|rd"

-- Show hours if remaining is > 99 Minutes (99 * 60)
elseif remaining > 5940 then
if not color_hour then
local r,g,b,a = pfUI.api.GetStringColor(C.appearance.cd.hourcolor)
color_hour = pfUI.api.rgbhex(r,g,b)
end

return color_hour .. round(remaining / 3600) .. "|rh"

-- Show minutes if remaining is > 99 Seconds (99)
elseif remaining > 99 then
if not color_minute then
local r,g,b,a = pfUI.api.GetStringColor(C.appearance.cd.minutecolor)
color_minute = pfUI.api.rgbhex(r,g,b)
end

return color_minute .. round(remaining / 60) .. "|rm"

-- Show milliseconds on low
elseif remaining <= 5 and pfUI_config.appearance.cd.milliseconds == "1" then
local r,g,b,a = pfUI.api.GetStringColor(C.appearance.cd.lowcolor)
return pfUI.api.rgbhex(r,g,b) .. string.format("%.1f", round(remaining,1))
if not color_low then
local r,g,b,a = pfUI.api.GetStringColor(C.appearance.cd.lowcolor)
color_low = pfUI.api.rgbhex(r,g,b)
end

return color_low .. string.format("%.1f", round(remaining,1))

-- Show seconds on low
elseif remaining <= 5 then
local r,g,b,a = pfUI.api.GetStringColor(C.appearance.cd.lowcolor)
return pfUI.api.rgbhex(r,g,b) .. round(remaining)
if not color_low then
local r,g,b,a = pfUI.api.GetStringColor(C.appearance.cd.lowcolor)
color_low = pfUI.api.rgbhex(r,g,b)
end

return color_low .. round(remaining)

-- Show seconds on normal
elseif remaining >= 0 then
local r, g, b, a = pfUI.api.GetStringColor(C.appearance.cd.normalcolor)
return pfUI.api.rgbhex(r,g,b) .. round(remaining)
if not color_normal then
local r, g, b, a = pfUI.api.GetStringColor(C.appearance.cd.normalcolor)
color_normal = pfUI.api.rgbhex(r,g,b)
end
return color_normal .. round(remaining)

-- Return empty
else
return ""
end
Expand Down
30 changes: 17 additions & 13 deletions api/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ setfenv(1, pfUI:GetEnvironment())
function pfUI:UpdateConfig(group, subgroup, entry, value)
-- create empty config if not existing
if not pfUI_config then
pfUI_config = {}
_G.pfUI_config = {}
end

-- check for missing config groups
Expand Down Expand Up @@ -178,6 +178,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("appearance", "worldmap", "mapreveal_color", ".4,.4,.4,1")
pfUI:UpdateConfig("appearance", "worldmap", "mapexploration", "0")
pfUI:UpdateConfig("appearance", "worldmap", "groupcircles", "3")
pfUI:UpdateConfig("appearance", "worldmap", "colornames", "1")

pfUI:UpdateConfig("loot", nil, "autoresize", "1")
pfUI:UpdateConfig("loot", nil, "autopickup", "1")
Expand Down Expand Up @@ -699,6 +700,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("nameplates", nil, "critters", "1")
pfUI:UpdateConfig("nameplates", nil, "totems", "1")
pfUI:UpdateConfig("nameplates", nil, "totemicons", "0")
pfUI:UpdateConfig("nameplates", nil, "showguildname", "0")

pfUI:UpdateConfig("nameplates", nil, "outfriendly", "0")
pfUI:UpdateConfig("nameplates", nil, "outfriendlynpc", "1")
Expand Down Expand Up @@ -755,14 +757,16 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("questlog", nil, "showQuestLevels", "0")
pfUI:UpdateConfig("thirdparty", nil, "chatbg", "1")
pfUI:UpdateConfig("thirdparty", nil, "showmeter", "0")
pfUI:UpdateConfig("thirdparty", "dpsmate", "skin", "1")
pfUI:UpdateConfig("thirdparty", "dpsmate", "dock", "1")
pfUI:UpdateConfig("thirdparty", "shagudps", "skin", "1")
pfUI:UpdateConfig("thirdparty", "shagudps", "dock", "1")
pfUI:UpdateConfig("thirdparty", "swstats", "skin", "1")
pfUI:UpdateConfig("thirdparty", "swstats", "dock", "1")
pfUI:UpdateConfig("thirdparty", "ktm", "skin", "1")
pfUI:UpdateConfig("thirdparty", "ktm", "dock", "1")
pfUI:UpdateConfig("thirdparty", "dpsmate", "skin", "0")
pfUI:UpdateConfig("thirdparty", "dpsmate", "dock", "0")
pfUI:UpdateConfig("thirdparty", "shagudps", "skin", "0")
pfUI:UpdateConfig("thirdparty", "shagudps", "dock", "0")
pfUI:UpdateConfig("thirdparty", "swstats", "skin", "0")
pfUI:UpdateConfig("thirdparty", "swstats", "dock", "0")
pfUI:UpdateConfig("thirdparty", "ktm", "skin", "0")
pfUI:UpdateConfig("thirdparty", "ktm", "dock", "0")
pfUI:UpdateConfig("thirdparty", "twt", "skin", "0")
pfUI:UpdateConfig("thirdparty", "twt", "dock", "0")
pfUI:UpdateConfig("thirdparty", "wim", "enable", "1")
pfUI:UpdateConfig("thirdparty", "healcomm", "enable", "1")
pfUI:UpdateConfig("thirdparty", "sortbags", "enable", "1")
Expand All @@ -783,10 +787,10 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("thirdparty", "ackis", "enable", "1")
pfUI:UpdateConfig("thirdparty", "bcepgp", "enable", "1")
pfUI:UpdateConfig("thirdparty", "noteit", "enable", "1")
pfUI:UpdateConfig("thirdparty", "recount", "skin", "1")
pfUI:UpdateConfig("thirdparty", "recount", "dock", "1")
pfUI:UpdateConfig("thirdparty", "omen", "skin", "1")
pfUI:UpdateConfig("thirdparty", "omen", "dock", "1")
pfUI:UpdateConfig("thirdparty", "recount", "skin", "0")
pfUI:UpdateConfig("thirdparty", "recount", "dock", "0")
pfUI:UpdateConfig("thirdparty", "omen", "skin", "0")
pfUI:UpdateConfig("thirdparty", "omen", "dock", "0")

pfUI:UpdateConfig("position", nil, nil, nil)
pfUI:UpdateConfig("disabled", nil, nil, nil)
Expand Down
Loading

0 comments on commit 5797f38

Please sign in to comment.