nastaveni barvicek

This commit is contained in:
Severak 2019-08-30 13:12:15 +02:00
parent cad312b9a0
commit af9448d229
2 changed files with 35 additions and 2 deletions

36
gui.lua
View File

@ -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}

View File

@ -8,7 +8,6 @@ WIN verze:
- handlovat vyjímky
- bugfix menu
- theme.ini na nastavení barviček
DOS verze: