context: /*******************************************************************************
   *
   * Space Trader for Windows 1.00
   *
   * Copyright (C) 2016 Keith Banner, All Rights Reserved
   *
   * Port to Windows by David Pierron & Jay French
   * Original coding by Pieter Spronck, Sam Anderson, Samuel Goldstein, Matt Lee
   *
   * This program is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License as published by the Free
   * Software Foundation; either version 2 of the License, or (at your option) any
   * later version.
   *
   * This program is distributed in the hope that it will be useful, but WITHOUT
   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   *
   * If you'd like a copy of the GNU General Public License, go to
   * http://www.gnu.org/copyleft/gpl.html.
   *
   * You can contact the author at spacetrader@kb4000.com
   *
   ******************************************************************************/
  
  namespace SpaceTrader
  {
  	public class FormOptions : System.Windows.Forms.Form
  	{
  		#region Control Declarations
  
  		private System.Windows.Forms.Button btnOk;
  		private System.Windows.Forms.Button btnCancel;
  		private System.Windows.Forms.Label lblEmpty;
  		private System.Windows.Forms.Label lblIgnore;
  		private System.Windows.Forms.CheckBox chkFuel;
  		private System.Windows.Forms.CheckBox chkContinuousAttack;
  		private System.Windows.Forms.CheckBox chkAttackFleeing;
  		private System.Windows.Forms.CheckBox chkDisable;
  		private System.Windows.Forms.CheckBox chkNewspaper;
  		private System.Windows.Forms.CheckBox chkNewspaperShow;
  		private System.Windows.Forms.CheckBox chkRange;
  		private System.Windows.Forms.CheckBox chkStopTracking;
  		private System.Windows.Forms.CheckBox chkLoan;
  		private System.Windows.Forms.CheckBox chkIgnoreTradersDealing;
  		private System.Windows.Forms.CheckBox chkReserveMoney;
  		private System.Windows.Forms.CheckBox chkIgnoreTraders;
  		private System.Windows.Forms.CheckBox chkIgnorePirates;
  		private System.Windows.Forms.CheckBox chkIgnorePolice;
  		private System.Windows.Forms.CheckBox chkRepair;
  		private System.Windows.Forms.NumericUpDown numEmpty;
  		private System.ComponentModel.Container components = null;
  		private System.Windows.Forms.Button btnSave;
  		private System.Windows.Forms.Button btnLoad;
  
  		#endregion
  
  		#region Member Declarations
  
  		private Game				game					= Game.CurrentGame;
  		private bool				initializing	= true;
  
  		private GameOptions	_options			= new GameOptions(false);
  
  		#endregion
  
  		#region Methods
  
  		public FormOptions()
  		{
  			InitializeComponent();
  
  			if (game != null)
  				Options.CopyValues(game.Options);
  			else
  			{
  				Options.LoadFromDefaults(false, this);
  				btnOk.Enabled	= false;
  				FormAlert.Alert(AlertType.OptionsNoGame, this);
  			}
  
  			UpdateAll();
  		}
  
  		protected override void Dispose(bool disposing)
  		{
  			if (disposing && components != null)
  				components.Dispose();
  			base.Dispose(disposing);
  		}
  
  		#region Windows Form 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.btnOk = new System.Windows.Forms.Button();
  			this.btnCancel = new System.Windows.Forms.Button();
  			this.lblEmpty = new System.Windows.Forms.Label();
  			this.chkFuel = new System.Windows.Forms.CheckBox();
  			this.chkContinuousAttack = new System.Windows.Forms.CheckBox();
  			this.chkAttackFleeing = new System.Windows.Forms.CheckBox();
  			this.chkNewspaper = new System.Windows.Forms.CheckBox();
  			this.chkRange = new System.Windows.Forms.CheckBox();
  			this.chkStopTracking = new System.Windows.Forms.CheckBox();
  			this.chkLoan = new System.Windows.Forms.CheckBox();
  			this.chkIgnoreTradersDealing = new System.Windows.Forms.CheckBox();
  			this.chkReserveMoney = new System.Windows.Forms.CheckBox();
  			this.chkIgnoreTraders = new System.Windows.Forms.CheckBox();
  			this.chkIgnorePirates = new System.Windows.Forms.CheckBox();
  			this.chkIgnorePolice = new System.Windows.Forms.CheckBox();
  			this.chkRepair = new System.Windows.Forms.CheckBox();
  			this.lblIgnore = new System.Windows.Forms.Label();
  			this.numEmpty = new System.Windows.Forms.NumericUpDown();
  			this.btnSave = new System.Windows.Forms.Button();
  			this.btnLoad = new System.Windows.Forms.Button();
  			this.chkNewspaperShow = new System.Windows.Forms.CheckBox();
  			this.chkDisable = new System.Windows.Forms.CheckBox();
  			((System.ComponentModel.ISupportInitialize)(this.numEmpty)).BeginInit();
  			this.SuspendLayout();
  			// 
  			// btnOk
  			// 
  			this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
  			this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
  			this.btnOk.Location = new System.Drawing.Point(14, 240);
  			this.btnOk.Name = "btnOk";
  			this.btnOk.Size = new System.Drawing.Size(40, 22);
  			this.btnOk.TabIndex = 15;
  			this.btnOk.Text = "Ok";
  			// 
  			// btnCancel
  			// 
  			this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  			this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
  			this.btnCancel.Location = new System.Drawing.Point(62, 240);
  			this.btnCancel.Name = "btnCancel";
  			this.btnCancel.Size = new System.Drawing.Size(49, 22);
  			this.btnCancel.TabIndex = 16;
  			this.btnCancel.Text = "Cancel";
  			// 
  			// lblEmpty
  			// 
  			this.lblEmpty.AutoSize = true;
  			this.lblEmpty.Location = new System.Drawing.Point(52, 90);
  			this.lblEmpty.Name = "lblEmpty";
  			this.lblEmpty.Size = new System.Drawing.Size(292, 16);
  			this.lblEmpty.TabIndex = 38;
  			this.lblEmpty.Text = "Cargo Bays to leave empty when buying goods in-system";
  			// 
  			// chkFuel
  			// 
  			this.chkFuel.Location = new System.Drawing.Point(8, 8);
  			this.chkFuel.Name = "chkFuel";
  			this.chkFuel.Size = new System.Drawing.Size(160, 16);
  			this.chkFuel.TabIndex = 1;
  			this.chkFuel.Text = "Get full fuel tanks on arrival";
  			this.chkFuel.CheckedChanged += new System.EventHandler(this.controlChanged);
  			// 
  			// chkContinuousAttack
  			// 
  			this.chkContinuousAttack.Location = new System.Drawing.Point(8, 176);
  			this.chkContinuousAttack.Name = "chkContinuousAttack";
  			this.chkContinuousAttack.Size = new System.Drawing.Size(163, 16);
  			this.chkContinuousAttack.TabIndex = 13;
  			this.chkContinuousAttack.Text = "Continuous attack and flight";
  			this.chkContinuousAttack.CheckedChanged += new System.EventHandler(this.controlChanged);
  			// 
  			// chkAttackFleeing
  			// 
  			this.chkAttackFleeing.Location = new System.Drawing.Point(24, 192);
  			this.chkAttackFleeing.Name = "chkAttackFleeing";
  			this.chkAttackFleeing.Size = new System.Drawing.Size(177, 16);
  			this.chkAttackFleeing.TabIndex = 14;
  			this.chkAttackFleeing.Text = "Continue attacking fleeing ship";
  			this.chkAttackFleeing.CheckedChanged += new System.EventHandler(this.controlChanged);
  			// 
  			// chkNewspaper
  			// 
  			this.chkNewspaper.Location = new System.Drawing.Point(8, 40);
  			this.chkNewspaper.Name = "chkNewspaper";
  			this.chkNewspaper.Size = new System.Drawing.Size(155, 16);
  			this.chkNewspaper.TabIndex = 3;
  			this.chkNewspaper.Text = "Always pay for newspaper";
  			this.chkNewspaper.CheckedChanged += new System.EventHandler(this.controlChanged);
  			// 
  			// chkRange
  			// 
  			this.chkRange.Location = new System.Drawing.Point(184, 8);
  			this.chkRange.Name = "chkRange";
  			this.chkRange.Size = new System.Drawing.Size(175, 16);
  			this.chkRange.TabIndex = 5;
  			this.chkRange.Text = "Show range to tracked system";
  			this.chkRange.CheckedChanged += new System.EventHandler(this.controlChanged);
  			// 
  			// chkStopTracking
  			// 
  			this.chkStopTracking.Location = new System.Drawing.Point(184, 24);
  			this.chkStopTracking.Name = "chkStopTracking";
  			this.chkStopTracking.Size = new System.Drawing.Size(139, 16);
  			this.chkStopTracking.TabIndex = 6;
  			this.chkStopTracking.Text = "Stop tracking on arrival";
  			this.chkStopTracking.CheckedChanged += new System.EventHandler(this.controlChanged);
  			// 
  			// chkLoan
  			// 
  
gt: 			this.chkLoan.Location = new System.Drawing.Point(184, 56);