This repository has been archived on 2019-04-06. You can view files and clone it, but cannot push or open issues or pull requests.
adventin/src/sdl-instead/gui.h
2009-08-26 05:25:53 +00:00

43 lines
966 B
C

char *instead_gui_lua = "game.hinting = true;\n\
game.showlast = true;\n\
iface.xref = function(self, str, obj)\n\
-- return '@'..str..'{'..obj..'}';\n\
local o = ref(here():srch(obj));\n\
local cmd=''\n\
if not o then \n\
o = ref(ways():srch(obj));\n\
if o then\n\
cmd = 'go ';\n\
end\n\
end\n\
if not o then\n\
o = ref(inv():srch(obj));\n\
end\n\
if not isObject(o) or not o.id then\n\
return str;\n\
end\n\
return cat('<a:'..cmd..'0'..tostring(o.id)..'>',str,'</a>');\n\
end;\n\
iface.title = function(self, str)\n\
return nil\n\
end;\n\
iface.em = function(self, str)\n\
if str == nil then return nil; end; \n\
return cat('<i>',str,'</i>');\n\
end;\n\
\n\
iface.inv = function(self, str)\n\
if str then\n\
return string.gsub(str,',','^');\n\
end\n\
return str\n\
end;\n\
\n\
iface.ways = function(self, str)\n\
if str then\n\
return '<c>'..string.gsub(str,',',' | ')..'</c>';\n\
end\n\
return str\n\
end;";