Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/Feature: Display GS dead state in the GS button in AI Debug window. (just as it is for AIs) #5230

Closed
DorpsGek opened this issue Jul 3, 2012 · 8 comments
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Jul 3, 2012

Zuu opened the ticket and wrote:

When an AI crashes, its button in the AI Debug window become red. The game script button on the other hand doesn't become red if the game script crashes.

This patch generalize the action of setting the button colour based on the dead states and use it both for AIs and Game Script.

This patch both fixes a problem in trunk and is a step to prepare for indicating paused scripts with yellow widget background in #5206.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5230
@DorpsGek
Copy link
Member Author

DorpsGek commented Jul 4, 2012

michi_cc wrote:

Minor nitpick: "bool dead = game && game->IsDead();"

Coding style says explicit comparisons with NULL.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5230#comment11304

@DorpsGek
Copy link
Member Author

DorpsGek commented Jul 6, 2012

Zuu wrote:

Ah, there is always something you forget about the coding style. :-)


This comment was imported from FlySpray: https://bugs.openttd.org/task/5230#comment11321

@DorpsGek
Copy link
Member Author

Zuu wrote:

The reported coding style issue have been fixed.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5230#comment11367

@DorpsGek
Copy link
Member Author

Alberth wrote:

Please write full English sentences in the line comments and doxygen lines.
In the second hunk you can rewrite the dirty flag setting to "dirty |= SetScriptButtonColour(*button, dead);".
In the last hunk, there is also a widget repaint function "Window::SetWidgetDirty(widget_index)" that may be useful.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5230#comment11371

@DorpsGek
Copy link
Member Author

Zuu wrote:

With
dirty |= SetScriptButtonColour(*button, dead);

will it not skip calling SetScriptButtonColour if dirty is already true?

What I could do is
dirty = SetScriptButtonColour(*button, dead) || dirty;

That will always call SetScriptButtonColour even if dirty is true.

Regarding full English sentences, do you refer to that the @param lines should end with full stop?


This comment was imported from FlySpray: https://bugs.openttd.org/task/5230#comment11372

@DorpsGek
Copy link
Member Author

Alberth wrote:

No, only || and && have short-circuit evaluation. | and & will always evaluate both sides.

Yes, I'd like to have complete sentences in comment and doxygen comments, starting with an upper-case letter, and ending with a full stop.
It is just a wish from me though, the coding style does not say about them.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5230#comment11373

@DorpsGek
Copy link
Member Author

Zuu wrote:

Uses
- dirty = SetScriptButtonColour(*button, dead) || dirty;
- more complete sentences
- SetWidgetDirty for script debug button

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5230#comment11457

@DorpsGek
Copy link
Member Author

Zuu closed the ticket.

Reason for closing: Implemented

In r24489


This comment was imported from FlySpray: https://bugs.openttd.org/task/5230

@DorpsGek DorpsGek added component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant