# HG changeset patch # User Wuzzy # Date 1506627162 -7200 # Node ID 0411e04cf12a6eaa0da1eddb3a8255648d130e3d # Parent 5b23c42ef150dd7b2d9f78e3b685dc35080c75a1 Fix stats screen caption showing only one winner if multiple teams have won diff -r 5b23c42ef150 -r 0411e04cf12a ChangeLog.txt --- a/ChangeLog.txt Thu Sep 28 19:26:22 2017 +0200 +++ b/ChangeLog.txt Thu Sep 28 21:32:42 2017 +0200 @@ -251,6 +251,7 @@ + Hedgewars creates 4 teams instead of 1 on its first launch + Allow to randomize hog names, hats, team name, flag, grave, voice and fort separately + “Random team” button is now able to randomly select from all available hats + * Fix flag being selectable for computer players although it had no effect * Campaign screen does no longer show AI-controlled teams * Campaign names and campaign mission names can now be translated * Creating randomized teams now randomizes (almost) every aspect @@ -258,8 +259,8 @@ * Clicking on "New" in weapon scheme editor now creates empty weapon scheme instead of default * Fix language names in language list being always in English * Prevent starting game with >48 hogs (because engine doesn't support it yet) - * Team editor Fix flag being selectable for computer players although it had no effect * Fix the key for toggling team bars being incorrectly described + * Fix caption of stats screen showing only one winner if multiple teams have won Content Creation: + Theme objects can now have more than 1 in-land rect specified. You can specify the amount in theme.cfg by adding another number (and ,) before the first rect diff -r 5b23c42ef150 -r 0411e04cf12a hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Thu Sep 28 19:26:22 2017 +0200 +++ b/hedgewars/uTeams.pas Thu Sep 28 21:32:42 2017 +0200 @@ -87,6 +87,7 @@ AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000); end else // win + begin with AliveClan^ do begin ts:= ansistring(Teams[0]^.TeamName); @@ -94,12 +95,28 @@ begin s:= FormatA(trmsg[sidWinner], ts); cap:= FormatA(GetEventString(eidRoundWin), ts); + AddCaption(cap, cWhiteColor, capgrpGameState); end else // clan wins - // FIXME: Clan needs a different message begin - s:= FormatA(trmsg[sidWinner], ts); - cap:= FormatA(GetEventString(eidRoundWin), ts); + s:= ''; + for j:= 0 to Pred(TeamsNumber) do + begin + (* + Currently, the game result string is just the victory + string concatenated multiple times. This assumes that + sidWinner is a complete sentence. + This might not work well for some languages. + + FIXME/TODO: Add event strings for 2, 3, 4 and >4 teams winning. + This requires FormatA to work with multiple parameters. *) + ts:= Teams[j]^.TeamName; + s:= s + ' ' + FormatA(trmsg[sidWinner], ts); + + // FIXME: Show victory captions one-by-one, not all at once + cap:= FormatA(GetEventString(eidRoundWin), ts); + AddCaption(cap, cWhiteColor, capgrpGameState); + end; end; for j:= 0 to Pred(TeamsNumber) do @@ -112,12 +129,12 @@ AddVoice(sndFlawless, Teams[0]^.voicepack) else AddVoice(sndVictory, Teams[0]^.voicepack); + end; - AddCaption(cap, cWhiteColor, capgrpGameState); - if SendGameResultOn then - SendStat(siGameResult, shortstring(s)); - AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000) - end; + if SendGameResultOn then + SendStat(siGameResult, shortstring(s)); + AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000) + end; SendStats; end; TeamsGameOver:= true;