2009-09-20 13:21:11 +03:00
|
|
|
game.hinting = true;
|
|
|
|
game.showlast = true;
|
|
|
|
|
2009-10-04 14:59:09 +03:00
|
|
|
iface.img = function(self, str)
|
|
|
|
return "<g:"..str..">";
|
|
|
|
end;
|
|
|
|
|
2009-09-20 13:21:11 +03:00
|
|
|
iface.xref = function(self, str, obj)
|
2009-10-06 21:22:52 +03:00
|
|
|
local o = ref(obj);
|
2009-09-20 13:21:11 +03:00
|
|
|
local cmd=''
|
2009-10-06 21:22:52 +03:00
|
|
|
|
2009-09-20 13:21:11 +03:00
|
|
|
if not isObject(o) or isStatus(o) or not o.id then
|
|
|
|
return str;
|
|
|
|
end
|
2009-10-06 21:22:52 +03:00
|
|
|
|
2009-10-15 08:36:22 +03:00
|
|
|
if ref(ways():srch(obj)) then
|
|
|
|
cmd = 'go ';
|
|
|
|
elseif isMenu(o) then
|
2009-09-20 13:21:11 +03:00
|
|
|
cmd = 'act ';
|
2009-10-15 10:06:45 +03:00
|
|
|
elseif isSceneUse(o) then
|
2009-10-15 08:36:22 +03:00
|
|
|
cmd = 'use ';
|
2009-09-20 13:21:11 +03:00
|
|
|
end
|
2009-10-06 21:22:52 +03:00
|
|
|
|
2009-09-20 13:21:11 +03:00
|
|
|
return cat('<a:'..cmd..'0'..tostring(o.id)..'>',str,'</a>');
|
|
|
|
end;
|
|
|
|
|
|
|
|
iface.title = function(self, str)
|
|
|
|
return nil
|
|
|
|
end;
|
|
|
|
|
|
|
|
iface.under = function(self, str)
|
|
|
|
if str == nil then return nil; end;
|
|
|
|
return cat('<u>',str,'</u>');
|
|
|
|
end;
|
|
|
|
|
|
|
|
iface.em = function(self, str)
|
|
|
|
if str == nil then return nil; end;
|
|
|
|
return cat('<i>',str,'</i>');
|
|
|
|
end;
|
|
|
|
|
|
|
|
iface.right = function(self, str)
|
|
|
|
if str == nil then return nil; end;
|
|
|
|
return cat('<r>',str,'</r>');
|
|
|
|
end;
|
|
|
|
|
|
|
|
iface.left = function(self, str)
|
|
|
|
if str == nil then return nil; end;
|
|
|
|
return cat('<l>',str,'</l>');
|
|
|
|
end;
|
|
|
|
|
|
|
|
iface.center = function(self, str)
|
|
|
|
if str == nil then return nil; end;
|
|
|
|
return cat('<c>',str,'</c>');
|
|
|
|
end;
|
|
|
|
|
|
|
|
iface.bold = function(self, str)
|
|
|
|
if str == nil then return nil; end;
|
|
|
|
return cat('<b>',str,'</b>');
|
|
|
|
end;
|
|
|
|
|
|
|
|
iface.inv = function(self, str)
|
|
|
|
if str then
|
|
|
|
return string.gsub(str,',','^');
|
|
|
|
end
|
|
|
|
return str
|
|
|
|
end;
|
|
|
|
|
|
|
|
iface.ways = function(self, str)
|
|
|
|
if str then
|
|
|
|
return '<c>'..string.gsub(str,',',' | ')..'</c>';
|
|
|
|
end
|
|
|
|
return str
|
|
|
|
end;
|
|
|
|
|
|
|
|
-- here is gui staff only
|
|
|
|
function stat(v)
|
|
|
|
v.status_type = true
|
|
|
|
return obj(v);
|
|
|
|
end
|
|
|
|
|
|
|
|
function isStatus(v)
|
|
|
|
if type(v) ~= 'table' then
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
if v.status_type then
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
|
|
|
|
function menu_save(self, name, h, need)
|
|
|
|
local dsc;
|
|
|
|
if need then
|
|
|
|
h:write(name.." = menu {nam = '"..tostring(self.nam).."'}\n");
|
|
|
|
end
|
|
|
|
savemembers(h, self, name, need);
|
|
|
|
end
|
|
|
|
|
2009-09-25 11:21:58 +03:00
|
|
|
MENU_TAG_ID = 10000
|
|
|
|
|
2009-09-20 13:21:11 +03:00
|
|
|
function menu(v)
|
|
|
|
v.menu_type = true
|
2009-09-20 13:37:00 +03:00
|
|
|
if v.inv == nil then
|
|
|
|
v.inv = function(s)
|
2009-09-25 12:00:15 +03:00
|
|
|
local r
|
|
|
|
r = call(s, 'menu');
|
|
|
|
if r == nil then
|
|
|
|
obj_tag(me(), MENU_TAG_ID); -- retag menu field
|
|
|
|
end
|
|
|
|
return r, true
|
2009-09-20 13:37:00 +03:00
|
|
|
end
|
|
|
|
end
|
2009-10-02 22:04:34 +03:00
|
|
|
if v.act == nil then
|
|
|
|
v.act = function(s)
|
|
|
|
local r
|
|
|
|
r = call(s, 'menu');
|
|
|
|
if r == nil then
|
|
|
|
obj_tag(me(), MENU_TAG_ID); -- retag menu field
|
|
|
|
end
|
|
|
|
return r, true
|
|
|
|
end
|
|
|
|
end
|
2009-09-20 13:21:11 +03:00
|
|
|
if v.save == nil then
|
|
|
|
v.save = menu_save;
|
|
|
|
end
|
|
|
|
return obj(v);
|
|
|
|
end
|
|
|
|
|
|
|
|
function isMenu(v)
|
|
|
|
if type(v) ~= 'table' then
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
if v.menu_type then
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
return false
|
|
|
|
end
|
2009-10-15 10:06:45 +03:00
|
|
|
|