Add scheme editor

This commit is contained in:
Li 2023-01-18 23:56:12 -08:00
parent 6ecbff1e66
commit 21906c49f4
15 changed files with 1302 additions and 820 deletions

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibW4M.Data.Schemes
{
public enum LandObjects : int
{
None = 0,
Mines = 1,
OilDrums = 2,
Full = 3
}
}

View File

@ -86,7 +86,7 @@ namespace LibW4M.Data.Schemes
public int WormHealth;
public int RoundTime;
public int TurnTime;
public int Objects; // TODO: make this an enum
public LandObjects Objects;
public int RandomCrateChancePerTurn;
public int MysteryChance;
public int WeaponChance;
@ -94,9 +94,9 @@ namespace LibW4M.Data.Schemes
public int HealthChance;
public int HealthInCrates;
public int Stockpiling; // TODO: make this an enum too
public int SuddenDeath; // TODO: make this an enum too
public int WaterSpeed; // TODO: make this an enum too
public Stockpiling Stockpiling;
public SuddenDeath SuddenDeath; // TODO: make this an enum too
public WaterSpeed WaterSpeed; // TODO: make this an enum too
public int DisplayTime;
public int LandTime;
@ -191,16 +191,16 @@ namespace LibW4M.Data.Schemes
this.WormHealth = reader.ReadInt32();
this.RoundTime = reader.ReadInt32();
this.TurnTime = reader.ReadInt32();
this.Objects = reader.ReadInt32();
this.Objects = (LandObjects)reader.ReadInt32();
this.RandomCrateChancePerTurn = reader.ReadInt32();
this.MysteryChance = reader.ReadInt32();
this.WeaponChance = reader.ReadInt32();
this.UtilityChance = reader.ReadInt32();
this.HealthChance = reader.ReadInt32();
this.HealthInCrates = reader.ReadInt32();
this.Stockpiling = reader.ReadInt32();
this.SuddenDeath = reader.ReadInt32();
this.WaterSpeed = reader.ReadInt32();
this.Stockpiling = (Stockpiling)reader.ReadInt32();
this.SuddenDeath = (SuddenDeath)reader.ReadInt32();
this.WaterSpeed = (WaterSpeed)reader.ReadInt32();
this.DisplayTime = reader.ReadInt32();
this.LandTime = reader.ReadInt32();
this.RopeTime = reader.ReadInt32();
@ -352,16 +352,16 @@ namespace LibW4M.Data.Schemes
writer.WriteInt32(this.WormHealth);
writer.WriteInt32(this.RoundTime);
writer.WriteInt32(this.TurnTime);
writer.WriteInt32(this.Objects);
writer.WriteInt32((int)this.Objects);
writer.WriteInt32(this.RandomCrateChancePerTurn);
writer.WriteInt32(this.MysteryChance);
writer.WriteInt32(this.WeaponChance);
writer.WriteInt32(this.UtilityChance);
writer.WriteInt32(this.HealthChance);
writer.WriteInt32(this.HealthInCrates);
writer.WriteInt32(this.Stockpiling);
writer.WriteInt32(this.SuddenDeath);
writer.WriteInt32(this.WaterSpeed);
writer.WriteInt32((int)this.Stockpiling);
writer.WriteInt32((int)this.SuddenDeath);
writer.WriteInt32((int)this.WaterSpeed);
writer.WriteInt32(this.DisplayTime);
writer.WriteInt32(this.LandTime);
writer.WriteInt32(this.RopeTime);

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibW4M.Data.Schemes
{
public enum Stockpiling : int
{
Normal = 0,
Additive = 1,
Limited = 2
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibW4M.Data.Schemes
{
public enum SuddenDeath : int
{
OneHealth = 0,
RaiseWater = 1,
DrawRound = 2
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibW4M.Data.Schemes
{
public enum WaterSpeed : int
{
None = 0,
Slow = 1,
Medium = 2,
Fast = 3
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
using LibW4M.Data.Highscores;
using LibW4M.Data.Schemes;
using LibW4M.Data.Teams;
using LibW4M.Data.WeaponFactory;
using System;
@ -21,30 +22,196 @@ namespace W4Gui.Components
InitializeComponent();
}
private void generalTab_Click(object sender, EventArgs e)
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;
}
private void weaponTab_Click(object sender, EventArgs e)
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;
}
/*public void SaveHighscoreData(ref HighscoreData highscore)
{
// Load general
highscore.WinnerName = DataManager.SaveFile.LookupString(selWinnerName.Text);
highscore.WinnerTime = selWinnerTime.Value;
}
public void LoadHighscoreData(HighscoreData highscore)
{
// Load general
this.selWinnerName.Text = highscore.WinnerName.Value;
this.selWinnerTime.Value = highscore.WinnerTime;
}*/
}
}

18
W4Gui/Main.Designer.cs generated
View File

@ -48,10 +48,12 @@ namespace W4Gui
this.highscoresPage = new W4Gui.Tabs.HighscoresTab();
this.inputTab = new System.Windows.Forms.TabPage();
this.variablesTab = new System.Windows.Forms.TabPage();
this.schemesPage = new W4Gui.Tabs.SchemeTab();
this.mainMenuStrip.SuspendLayout();
this.mainTabControl.SuspendLayout();
this.weaponTab.SuspendLayout();
this.teamTab.SuspendLayout();
this.schemeTab.SuspendLayout();
this.highscoreTab.SuspendLayout();
this.SuspendLayout();
//
@ -182,9 +184,10 @@ namespace W4Gui
// schemeTab
//
this.schemeTab.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.schemeTab.Controls.Add(this.schemesPage);
this.schemeTab.Location = new System.Drawing.Point(4, 24);
this.schemeTab.Name = "schemeTab";
this.schemeTab.Size = new System.Drawing.Size(192, 72);
this.schemeTab.Size = new System.Drawing.Size(868, 509);
this.schemeTab.TabIndex = 3;
this.schemeTab.Text = "Schemes";
this.schemeTab.UseVisualStyleBackColor = true;
@ -195,14 +198,13 @@ namespace W4Gui
this.highscoreTab.Controls.Add(this.highscoresPage);
this.highscoreTab.Location = new System.Drawing.Point(4, 24);
this.highscoreTab.Name = "highscoreTab";
this.highscoreTab.Size = new System.Drawing.Size(868, 509);
this.highscoreTab.Size = new System.Drawing.Size(192, 72);
this.highscoreTab.TabIndex = 2;
this.highscoreTab.Text = "Highscores";
this.highscoreTab.UseVisualStyleBackColor = true;
//
// highscoresPage
//
this.highscoresPage.Dock = System.Windows.Forms.DockStyle.Fill;
this.highscoresPage.Location = new System.Drawing.Point(3, 3);
this.highscoresPage.Name = "highscoresPage";
@ -229,6 +231,14 @@ namespace W4Gui
this.variablesTab.Text = "Variables";
this.variablesTab.UseVisualStyleBackColor = true;
//
// schemePage
//
this.schemesPage.Dock = System.Windows.Forms.DockStyle.Fill;
this.schemesPage.Location = new System.Drawing.Point(3, 3);
this.schemesPage.Name = "schemePage";
this.schemesPage.Size = new System.Drawing.Size(858, 499);
this.schemesPage.TabIndex = 0;
//
// Main
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
@ -247,6 +257,7 @@ namespace W4Gui
this.mainTabControl.ResumeLayout(false);
this.weaponTab.ResumeLayout(false);
this.teamTab.ResumeLayout(false);
this.schemeTab.ResumeLayout(false);
this.highscoreTab.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@ -273,5 +284,6 @@ namespace W4Gui
private TabPage inputTab;
private TabPage variablesTab;
private HighscoresTab highscoresPage;
private SchemeTab schemesPage;
}
}

View File

@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2023-01-15T04:06:35.5919106Z;True|2023-01-13T16:57:56.0824690-08:00;True|2023-01-11T01:22:28.8737310-08:00;True|2023-01-11T01:16:55.3469226-08:00;</History>
<History>True|2023-01-19T07:41:26.7371208Z;True|2023-01-14T20:06:35.5919106-08:00;True|2023-01-13T16:57:56.0824690-08:00;True|2023-01-11T01:22:28.8737310-08:00;True|2023-01-11T01:16:55.3469226-08:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

99
W4Gui/Tabs/SchemeTab.Designer.cs generated Normal file
View File

@ -0,0 +1,99 @@
namespace W4Gui.Tabs
{
partial class SchemeTab
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.schemesSplitContainer = new System.Windows.Forms.SplitContainer();
this.schemesList = new W4Gui.Components.CollectiveListAddDelete();
this.schemesPanel = new W4Gui.Components.SchemePanel();
((System.ComponentModel.ISupportInitialize)(this.schemesSplitContainer)).BeginInit();
this.schemesSplitContainer.Panel1.SuspendLayout();
this.schemesSplitContainer.Panel2.SuspendLayout();
this.schemesSplitContainer.SuspendLayout();
this.SuspendLayout();
//
// teamsSplitContainer
//
this.schemesSplitContainer.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.schemesSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.schemesSplitContainer.Location = new System.Drawing.Point(0, 0);
this.schemesSplitContainer.Name = "schemesSplitContainer";
//
// teamsSplitContainer.Panel1
//
this.schemesSplitContainer.Panel1.Controls.Add(this.schemesList);
//
// teamsSplitContainer.Panel2
//
this.schemesSplitContainer.Panel2.Controls.Add(this.schemesPanel);
this.schemesSplitContainer.Size = new System.Drawing.Size(797, 464);
this.schemesSplitContainer.SplitterDistance = 265;
this.schemesSplitContainer.TabIndex = 0;
//
// schemesList
//
this.schemesList.Dock = System.Windows.Forms.DockStyle.Fill;
this.schemesList.Location = new System.Drawing.Point(3, 3);
this.schemesList.Name = "schemesList";
this.schemesList.Size = new System.Drawing.Size(261, 460);
this.schemesList.TabIndex = 0;
this.schemesList.NewButton += new System.EventHandler<System.EventArgs>(this.schemesList_NewButton);
this.schemesList.DeleteButton += new System.EventHandler<System.EventArgs>(this.schemesList_DeleteButton);
//
// schemesPanel
//
this.schemesPanel.BackColor = System.Drawing.Color.LightGray;
this.schemesPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.schemesPanel.Enabled = false;
this.schemesPanel.Location = new System.Drawing.Point(0, 0);
this.schemesPanel.Name = "schemesPanel";
this.schemesPanel.Size = new System.Drawing.Size(524, 460);
this.schemesPanel.TabIndex = 0;
//
// SchemeTab
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.schemesSplitContainer);
this.Name = "SchemeTab";
this.Size = new System.Drawing.Size(797, 464);
this.schemesSplitContainer.Panel1.ResumeLayout(false);
this.schemesSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.schemesSplitContainer)).EndInit();
this.schemesSplitContainer.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private SplitContainer schemesSplitContainer;
private Components.CollectiveListAddDelete schemesList;
private Components.SchemePanel schemesPanel;
}
}

62
W4Gui/Tabs/SchemeTab.cs Normal file
View File

@ -0,0 +1,62 @@
using LibW4M.Data.Schemes;
using LibW4M.Data.Teams;
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;
namespace W4Gui.Tabs
{
public partial class SchemeTab : TabEntry
{
public SchemeTab()
{
InitializeComponent();
this.schemesList.List.Selected += schemesList_Selected;
this.schemesList.List.Unselected += schemesList_Unselected;
}
public override void SaveFromControl()
{
if (schemesList.List.IsItemSelected)
schemesList_Unselected(null, null);
}
public override void LoadIntoControl()
{
this.schemesList.List.LoadCollective(DataManager.SaveFile.SchemeCollective);
schemesPanel.Enabled = false;
}
private void schemesList_Unselected(object? sender, EventArgs e)
{
SchemeData scheme = DataManager.SaveFile.SchemeCollective[schemesList.List.LastSelected] as SchemeData;
schemesPanel.SaveSchemeData(ref scheme);
schemesList.List.UpdateName(schemesList.List.LastSelected, scheme.Name.Value);
}
private void schemesList_Selected(object? sender, EventArgs e)
{
SchemeData scheme = DataManager.SaveFile.SchemeCollective[schemesList.List.CurrentlySelected] as SchemeData;
schemesPanel.LoadSchemeData(scheme);
schemesPanel.Enabled = true;
}
private void schemesList_NewButton(object sender, EventArgs e)
{
throw new NotImplementedException("Adding new schemes from here not implemented yet ;)");
}
private void schemesList_DeleteButton(object sender, EventArgs e)
{
throw new NotImplementedException("Removing schemes from here not implemented yet ;)");
}
}
}

60
W4Gui/Tabs/SchemeTab.resx Normal file
View File

@ -0,0 +1,60 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -58,7 +58,7 @@
// teamsList
//
this.teamsList.Dock = System.Windows.Forms.DockStyle.Fill;
this.teamsList.Location = new System.Drawing.Point(0, 0);
this.teamsList.Location = new System.Drawing.Point(3, 3);
this.teamsList.Name = "teamsList";
this.teamsList.Size = new System.Drawing.Size(261, 460);
this.teamsList.TabIndex = 0;

View File

@ -18,6 +18,7 @@
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Update="Tabs\SchemeTab.cs" />
</ItemGroup>
<ItemGroup>

View File

@ -52,6 +52,9 @@
<Compile Update="Tabs\TabEntry.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Update="Tabs\SchemeTab.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Update="Tabs\TeamsTab.cs">
<SubType>UserControl</SubType>
</Compile>