2015-06-16 21:20:54 +00:00
|
|
|
io.include("Aircraft/c172p/Nasal/registration_number.nas");
|
2008-10-11 23:17:23 +00:00
|
|
|
|
|
|
|
var refresh_immat = func {
|
|
|
|
var immat = props.globals.getNode("/sim/model/immat",1).getValue();
|
2015-06-16 21:20:54 +00:00
|
|
|
set_registration_number(props.globals, immat);
|
|
|
|
};
|
2008-10-11 23:17:23 +00:00
|
|
|
|
|
|
|
var immat_dialog = gui.Dialog.new("/sim/gui/dialogs/c172p/status/dialog",
|
2015-06-16 21:20:54 +00:00
|
|
|
"Aircraft/c172p/gui/dialogs/immat.xml");
|
2012-03-20 20:19:42 +00:00
|
|
|
|
2008-10-11 23:17:23 +00:00
|
|
|
setlistener("/sim/signals/fdm-initialized", func {
|
2015-06-16 21:20:54 +00:00
|
|
|
if (props.globals.getNode("/sim/model/immat") == nil) {
|
|
|
|
var immat = props.globals.getNode("/sim/model/immat", 1);
|
|
|
|
var callsign = props.globals.getNode("/sim/multiplay/callsign").getValue();
|
|
|
|
|
|
|
|
if (callsign != "callsign")
|
|
|
|
immat.setValue(callsign);
|
|
|
|
else
|
|
|
|
immat.setValue("");
|
|
|
|
}
|
|
|
|
setlistener("sim/model/immat", refresh_immat, 1, 0);
|
|
|
|
});
|