* Set the widget colour of a button based on the * state of the script. (dead or alive) * @param button the button to update. * @param dead true if the script is dead, otherwise false. * @param paused true if the script is paused, otherwise false. * @return true if the colour was changed and the window need to be marked as dirty. */
| 644 | * @return true if the colour was changed and the window need to be marked as dirty. |
| 645 | */ |
| 646 | static bool SetScriptButtonColour(NWidgetCore &button, bool dead, bool paused) |
| 647 | { |
| 648 | /* Dead scripts are indicated with red background and |
| 649 | * paused scripts are indicated with yellow background. */ |
| 650 | Colours colour = dead ? COLOUR_RED : |
| 651 | (paused ? COLOUR_YELLOW : COLOUR_GREY); |
| 652 | if (button.colour != colour) { |
| 653 | button.colour = colour; |
| 654 | return true; |
| 655 | } |
| 656 | return false; |
| 657 | } |
| 658 | |
| 659 | /** |
| 660 | * Window with everything an AI prints via ScriptLog. |
no outgoing calls
no test coverage detected