Skip to content
Snippets Groups Projects
Commit 900d8239 authored by dg's avatar dg
Browse files

Added scrollbars to most dialogs along with mouse wheel support

git-svn-id: http://svn.net-core.org/repos/t-engine4@1289 51575b47-30f0-44d4-a5cc-537603b46e54
parent 3e497bd5
No related branches found
No related tags found
No related merge requests found
Showing
with 107 additions and 44 deletions
......@@ -337,12 +337,18 @@ function _M:drawHBorder(s, x, y, h)
end
end
function _M:drawSelectionList(s, x, y, hskip, list, sel, prop, scroll, max, color, selcolor, max_size, cutoff_size)
function _M:drawSelectionList(s, x, y, hskip, list, sel, prop, scroll, max, color, selcolor, max_size, cutoff_size, scrollbar)
selcolor = selcolor or {0,255,255}
color = color or {255,255,255}
max = max or 99999
scroll = util.bound(scroll or 1, 1, #list)
if scrollbar then
if max_size then max_size = max_size - 6 end
if cutoff_size then cutoff_size = cutoff_size - 6 end
end
local by = y
for i = scroll, math.min(#list, scroll + max - 1) do
local v = list[i]
local vc = nil
......@@ -369,4 +375,11 @@ function _M:drawSelectionList(s, x, y, hskip, list, sel, prop, scroll, max, colo
end
end
end
if not scrollbar or sel < 1 then return end
local size = y - 4 - by
for j = by, y - 4 do
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "border_4.png"), x + cutoff_size - 4, j)
end
self:drawWBorder(s, x + cutoff_size - 3, by + sel * size / #list, 6)
end
......@@ -45,7 +45,7 @@ function _M:init()
EXIT = function() game:unregisterDialog(self) end,
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then game:unregisterDialog(self) end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
{ x=2, y=5, w=350, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty, event)
self.changed = true
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
......
......@@ -46,7 +46,7 @@ function _M:init(actions)
EXIT = function() game:unregisterDialog(self) end,
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then game:unregisterDialog(self) end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
{ x=2, y=5, w=350, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty, event)
self.changed = true
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
......
......@@ -59,7 +59,7 @@ function _M:init(title, prompt, act)
end,
}
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then game:unregisterDialog(self) end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
}
end
......
......@@ -53,7 +53,7 @@ function _M:init(title, text, min, max, action)
end
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then game:unregisterDialog(self) end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
}
end
......
......@@ -49,17 +49,22 @@ function _M:init(key_source)
end,
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then game:unregisterDialog(self) end end},
{ x=2, y=5, w=600, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty)
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
{ x=2, y=5, w=600, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty, event)
if tx < 430 then
self.selcol = 1
else
self.selcol = 2
end
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
if button ~= "wheelup" and button ~= "wheeldown" then
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
end
self.changed = true
if button == "left" then self:use()
elseif button == "right" then
if button == "left" and event == "button" then self:use()
elseif button == "right" and event == "button" then
elseif button == "wheelup" and event == "button" then self.key:triggerVirtual("MOVE_UP")
elseif button == "wheeldown" and event == "button" then self.key:triggerVirtual("MOVE_DOWN")
end
end },
}
......@@ -167,5 +172,5 @@ function _M:drawDialog(s)
self:drawSelectionList(s, 2, 5, self.font_h, self.list, self.sel, "name", self.scroll, self.max)
self:drawSelectionList(s, 230, 5, self.font_h, self.list, self.sel, "b1", self.scroll, self.max, col, self.selcol == 1 and selcol or col)
self:drawSelectionList(s, 430, 5, self.font_h, self.list, self.sel, "b2", self.scroll, self.max, col, self.selcol == 2 and selcol or col)
self:drawSelectionList(s, 430, 5, self.font_h, self.list, self.sel, "b2", self.scroll, self.max, col, self.selcol == 2 and selcol or col, nil, self.iw - 430, true)
end
......@@ -41,10 +41,13 @@ function _M:init(title)
EXIT = function() game:unregisterDialog(self) end,
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then game:unregisterDialog(self) end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
{ x=2, y=5, w=350, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty)
self.changed = true
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
if button == "wheelup" and event == "button" then self.key:triggerVirtual("MOVE_UP")
elseif button == "wheeldown" and event == "button" then self.key:triggerVirtual("MOVE_DOWN")
end
end },
}
end
......@@ -79,6 +82,6 @@ function _M:drawDialog(s)
h = h + self.font:lineSkip()
end
self:drawSelectionList(s, 2, 5, self.font_h, self.list, self.sel, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5)
self:drawSelectionList(s, 2, 5, self.font_h, self.list, self.sel, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5, true)
self.changed = false
end
......@@ -89,7 +89,7 @@ function _M:init(title, actor, filter, action)
EXIT = function() game:unregisterDialog(self) end,
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then game:unregisterDialog(self) end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
{ x=2, y=5, w=self.iw, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty, event)
if tx < self.iw / 2 then
self.list = self.equip_list
......@@ -195,8 +195,8 @@ function _M:drawDialog(s)
h = h + self.font:lineSkip()
end
self:drawSelectionList(s, 2, 5, self.font_h, self.equip_list, self.list == self.equip_list and self.sel or -1, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5)
self:drawSelectionList(s, 2, 5, self.font_h, self.equip_list, self.list == self.equip_list and self.sel or -1, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5, true)
self:drawHBorder(s, self.iw / 2, 2, sh - 4)
self:drawSelectionList(s, self.iw / 2 + 5, 5, self.font_h, self.inven_list, self.list == self.inven_list and self.sel or -1, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5)
self:drawSelectionList(s, self.iw / 2 + 5, 5, self.font_h, self.inven_list, self.list == self.inven_list and self.sel or -1, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5, true)
self.changed = false
end
......@@ -51,9 +51,13 @@ function _M:init(title, actor, filter, action)
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then game:unregisterDialog(self) end end},
{ x=2, y=5, w=350, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty, event)
self.changed = true
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
if button ~= "wheelup" and button ~= "wheeldown" then
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
end
if button == "left" and event == "button" then self:use()
elseif button == "right" and event == "button" then
elseif button == "wheelup" and event == "button" then self.key:triggerVirtual("MOVE_UP")
elseif button == "wheeldown" and event == "button" then self.key:triggerVirtual("MOVE_DOWN")
end
end },
}
......@@ -119,6 +123,6 @@ Mouse: #00FF00#Left click#FFFFFF# to use.
end
-- Talents
self:drawSelectionList(s, 2, 5, self.font_h, self.list, self.sel, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5)
self:drawSelectionList(s, 2, 5, self.font_h, self.list, self.sel, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5, true)
self.changed = false
end
......@@ -86,12 +86,17 @@ function _M:init(title, inven, filter, action, actor)
EXIT = function() game:unregisterDialog(self) end,
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then game:unregisterDialog(self) end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
{ x=2, y=5, w=350, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty, event)
if button ~= "wheelup" and button ~= "wheeldown" then
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
end
self.changed = true
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
if button == "left" and event == "button" then self:use()
elseif button == "right" and event == "button" then
elseif button == "wheelup" and event == "button" then self.key:triggerVirtual("MOVE_UP")
elseif button == "wheeldown" and event == "button" then self.key:triggerVirtual("MOVE_DOWN")
end
end },
}
......@@ -161,6 +166,6 @@ Mouse: #00FF00#Left click#FFFFFF# to use.
end
-- Talents
self:drawSelectionList(s, 2, 5, self.font_h, self.list, self.sel, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5)
self:drawSelectionList(s, 2, 5, self.font_h, self.list, self.sel, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5, true)
self.changed = false
end
......@@ -49,12 +49,17 @@ function _M:init(title, x, y, filter, action)
EXIT = function() game:unregisterDialog(self) end,
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then game:unregisterDialog(self) end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
{ x=2, y=5, w=350, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty, event)
if button ~= "wheelup" and button ~= "wheeldown" then
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
end
self.changed = true
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
if button == "left" and event == "button" then self:use()
elseif button == "right" and event == "button" then
elseif button == "wheelup" and event == "button" then self.key:triggerVirtual("MOVE_UP")
elseif button == "wheeldown" and event == "button" then self.key:triggerVirtual("MOVE_DOWN")
end
end },
}
......@@ -123,6 +128,6 @@ Mouse: #00FF00#Left click#FFFFFF# to pickup.
end
-- Talents
self:drawSelectionList(s, 2, 5, self.font_h, self.list, self.sel, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5)
self:drawSelectionList(s, 2, 5, self.font_h, self.list, self.sel, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5, true)
self.changed = false
end
......@@ -47,12 +47,13 @@ function _M:init(actor)
EXIT = function() game:unregisterDialog(self) end,
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then game:unregisterDialog(self) end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
{ x=2, y=5, w=350, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty, event)
self.changed = true
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
if button == "left" and event == "button" then
elseif button == "right" and event == "button" then
if button == "wheelup" and event == "button" then self.key:triggerVirtual("MOVE_UP")
elseif button == "wheeldown" and event == "button" then self.key:triggerVirtual("MOVE_DOWN")
end
end },
}
......@@ -102,6 +103,6 @@ function _M:drawDialog(s)
end
-- Talents
self:drawSelectionList(s, 2, 5, self.font_h, self.list, self.sel, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5)
self:drawSelectionList(s, 2, 5, self.font_h, self.list, self.sel, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5, true)
self.changed = false
end
......@@ -54,17 +54,22 @@ function _M:init(title, store_inven, actor_inven, store_filter, actor_filter, ac
EXIT = function() game:unregisterDialog(self) end,
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then game:unregisterDialog(self) end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
{ x=2, y=5, w=self.iw, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty, event)
if tx < self.iw / 2 then
self.list = self.store_list
else
self.list = self.actor_list
end
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
if button ~= "wheelup" and button ~= "wheeldown" then
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
end
self.changed = true
if button == "left" and event == "button" then self:use()
elseif button == "right" and event == "button" then
elseif button == "wheelup" and event == "button" then self.key:triggerVirtual("MOVE_UP")
elseif button == "wheeldown" and event == "button" then self.key:triggerVirtual("MOVE_DOWN")
end
end },
}
......@@ -133,8 +138,8 @@ function _M:drawDialog(s)
h = h + self.font:lineSkip()
end
self:drawSelectionList(s, 2, 5, self.font_h, self.store_list, self.list == self.store_list and self.sel or -1, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5)
self:drawSelectionList(s, 2, 5, self.font_h, self.store_list, self.list == self.store_list and self.sel or -1, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5, true)
self:drawHBorder(s, self.iw / 2, 2, sh - 4)
self:drawSelectionList(s, self.iw / 2 + 5, 5, self.font_h, self.actor_list, self.list == self.actor_list and self.sel or -1, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5)
self:drawSelectionList(s, self.iw / 2 + 5, 5, self.font_h, self.actor_list, self.list == self.actor_list and self.sel or -1, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5, true)
self.changed = false
end
......@@ -47,7 +47,7 @@ function _M:init()
EXIT = function() game:unregisterDialog(self) end,
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then game:unregisterDialog(self) end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
{ x=2, y=5, w=350, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty, event)
self.changed = true
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
......
......@@ -86,12 +86,18 @@ function _M:init(actor)
EXIT = function() game:unregisterDialog(self) end,
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then game:unregisterDialog(self) end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
{ x=2, y=5, w=350, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty, event)
self.changed = true
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
if button ~= "wheelup" and button ~= "wheeldown" then
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
end
self.changed = true
if button == "left" and event == "button" then self:use()
elseif button == "right" and event == "button" then
elseif button == "wheelup" and event == "button" then self.key:triggerVirtual("MOVE_UP")
elseif button == "wheeldown" and event == "button" then self.key:triggerVirtual("MOVE_DOWN")
end
end },
}
......@@ -188,6 +194,6 @@ Mouse: #00FF00#Left click#FFFFFF# to use.
end
-- Talents
self:drawSelectionList(s, 2, 5, self.font_h, self.list, self.sel, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5)
self:drawSelectionList(s, 2, 5, self.font_h, self.list, self.sel, "name", self.scroll, self.max, nil, nil, nil, self.iw / 2 - 5, true)
self.changed = false
end
......@@ -42,8 +42,12 @@ function _M:init(actor)
self:mouseZones{
{ x=2, y=10 + self.font:lineSkip()*6, w=350, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty, event)
self.changed = true
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
if button ~= "wheelup" and button ~= "wheeldown" then
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
end
if button == "left" and event == "button" then self:use()
elseif button == "wheelup" and event == "button" then self.key:triggerVirtual("MOVE_UP")
elseif button == "wheeldown" and event == "button" then self.key:triggerVirtual("MOVE_DOWN")
end
end },
}
......
......@@ -45,12 +45,16 @@ function _M:init()
EXIT = function() game:unregisterDialog(self) end,
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then game:unregisterDialog(self) end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
{ x=2, y=5, w=350, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty, event)
self.changed = true
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
if button ~= "wheelup" and button ~= "wheeldown" then
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
end
if button == "left" and event == "button" then self:use()
elseif button == "right" and event == "button" then
elseif button == "wheelup" and event == "button" then self.key:triggerVirtual("MOVE_UP")
elseif button == "wheeldown" and event == "button" then self.key:triggerVirtual("MOVE_DOWN")
end
end },
}
......
......@@ -34,7 +34,7 @@ function _M:init(actor, on_exit)
end,
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then self.key:triggerVirtual("EXIT") end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then self.key:triggerVirtual("EXIT") end end},
}
end
......
......@@ -50,12 +50,16 @@ function _M:init(actor, on_finish)
end,
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then self.key:triggerVirtual("EXIT") end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then self.key:triggerVirtual("EXIT") end end},
{ x=2, y=25, w=130, h=self.font_h*6, fct=function(button, x, y, xrel, yrel, tx, ty, event)
self.changed = true
self.sel = 1 + math.floor(ty / self.font_h)
if button ~= "wheelup" and button ~= "wheeldown" then
self.sel = 1 + math.floor(ty / self.font_h)
end
if button == "left" and event == "button" then self:incStat(1)
elseif button == "right" and event == "button" then self:incStat(-1)
elseif button == "wheelup" and event == "button" then self.key:triggerVirtual("MOVE_UP")
elseif button == "wheeldown" and event == "button" then self.key:triggerVirtual("MOVE_DOWN")
end
end },
}
......
......@@ -68,12 +68,16 @@ function _M:init(actor, on_finish)
end,
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button ~= "none" then self.key:triggerVirtual("EXIT") end end},
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then self.key:triggerVirtual("EXIT") end end},
{ x=2, y=65, w=350, h=self.font_h*self.max, fct=function(button, x, y, xrel, yrel, tx, ty, event)
self.changed = true
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
if button ~= "wheelup" and button ~= "wheeldown" then
self.sel = util.bound(self.scroll + math.floor(ty / self.font_h), 1, #self.list)
end
if button == "left" and event == "button" then self:learn(true)
elseif button == "right" and event == "button" then self:learn(false)
elseif button == "wheelup" and event == "button" then self.key:triggerVirtual("MOVE_UP")
elseif button == "wheeldown" and event == "button" then self.key:triggerVirtual("MOVE_DOWN")
end
self.changed = true
end },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment