Skip to content

Commit

Permalink
- Added title bar coloring
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Jan 3, 2024
1 parent 28cc54d commit d9a02be
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
1 change: 1 addition & 0 deletions class_configs/shd_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ local _ClassConfig = {
},
['Themes'] = {
['Tank'] = {
{ element = ImGuiCol.TitleBgActive, color = { r = 0.5, g = 0.05, b = 0.05, a = .8, }, },
{ element = ImGuiCol.TableHeaderBg, color = { r = 0.5, g = 0.05, b = 0.05, a = .8, }, },
{ element = ImGuiCol.Tab, color = { r = 0.2, g = 0.05, b = 0.05, a = .8, }, },
{ element = ImGuiCol.TabActive, color = { r = 0.5, g = 0.05, b = 0.05, a = .8, }, },
Expand Down
24 changes: 11 additions & 13 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,20 @@ end

local function RGMercsGUI()
local theme = GetTheme()
local themeStylePop = 0
if openGUI and Alive() then
if theme ~= nil then
for _, t in pairs(theme) do
ImGui.PushStyleColor(t.element, t.color.r, t.color.g, t.color.b, t.color.a)
themeStylePop = themeStylePop + 1
end
end

openGUI, shouldDrawGUI = ImGui.Begin('RGMercs', openGUI)
if mq.TLO.MacroQuest.GameState() ~= "INGAME" then return end

local themeStylePop = 0

if shouldDrawGUI then
local pressed
if theme ~= nil then
for _, t in pairs(theme) do
ImGui.PushStyleColor(t.element, t.color.r, t.color.g, t.color.b, t.color.a)
themeStylePop = themeStylePop + 1
end
else
--ImGui.PushStyleColor(ImGuiCol.Text, 1.0, 1.0, 1.0, 1)
end

ImGui.Text(string.format("RGMercs [%s/%s] running for %s (%s)", RGMercConfig._version, RGMercConfig._subVersion, RGMercConfig.Globals.CurLoadedChar,
RGMercConfig.Globals.CurLoadedClass))
Expand Down Expand Up @@ -207,9 +205,6 @@ local function RGMercsGUI()

ImGui.EndTabBar();
end
if themeStylePop > 0 then
ImGui.PopStyleColor(themeStylePop)
end

ImGui.NewLine()
ImGui.NewLine()
Expand All @@ -219,6 +214,9 @@ local function RGMercsGUI()
end

ImGui.End()
if themeStylePop > 0 then
ImGui.PopStyleColor(themeStylePop)
end
end
end

Expand Down
2 changes: 1 addition & 1 deletion version.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return { commitId = 'fa5c5f5 2024-01-02' }
return { commitId = '28cc54d 2024-01-02' }

0 comments on commit d9a02be

Please sign in to comment.