public class AircraftTools
extends java.lang.Object
This Class is used to provide helpers and missing functions for Aircrafts in IL-2 Sturmovik 1946.
Modifier and Type | Method and Description |
---|---|
static void |
updateExternalWeaponHooks(com.maddox.il2.objects.air.Aircraft aircraft)
This method provides a simple means of keeping wing weapons visible and usable while
an Aircraft is folding its wings. |
static void |
weaponsRegister(java.lang.Class airClass,
java.lang.String slotName,
java.lang.String[] theWeapons)
This method provides support for creation of aircraft weapon slots with a single line of code.
|
public static final void weaponsRegister(java.lang.Class airClass, java.lang.String slotName, java.lang.String[] theWeapons)
weaponsRegister(class1, "default", new String[] { "MGunBrowning50k 250", "MGunBrowning50k 250" });
airClass
- The aircraft's Class where you want to create a weapon slot forslotName
- The string defining the name of the weapon slot, e.g. "default", "empty", "2x100lb" etc.theWeapons
- The weapons available in this slot.public static final void updateExternalWeaponHooks(com.maddox.il2.objects.air.Aircraft aircraft)
public void moveWingFold(float f) {
if (f < 0.001F) {
this.setGunPodsOn(true);
this.hideWingWeapons(false);
} else {
this.setGunPodsOn(false);
this.FM.CT.WeaponControl[0] = false;
this.hideWingWeapons(true);
}
this.moveWingFold(this.hierMesh(), f);
}
public void moveWingFold(float f) {
this.moveWingFold(this.hierMesh(), f);
AircraftTools.updateExternalWeaponHooks(this);
}
aircraft
- The aircraft which needs to have its wing weapons updated while folding wings