Safeguards in SWWMDirectMessage.

This commit is contained in:
Mari the Deer 2021-10-07 19:47:08 +02:00
commit e97f72b176
2 changed files with 6 additions and 3 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\chSWWM \czGZ\c- \cw1.1.17 \cu(Wed 6 Oct 19:02:58 CEST 2021)\c-";
SWWM_SHORTVER="\cw1.1.17 \cu(2021-10-06 19:02:58)\c-";
SWWM_MODVER="\chSWWM \czGZ\c- \cw1.1.18 \cu(Thu 7 Oct 19:47:39 CEST 2021)\c-";
SWWM_SHORTVER="\cw1.1.18 \cu(2021-10-07 19:47:39)\c-";

View file

@ -373,6 +373,8 @@ Class SWWMDirectMessage : HUDMessageBase
private void SetText()
{
if ( !fnt ) fnt = Font.GetFont('TewiShaded');
if ( !jpfnt ) jpfnt = Font.GetFont('MPlusShaded');
String txt;
if ( (seqnum == 2) && znvspecial )
{
@ -382,7 +384,8 @@ Class SWWMDirectMessage : HUDMessageBase
}
else txt = StringTable.Localize("$SWWM_"..seqname..seqnum);
if ( l ) l.Destroy();
l = fnt.BreakLines(txt,220);
let tfnt = (language~=="jp")?jpfnt:fnt;
l = tfnt.BreakLines(txt,220);
// append to the player's chat log (if it's valid)
if ( (seqnum < 1) || (seqnum > seqcnt) ) return;
let bar = SWWMStatusBar(StatusBar);