public StartingConditions GetResult() { return(new StartingConditions( NumberInput.DecodeQuantity(populationInput.Text).Value, (int)coloniesSelector.Value, NumberInput.DecodeQuantity(infrastructureInput.Text).Value, NewGameController.CustomStartNameKey)); }
public StartingConditions GetResult() { //TODO(v0.9) ignored number of buildings return(new StartingConditions( NumberInput.DecodeQuantity(populationInput.Text).Value, (int)coloniesSelector.Value, new StartingBuilding[0], NewGameController.CustomStartNameKey)); }
private void capacityInput_TextChanged(object sender, EventArgs e) { var quantity = NumberInput.DecodeQuantity(this.capacityInput.Text); if (quantity.HasValue && quantity.Value < 0) quantity = null; if (quantity.HasValue) { this.controller.TargetTransportCapacity = quantity.Value; this.capacityInput.BackColor = SystemColors.Window; } else this.capacityInput.BackColor = Color.LightPink; }
private void quantityInput_TextChanged(object sender, EventArgs e) { if (ignoreEvents) { return; } ignoreEvents = true; var quantity = NumberInput.DecodeQuantity(quantityInput.Text); if (quantity.HasValue && (quantity.Value < 0 || quantity.Value > maximum)) { quantity = null; } quantityInput.BackColor = quantity.HasValue ? validColor : invalidColor; if (quantity.HasValue) { this.quantitySlider.Value = (int)((quantity.Value / (double)maximum) * this.quantitySlider.Maximum); } ignoreEvents = false; }
private void infrastructureInput_TextChanged(object sender, EventArgs e) { infrastructureInput.BackColor = NumberInput.DecodeQuantity(infrastructureInput.Text) != null ? validColor : invalidColor; }
private void populationInput_TextChanged(object sender, EventArgs e) { populationInput.BackColor = NumberInput.DecodeQuantity(populationInput.Text) != null ? validColor : invalidColor; }