[patch] Improve sitrep messages

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Message
Author
User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: [patch] Improve sitrep messages

#16 Post by adrian_broher »

Vegavis wrote:Here is a version with the field-filling code repeated for each variant. Do you really prefer it?
Yes, I do. Thanks. The last issue with the given patch is the broken indentation in the ServerApp.cpp file. Otherwise the patch looks fine to me.
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

Vegavis
Space Squid
Posts: 71
Joined: Sun Jan 12, 2014 7:04 am

Re: [patch] Improve sitrep messages

#17 Post by Vegavis »

Oh, more stray tabs. Fixed version attached.

Also, here's a trivial patch to prevent similar problems from other emacs users by giving them the right defaults for indent style and tabs.
Attachments

[The extension patch has been deactivated and can no longer be displayed.]

[The extension patch has been deactivated and can no longer be displayed.]


User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: [patch] Improve sitrep messages

#18 Post by Geoff the Medio »

Vegavis wrote:Also, here's a trivial patch to prevent similar problems from other emacs users by giving them the right defaults for indent style and tabs.
Is there a "FreeOrion/.dir-locals.el" in SVN? I don't see it...

Vegavis
Space Squid
Posts: 71
Joined: Sun Jan 12, 2014 7:04 am

Re: [patch] Improve sitrep messages

#19 Post by Vegavis »

Geoff the Medio wrote:Is there a "FreeOrion/.dir-locals.el" in SVN? I don't see it...
It's not there yet; the patch adds it. (It's a file emacs looks for. Many projects include such tool-specific files to give their users good defaults.)

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: [patch] Improve sitrep messages

#20 Post by Geoff the Medio »

Vegavis wrote:Fixed version attached.
Could you put the EnemyID function in an anonymous namespace, probably at the top of its file?

Could you fix the indenting of the (mostly?) raw text sitrep.AddVariable lines, where the boost::lexical_cast... texts doesn't line up with the preceeding lines?

Vegavis
Space Squid
Posts: 71
Joined: Sun Jan 12, 2014 7:04 am

Re: [patch] Improve sitrep messages

#21 Post by Vegavis »

Geoff the Medio wrote:Could you fix the indenting of the (mostly?) raw text sitrep.AddVariable lines, where the boost::lexical_cast... texts doesn't line up with the preceeding lines?
Done.
Attachments

[The extension patch has been deactivated and can no longer be displayed.]


User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: [patch] Improve sitrep messages

#22 Post by Geoff the Medio »

The UserStringNop comments still apply...

Code: Select all

UserStringNop(enemy_id == ALL_EMPIRES ? "SITREP_GROUND_BATTLE" : "SITREP_GROUND_BATTLE_ENEMY")

Vegavis
Space Squid
Posts: 71
Joined: Sun Jan 12, 2014 7:04 am

Re: [patch] Improve sitrep messages

#23 Post by Vegavis »

Fixed the remaining UserStringNop.
Attachments

[The extension patch has been deactivated and can no longer be displayed.]


User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: [patch] Improve sitrep messages

#24 Post by Geoff the Medio »

Had an extra ) that caused a compile error, but after fixed that, I committed it.

Send me a pm if you have a real name you'd like to be credited with.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: [patch] Improve sitrep messages

#25 Post by Dilvish »

Looks like this still has some bugs. You may have been unaware vegavis, but the default options cause sitreps with errors in them to be supressed; to see them you need to go to the end of the Options->UI tab and select "Situation reports with errors"
ship_sitrep_error.png
ship_sitrep_error.png (7.84 KiB) Viewed 952 times
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Vegavis
Space Squid
Posts: 71
Joined: Sun Jan 12, 2014 7:04 am

Re: [patch] Improve sitrep messages

#26 Post by Vegavis »

Enemy fleets had the wrong message ID. Here's a fix.
Dilvish wrote:the default options cause sitreps with errors in them to be supressed
Why does this feature even exist?
Attachments

[The extension patch has been deactivated and can no longer be displayed.]


User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: [patch] Improve sitrep messages

#27 Post by Geoff the Medio »

Vegavis wrote:Why does this feature even exist?
Because players whine/complain about such very visible errors, and scripts will often cause them.

Edit: committed

Post Reply