コード例 #1
0
ファイル: ShipDesignDialog.cs プロジェクト: ekolis/stars-nova
        /// <Summary>
        /// Hull selection changed. Ensure we take a copy of the hull design so that we
        /// don't end up messing with the master copy.
        /// </Summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">A <see cref="EventArgs"/> that contains the event data.</param>
        private void HullList_SelectedValueChanged(object sender, EventArgs e)
        {
            string selectedHullName = HullList.SelectedItem as string;

            DesignName.Text = selectedHullName;
            Nova.Common.Components.Component hull = clientState.EmpireState.AvailableComponents[selectedHullName];
            this.selectedHull      = new Nova.Common.Components.Component(hull);
            this.selectedHull.Name = selectedHullName;
            HullGrid.HullName      = selectedHullName;

            UpdateHullFields();
        }
コード例 #2
0
ファイル: DesignManager.cs プロジェクト: ekolis/stars-nova
        /// <Summary>
        /// Deal with a hull module being selected
        /// </Summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">A <see cref="EventArgs"/> that contains the event data.</param>
        private void DesignModuleSelected(object sender, EventArgs e)
        {
            Panel gridModule = sender as Panel;

            if (gridModule.Tag == null)
            {
                return;
            }

            HullModule module = gridModule.Tag as HullModule;

            if (module.AllocatedComponent == null)
            {
                return;
            }

            Nova.Common.Components.Component component = module.AllocatedComponent;

            this.componentSummary.Text = component.Description;
        }