core/menusystem: rename all instance of focus to haveFocus
This commit is contained in:
parent
a8965a8945
commit
242c877592
4 changed files with 5 additions and 5 deletions
|
@ -153,7 +153,7 @@ function FlowBox:draw()
|
||||||
for i,v in ipairs(self.widget.list) do
|
for i,v in ipairs(self.widget.list) do
|
||||||
if (i >= self.begin) and (i < self.begin + self.slots) then
|
if (i >= self.begin) and (i < self.begin + self.slots) then
|
||||||
v:draw(widgetx, widgety, self.widget.w, self.widget.h)
|
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)
|
v:drawSelected(widgetx, widgety, self.widget.w, self.widget.h)
|
||||||
else
|
else
|
||||||
v:draw(widgetx, widgety, self.widget.w, self.widget.h)
|
v:draw(widgetx, widgety, self.widget.w, self.widget.h)
|
||||||
|
|
|
@ -206,7 +206,7 @@ function GridBox:draw()
|
||||||
for i,v in ipairs(self.listSlot) do
|
for i,v in ipairs(self.listSlot) do
|
||||||
if (v.isSlave == 0) and (v.widgetID <= #self.widget.list) then
|
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)
|
--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)
|
self.widget.list[v.widgetID]:drawSelected(widgetx, widgety, self.widget.w * v.sizeW, self.widget.h * v.sizeH)
|
||||||
else
|
else
|
||||||
self.widget.list[v.widgetID]:draw(widgetx, widgety, self.widget.w * v.sizeW, self.widget.h * v.sizeH)
|
self.widget.list[v.widgetID]:draw(widgetx, widgety, self.widget.w * v.sizeW, self.widget.h * v.sizeH)
|
||||||
|
|
|
@ -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
|
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 )
|
v:mousepressed(x - v.x, y - v.y, button, istouch )
|
||||||
for j,u in ipairs(self.menus) do
|
for j,u in ipairs(self.menus) do
|
||||||
u.focus = false
|
u.haveFocus = false
|
||||||
end
|
end
|
||||||
v.focus = true
|
v.haveFocus = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -73,7 +73,7 @@ function ListBox:draw()
|
||||||
for i,v in ipairs(self.widget.list) do
|
for i,v in ipairs(self.widget.list) do
|
||||||
if (i >= self.begin) and (i < self.begin + self.slots) then
|
if (i >= self.begin) and (i < self.begin + self.slots) then
|
||||||
v:draw(self.x, widgety, self.w, self.widget.h)
|
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)
|
v:drawSelected(self.x, widgety, self.w, self.widget.h)
|
||||||
else
|
else
|
||||||
v:draw(self.x, widgety, self.w, self.widget.h)
|
v:draw(self.x, widgety, self.w, self.widget.h)
|
||||||
|
|
Loading…
Reference in a new issue