Code: Select all
this.name = "background_changer";
this.alertConditionChanged = function (newAlert, oldAlert) {
if (newAlert == 1) { // green
setScreenBackgroundForKey("status_in_flight", { name: "my_green.png", height: 512 });
} else if (newAlert == 2) { // orange
setScreenBackgroundForKey("status_in_flight", { name: "my_orange.png", height: 512 });
} else if (newAlert == 3) {
setScreenBackgroundForKey("status_red_alert", { name: "my_red.png", height: 512 });
} else if (newAlert == 0) {
setScreenBackgroundForKey("status_docked", { name: "my_blue.png", height: 512 });
}
}
You're hooning along at 32x max speed, and think, "Now would be a good time to check the status screen."
While you're looking at that screen, you become mass-locked.
The screen background instantly changes from green to orange, to alert you to what has happened.
Except it doesn't. The change only takes effect once you leave the status screen and come back to it again.
What my friend would really like to do is change the background image on the market screen on every playerBoughtCargo event, but I've advised him not to even bother trying. Is my advice correct?