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

More space for price in store dialogs

git-svn-id: http://svn.net-core.org/repos/t-engine4@1860 51575b47-30f0-44d4-a5cc-537603b46e54
parent 710ef1fa
No related branches found
No related tags found
No related merge requests found
......@@ -44,17 +44,17 @@ function _M:init(title, store_inven, actor_inven, store_filter, actor_filter, ac
self.c_inven = ListColumns.new{width=math.floor(self.iw / 2 - 10), height=self.ih - self.max_h*self.font_h - 10, sortable=true, scrollbar=true, columns={
{name="", width={20,"fixed"}, display_prop="char", sort="id"},
{name="", width={24,"fixed"}, display_prop="object", direct_draw=function(item, x, y) item.object:toScreen(nil, x+4, y, 16, 16) end},
{name="Inventory", width=72, display_prop="name", sort="name"},
{name="Inventory", width=80, display_prop="name", sort="name"},
{name="Category", width=20, display_prop="cat", sort="cat"},
{name="Price", width=8, display_prop="desc_price", sort=function(a, b) return descprice("sell", a.object) <descprice("sell", b.object) end},
{name="Price", width={50,"fixed"}, display_prop="desc_price", sort=function(a, b) return descprice("sell", a.object) <descprice("sell", b.object) end},
}, list={}, fct=function(item, sel) self:use(item) end, select=function(item, sel) self:select(item) end}
self.c_store = ListColumns.new{width=math.floor(self.iw / 2 - 10), height=self.ih - self.max_h*self.font_h - 10, sortable=true, scrollbar=true, columns={
{name="", width={20,"fixed"}, display_prop="char", sort="id"},
{name="", width={24,"fixed"}, display_prop="object", direct_draw=function(item, x, y) item.object:toScreen(nil, x+4, y, 16, 16) end},
{name="Store", width=72, display_prop="name"},
{name="Store", width=80, display_prop="name"},
{name="Category", width=20, display_prop="cat"},
{name="Price", width=8, display_prop="desc_price", sort=function(a, b) return descprice("buy", a.object) <descprice("buy", b.object) end},
{name="Price", width={50,"fixed"}, display_prop="desc_price", sort=function(a, b) return descprice("buy", a.object) <descprice("buy", b.object) end},
}, list={}, fct=function(item) self:use(item) end, select=function(item, sel) self:select(item) end}
self:generateList()
......
......@@ -109,7 +109,8 @@ function _M:drawItem(item)
local s = col.surface
s:erase(0, 0, 0, 0)
text:drawOnSurface(s, fw - ls_w - rs_w, 1, self.font, ls_w, (fh - self.font_h) / 2, color[1], color[2], color[3])
-- We use 1000 and do not cut lines to make sure it draws as much as possible
text:drawOnSurface(s, 10000, nil, self.font, ls_w, (fh - self.font_h) / 2, color[1], color[2], color[3])
item._tex = item._tex or {}
item._tex[j] = {s:glTexture()}
end
......
......@@ -666,8 +666,8 @@ function tstring:drawOnSurface(s, max_width, max_lines, font, x, y, r, g, b)
s:drawStringBlended(font, v, x + w, y + h, r, g, b, true)
w = w + fontoldsize(font, v)
elseif tv == "boolean" then
w = 0
h = h + fh
-- w = 0
-- h = h + fh
max_lines = max_lines - 1
if max_lines <= 0 then break end
else
......
No preview for this file type
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