public override void LeaveState() { base.LeaveState(); shipselectKit = null; aiconKit = null; ticonKit = null; ciconKit = null; ShipSelect.MenuDestroy(); ShipSelect = null; leftButtonKit = null; leftButton.MenuDestroy(); leftButton = null; rightButtonKit = null; rightButton.MenuDestroy(); rightButton = null; backButtonKit = null; backButton.MenuDestroy(); backButton = null; mAbilityBox.MenuDestroy(); mAbilityBox = null; mGameReference.aaDisplay.mMenuUIElements.Clear(); }
public override void EnterState() { base.EnterState(); Abilitydata = mGameReference.aaDisplay.aaGame.aaHSManager.Abilitydata; lockedKit = new AssetKit_Ability_Locked(); quickturnKit = new AssetKit_Ability_QuickTurn(); warpdriveKit = new AssetKit_Ability_WarpDrive(); gunoverchargeKit = new AssetKit_Ability_GunOvercharge(); bulletstarKit = new AssetKit_Ability_BulletStar(); bulletfurryKit = new AssetKit_Ability_BulletFurry(); dualwieldKit = new AssetKit_Ability_DualWield(); missileflurryKit = new AssetKit_Ability_MissileFlurry(); overchargeenginesKit = new AssetKit_Ability_OverchargeEngines(); tighterturnsKit = new AssetKit_Ability_TighterTurns(); energyshieldKit = new AssetKit_Ability_EnergyShield(); shotgunblastKit = new AssetKit_Ability_ShotgunBlast(); reargunsKit = new AssetKit_Ability_RearGuns(); antibulletsKit = new AssetKit_Ability_AntiBullets(); satelliteKit = new AssetKit_Ability_Satellite(); mineKit = new AssetKit_Ability_Mine(); fullshieldKit = new AssetKit_Ability_FullShield(); DefaultAbility1 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, quickturnKit.ASSET_NAME, 633, 335, (int)quickturnKit.ORIGIN.X, (int)quickturnKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, quickturnKit.SRC_RECTX, quickturnKit.SRC_RECTY, quickturnKit.SRC_RECTWIDTH, quickturnKit.SRC_RECTHEIGHT, 0.0f); DefaultAbility2 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, warpdriveKit.ASSET_NAME, 705, 335, (int)warpdriveKit.ORIGIN.X, (int)warpdriveKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, warpdriveKit.SRC_RECTX, warpdriveKit.SRC_RECTY, warpdriveKit.SRC_RECTWIDTH, warpdriveKit.SRC_RECTHEIGHT, 0.0f); DefaultAbility3 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, gunoverchargeKit.ASSET_NAME, 779, 335, (int)gunoverchargeKit.ORIGIN.X, (int)gunoverchargeKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, gunoverchargeKit.SRC_RECTX, gunoverchargeKit.SRC_RECTY, gunoverchargeKit.SRC_RECTWIDTH, gunoverchargeKit.SRC_RECTHEIGHT, 0.0f); DefaultAbility4 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, bulletstarKit.ASSET_NAME, 849, 335, (int)bulletstarKit.ORIGIN.X, (int)bulletstarKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, bulletstarKit.SRC_RECTX, bulletstarKit.SRC_RECTY, bulletstarKit.SRC_RECTWIDTH, bulletstarKit.SRC_RECTHEIGHT, 0.0f); SpecialAbility1 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, lockedKit.ASSET_NAME, 633, 482, (int)lockedKit.ORIGIN.X, (int)lockedKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, lockedKit.SRC_RECTX, lockedKit.SRC_RECTY, lockedKit.SRC_RECTWIDTH, lockedKit.SRC_RECTHEIGHT, 0.0f); SpecialAbility2 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, lockedKit.ASSET_NAME, 705, 482, (int)lockedKit.ORIGIN.X, (int)lockedKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, lockedKit.SRC_RECTX, lockedKit.SRC_RECTY, lockedKit.SRC_RECTWIDTH, lockedKit.SRC_RECTHEIGHT, 0.0f); SpecialAbility3 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, lockedKit.ASSET_NAME, 779, 482, (int)lockedKit.ORIGIN.X, (int)lockedKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, lockedKit.SRC_RECTX, lockedKit.SRC_RECTY, lockedKit.SRC_RECTWIDTH, lockedKit.SRC_RECTHEIGHT, 0.0f); SpecialAbility4 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, lockedKit.ASSET_NAME, 849, 482, (int)lockedKit.ORIGIN.X, (int)lockedKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, lockedKit.SRC_RECTX, lockedKit.SRC_RECTY, lockedKit.SRC_RECTWIDTH, lockedKit.SRC_RECTHEIGHT, 0.0f); mGameReference.aaDisplay.AddMenuUIElement(DefaultAbility1); mGameReference.aaDisplay.AddMenuUIElement(DefaultAbility2); mGameReference.aaDisplay.AddMenuUIElement(DefaultAbility3); mGameReference.aaDisplay.AddMenuUIElement(DefaultAbility4); mGameReference.aaDisplay.AddMenuUIElement(SpecialAbility1); mGameReference.aaDisplay.AddMenuUIElement(SpecialAbility2); mGameReference.aaDisplay.AddMenuUIElement(SpecialAbility3); mGameReference.aaDisplay.AddMenuUIElement(SpecialAbility4); abilitykit = new AssetKit_AbilityButton(); ability1Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 639, 206, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f); ability2Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 711, 206, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f); ability3Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 785, 206, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f); ability4Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 855, 206, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f); default1Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 639, 341, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f); default2Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 711, 341, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f); default3Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 785, 341, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f); default4Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 855, 341, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f); special1Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 639, 488, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f); special2Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 711, 488, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f); special3Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 785, 488, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f); special4Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 855, 488, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f); ability1Button.highlightDisabled = true; ability2Button.highlightDisabled = true; ability3Button.highlightDisabled = true; ability4Button.highlightDisabled = true; mGameReference.aaDisplay.AddMenuUIElement(ability1Button); mGameReference.aaDisplay.AddMenuUIElement(ability2Button); mGameReference.aaDisplay.AddMenuUIElement(ability3Button); mGameReference.aaDisplay.AddMenuUIElement(ability4Button); mGameReference.aaDisplay.AddMenuUIElement(default1Button); mGameReference.aaDisplay.AddMenuUIElement(default2Button); mGameReference.aaDisplay.AddMenuUIElement(default3Button); mGameReference.aaDisplay.AddMenuUIElement(default4Button); mGameReference.aaDisplay.AddMenuUIElement(special1Button); mGameReference.aaDisplay.AddMenuUIElement(special2Button); mGameReference.aaDisplay.AddMenuUIElement(special3Button); mGameReference.aaDisplay.AddMenuUIElement(special4Button); backButtonKit = new AssetKit_Menu_BackButton(); backButton = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, backButtonKit.ASSET_NAME, 1060, 370, (int)backButtonKit.ORIGIN.X, (int)backButtonKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, backButtonKit.SRC_RECTX, backButtonKit.SRC_RECTY, backButtonKit.SRC_RECTWIDTH, backButtonKit.SRC_RECTHEIGHT, 0.0f); mGameReference.aaDisplay.AddMenuUIElement(backButton); rightButtonKit = new AssetKit_RightArrowButton(); rightButton = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, rightButtonKit.ASSET_NAME, 325, 90, (int)rightButtonKit.ORIGIN.X, (int)rightButtonKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, rightButtonKit.SRC_RECTX, rightButtonKit.SRC_RECTY, rightButtonKit.SRC_RECTWIDTH, rightButtonKit.SRC_RECTHEIGHT, 0.0f); mGameReference.aaDisplay.AddMenuUIElement(rightButton); leftButtonKit = new AssetKit_LeftArrowButton(); leftButton = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, leftButtonKit.ASSET_NAME, 180, 90, (int)leftButtonKit.ORIGIN.X, (int)leftButtonKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, leftButtonKit.SRC_RECTX, leftButtonKit.SRC_RECTY, leftButtonKit.SRC_RECTWIDTH, leftButtonKit.SRC_RECTHEIGHT, 0.0f); mGameReference.aaDisplay.AddMenuUIElement(leftButton); playButtonKit = new AssetKit_PlayButton(); playButton = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, playButtonKit.ASSET_NAME, 1060, 270, (int)playButtonKit.ORIGIN.X, (int)playButtonKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, playButtonKit.SRC_RECTX, playButtonKit.SRC_RECTY, playButtonKit.SRC_RECTWIDTH, playButtonKit.SRC_RECTHEIGHT, 0.0f); mGameReference.aaDisplay.AddMenuUIElement(playButton); aiconKit = new AssetKit_AgilityIcon(); ticonKit = new AssetKit_TankIcon(); ciconKit = new AssetKit_CommandoIcon(); ShipIcon = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, aiconKit.ASSET_NAME, 235, 85, (int)aiconKit.ORIGIN.X, (int)aiconKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, aiconKit.SRC_RECTX, aiconKit.SRC_RECTY, aiconKit.SRC_RECTWIDTH, aiconKit.SRC_RECTHEIGHT, 0.0f); mGameReference.aaDisplay.AddMenuUIElement(ShipIcon); shipselectKit = new AssetKit_ShipSelect(); ShipSelect = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, shipselectKit.ASSET_NAME, 20, 10, (int)shipselectKit.ORIGIN.X, (int)shipselectKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, shipselectKit.SRC_RECTX, shipselectKit.SRC_RECTY, shipselectKit.SRC_RECTWIDTH, shipselectKit.SRC_RECTHEIGHT, 0.0f); mGameReference.aaDisplay.AddMenuUIElement(ShipSelect); helpKit = new AssetKit_ShipMenu_Help(); HelpPlaque = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, helpKit.ASSET_NAME, 20, 365, (int)helpKit.ORIGIN.X, (int)helpKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, helpKit.SRC_RECTX, helpKit.SRC_RECTY, helpKit.SRC_RECTWIDTH, helpKit.SRC_RECTHEIGHT, 0.0f); mGameReference.aaDisplay.AddMenuUIElement(HelpPlaque); abilityselectKit = new AssetKit_AbilitySelect(); AbilitySelect = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilityselectKit.ASSET_NAME, 535, 60, (int)abilityselectKit.ORIGIN.X, (int)abilityselectKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, abilityselectKit.SRC_RECTX, abilityselectKit.SRC_RECTY, abilityselectKit.SRC_RECTWIDTH, abilityselectKit.SRC_RECTHEIGHT, 0.0f); mGameReference.aaDisplay.AddMenuUIElement(AbilitySelect); mAbilityBox = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.mTextboxFont, 900 - (int)(textSize.X / 2), 560, Color.White, ""); mDescriptionBox = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.mDescriptionFont, 935 - (int)(textSize.X / 2), 600, Color.White, ""); mGameReference.aaDisplay.AddMenuUIElement(mAbilityBox); mGameReference.aaDisplay.AddMenuUIElement(mDescriptionBox); mShipName = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.mTextboxFont, 270 - (int)(textSize.X / 2), 185, Color.White, shipname); mHealth = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.mDescription2Font, 131, 230, Color.White, "Health: " + health); mMaxThrust = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.mDescription2Font, 132, 260, Color.White, "Max Thrust: " + maxthrust); mTurnSpeed = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.mDescription2Font, 130, 290, Color.White, "Turn Speed: " + turnspeed); slot1Kit = new AssetKit_Ability_Slot1(); slot2Kit = new AssetKit_Ability_Slot2(); slot3Kit = new AssetKit_Ability_Slot3(); slot4Kit = new AssetKit_Ability_Slot4(); Ability1 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, slot1Kit.ASSET_NAME, 633, 200, (int)slot1Kit.ORIGIN.X, (int)slot1Kit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, slot1Kit.SRC_RECTX, slot1Kit.SRC_RECTY, slot1Kit.SRC_RECTWIDTH, slot1Kit.SRC_RECTHEIGHT, 0.0f); Ability2 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, slot1Kit.ASSET_NAME, 705, 200, (int)slot1Kit.ORIGIN.X, (int)slot1Kit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, slot1Kit.SRC_RECTX, slot1Kit.SRC_RECTY, slot1Kit.SRC_RECTWIDTH, slot1Kit.SRC_RECTHEIGHT, 0.0f); Ability3 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, slot1Kit.ASSET_NAME, 779, 200, (int)slot1Kit.ORIGIN.X, (int)slot1Kit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, slot1Kit.SRC_RECTX, slot1Kit.SRC_RECTY, slot1Kit.SRC_RECTWIDTH, slot1Kit.SRC_RECTHEIGHT, 0.0f); Ability4 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, slot1Kit.ASSET_NAME, 849, 200, (int)slot1Kit.ORIGIN.X, (int)slot1Kit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, slot1Kit.SRC_RECTX, slot1Kit.SRC_RECTY, slot1Kit.SRC_RECTWIDTH, slot1Kit.SRC_RECTHEIGHT, 0.0f); mGameReference.aaDisplay.AddMenuUIElement(Ability1); mGameReference.aaDisplay.AddMenuUIElement(Ability2); mGameReference.aaDisplay.AddMenuUIElement(Ability3); mGameReference.aaDisplay.AddMenuUIElement(Ability4); ShipChangeUpdate(); }