From 78d26f5680291f2b6563f1f6cee5cbbffc34e891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 25 Aug 2024 20:19:51 +0300 Subject: [PATCH] Cleanup some junk, update the default configuration --- Viewer/FormMain.Designer.cs | 64 +++++++----------- Viewer/FormMain.cs | 8 --- WalkerSim/Config.cs | 3 - WalkerSim/WalkerSim.xml | 118 +++++++++------------------------- WalkerSim/WalkerSimSchema.xsd | 6 +- 5 files changed, 56 insertions(+), 143 deletions(-) diff --git a/Viewer/FormMain.Designer.cs b/Viewer/FormMain.Designer.cs index 8acddaa..75ad2f8 100644 --- a/Viewer/FormMain.Designer.cs +++ b/Viewer/FormMain.Designer.cs @@ -34,6 +34,7 @@ private void InitializeComponent() this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.loadConfigurationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exportConfigurationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -48,8 +49,6 @@ private void InitializeComponent() this.resumeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.speedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.advanceOneTickToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); - this.reduceCPULoadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.emitSoundToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.killToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -73,6 +72,7 @@ private void InitializeComponent() this.inputRandomSeed = new System.Windows.Forms.NumericUpDown(); this.inputStartGrouped = new System.Windows.Forms.CheckBox(); this.tabPage2 = new System.Windows.Forms.TabPage(); + this.buttonDuplicateGroup = new System.Windows.Forms.Button(); this.groupProps = new System.Windows.Forms.GroupBox(); this.boxGroupColor = new System.Windows.Forms.PictureBox(); this.buttonGroupColor = new System.Windows.Forms.Button(); @@ -99,8 +99,6 @@ private void InitializeComponent() this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.colorPickerDlg = new System.Windows.Forms.ColorDialog(); - this.buttonDuplicateGroup = new System.Windows.Forms.Button(); - this.exportConfigurationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); @@ -161,15 +159,22 @@ private void InitializeComponent() this.loadConfigurationToolStripMenuItem.Text = "Import Configuration"; this.loadConfigurationToolStripMenuItem.Click += new System.EventHandler(this.loadConfigurationToolStripMenuItem_Click); // + // exportConfigurationToolStripMenuItem + // + this.exportConfigurationToolStripMenuItem.Name = "exportConfigurationToolStripMenuItem"; + this.exportConfigurationToolStripMenuItem.Size = new System.Drawing.Size(187, 22); + this.exportConfigurationToolStripMenuItem.Text = "Export Configuration"; + this.exportConfigurationToolStripMenuItem.Click += new System.EventHandler(this.OnExportConfigurationClick); + // // toolStripMenuItem1 // this.toolStripMenuItem1.Name = "toolStripMenuItem1"; - this.toolStripMenuItem1.Size = new System.Drawing.Size(172, 6); + this.toolStripMenuItem1.Size = new System.Drawing.Size(184, 6); // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(175, 22); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(187, 22); this.exitToolStripMenuItem.Text = "Exit"; // // viewToolStripMenuItem @@ -218,9 +223,7 @@ private void InitializeComponent() this.pauseToolStripMenuItem, this.resumeToolStripMenuItem, this.speedToolStripMenuItem, - this.advanceOneTickToolStripMenuItem, - this.toolStripMenuItem2, - this.reduceCPULoadToolStripMenuItem}); + this.advanceOneTickToolStripMenuItem}); this.simulationToolStripMenuItem.Name = "simulationToolStripMenuItem"; this.simulationToolStripMenuItem.Size = new System.Drawing.Size(76, 20); this.simulationToolStripMenuItem.Text = "Simulation"; @@ -280,18 +283,6 @@ private void InitializeComponent() this.advanceOneTickToolStripMenuItem.Text = "Advance one Tick"; this.advanceOneTickToolStripMenuItem.Click += new System.EventHandler(this.OnAdvanceTick); // - // toolStripMenuItem2 - // - this.toolStripMenuItem2.Name = "toolStripMenuItem2"; - this.toolStripMenuItem2.Size = new System.Drawing.Size(190, 6); - // - // reduceCPULoadToolStripMenuItem - // - this.reduceCPULoadToolStripMenuItem.Name = "reduceCPULoadToolStripMenuItem"; - this.reduceCPULoadToolStripMenuItem.Size = new System.Drawing.Size(193, 22); - this.reduceCPULoadToolStripMenuItem.Text = "Reduce CPU Load"; - this.reduceCPULoadToolStripMenuItem.Click += new System.EventHandler(this.OnReduceCPULoadClick); - // // toolsToolStripMenuItem // this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -566,6 +557,17 @@ private void InitializeComponent() this.tabPage2.Text = "Movement Processors"; this.tabPage2.UseVisualStyleBackColor = true; // + // buttonDuplicateGroup + // + this.buttonDuplicateGroup.Enabled = false; + this.buttonDuplicateGroup.Location = new System.Drawing.Point(83, 128); + this.buttonDuplicateGroup.Name = "buttonDuplicateGroup"; + this.buttonDuplicateGroup.Size = new System.Drawing.Size(62, 23); + this.buttonDuplicateGroup.TabIndex = 7; + this.buttonDuplicateGroup.Text = "Duplicate"; + this.buttonDuplicateGroup.UseVisualStyleBackColor = true; + this.buttonDuplicateGroup.Click += new System.EventHandler(this.OnDuplicateGroupClick); + // // groupProps // this.groupProps.Controls.Add(this.boxGroupColor); @@ -868,24 +870,6 @@ private void InitializeComponent() // this.colorPickerDlg.AnyColor = true; // - // buttonDuplicateGroup - // - this.buttonDuplicateGroup.Enabled = false; - this.buttonDuplicateGroup.Location = new System.Drawing.Point(83, 128); - this.buttonDuplicateGroup.Name = "buttonDuplicateGroup"; - this.buttonDuplicateGroup.Size = new System.Drawing.Size(62, 23); - this.buttonDuplicateGroup.TabIndex = 7; - this.buttonDuplicateGroup.Text = "Duplicate"; - this.buttonDuplicateGroup.UseVisualStyleBackColor = true; - this.buttonDuplicateGroup.Click += new System.EventHandler(this.OnDuplicateGroupClick); - // - // exportConfigurationToolStripMenuItem - // - this.exportConfigurationToolStripMenuItem.Name = "exportConfigurationToolStripMenuItem"; - this.exportConfigurationToolStripMenuItem.Size = new System.Drawing.Size(187, 22); - this.exportConfigurationToolStripMenuItem.Text = "Export Configuration"; - this.exportConfigurationToolStripMenuItem.Click += new System.EventHandler(this.OnExportConfigurationClick); - // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -985,11 +969,9 @@ private void InitializeComponent() private System.Windows.Forms.Label label10; private System.Windows.Forms.ToolStripMenuItem speedToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem killToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem reduceCPULoadToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem loadConfigurationToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; - private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2; private System.Windows.Forms.ToolStripMenuItem stopToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3; private System.Windows.Forms.TabPage tabPage3; diff --git a/Viewer/FormMain.cs b/Viewer/FormMain.cs index 5a313d8..13f3aed 100644 --- a/Viewer/FormMain.cs +++ b/Viewer/FormMain.cs @@ -283,8 +283,6 @@ private void UpdateConfigFields() _updatingConfig = true; - reduceCPULoadToolStripMenuItem.Checked = CurrentConfig.ReduceCPULoad; - inputRandomSeed.Value = CurrentConfig.RandomSeed; inputMaxAgents.Value = CurrentConfig.MaxAgents; inputGroupSize.Value = CurrentConfig.GroupSize; @@ -677,12 +675,6 @@ private void OnSimCanvasClick(object sender, MouseEventArgs e) } } - private void OnReduceCPULoadClick(object sender, EventArgs e) - { - CurrentConfig.ReduceCPULoad = !CurrentConfig.ReduceCPULoad; - reduceCPULoadToolStripMenuItem.Checked = CurrentConfig.ReduceCPULoad; - } - private void loadConfigurationToolStripMenuItem_Click(object sender, EventArgs e) { var browseFileDlg = new OpenFileDialog(); diff --git a/WalkerSim/Config.cs b/WalkerSim/Config.cs index 0c9aa64..ff71227 100644 --- a/WalkerSim/Config.cs +++ b/WalkerSim/Config.cs @@ -104,9 +104,6 @@ public class DebugOptions [XmlElement("GroupSize")] public int GroupSize = 200; - [XmlElement("ReduceCPULoad")] - public bool ReduceCPULoad = false; - [XmlElement("AgentStartPosition")] public WorldLocation StartPosition = WorldLocation.RandomLocation; diff --git a/WalkerSim/WalkerSim.xml b/WalkerSim/WalkerSim.xml index 3f333c2..f41cec6 100644 --- a/WalkerSim/WalkerSim.xml +++ b/WalkerSim/WalkerSim.xml @@ -1,100 +1,42 @@ - - - - + + - true + false - - 1337 - - - 15000 - - - 1000 - - + 6000 100 - - - false - - + true + 100 RandomLocation - - RandomBorderLocation - - true - - true - - - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - diff --git a/WalkerSim/WalkerSimSchema.xsd b/WalkerSim/WalkerSimSchema.xsd index fe9b46d..9f5c7d5 100644 --- a/WalkerSim/WalkerSimSchema.xsd +++ b/WalkerSim/WalkerSimSchema.xsd @@ -162,7 +162,7 @@ - + @@ -213,8 +213,8 @@ Specifies if the simulation should be paused during blood moons - - + +