Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight borders for changed config options in config tab #5717

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Classes/CheckBoxControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ function CheckBoxClass:Draw(viewPort, noTooltip)
SetDrawColor(0.33, 0.33, 0.33)
elseif mOver then
SetDrawColor(1, 1, 1)
elseif self.borderFunc then
r, g, b = self.borderFunc()
SetDrawColor(r, g, b)
else
SetDrawColor(0.5, 0.5, 0.5)
end
Expand Down
17 changes: 16 additions & 1 deletion src/Classes/ConfigTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,23 @@ local ConfigTabClass = newClass("ConfigTab", "UndoHandler", "ControlHost", "Cont
end
end

local innerShown = control.shown
if not varData.doNotHighlight then
control.borderFunc = function()
local shown = type(innerShown) == "boolean" and innerShown or innerShown()
local cur = self.input[varData.var]
local def = self:GetDefaultState(varData.var, type(cur))
if cur ~= nil and cur ~= def then
if not shown then
return 0.753, 0.502, 0.502
end
return 0.451, 0.576, 0.702
end
return 0.5, 0.5, 0.5
end
end

if not varData.hideIfInvalid then
local innerShown = control.shown
control.shown = function()
local shown = type(innerShown) == "boolean" and innerShown or innerShown()
local cur = self.input[varData.var]
Expand Down
3 changes: 3 additions & 0 deletions src/Classes/DropDownControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ function DropDownClass:Draw(viewPort, noTooltip)
SetDrawColor(0.33, 0.33, 0.33)
elseif mOver or self.dropped then
SetDrawColor(1, 1, 1)
elseif self.borderFunc then
r, g, b = self.borderFunc()
SetDrawColor(r, g, b)
else
SetDrawColor(0.5, 0.5, 0.5)
end
Expand Down
3 changes: 3 additions & 0 deletions src/Classes/EditControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ function EditClass:Draw(viewPort, noTooltip)
SetDrawColor(0.33, 0.33, 0.33)
elseif mOver then
SetDrawColor(1, 1, 1)
elseif self.borderFunc then
r, g, b = self.borderFunc()
SetDrawColor(r, g, b)
else
SetDrawColor(0.5, 0.5, 0.5)
end
Expand Down
4 changes: 2 additions & 2 deletions src/Modules/ConfigOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,7 @@ Huge sets the radius to 11.
end

modList:NewMod("BossSkillActive", "FLAG", true, "Config")

-- boss specific mods
if val == "Atziri Flameblast" and isUber then
enemyModList:NewMod("Damage", "INC", 60, "Alluring Abyss Map Mod")
Expand Down Expand Up @@ -1817,7 +1817,7 @@ Huge sets the radius to 11.

-- Section: Custom mods
{ section = "Custom Modifiers", col = 1 },
{ var = "customMods", type = "text", label = "",
{ var = "customMods", type = "text", label = "", doNotHighlight = true,
apply = function(val, modList, enemyModList, build)
for line in val:gmatch("([^\n]*)\n?") do
local strippedLine = StripEscapes(line):gsub("^[%s?]+", ""):gsub("[%s?]+$", "")
Expand Down