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

Fix online profile dialog size

git-svn-id: http://svn.net-core.org/repos/t-engine4@1026 51575b47-30f0-44d4-a5cc-537603b46e54
parent f8f07fd1
No related branches found
No related tags found
No related merge requests found
......@@ -126,12 +126,17 @@ function _M:init(title, w, h, x, y, alpha, font)
self.tabindex = 0
self.state = ""
self.currenttabindex = 0
self.w, self.h = math.floor(w), math.floor(h)
self.display_x = math.floor(x or (game.w - self.w) / 2)
self.display_y = math.floor(y or (game.h - self.h) / 2)
self.font = font
if not font then self.font = core.display.newFont("/data/font/Vera.ttf", 12) end
self.font_h = self.font:lineSkip()
self:resize(w, h, x, y, alpha)
end
function _M:resize(w, h, x, y, alpha)
self.w, self.h = math.floor(w), math.floor(h)
self.display_x = math.floor(x or (game.w - self.w) / 2)
self.display_y = math.floor(y or (game.h - self.h) / 2)
self.surface = core.display.newSurface(w, h)
self.iw, self.ih = w - 2 * 5, h - 8 - 16 - 3
self.internal_surface = core.display.newSurface(self.iw, self.ih)
......
......@@ -105,7 +105,6 @@ newBirthDescriptor
"- fear immunity",
"- no need to breathe",
"- special skeleton talents: sharp bones, bone amour, re-assemble",
"The rotting body of ghouls also forces them to act a bit slower than most creatures.",
},
descriptor_choices =
{
......
......@@ -95,9 +95,11 @@ function _M:init(dialogdef, profile_help_text)
self:addControl(TextBox.new({name="name",title="Name:",min=2, max=25, x=30, y=basey + 125, w=350, h=30}, self, self.font, "name"))
self:addControl(Button.new("ok", "Ok", 50, basey + 165, 50, 30, self, self.font, function() self:okclick() end))
self:addControl(Button.new("cancel", "Canel", 400, basey + 165, 50, 30, self, self.font, function() self:cancelclick() end))
self:resize(500, basey + 225)
else
self:addControl(Button.new("ok", "Ok", 50, basey + 85, 50, 30, self, self.font, function() self:okclick() end))
self:addControl(Button.new("cancel", "Canel", 400, basey + 85, 50, 30, self, self.font, function() self:cancelclick() end))
self:resize(500, basey + 145)
end
self:focusControl("login")
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