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

New options to select UI style, font style and font size; Small screen users rejoince!

git-svn-id: http://svn.net-core.org/repos/t-engine4@2921 51575b47-30f0-44d4-a5cc-537603b46e54
parent 92e38bac
No related branches found
No related tags found
No related merge requests found
......@@ -80,6 +80,8 @@ function _M:init(t, no_gen)
self.mouse = Mouse.new()
self.key = KeyBind.new()
if not rawget(self, "ui") then self.ui = self.ui end
if t.font then
if type(t.font) == "table" then
self.font = core.display.newFont(t.font[1], t.font[2])
......
......@@ -146,5 +146,41 @@ function _M:generateList()
self.c_list:drawItem(item)
end,}
local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Select the interface look. Stone is the default one, Simple is basic but takes less screen space.\nYou must restart the game for the change to take effect."}
list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Interface Style#WHITE##{normal}#", status=function(item)
return tostring(config.settings.tome.ui_theme):capitalize()
end, fct=function(item)
Dialog:listPopup("Interface style", "Select style", {{name="Stone", ui="stone"}, {name="Simple", ui="simple"}}, 300, 200, function(sel)
if not sel or not sel.ui then return end
game:saveSettings("tome.ui_theme", ("tome.ui_theme = %q\n"):format(sel.ui))
config.settings.tome.ui_theme = sel.ui
self.c_list:drawItem(item)
end)
end,}
local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Select the fonts look. fantasy is the default one, Basic is simplied and smaller.\nYou must restart the game for the change to take effect."}
list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Font Style#WHITE##{normal}#", status=function(item)
return tostring(config.settings.tome.fonts.type):capitalize()
end, fct=function(item)
Dialog:listPopup("Font style", "Select font", {{name="Fantasy", type="fantasy"}, {name="Basic", type="basic"}}, 300, 200, function(sel)
if not sel or not sel.type then return end
game:saveSettings("tome.fonts", ("tome.fonts = { type = %q, size = %q }\n"):format(sel.type, config.settings.tome.fonts.size))
config.settings.tome.fonts.type = sel.type
self.c_list:drawItem(item)
end)
end,}
local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Select the fonts size.\nYou must restart the game for the change to take effect."}
list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Font Size#WHITE##{normal}#", status=function(item)
return tostring(config.settings.tome.fonts.size):capitalize()
end, fct=function(item)
Dialog:listPopup("Font size", "Select font", {{name="Normal", size="normal"},{name="Small", size="small"},{name="Big", size="big"},}, 300, 200, function(sel)
if not sel or not sel.size then return end
game:saveSettings("tome.fonts", ("tome.fonts = { type = %q, size = %q }\n"):format(config.settings.tome.fonts.type, sel.size))
config.settings.tome.fonts.size = sel.size
self.c_list:drawItem(item)
end)
end,}
self.list = list
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