nastaveni barvicek
This commit is contained in:
parent
cad312b9a0
commit
af9448d229
36
gui.lua
36
gui.lua
|
@ -181,6 +181,32 @@ game = {
|
|||
vars = {}
|
||||
}
|
||||
|
||||
-- utils
|
||||
|
||||
function read_config(filename)
|
||||
filename = filename or ''
|
||||
assert(type(filename) == 'string')
|
||||
local ans,u,k,v,temp = {}, '_'
|
||||
local f = io.open(filename)
|
||||
if f then
|
||||
f:close()
|
||||
for line in io.lines(filename) do
|
||||
temp = line:match('^%[(.+)%]$')
|
||||
if temp ~= nil and u ~= temp then u = temp end
|
||||
k,v = line:match('^([^=]+)=(.+)$')
|
||||
if u ~= nil then
|
||||
ans[u] = ans[u] or {}
|
||||
if k ~= nil then
|
||||
ans[u][k] = v
|
||||
end
|
||||
end
|
||||
end
|
||||
return ans
|
||||
else
|
||||
return {}
|
||||
end
|
||||
end
|
||||
|
||||
-- GUI
|
||||
|
||||
iup.SetGlobal("UTF8MODE","YES")
|
||||
|
@ -207,9 +233,17 @@ function commands:k_any(k)
|
|||
end
|
||||
end
|
||||
|
||||
local theme = read_config "theme.ini"
|
||||
theme = theme._ -- hack - TODO - odstranit
|
||||
setmetatable(theme, {__get = {
|
||||
font = "Arial 12",
|
||||
fgcolor = "#00000",
|
||||
fgcolor = "#ffffff",
|
||||
}})
|
||||
|
||||
vbox= iup.hbox{text, commands; expand=1}
|
||||
|
||||
window = iup.dialog{vbox, title = "Hagen", gap = "10", rastersize="640x480"}
|
||||
window = iup.dialog{vbox, title = "Hagen", gap = "10", rastersize="640x480", font=theme.font, fgcolor=theme.fgcolor, bgcolor=theme.bgcolor}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue