widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #08910
[Merge] lp:~widelands-dev/widelands/bug-collectors into lp:widelands
Notabilis has proposed merging lp:~widelands-dev/widelands/bug-collectors into lp:widelands.
Requested reviews:
Widelands Developers (widelands-dev)
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-collectors/+merge/312092
When a game of Collectors ends and the player keeps playing, he can see a status message in his inbox which states: "Game will end in ."
Since the game already ended, no time is printed as part of the sentence.
This branch fixes the issue by printing "Game over" in this last message.
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-collectors into lp:widelands.
=== modified file 'data/scripting/win_conditions/collectors.lua'
--- data/scripting/win_conditions/collectors.lua 2016-09-12 09:57:16 +0000
+++ data/scripting/win_conditions/collectors.lua 2016-11-29 20:55:36 +0000
@@ -135,25 +135,31 @@
-- Send all players the momentary game state
local function _send_state(remaining_time, plrs)
- set_textdomain("win_conditions")
- local h = math.floor(remaining_time / 60)
- local m = remaining_time % 60
- -- TRANSLATORS: Context: 'The game will end in (2 hours and) 30 minutes.'
- local time = ""
- if m > 0 then
- time = (ngettext("%i minute", "%i minutes", m)):format(m)
- end
- if h > 0 then
+ local msg = ""
+ if remaining_time <= 0 then
+ set_textdomain("widelands")
+ msg = p(_"Game over")
+ else
+ set_textdomain("win_conditions")
+ local h = math.floor(remaining_time / 60)
+ local m = remaining_time % 60
+ -- TRANSLATORS: Context: 'The game will end in (2 hours and) 30 minutes.'
+ local time = ""
if m > 0 then
- -- TRANSLATORS: Context: 'The game will end in 2 hours and 30 minutes.'
- time = (ngettext("%1% hour and %2%", "%1% hours and %2%", h)):bformat(h, time)
- else
- -- TRANSLATORS: Context: 'The game will end in 2 hours.'
- time = (ngettext("%1% hour", "%1% hours", h)):bformat(h)
- end
+ time = (ngettext("%i minute", "%i minutes", m)):format(m)
+ end
+ if h > 0 then
+ if m > 0 then
+ -- TRANSLATORS: Context: 'The game will end in 2 hours and 30 minutes.'
+ time = (ngettext("%1% hour and %2%", "%1% hours and %2%", h)):bformat(h, time)
+ else
+ -- TRANSLATORS: Context: 'The game will end in 2 hours.'
+ time = (ngettext("%1% hour", "%1% hours", h)):bformat(h)
+ end
+ end
+ -- TRANSLATORS: Context: 'The game will end in 2 hours and 30 minutes.'
+ msg = p(_"The game will end in %s."):format(time)
end
- -- TRANSLATORS: Context: 'The game will end in 2 hours and 30 minutes.'
- local msg = p(_"The game will end in %s."):format(time)
-- Points for players without team
for idx, plr in ipairs(plrs) do
Follow ups
-
Re: [Merge] lp:~widelands-dev/widelands/bug-collectors into lp:widelands
From: Notabilis, 2016-12-04
-
Re: [Merge] lp:~widelands-dev/widelands/bug-collectors into lp:widelands
From: GunChleoc, 2016-12-04
-
[Merge] lp:~widelands-dev/widelands/bug-collectors into lp:widelands
From: noreply, 2016-12-02
-
Re: [Merge] lp:~widelands-dev/widelands/bug-collectors into lp:widelands
From: GunChleoc, 2016-12-02
-
Re: [Merge] lp:~widelands-dev/widelands/bug-collectors into lp:widelands
From: Notabilis, 2016-12-01
-
Re: [Merge] lp:~widelands-dev/widelands/bug-collectors into lp:widelands
From: GunChleoc, 2016-12-01
-
[Merge] lp:~widelands-dev/widelands/bug-collectors into lp:widelands
From: bunnybot, 2016-12-01
-
Re: [Merge] lp:~widelands-dev/widelands/bug-collectors into lp:widelands
From: Notabilis, 2016-11-30
-
Re: [Merge] lp:~widelands-dev/widelands/bug-collectors into lp:widelands
From: GunChleoc, 2016-11-30
-
[Merge] lp:~widelands-dev/widelands/bug-collectors into lp:widelands
From: bunnybot, 2016-11-30