/// <summary> /// Initializes a new instance of the <see cref="PlayerActionDivineIntervention.ModifyBaseCoverType"/> struct. /// </summary> /// <param name='baseCoverType'> /// Base cover type. /// </param> public ModifyBaseCoverType(BaseCoverType baseCoverType) : this() { this.landcover_class_code = 255; // excluded switch (baseCoverType) { case BaseCoverType.Barren: this.landcover_class_code = 31; break; case BaseCoverType.CultivatedCrops: this.landcover_class_code = 82; break; case BaseCoverType.Developed: this.landcover_class_code = 21; // developed_open_space break; case BaseCoverType.Forest: // NOTE: this will have the side effect of setting treeType as well, until it is specified separately on the server this.landcover_class_code = 43; // mixed break; case BaseCoverType.Herbaceous: this.landcover_class_code = 71; // grassland_herbaceous break; case BaseCoverType.Water: this.landcover_class_code = 11; break; case BaseCoverType.Wetland: // NOTE: this will have the side effect of setting treeType as well, until it is specified separately on the server this.landcover_class_code = 90; // forested_wetland break; } }
/// <summary> /// Displays the controls contents. /// </summary> protected override void DisplayControlsContents() { ResourceTileSelection selection = ResourceTileSelection.GetCurrent(); bool areButtonsDisabled = isActionInProgress || selection.Count() == 0; m_scrollPosition = GUILayout.BeginScrollView(m_scrollPosition); { GUILayout.Label("Zone Type:", m_mainText); m_zoneType = (ZoneType)GUILayout.SelectionGrid( (int)m_zoneType, System.Enum.GetNames(typeof(ZoneType)), m_selectionGridCount, m_styles.smallButton ); if (GUILayout.Button(new GUIContent("Set Zone Type", dialogConfirmButtonDo.tooltip), areButtonsDisabled?m_buttonDisabled:m_button)) { m_tileModifications.resource_tile = m_zoningModification; StartCoroutine(Put(selection)); } m_styles.DrawLine(GUIStyles.LineDirection.Horizontal, GUIStyles.LineColor.Medium); GUILayout.Label("Housing:", m_mainText); GUILayout.BeginHorizontal(); { GUILayout.Label(string.Format("Capacity: {0}", m_housingCapacity), m_minorText); int capacity = (int)GUILayout.HorizontalSlider( (float)m_housingCapacity, (float)m_possibleHousingCapacityValues[0], (float)m_possibleHousingCapacityValues[m_possibleHousingCapacityValues.Count-1] ); for (int i=1; i<m_possibleHousingCapacityValues.Count; ++i) { if (capacity >= m_possibleHousingCapacityValues[i-1] && capacity < m_possibleHousingCapacityValues[i] ) { capacity = m_possibleHousingCapacityValues[i-1]; } } m_housingCapacity = capacity; } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label(string.Format("Occupants: {0}", m_housingOccupants), m_minorText); m_housingOccupants = (int)GUILayout.HorizontalSlider( m_housingOccupants, 0, m_housingCapacity ); m_housingOccupants = Mathf.Clamp(m_housingOccupants, 0, m_housingCapacity); } GUILayout.EndHorizontal(); if (GUILayout.Button(new GUIContent("Set Housing", dialogConfirmButtonDo.tooltip), areButtonsDisabled?m_buttonDisabled:m_button)) { m_tileModifications.resource_tile = m_housingModifications; StartCoroutine(Put(selection)); } m_styles.DrawLine(GUIStyles.LineDirection.Horizontal, GUIStyles.LineColor.Medium); GUILayout.Label("Base Cover Type:", m_mainText); m_baseCoverType = (BaseCoverType)GUILayout.SelectionGrid( (int)m_baseCoverType, System.Enum.GetNames(typeof(BaseCoverType)), m_selectionGridCount, m_styles.smallButton ); if (GUILayout.Button(new GUIContent("Set Base Cover Type", dialogConfirmButtonDo.tooltip), areButtonsDisabled?m_buttonDisabled:m_button)) { m_tileModifications.resource_tile = m_baseCoverModification; StartCoroutine(Put(selection)); } m_styles.DrawLine(GUIStyles.LineDirection.Horizontal, GUIStyles.LineColor.Medium); GUILayout.Label("Trees:", m_mainText); float max = 100f; GUILayout.BeginHorizontal(); { for (int i=0; i<m_treeDistribution.Length; ++i) { GUILayout.BeginVertical(); { GUILayout.Label(m_treeDistribution[i].ToString(), m_minorText); m_treeDistribution[i] = (int)(max-GUILayout.VerticalSlider(max-(float)m_treeDistribution[i], 0f, max, GUILayout.Height(40f))); GUILayout.Label(string.Format("{0}\"", (i+1)*2), m_minorText); } GUILayout.EndVertical(); } } GUILayout.EndHorizontal(); if (GUILayout.Button(new GUIContent("Set Trees", dialogConfirmButtonDo.tooltip), areButtonsDisabled?m_buttonDisabled:m_button)) { m_tileModifications.resource_tile = m_treeModifications; StartCoroutine(Put(selection)); } GUILayout.BeginHorizontal(); { m_isHarvestArea = GUILayout.Toggle(m_isHarvestArea, string.Format("Harvest Area: {0}", m_isHarvestArea), m_button); if (GUILayout.Button(new GUIContent("Set Harvest Area", dialogConfirmButtonDo.tooltip), areButtonsDisabled?m_buttonDisabled:m_button)) { m_tileModifications.resource_tile = m_harvestAreaModifications; StartCoroutine(Put(selection)); } } GUILayout.EndHorizontal(); // TODO: supported saplings // GUILayout.Label("Aminals:", m_mainText); } GUILayout.EndScrollView(); m_styles.DrawLine(GUIStyles.LineDirection.Horizontal, GUIStyles.LineColor.Medium); DisplayPaintSelectionControlGroup(); }