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() ...@@ -544,6 +544,7 @@ function _M:createDisplay()
width=self.iw-200-10, height=self.ih-10, 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, 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, on_use = function(item, inc) self:onUseTalent(item, inc) end,
scrollbar = true,
} }
self.c_stat = TalentTrees.new{ self.c_stat = TalentTrees.new{
......
...@@ -33,6 +33,7 @@ function _M:init(t) ...@@ -33,6 +33,7 @@ function _M:init(t)
self.tooltip = assert(t.tooltip, "no tooltip") self.tooltip = assert(t.tooltip, "no tooltip")
self.on_use = assert(t.on_use, "no on_use") self.on_use = assert(t.on_use, "no on_use")
self.on_expand = t.on_expand self.on_expand = t.on_expand
self.scrollbar = t.scrollbar
self.no_cross = t.no_cross self.no_cross = t.no_cross
self.icon_size = 48 self.icon_size = 48
...@@ -82,7 +83,7 @@ function _M:generate() ...@@ -82,7 +83,7 @@ function _M:generate()
-- Draw the scrollbar -- Draw the scrollbar
if self.scrollbar then 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 end
self.mousezones = {} self.mousezones = {}
...@@ -239,7 +240,7 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y) ...@@ -239,7 +240,7 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y)
end end
if self.focused and self.scrollbar then if self.focused and self.scrollbar then
self.scrollbar.pos = self.sel self.scrollbar.pos = self.scroll
self.scrollbar:display(bx + self.w - self.scrollbar.w, by + self.fh) self.scrollbar:display(x + self.w - self.scrollbar.w, y)
end end
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