public ItemTab(Item item, LinkType type, ProductionGraphViewer parent) : base(parent) { this.Item = item; this.Type = type; centreFormat.Alignment = centreFormat.LineAlignment = StringAlignment.Center; }
public AssemblerIconElement(MachinePermutation assembler, int number, ProductionGraphViewer parent) : base(parent) { DisplayedMachine = assembler; DisplayedNumber = number; centreFormat.Alignment = centreFormat.LineAlignment = StringAlignment.Center; }
public RateOptionsPanel(ProductionNode baseNode, ProductionGraphViewer graphViewer) { InitializeComponent(); BaseNode = baseNode; GraphViewer = graphViewer; if (baseNode.rateType == RateType.Auto) { autoOption.Checked = true; fixedTextBox.Enabled = false; } else { fixedOption.Checked = true; fixedTextBox.Enabled = true; } float amountToShow = baseNode.desiredRate; if (GraphViewer.Graph.SelectedAmountType == AmountType.Rate) { fixedTextBox.Width = 65; unitLabel.Visible = true; if (GraphViewer.Graph.SelectedUnit == RateUnit.PerMinute) { amountToShow *= 60; unitLabel.Text = "/m"; } else { unitLabel.Text = "/s"; } } else { unitLabel.Visible = false; fixedTextBox.Width = 85; } fixedTextBox.Text = Convert.ToString(amountToShow); this.productivityBonusTextBox.Text = Convert.ToString(baseNode.ProductivityBonus); this.speedBonusTextBox.Text = Convert.ToString(baseNode.SpeedBonus); if (GraphViewer.ShowAssemblers && baseNode is RecipeNode) { this.assemblerPanel.Visible = true; updateAssemblerButtons(); } else { this.assemblerPanel.Visible = false; } }
public ChooserPanel(IEnumerable <ChooserControl> controls, ProductionGraphViewer parent) : base() { InitializeComponent(); this.controls = controls.ToList(); parent.Controls.Add(this); this.Location = new Point(parent.Width / 2 - Width / 2, parent.Height / 2 - Height / 2); this.Anchor = AnchorStyles.None; this.BringToFront(); parent.PerformLayout(); FilterTextBox.Focus(); }
public FloatingTooltipControl(Control control, Direction direction, Point graphLocation, ProductionGraphViewer parent) { Control = control; Direction = direction; GraphLocation = graphLocation; GraphViewer = parent; parent.floatingTooltipControls.Add(this); parent.Controls.Add(control); Rectangle ttRect = parent.getTooltipScreenBounds(parent.GraphToScreen(graphLocation), new Point(control.Size), direction); control.Location = ttRect.Location; control.Focus(); }
public NodeElement(ProductionNode node, ProductionGraphViewer parent) : base(parent) { Width = 100; Height = 90; DisplayedNode = node; if (DisplayedNode.GetType() == typeof(ConsumerNode)) { backgroundColour = supplyColour; } else if (DisplayedNode.GetType() == typeof(SupplyNode)) { backgroundColour = consumerColour; } else { backgroundColour = recipeColour; } backgroundBrush = new SolidBrush(backgroundColour); foreach (Item item in node.Inputs) { ItemTab newTab = new ItemTab(item, LinkType.Input, Parent); SubElements.Add(newTab); inputTabs.Add(newTab); } foreach (Item item in node.Outputs) { ItemTab newTab = new ItemTab(item, LinkType.Output, Parent); SubElements.Add(newTab); outputTabs.Add(newTab); } if (DisplayedNode is RecipeNode || DisplayedNode is SupplyNode) { assemblerBox = new AssemblerBox(Parent); SubElements.Add(assemblerBox); assemblerBox.Height = assemblerBox.Width = 50; } centreFormat.Alignment = centreFormat.LineAlignment = StringAlignment.Center; }
public DraggedLinkElement(ProductionGraphViewer parent, NodeElement startNode, LinkType startConnectionType, Item item) : base(parent) { if (startConnectionType == LinkType.Input) { ConsumerElement = startNode; } else { SupplierElement = startNode; } StartConnectionType = startConnectionType; Item = item; if ((Control.MouseButtons & MouseButtons.Left) != 0) { DragType = DragType.MouseDown; } else { DragType = DragType.MouseUp; } }
public GraphElement(ProductionGraphViewer parent) { Parent = parent; Parent.Elements.Add(this); SubElements = new HashSet <GraphElement>(); }
public AssemblerBox(ProductionGraphViewer parent) : base(parent) { AssemblerList = new Dictionary <MachinePermutation, int>(); }
public AssemblerBox(ProductionGraphViewer parent) : base(parent) { AssemblerList = new Dictionary<MachinePermutation, int>(); }
public LinkElement(ProductionGraphViewer parent, NodeLink displayedLink) : base(parent) { DisplayedLink = displayedLink; }
public GraphElement(ProductionGraphViewer parent) { Parent = parent; Parent.Elements.Add(this); SubElements = new HashSet<GraphElement>(); }
public GhostNodeElement(ProductionGraphViewer parent) : base(parent) { Width = 96; Height = 96; }
public ImageExportForm(ProductionGraphViewer graphViewer) { InitializeComponent(); this.graphViewer = graphViewer; }
public NodeElement(ProductionNode node, ProductionGraphViewer parent) : base(parent) { Width = 100; Height = 90; DisplayedNode = node; Color backgroundColour = missingColour; Color textColour = darkTextColour; if (DisplayedNode is ConsumerNode) { backgroundColour = outputColour; if (((ConsumerNode)DisplayedNode).ConsumedItem.IsMissingItem) { backgroundColour = missingColour; } } else if (DisplayedNode is SupplyNode) { backgroundColour = supplyColour; if (((SupplyNode)DisplayedNode).SuppliedItem.IsMissingItem) { backgroundColour = missingColour; } } else if (DisplayedNode is RecipeNode) { backgroundColour = recipeColour; if (((RecipeNode)DisplayedNode).BaseRecipe.IsMissingRecipe) { backgroundColour = missingColour; } } else if (DisplayedNode is PassthroughNode) { backgroundColour = passthroughColour; if (((PassthroughNode)DisplayedNode).PassedItem.IsMissingItem) { backgroundColour = missingColour; } } else { Trace.Fail("No branch for node: " + DisplayedNode.ToString()); } backgroundBrush = new SolidBrush(backgroundColour); textBrush = new SolidBrush(textColour); foreach (Item item in node.Inputs) { ItemTab newTab = new ItemTab(item, LinkType.Input, Parent); SubElements.Add(newTab); inputTabs.Add(newTab); } foreach (Item item in node.Outputs) { ItemTab newTab = new ItemTab(item, LinkType.Output, Parent); SubElements.Add(newTab); outputTabs.Add(newTab); } if (DisplayedNode is RecipeNode || DisplayedNode is SupplyNode) { assemblerBox = new AssemblerBox(Parent); SubElements.Add(assemblerBox); assemblerBox.Height = assemblerBox.Width = 50; } centreFormat.Alignment = centreFormat.LineAlignment = StringAlignment.Center; }