/// <summary> /// Initialize any components required by this state. /// </summary> public override void Initialize() { ServiceManager.Game.Renderer.ActiveScene.ClearAll(); form = new TankCreation(ServiceManager.Game.Manager); ServiceManager.Game.FormManager.SwitchWindows(form.Window); form.Cancel.Click += new TomShane.Neoforce.Controls.EventHandler(Cancel_Click); form.Create.Click += new TomShane.Neoforce.Controls.EventHandler(Create_Click); form.TankSelectionChanged += new TomShane.Neoforce.Controls.EventHandler(TankSelectionChanged); form.TurretSelectionChanged += new TomShane.Neoforce.Controls.EventHandler(TurretSelectionChanged); form.ScrollSkinLeft.Click += new TomShane.Neoforce.Controls.EventHandler(ScrollSkinLeft_Click); form.ScrollSkinRight.Click += new TomShane.Neoforce.Controls.EventHandler(ScrollSkinRight_Click); skinList = Toolkit.GetSkinList(); for (int i = 0; i < skinList.Count; ++i) { if (skinList[i] == DEFAULT_CAMO) { defaultIndex = i; break; } } form.TankSkin = skinList[defaultIndex]; if (defaultIndex == 0) { form.ScrollSkinLeft.Enabled = false; } else if (defaultIndex + 1 >= skinList.Count) { form.ScrollSkinRight.Enabled = false; } skinIndex = defaultIndex; PopulateBoxes(); form.TurretIndex = 0; form.TankIndex = 0; ApplySkin(); }
/// <summary> /// Initializes components /// </summary> public override void Initialize() { ServiceManager.Scene.ClearAll(); form = new TankCreation(ServiceManager.Game.Manager); ServiceManager.Game.FormManager.SwitchWindows(form.Window); form.Cancel.Click += new TomShane.Neoforce.Controls.EventHandler(Cancel_Click); form.Create.Text = "Edit Tank"; form.Create.Click += new TomShane.Neoforce.Controls.EventHandler(Edit_Click); form.TankSelectionChanged += new TomShane.Neoforce.Controls.EventHandler(TankSelectionChanged); form.TurretSelectionChanged += new TomShane.Neoforce.Controls.EventHandler(TurretSelectionChanged); form.ScrollSkinLeft.Click += new TomShane.Neoforce.Controls.EventHandler(ScrollSkinLeft_Click); form.ScrollSkinRight.Click += new TomShane.Neoforce.Controls.EventHandler(ScrollSkinRight_Click); skinList = Toolkit.GetSkinList(); for (int i = 0; i < skinList.Count; ++i) { if (skinList[i] == tank.skin) { defaultIndex = i; break; } } skinIndex = defaultIndex; oldSkin = tank.skin; PopulateBoxes(); form.TurretIndex = 0; form.TankIndex = 0; form.TankName = tank.name; form.TankSkin = tank.skin; form.NameEditable = false; form.TankColor = Toolkit.GetColor(tank.color); form.TankSkin = skinList[skinIndex]; ApplySkin(); SetStatistics(); }