core/menusystem: rename all instance of focus to haveFocus

This commit is contained in:
Kazhnuz 2019-02-11 23:04:25 +01:00
parent a8965a8945
commit 242c877592
4 changed files with 5 additions and 5 deletions

View file

@ -153,7 +153,7 @@ function FlowBox:draw()
for i,v in ipairs(self.widget.list) do
if (i >= self.begin) and (i < self.begin + self.slots) then
v:draw(widgetx, widgety, self.widget.w, self.widget.h)
if self.widget.selected == i and self.focus == true then
if self.widget.selected == i and self.haveFocus == true then
v:drawSelected(widgetx, widgety, self.widget.w, self.widget.h)
else
v:draw(widgetx, widgety, self.widget.w, self.widget.h)

View file

@ -206,7 +206,7 @@ function GridBox:draw()
for i,v in ipairs(self.listSlot) do
if (v.isSlave == 0) and (v.widgetID <= #self.widget.list) then
--self.widget.list[v.widgetID]:draw(widgetx, widgety, self.widget.w * v.sizeW, self.widget.h * v.sizeH)
if self.widget.selected == v.widgetID and self.focus == true then
if self.widget.selected == v.widgetID and self.haveFocus == true then
self.widget.list[v.widgetID]:drawSelected(widgetx, widgety, self.widget.w * v.sizeW, self.widget.h * v.sizeH)
else
self.widget.list[v.widgetID]:draw(widgetx, widgety, self.widget.w * v.sizeW, self.widget.h * v.sizeH)

View file

@ -73,9 +73,9 @@ function MenuSystem:mousepressed( x, y, button, istouch )
if (x > v.x) and (x < v.x + v.w) and (y > v.y) and (y < v.y + v.h) then
v:mousepressed(x - v.x, y - v.y, button, istouch )
for j,u in ipairs(self.menus) do
u.focus = false
u.haveFocus = false
end
v.focus = true
v.haveFocus = true
end
end
end

View file

@ -73,7 +73,7 @@ function ListBox:draw()
for i,v in ipairs(self.widget.list) do
if (i >= self.begin) and (i < self.begin + self.slots) then
v:draw(self.x, widgety, self.w, self.widget.h)
if self.widget.selected == i and self.focus == true then
if self.widget.selected == i and self.haveFocus == true then
v:drawSelected(self.x, widgety, self.w, self.widget.h)
else
v:draw(self.x, widgety, self.w, self.widget.h)