Change or disable Emergency Flag

Are you having problems with using or developing a plugin? Let me know here.
Post Reply
ricreig
Posts: 17
Joined: Sat Mar 21, 2015 8:52 pm

Change or disable Emergency Flag

Post by ricreig » Tue Nov 01, 2016 7:29 pm

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.

agw
Posts: 2248
Joined: Fri Feb 17, 2012 3:20 am

Re: Change or disable Emergency Flag

Post by agw » Sun Nov 06, 2016 1:36 am

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.

ricreig
Posts: 17
Joined: Sat Mar 21, 2015 8:52 pm

Re: Change or disable Emergency Flag

Post by ricreig » Wed Nov 09, 2016 3:35 am

Wow! Thanks so much for the quick reply, it worked like a charm.

Regards!

Post Reply