#3501 closed enhancement (fixed)
[PATCH] Distinguish player resign and defeat message
Reported by: | Stan | Owned by: | Damien PIQUET |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 21 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | damien@… | Patch: |
Description
Currently it says X has been defeated while it should either say
X has resigned X has been defeated
or just
X has resigned.
Attachments (8)
Change History (16)
comment:1 by , 8 years ago
Milestone: | Backlog → Alpha 20 |
---|
comment:2 by , 8 years ago
Keywords: | simple added |
---|---|
Milestone: | Alpha 20 → Backlog |
Priority: | Should Have → Nice to Have |
Summary: | Incorrect Message When Resigning a MP Game → Distinguish player resign and defeat message |
Type: | defect → enhancement |
by , 8 years ago
comment:3 by , 8 years ago
Cc: | added |
---|---|
Keywords: | review patch added |
Milestone: | Backlog → Alpha 22 |
Owner: | set to |
Status: | new → assigned |
Summary: | Distinguish player resign and defeat message → [PATCH] Distinguish player resign and defeat message |
That's my first patch attempt. It may need rework as i'm not used to the code, i'll rewrite it according to suggestions if needed.
comment:4 by , 8 years ago
Milestone: | Alpha 22 → Alpha 21 |
---|
A21 is next release so putted milestone on that.
From a quick look at the code: "} )" should be simply "})" and use double quotations instead of single.
comment:5 by , 8 years ago
In addition to bb's comments you should also fix the following:
Commands.js
,Player.js
: Remove that unneeded variable and just avoid the undefined warning by using!!foo.bar
- The
formatResignMessage
is ugly. Better copy from the updatedformatDefeatMessage
, which should be less ugly as of r18147.
Also want to mention that setting the resign-boolean in the GUI is the right place, as for example triggerscripts of maps (TriggerHelper.DefeatPlayer()
) might want to send a defead command for that player from the simulation, which should not show up as a resign.
by , 8 years ago
Attachment: | 3501-5.patch added |
---|
by , 8 years ago
Attachment: | 3501-6.patch added |
---|
Merged formatResignMessage and formatDefeatMessage functions
comment:7 by , 8 years ago
Keywords: | simple review removed |
---|
Thanks for the patch and staying with us throughout all the iterations. ;) More patches are always welcome (not only for simple tickets)
Yes, it would be nice to distinguish between defeat and resign.
The reisgn-command is defined in
Commands.js
(and called fromsession.js
):Since it only works for the current playerID, it is not possible to defeat a different player. Therefore it should be safe to add a boolean
resign
argument to the message that is sent in that case, pass it to the notification sent inPlayer.js
and display the alternative message inmessages.js