Class WeaponAmmoChoice

java.lang.Object
megamek.client.ui.dialogs.customMek.WeaponAmmoChoice

public class WeaponAmmoChoice extends Object
A panel representing the option to choose a particular ammo bin for an individual weapon.
  • Constructor Details

    • WeaponAmmoChoice

      public WeaponAmmoChoice(WeaponMounted weapon, Entity entity, JPanel parentPanel, GBC2 gbc)
      Constructor
      Parameters:
      weapon - The mounted weapon. Assumes that the weapon uses ammo.
  • Method Details

    • refreshAmmoBinNames

      public void refreshAmmoBinNames()
      Worker function that refreshes the combo box with "up-to-date" ammo names.
    • refreshAmmoBinName

      public void refreshAmmoBinName(Mounted<?> ammoBin, AmmoType selectedAmmoType)
      Refreshes a single item in the ammo type combo box to display the correct ammo type name. Because the underlying ammo bin hasn't been updated yet, we carry out the name swap "in-place".
      Parameters:
      ammoBin - The ammo bin whose ammo type has probably changed.
      selectedAmmoType - The new ammo type.
    • applyChoice

      public void applyChoice()
      Common functionality that applies the panel's current ammo bin choice to the panel's weapon.