Skip to content

Commit

Permalink
bard driver and ui cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Jan 1, 2024
1 parent 20a658f commit 30196d7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/brd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Module.ResolvedActionMap = {}
Module.TempSettings = {}

Module.DefaultCategories = Set.new({})
for _, v in pairs(brdClassConfig.DefaultConfig) do
for _, v in pairs(brdClassConfig.DefaultConfig or {}) do
if v.Type ~= "Custom" then
Module.DefaultCategories:add(v.Category)
end
Expand Down
2 changes: 1 addition & 1 deletion modules/shd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Module.ResolvedActionMap = {}
Module.TempSettings = {}

Module.DefaultCategories = Set.new({})
for _, v in pairs(shdClassConfig.DefaultConfig) do
for _, v in pairs(shdClassConfig.DefaultConfig or {}) do
if v.Type ~= "Custom" then
Module.DefaultCategories:add(v.Category)
end
Expand Down
17 changes: 15 additions & 2 deletions utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1634,17 +1634,25 @@ function Utils.RenderOptionToggle(id, text, on)
local toggled = false
local state = on
ImGui.PushID(id .. "_togg_btn")

ImGui.PushStyleColor(ImGuiCol.ButtonActive, 1.0, 1.0, 1.0, 0)
ImGui.PushStyleColor(ImGuiCol.ButtonHovered, 1.0, 1.0, 1.0, 0)
ImGui.PushStyleColor(ImGuiCol.Button, 1.0, 1.0, 1.0, 0)

if on then
if ImGui.SmallButton(ICONS.FA_TOGGLE_ON) then
ImGui.PushStyleColor(ImGuiCol.Text, 0.3, 1.0, 0.3, 0.9)
if ImGui.Button(ICONS.FA_TOGGLE_ON) then
toggled = true
state = false
end
else
if ImGui.SmallButton(ICONS.FA_TOGGLE_OFF) then
ImGui.PushStyleColor(ImGuiCol.Text, 1.0, 0.3, 0.3, 0.8)
if ImGui.Button(ICONS.FA_TOGGLE_OFF) then
toggled = true
state = true
end
end
ImGui.PopStyleColor(4)
ImGui.PopID()
ImGui.SameLine()
ImGui.Text(text)
Expand All @@ -1654,7 +1662,12 @@ end

function Utils.RenderOptionNumber(id, text, cur, min, max)
ImGui.PushID("##num_spin_" .. id)
ImGui.PushStyleColor(ImGuiCol.ButtonActive, 0.5, 0.5, 0.5, 1.0)
ImGui.PushStyleColor(ImGuiCol.ButtonHovered, 0.5, 0.5, 0.5, 0.5)
ImGui.PushStyleColor(ImGuiCol.Button, 1.0, 1.0, 1.0, 0)
ImGui.PushStyleColor(ImGuiCol.FrameBg, 1.0, 1.0, 1.0, 0)
local input, changed = ImGui.InputInt(text, cur)
ImGui.PopStyleColor(4)
ImGui.PopID()

if input > max then input = max 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 = 'e24c232 2024-01-01' }
return { commitId = '20a658f 2024-01-01' }

0 comments on commit 30196d7

Please sign in to comment.