This commit is contained in:
p.kosyh@gmail.com 2010-10-31 15:06:54 +00:00
parent 399ea30772
commit b69834cc04
3 changed files with 23 additions and 6 deletions

View file

@ -1484,6 +1484,8 @@ int game_cmd(char *cmd)
if (!cmdstr)
goto inv; /* hackish? ok, yes it is... */
fading = check_fading();
instead_function("instead.get_title", NULL);
title = instead_retval(0);
instead_clear();
@ -1498,8 +1500,6 @@ int game_cmd(char *cmd)
new_pict = check_new_pict(pict);
fading = check_fading();
if (game_theme_changed == 2 && opt_owntheme && !fading)
fading = 1; /* one frame at least */

View file

@ -4,7 +4,7 @@ game.showlast = true;
game.gui = {
fading = 4;
ways_delim = ' | ';
inv_delim = '\n';
inv_delim = '^';
hinv_delim = ' | ';
}
@ -95,6 +95,11 @@ iface.center = function(self, str)
return stead.cat('<c>',str,'</c>');
end;
iface.just = function(self, str)
if str == nil then return nil; end;
return stead.cat('<j>',str,'</j>');
end;
iface.bold = function(self, str)
if str == nil then return nil; end;
return stead.cat('<b>',str,'</b>');
@ -132,7 +137,8 @@ function get_inv(horiz)
else
str = stead.string.gsub(str, '\\?[\\'.. stead.delim ..']', { [stead.delim] = game.gui.hinv_delim });
end
str = stead.string.gsub(str, '\\?[\\^]', { ['^'] = '\n' }):gsub('\\(.)', '%1');
stead.state = false
str = stead.fmt(str);
end
return str
end
@ -143,7 +149,8 @@ function get_ways()
if str and str ~= '' then
str = stead.string.gsub(str, '\n$','');
str = stead.string.gsub(str, '\\?[\\'.. stead.delim ..']', { [stead.delim] = game.gui.ways_delim });
str = stead.string.gsub(str, '\\?[\\^]', { ['^'] = '\n' }):gsub('\\(.)', '%1');
stead.state = false
str = stead.fmt(str);
return iface:center(str);
end
return str
@ -159,7 +166,9 @@ function get_title()
s = call(here(), 'nam');
end
if type(s) == 'string' and s ~= '' then
s = stead.string.gsub(s, '\\?[\\^]', { ['^'] = '\n' }):gsub('\\(.)', '%1');
-- s = stead.string.gsub(s, '\\?[\\^]', { ['^'] = '\n' }):gsub('\\(.)', '%1');
stead.state = false
s = stead.fmt(s);
s = "<c><b>"..s.."</b></c>";
end
return s

View file

@ -240,6 +240,11 @@ function txtc(v)
return iface:center(v)
end
function txtj(v)
if type(v) ~= 'string' then return nil; end;
return iface:just(v)
end
function txtb(v)
if type(v) ~= 'string' then return nil; end;
return iface:bold(v)
@ -1913,6 +1918,9 @@ iface = {
center = function(self, str)
return str;
end,
just = function(self, str)
return str;
end,
top = function(self, str)
return str;
end,