diff options
Diffstat (limited to 'not/Selector.lua')
-rw-r--r-- | not/Selector.lua | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/not/Selector.lua b/not/Selector.lua index d6910fe..ed1813f 100644 --- a/not/Selector.lua +++ b/not/Selector.lua @@ -67,9 +67,11 @@ end -- @return boolean answering question function Selector:isUnique () if self.group then - -- In this case next is used to determine if table returned by call is empty. - if next(group:callEachBut(self, "getLocked")) then - return false + local locked = self.group:callEachBut(self, "getLocked") + for _,value in pairs(locked) do + if value == self:getSelected() then + return false + end end end return true @@ -108,13 +110,17 @@ function Selector:draw (scale) end love.graphics.setColor(255, 255, 255, 255) + if not self:isUnique() then + love.graphics.setColor(120, 120, 120, 255) + end love.graphics.draw(self.atlas, self.quads[self:getShapeString()][boxType], x*scale, y*scale, 0, scale, scale) - -- TODO: That is one way to draw icon for selected value. Find better one. See: `config/menus/host`. if self.icons_atlas and self.icons_quads then love.graphics.draw(self.icons_atlas, self.icons_quads[self.index], (x+2)*scale, (y+3)*scale, 0, scale, scale) end + love.graphics.setColor(255, 255, 255, 255) + if self.focused then local dy = (h-6)/2 local al, ar = self.quads.arrow_r, self.quads.arrow_l |