From 5408781154254b0890e735cb3ddb2bf645566c63 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 21 Aug 2007 00:26:49 +0000 Subject: [PATCH] settext: support alt text --- stepmania/src/BitmapText.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index 333ae6462e..481340ea2d 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -761,6 +761,7 @@ public: static int settext( T* p, lua_State *L ) { RString s = SArg(1); + RString sAlt; // XXX: Lua strings should simply use "\n" natively. However, some // settext calls may be made from GetMetric() calls to other strings, // and it's confusing for :: to work in some strings and not others. @@ -769,7 +770,15 @@ public: s.Replace("::","\n"); FontCharAliases::ReplaceMarkers( s ); - p->SetText( s ); return 0; + if( lua_gettop(L) > 1 ) + { + sAlt = SArg(2); + sAlt.Replace("::","\n"); + FontCharAliases::ReplaceMarkers( sAlt ); + } + + p->SetText( s, sAlt ); + return 0; } static int rainbowscroll( T* p, lua_State *L ) { p->SetRainbowScroll( BArg(1) ); return 0; } static int jitter( T* p, lua_State *L ) { p->SetJitter( BArg(1) ); return 0; }