So you don't really need the missionScreenEnded. missionScreenEnded could have been from an other similar oxp were you now react on. You currently don't test if it was your oxp that generated the ending.
Better use your callBack for the detection as you have the code already in place as I see it.
Being a VB.NET programmer professionaly I am not experienced in JAVA scripts. I know a bit about callbacks. and I have a call back function as you mentioned as having a parameter choice. Can you please give me a clue what I will receive in choice variable when the player presses F1 Key and ends the mission screen during flight?
And as I said I am not used to Java variables as well.
If you are in-flight, then guiScreen will have the value "GUI_SCREEN_MAIN".
If you're in your mission screen it will be "GUI_SCREEN_MISSION", and if you're in the status screen (F5) it will be "GUI_SCREEN_STATUS". There are other values for the other screens available when docked.
You can't tell which view of the flight screen you are in (front, rear etc) but for your requirements that doesn't matter. In your callback you can use this to see if you're still in a mission screen or not.
Being a VB.NET programmer professionaly I am not experienced in JAVA scripts. I know a bit about callbacks. and I have a call back function as you mentioned as having a parameter choice. Can you please give me a clue what I will receive in choice variable when the player presses F1 Key and ends the mission screen during flight?
Firstly, JavaScript is not Java. :-)
Secondly: as of r4354, you get null. Until a minute ago, you got an arbitrary value or a crash on some platforms and 0 on others. In 1.74, I expect you get undefined.
if(guiScreen === "GUI_SCREEN_MAIN") { code to run if you're currently in the flight screen here }
where the code is what you want to do if the player has left the mission screen via F1-F4. You don't need to reference the choice parameter at all (as nothing will be present there).[/color]
The most chalanging think about being a programmer, you never stop learning. most of it is by trial and error but if you got people like the ones in BB to respond you before you finished your next post it is great indeed.
The most chalanging think about being a programmer, you never stop learning.
True!
On the other hand: after programming for 2-3 dekades, thereby using at least 15 different programming languages there comes a time in your life where learning isn't that easy anymore.
Am I sounding like a grey beard? Nah!
switch (player.ship.viewDirection) {
case "VIEW_FORWARD": xxxx; break;
case "VIEW_AFT": xxxx;break;
case "VIEW_PORT": xxxx;break;
case "VIEW_STARBOARD": xxxx;break;
default : xxxx;
}