Skip to content
Snippets Groups Projects
Commit 1abfd152 authored by dg's avatar dg
Browse files

scroll

git-svn-id: http://svn.net-core.org/repos/t-engine4@5234 51575b47-30f0-44d4-a5cc-537603b46e54
parent 006b61d6
No related branches found
No related tags found
No related merge requests found
......@@ -544,6 +544,7 @@ function _M:createDisplay()
width=self.iw-200-10, height=self.ih-10,
tooltip=function(item) return self:getTalentDesc(item), self.uis[3].x - game.tooltip.max, nil end,
on_use = function(item, inc) self:onUseTalent(item, inc) end,
scrollbar = true,
}
self.c_stat = TalentTrees.new{
......
......@@ -33,6 +33,7 @@ function _M:init(t)
self.tooltip = assert(t.tooltip, "no tooltip")
self.on_use = assert(t.on_use, "no on_use")
self.on_expand = t.on_expand
self.scrollbar = t.scrollbar
self.no_cross = t.no_cross
self.icon_size = 48
......@@ -82,7 +83,7 @@ function _M:generate()
-- Draw the scrollbar
if self.scrollbar then
self.scrollbar = Slider.new{size=self.h - fh, max=1}
self.scrollbar = Slider.new{size=self.h, max=#self.tree}
end
self.mousezones = {}
......@@ -239,7 +240,7 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y)
end
if self.focused and self.scrollbar then
self.scrollbar.pos = self.sel
self.scrollbar:display(bx + self.w - self.scrollbar.w, by + self.fh)
self.scrollbar.pos = self.scroll
self.scrollbar:display(x + self.w - self.scrollbar.w, y)
end
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