Page 1 of 1

Change or disable Emergency Flag

Posted: Tue Nov 01, 2016 7:29 pm
by ricreig
Hi, im looking for the line where i can disable the red flag on the emergency squawk that appears on the aircraft list.

The retrieved squawks are not ver reliable so, i got 7500 like 10 a day, and... come on that would be on the news.

So i would appreciate a walkthrough to delete this flag either with custom content or modify the js files.

Thanks so much in advance.

Re: Change or disable Emergency Flag

Posted: Sun Nov 06, 2016 1:36 am
by agw
If you save the script below to a file called "NoEmergency.html":

Code: Select all

<script type="text/javascript">
    if(VRS && VRS.globalDispatch && VRS.serverConfig) {
        VRS.globalDispatch.hook(VRS.globalEvent.bootstrapCreated, function(bootStrap) {
            if(bootStrap.hookInitialised) {
                bootStrap.hookInitialised(function(pageSettings) {
                    var aircraftList = pageSettings.aircraftList;
                    if(aircraftList) {
                        aircraftList.hookAppliedJson(function() {
                            aircraftList.foreachAircraft(function(aircraft) {
                                if(aircraft.isEmergency.val) {
                                    aircraft.isEmergency.val = false;
                                }
                            });
                        });
                    }
                });
            }
        });
    }
</script>
and then install the custom content plugin, run VRS, click Plugins, click Options against the custom content plugin and then:

1. Make sure the Enabled checkbox is ticked.
2. Click New
3. Click the "..." against "Inject file" and choose your NoEmergency.html file
4. Change the address to an asterisk (i.e. *)
5. Click OK
6. Reload the page in the browser

Then that should switch off the isEmergency flag for all aircraft on display.

Re: Change or disable Emergency Flag

Posted: Wed Nov 09, 2016 3:35 am
by ricreig
Wow! Thanks so much for the quick reply, it worked like a charm.

Regards!