Exemple #1
0
        public MainForm(IndustryManager manager)
        {
            InitializeComponent();
            // Setup the trees.  One recipe on each main node
            Manager = manager;

            Market = new MarketManager();


            treeView.AfterSelect += TreeView_AfterSelect;

            // TODO: Freeze updates first
            foreach (var group in manager._recipes.Values.OrderBy(r => r.Name).GroupBy(r => r.ParentGroupName))
            {
                var groupNode = new TreeNode(group.Key);

                foreach (var recipe in group)
                {
                    var recipeNode = new TreeNode(recipe.Name);
                    recipeNode.Tag = recipe;
                    recipe.Node    = recipeNode;

                    groupNode.Nodes.Add(recipeNode);
                }

                treeView.Nodes.Add(groupNode);
            }
        }
        public SkillForm(IndustryManager manager)
        {
            InitializeComponent();
            Manager   = manager;
            mainPanel = new FlowLayoutPanel();
            mainPanel.FlowDirection = FlowDirection.TopDown;
            mainPanel.WrapContents  = false;
            mainPanel.AutoScroll    = true;
            mainPanel.AutoSize      = true;

            foreach (var talent in manager.Talents.OrderBy(t => t.Name))
            {
                var panel = new FlowLayoutPanel();
                panel.WrapContents = false;
                panel.AutoSize     = true;

                var label = new Label();
                label.Text     = talent.Name;
                label.AutoSize = true;
                panel.Controls.Add(label);

                var textbox = new TextBox();
                textbox.Text = talent.Value.ToString();
                panel.Controls.Add(textbox);

                mainPanel.Controls.Add(panel);
            }
            this.Controls.Add(mainPanel);
            this.AutoScroll = true;
        }
Exemple #3
0
 public OreValueForm(IndustryManager manager)
 {
     InitializeComponent();
     Manager = manager;
     // This is intended to have a DataGrid that they can paste the ore values into
     // So we parse out the names and store them back in after they save
     foreach (var ore in manager.Ores)
     {
         oreGrid.Rows.Add(ore.Name, ore.Value);
     }
     oreGrid.AutoSize = true;
     this.AutoSize    = true;
 }