fix with ^ in inv and ways

This commit is contained in:
p.kosyh 2010-10-31 10:01:22 +00:00
parent 6faa91ad36
commit fe104dfec1

View file

@ -127,13 +127,12 @@ function get_inv(horiz)
local str = me():inv(); local str = me():inv();
if str then if str then
str = stead.string.gsub(str, '\n$',''); str = stead.string.gsub(str, '\n$','');
-- str = stead.string.gsub(str, stead.delim..'$', '')
if not horiz then if not horiz then
str = stead.string.gsub(str, '\\?[\\'.. stead.delim ..']', { [stead.delim] = game.gui.inv_delim }); str = stead.string.gsub(str, '\\?[\\'.. stead.delim ..']', { [stead.delim] = game.gui.inv_delim });
else else
str = stead.string.gsub(str, '\\?[\\'.. stead.delim ..']', { [stead.delim] = game.gui.hinv_delim }); str = stead.string.gsub(str, '\\?[\\'.. stead.delim ..']', { [stead.delim] = game.gui.hinv_delim });
end end
str = stead.string.gsub(str, '\\(.)', '%1'); str = stead.string.gsub(str, '\\?[\\^]', { ['^'] = '\n' }):gsub('\\(.)', '%1');
end end
return str return str
end end
@ -144,7 +143,7 @@ function get_ways()
if str and str ~= '' then if str and str ~= '' then
str = stead.string.gsub(str, '\n$',''); str = stead.string.gsub(str, '\n$','');
str = stead.string.gsub(str, '\\?[\\'.. stead.delim ..']', { [stead.delim] = game.gui.ways_delim }); str = stead.string.gsub(str, '\\?[\\'.. stead.delim ..']', { [stead.delim] = game.gui.ways_delim });
str = stead.string.gsub(str, '\\(.)', '%1'); str = stead.string.gsub(str, '\\?[\\^]', { ['^'] = '\n' }):gsub('\\(.)', '%1');
return iface:center(str); return iface:center(str);
end end
return str return str
@ -160,7 +159,7 @@ function get_title()
s = call(here(), 'nam'); s = call(here(), 'nam');
end end
if type(s) == 'string' and s ~= '' then if type(s) == 'string' and s ~= '' then
s = stead.string.gsub(s, '\\(.)', '%1'); s = stead.string.gsub(s, '\\?[\\^]', { ['^'] = '\n' }):gsub('\\(.)', '%1');
s = "<c><b>"..s.."</b></c>"; s = "<c><b>"..s.."</b></c>";
end end
return s return s