Worms4Editor/W4Gui/Components/SchemePanel.cs

218 lines
13 KiB
C#

using LibW4M.Data.Highscores;
using LibW4M.Data.Schemes;
using LibW4M.Data.Teams;
using LibW4M.Data.WeaponFactory;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using W4Gui.Dialogs;
namespace W4Gui.Components
{
public partial class SchemePanel : UserControl
{
public SchemePanel()
{
InitializeComponent();
}
public void SaveSchemeData(ref SchemeData scheme)
{
this.selAirstrike.SaveWeaponSettingsData(ref scheme.Airstrike);
this.selBananaBomb.SaveWeaponSettingsData(ref scheme.BananaBomb);
this.selBaseballBat.SaveWeaponSettingsData(ref scheme.BaseballBat);
this.selBazooka.SaveWeaponSettingsData(ref scheme.Bazooka);
this.selClusterBomb.SaveWeaponSettingsData(ref scheme.ClusterGrenade);
this.selConcreteDonkey.SaveWeaponSettingsData(ref scheme.ConcreteDonkey);
this.selCrateShower.SaveWeaponSettingsData(ref scheme.CrateShower);
this.selCrateSpy.SaveWeaponSettingsData(ref scheme.CrateSpy);
this.selDoubleDamage.SaveWeaponSettingsData(ref scheme.DoubleDamage);
this.selDynamite.SaveWeaponSettingsData(ref scheme.Dynamite);
this.selFirePunch.SaveWeaponSettingsData(ref scheme.FirePunch);
this.selGasCanister.SaveWeaponSettingsData(ref scheme.GasCanister);
this.selGirder.SaveWeaponSettingsData(ref scheme.Girder);
this.selGrenade.SaveWeaponSettingsData(ref scheme.Grenade);
this.selHolyHandGrenade.SaveWeaponSettingsData(ref scheme.HolyHandGrenade);
this.selHomingMissile.SaveWeaponSettingsData(ref scheme.HomingMissile);
this.selJetpack.SaveWeaponSettingsData(ref scheme.Jetpack);
this.selLandMine.SaveWeaponSettingsData(ref scheme.Landmine);
this.selNinjaRope.SaveWeaponSettingsData(ref scheme.NinjaRope);
this.selOldWoman.SaveWeaponSettingsData(ref scheme.OldWoman);
this.selParachute.SaveWeaponSettingsData(ref scheme.Parachute);
this.selProd.SaveWeaponSettingsData(ref scheme.Prod);
this.selWormSelect.SaveWeaponSettingsData(ref scheme.SelectWorm);
this.selSheep.SaveWeaponSettingsData(ref scheme.Sheep);
this.selShotgun.SaveWeaponSettingsData(ref scheme.Shotgun);
this.selSkipGo.SaveWeaponSettingsData(ref scheme.SkipGo);
this.selSuperSheep.SaveWeaponSettingsData(ref scheme.SuperSheep);
this.selIcarusPotion.SaveWeaponSettingsData(ref scheme.Redbull);
this.selFlood.SaveWeaponSettingsData(ref scheme.Flood);
this.selArmour.SaveWeaponSettingsData(ref scheme.Armour);
this.selTeamWeapon.SaveWeaponSettingsData(ref scheme.WeaponFactoryWeapon);
this.selAlienAbduction.SaveWeaponSettingsData(ref scheme.AlienAbduction);
this.selFatkinsStrike.SaveWeaponSettingsData(ref scheme.Fatkins);
this.selInflatableScouser.SaveWeaponSettingsData(ref scheme.Scouser);
this.selTailNail.SaveWeaponSettingsData(ref scheme.NoMoreNails);
this.selPoisonArrow.SaveWeaponSettingsData(ref scheme.PoisonArrow);
this.selSentryGun.SaveWeaponSettingsData(ref scheme.SentryGun);
this.selSniperRifle.SaveWeaponSettingsData(ref scheme.SniperRifle);
this.selBovineBlitz.SaveWeaponSettingsData(ref scheme.SuperAirstrike);
this.selBubbleTrouble.SaveWeaponSettingsData(ref scheme.BubbleTrouble);
this.selStarburst.SaveWeaponSettingsData(ref scheme.Starburst);
this.selSurrender.SaveWeaponSettingsData(ref scheme.Surrender);
this.selMineLayerMystery.SaveWeaponSettingsData(ref scheme.MineLayerMystery);
this.selMineTripletMystery.SaveWeaponSettingsData(ref scheme.MineTripletMystery);
this.selBarrelTripletMystery.SaveWeaponSettingsData(ref scheme.BarrelTripletMystery);
this.selFloodMystery.SaveWeaponSettingsData(ref scheme.FloodMystery);
this.selDisarmMystery.SaveWeaponSettingsData(ref scheme.DisarmMystery);
this.selTeleportMystery.SaveWeaponSettingsData(ref scheme.TeleportMystery);
this.selQuickWalkMystery.SaveWeaponSettingsData(ref scheme.QuickWalkMystery);
this.selLowGravityMystery.SaveWeaponSettingsData(ref scheme.LowGravityMystery);
this.selDoubleTurnTimeMystery.SaveWeaponSettingsData(ref scheme.DoubleTurnTimeMystery);
this.selHealthMystery.SaveWeaponSettingsData(ref scheme.HealthMystery);
this.selDoubleDamage.SaveWeaponSettingsData(ref scheme.DamageMystery);
this.selSuperHealthMystery.SaveWeaponSettingsData(ref scheme.SuperHealthMystery);
this.selSpecialWeaponMystery.SaveWeaponSettingsData(ref scheme.SpecialWeaponMystery);
this.selBadPoisonMystery.SaveWeaponSettingsData(ref scheme.BadPoisonMystery);
this.selGoodPoisonMystery.SaveWeaponSettingsData(ref scheme.GoodPoisonMystery);
scheme.Name = DataManager.SaveFile.LookupString(this.selSchemeName.Text);
scheme.Lock = DataManager.SaveFile.LookupString(this.selLock.Text);
scheme.ArtileryMode = this.selArtilaryMode.Value;
scheme.TeleportIn = this.selTeleportIn.Value;
scheme.Wins = this.selNumRounds.Value;
scheme.WormSelect = this.selWormSelectAtGameStart.Value;
scheme.WormHealth = this.selWormHealth.Value;
scheme.RoundTime = this.selRoundTime.Value;
scheme.TurnTime = this.selTurnTime.Value;
scheme.Stockpiling = (Stockpiling)this.selStockpiling.SelectedIndex;
scheme.DisplayTime = this.selDisplayTime.Value;
scheme.LandTime = this.selLandTime.Value;
scheme.RopeTime = this.selRopeTime.Value;
scheme.FallDamage = this.selFallDamage.Value;
scheme.HotSeat = this.selHotSeat.Value;
scheme.Special = this.selSpecial.Value;
scheme.HelpPanelDelay = this.selHelpPanelDisplay.Value;
scheme.Permanant = this.selPermanent.Checked;
scheme.RandomCrateChancePerTurn = this.selCrateChance.Value;
scheme.MysteryChance = this.selMysteryCrateChance.Value;
scheme.UtilityChance = this.selUtilityCrateChance.Value;
scheme.HealthChance = this.selHealthCrateChance.Value;
scheme.HealthInCrates = this.selHealthCrateAmount.Value;
scheme.Objects = (LandObjects)this.selLndObjects.SelectedIndex;
scheme.MineFuse = this.selMineFuse.Value;
scheme.SuddenDeath = (SuddenDeath)this.selSuddenDeath.SelectedIndex;
scheme.WaterSpeed = (WaterSpeed)this.selWaterSpeed.SelectedIndex;
scheme.WindMaxStrength = this.selMaxWindStrength.Value;
scheme.MineFactoryOn = this.selMineFactory.Checked;
scheme.TelepadsOn = this.selTelepads.Checked;
}
public void LoadSchemeData(SchemeData scheme)
{
this.selAirstrike.LoadWeaponSettingsData(scheme.Airstrike);
this.selBananaBomb.LoadWeaponSettingsData(scheme.BananaBomb);
this.selBaseballBat.LoadWeaponSettingsData(scheme.BaseballBat);
this.selBazooka.LoadWeaponSettingsData(scheme.Bazooka);
this.selClusterBomb.LoadWeaponSettingsData(scheme.ClusterGrenade);
this.selConcreteDonkey.LoadWeaponSettingsData(scheme.ConcreteDonkey);
this.selCrateShower.LoadWeaponSettingsData(scheme.CrateShower);
this.selCrateSpy.LoadWeaponSettingsData(scheme.CrateSpy);
this.selDoubleDamage.LoadWeaponSettingsData(scheme.DoubleDamage);
this.selDynamite.LoadWeaponSettingsData(scheme.Dynamite);
this.selFirePunch.LoadWeaponSettingsData(scheme.FirePunch);
this.selGasCanister.LoadWeaponSettingsData(scheme.GasCanister);
this.selGirder.LoadWeaponSettingsData(scheme.Girder);
this.selGrenade.LoadWeaponSettingsData(scheme.Grenade);
this.selHolyHandGrenade.LoadWeaponSettingsData(scheme.HolyHandGrenade);
this.selHomingMissile.LoadWeaponSettingsData(scheme.HomingMissile);
this.selJetpack.LoadWeaponSettingsData(scheme.Jetpack);
this.selLandMine.LoadWeaponSettingsData(scheme.Landmine);
this.selNinjaRope.LoadWeaponSettingsData(scheme.NinjaRope);
this.selOldWoman.LoadWeaponSettingsData(scheme.OldWoman);
this.selParachute.LoadWeaponSettingsData(scheme.Parachute);
this.selProd.LoadWeaponSettingsData(scheme.Prod);
this.selWormSelect.LoadWeaponSettingsData(scheme.SelectWorm);
this.selSheep.LoadWeaponSettingsData(scheme.Sheep);
this.selShotgun.LoadWeaponSettingsData(scheme.Shotgun);
this.selSkipGo.LoadWeaponSettingsData(scheme.SkipGo);
this.selSuperSheep.LoadWeaponSettingsData(scheme.SuperSheep);
this.selIcarusPotion.LoadWeaponSettingsData(scheme.Redbull);
this.selFlood.LoadWeaponSettingsData(scheme.Flood);
this.selArmour.LoadWeaponSettingsData(scheme.Armour);
this.selTeamWeapon.LoadWeaponSettingsData(scheme.WeaponFactoryWeapon);
this.selAlienAbduction.LoadWeaponSettingsData(scheme.AlienAbduction);
this.selFatkinsStrike.LoadWeaponSettingsData(scheme.Fatkins);
this.selInflatableScouser.LoadWeaponSettingsData(scheme.Scouser);
this.selTailNail.LoadWeaponSettingsData(scheme.NoMoreNails);
this.selPoisonArrow.LoadWeaponSettingsData(scheme.PoisonArrow);
this.selSentryGun.LoadWeaponSettingsData(scheme.SentryGun);
this.selSniperRifle.LoadWeaponSettingsData(scheme.SniperRifle);
this.selBovineBlitz.LoadWeaponSettingsData(scheme.SuperAirstrike);
this.selBubbleTrouble.LoadWeaponSettingsData(scheme.BubbleTrouble);
this.selStarburst.LoadWeaponSettingsData(scheme.Starburst);
this.selSurrender.LoadWeaponSettingsData(scheme.Surrender);
this.selMineLayerMystery.LoadWeaponSettingsData(scheme.MineLayerMystery);
this.selMineTripletMystery.LoadWeaponSettingsData(scheme.MineTripletMystery);
this.selBarrelTripletMystery.LoadWeaponSettingsData(scheme.BarrelTripletMystery);
this.selFloodMystery.LoadWeaponSettingsData(scheme.FloodMystery);
this.selDisarmMystery.LoadWeaponSettingsData(scheme.DisarmMystery);
this.selTeleportMystery.LoadWeaponSettingsData(scheme.TeleportMystery);
this.selQuickWalkMystery.LoadWeaponSettingsData(scheme.QuickWalkMystery);
this.selLowGravityMystery.LoadWeaponSettingsData(scheme.LowGravityMystery);
this.selDoubleTurnTimeMystery.LoadWeaponSettingsData(scheme.DoubleTurnTimeMystery);
this.selHealthMystery.LoadWeaponSettingsData(scheme.HealthMystery);
this.selDoubleDamage.LoadWeaponSettingsData(scheme.DamageMystery);
this.selSuperHealthMystery.LoadWeaponSettingsData(scheme.SuperHealthMystery);
this.selSpecialWeaponMystery.LoadWeaponSettingsData(scheme.SpecialWeaponMystery);
this.selBadPoisonMystery.LoadWeaponSettingsData(scheme.BadPoisonMystery);
this.selGoodPoisonMystery.LoadWeaponSettingsData(scheme.GoodPoisonMystery);
this.selSchemeName.Text = scheme.Name.Value;
this.selLock.Text = scheme.Lock.Value;
this.selArtilaryMode.Value = scheme.ArtileryMode;
this.selTeleportIn.Value = scheme.TeleportIn;
this.selNumRounds.Value = scheme.Wins;
this.selWormSelectAtGameStart.Value = scheme.WormSelect;
this.selWormHealth.Value = scheme.WormHealth;
this.selRoundTime.Value = scheme.RoundTime;
this.selTurnTime.Value = scheme.TurnTime;
this.selStockpiling.SelectedIndex = (int)scheme.Stockpiling;
this.selDisplayTime.Value = scheme.DisplayTime;
this.selLandTime.Value = scheme.LandTime;
this.selRopeTime.Value = scheme.RopeTime;
this.selFallDamage.Value = scheme.FallDamage;
this.selHotSeat.Value = scheme.HotSeat;
this.selSpecial.Value = scheme.Special;
this.selHelpPanelDisplay.Value = scheme.HelpPanelDelay;
this.selPermanent.Checked = scheme.Permanant;
this.selCrateChance.Value = scheme.RandomCrateChancePerTurn;
this.selMysteryCrateChance.Value = scheme.MysteryChance;
this.selUtilityCrateChance.Value = scheme.UtilityChance;
this.selHealthCrateChance.Value = scheme.HealthChance;
this.selHealthCrateAmount.Value = scheme.HealthInCrates;
this.selLndObjects.SelectedIndex = (int)scheme.Objects;
this.selMineFuse.Value = scheme.MineFuse;
this.selSuddenDeath.SelectedIndex = (int)scheme.SuddenDeath;
this.selWaterSpeed.SelectedIndex = (int)scheme.WaterSpeed;
this.selMaxWindStrength.Value = scheme.WindMaxStrength;
this.selMineFactory.Checked = scheme.MineFactoryOn;
this.selTelepads.Checked = scheme.TelepadsOn;
}
}
}