Reduce the number of views to cycle through when using the cockpit off function ('Wonder Woman' view).
Based on the stock 4.12 code. Unknown if it works with other versions.
If you want to use (or retain) Storbror's Stabilizers For All Aircraft mod, go instead to the following thread to get this mod incorporating Mike's work as well:
https://www.sas1946.com/main/index.php/topic,65391.0.htmlIf any other mod alters AircraftHotKeys.class, this new bit of code can easily be added to replace the stock code by the creator of that other mod. Otherwise, if you use this mod you lose the feature(s) of the other mod(s).
Get my 'Wonder Woman' reduced view cycling count mod here (built upon stock 4.12 code):
https://www.mediafire.com/file/cvh4ekcd6wghtf3/00_WxTech_No-Cockpit_fewer-views.7z/file=====================================================
From the included readme file (trimmed down to leave out code supplied farther below):
In answer to the recent question posed by shardana in the BAT Lounge: Is it possible to reduce the view count when cycling through the non-cockpit (Wonder Woman) views?
YES, it is! Pretty simple in the end.
My first test, going to extremes, brought the view count down to just 2 views (!) to cycle through; (1) cockpit on, and (2) Wonder Woman view with HUD instruments/reticle (newer type with acceleration vector.) But that's rather limiting. We want to also have at least a view that's completely empty, for gun camera simulating, for instance.
I've always wanted to dispense with those views having the game's original no-cockpit type reticle (no acceleration vector caret), because they are rather superfluous when the later type is available (introduced with Pacific Fighters.)
My desire from long ago was to bring the number of views to cycle through down to no more than 4.
So. I altered the relevant part of AircraftHotKeys.java to obtain the following view cycling sequence (starting from the normal cockpit view):
1) HUD instruments and reticle (newer Pacific Fighters type with acceleration vector indicator)
2) Reticle only (same as previous)
3) Empty
4) Back to cockpit view
As noted this now bypasses the original style no-cockpit reticle (circle with dotted cross lines). I never liked that one, although its texture can be changed to whatever one fancies. I find that the newer reticle introduced with Pacific Fighters, with the valuable addition of the acceleration vector caret, is much more useful. Especially for carrier landing practice!

This mod is based on the stock 4.12 Java. I've no idea at the moment if other game versions are compatible. But any other Java-capable modder can EASILY incorporate this into other versions as required.
Note that users of the 'Stabilizers For All Planes' mod will require to have this code added. Because that mod (and any others out there, for that matter) is based on the same AircraftHotKeys.class. I'll post a version so altered...
This work is offered for use by any and all, for any purpose, without restriction.
WxTech
Nov 14, 2020
=====================================================
For other modders, here's what you're looking at.
Original 4.12 code in AircraftHotKeys.java:
public void begin()
{
if(World.cur().diffCur.Cockpit_Always_On)
return;
if(Main3D.cur3D().isViewOutside())
return;
if(!(Main3D.cur3D().cockpitCur instanceof CockpitPilot))
return;
if(Main3D.cur3D().isViewInsideShow())
{
Main3D.cur3D().hud.bDrawDashBoard = true;
Main3D.cur3D().setViewInsideShow(false);
Main3D.cur3D().cockpitCur.setEnableRenderingBall(true);
} else
if(Main3D.cur3D().hud.bDrawDashBoard && Main3D.cur3D().cockpitCur.isEnableRenderingBall())
Main3D.cur3D().cockpitCur.setEnableRenderingBall(false);
else
if(Main3D.cur3D().hud.bDrawDashBoard && !Main3D.cur3D().cockpitCur.isEnableRenderingBall())
{
Main3D.cur3D().hud.bDrawDashBoard = false;
Main3D.cur3D().cockpitCur.setEnableRenderingBall(true);
} else
if(Main3D.cur3D().isEnableRenderingCockpit() && Main3D.cur3D().cockpitCur.isEnableRenderingBall())
Main3D.cur3D().cockpitCur.setEnableRenderingBall(false);
else
if(Main3D.cur3D().isEnableRenderingCockpit() && !Main3D.cur3D().cockpitCur.isEnableRenderingBall())
{
Main3D.cur3D().setEnableRenderingCockpit(false);
} else
{
Main3D.cur3D().setEnableRenderingCockpit(true);
Main3D.cur3D().setViewInsideShow(true);
}
}
The new code to reduce the view count to 4, as outlined above:
public void begin()
{
if(World.cur().diffCur.Cockpit_Always_On)
return;
if(Main3D.cur3D().isViewOutside())
return;
if(!(Main3D.cur3D().cockpitCur instanceof CockpitPilot))
return;
if(Main3D.cur3D().isViewInsideShow()) //to toggle off interior, and show HUD and reticle
{
Main3D.cur3D().hud.bDrawDashBoard = true;
Main3D.cur3D().setViewInsideShow(false);
Main3D.cur3D().cockpitCur.setEnableRenderingBall(true);
} else
if(Main3D.cur3D().hud.bDrawDashBoard && Main3D.cur3D().cockpitCur.isEnableRenderingBall()) //to toggle off HUD instruments, and show reticle only
{
Main3D.cur3D().hud.bDrawDashBoard = false;
} else
if(Main3D.cur3D().isEnableRenderingCockpit() && Main3D.cur3D().cockpitCur.isEnableRenderingBall()) //to toggle off reticle, and show empty
{
Main3D.cur3D().setEnableRenderingCockpit(false);
Main3D.cur3D().cockpitCur.setEnableRenderingBall(false);
} else
{
Main3D.cur3D().setEnableRenderingCockpit(true); //to restore to normal cockpit view
Main3D.cur3D().setViewInsideShow(true);
}
}