/// <summary> /// Adds commercial options tab to tabstrip. /// </summary> /// <param name="tabStrip">Tab strip to add to</param> /// <param name="tabIndex">Index number of tab</param> public OffConsumptionPanel(UITabstrip tabStrip, int tabIndex) { // Add tab. UIPanel panel = PanelUtils.AddIconTab(tabStrip, Translations.Translate("RPR_OPT_CON"), tabIndex, tabIconNames, tabAtlasNames); // Initialise textfield arrays (first dimension, sub-services). SubServiceArrays(NumSubServices); // Initialise textfield arrays (second dimension, levels). for (int i = 0; i < NumSubServices; i++) { // Number of levels is either 3 (for the first category, generic offices), or 1 for the remainder. int levels = i == 0 ? NumLevels : 1; LevelArrays(i, levels); } // Headings. AddHeadings(panel); // Create residential per-person area textfields and labels. PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate(subServiceLables[Office]), "ZoningOffice", "Thumbnails"); AddSubService(panel, true, Office); PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate(subServiceLables[HighTech]), "IconPolicyHightech", "Ingame"); AddSubService(panel, false, HighTech, label: Translations.Translate(subServiceLables[HighTech])); // Populate initial values. PopulateFields(); // Add command buttons. AddButtons(panel); }
/// <summary> /// Constructor - adds default options tab to tabstrip. /// </summary> /// <param name="tabStrip">Tab strip to add to</param> /// <param name="tabIndex">Index number of tab</param> internal CalculationsPanelBase(UITabstrip tabStrip, int tabIndex) { // Add tab and helper. panel = PanelUtils.AddIconTab(tabStrip, TabName, tabIndex, TabIconNames, TabAtlasNames, TabWidth); // Set instance. instance = this; }
/// <summary> /// Constructor - adds editing options tab to tabstrip. /// </summary> /// <param name="tabStrip">Tab strip to add to</param> /// <param name="tabIndex">Index number of tab</param> internal PackPanelBase(UITabstrip tabStrip, int tabIndex) { // Layout constants. const float TabWidth = 50f; // Add tab and helper. panel = PanelUtils.AddIconTab(tabStrip, Translations.Translate(TabTooltipKey), tabIndex, new string[] { TabSprite }, new string[] { "ingame" }, TabWidth); }
/// <summary> /// Adds options tab to tabstrip. /// </summary> /// <param name="tabStrip">Tab strip to add to</param> /// <param name="tabIndex">Index number of tab</param> internal CalculationsTabBase(UITabstrip parentTabStrip, int tabIndex) { // Add tab and helper. UIPanel panel = PanelUtils.AddIconTab(parentTabStrip, Tooltip, tabIndex, IconNames, AtlasNames, TabWidth); // Add tabstrip. UITabstrip childTabStrip = panel.AddUIComponent <UITabstrip>(); childTabStrip.relativePosition = new Vector3(0, 0); childTabStrip.size = new Vector2(744f, 725f); // Tab container (the panels underneath each tab). UITabContainer tabContainer = panel.AddUIComponent <UITabContainer>(); tabContainer.relativePosition = new Vector3(0, 30f); tabContainer.size = new Vector3(744f, 720); childTabStrip.tabPages = tabContainer; // Add child tabs. AddTabs(childTabStrip); }
/// <summary> /// Adds residential options tab to tabstrip. /// </summary> /// <param name="tabStrip">Tab strip to add to</param> /// <param name="tabIndex">Index number of tab</param> public ResConsumptionPanel(UITabstrip tabStrip, int tabIndex) { // Add tab. UIPanel panel = PanelUtils.AddIconTab(tabStrip, Translations.Translate("RPR_OPT_CON"), tabIndex, tabIconNames, tabAtlasNames); // Set residential flag. notResidential = false; // Initialise textfield arrays (first dimension, sub-services). SubServiceArrays(NumSubServices); // Initialise textfield arrays (second dimension, levels - five each). for (int i = 0; i < NumSubServices; ++i) { LevelArrays(i, NumLevels); } // Headings. AddHeadings(panel); // Move currentY up, so we can fit everything. currentY -= 30f; // Create residential per-person area textfields and labels. PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate("RPR_CAT_RLO"), "ZoningResidentialLow", "Thumbnails"); AddSubService(panel, true, LowRes); PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate("RPR_CAT_RHI"), "ZoningResidentialHigh", "Thumbnails"); AddSubService(panel, true, HighRes); PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate("RPR_CAT_ERL"), "IconPolicySelfsufficient", "Ingame"); AddSubService(panel, true, LowEcoRes); PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate("RPR_CAT_ERH"), "IconPolicySelfsufficient", "Ingame"); AddSubService(panel, true, HighEcoRes); // Populate initial values. PopulateFields(); // Add command buttons. AddButtons(panel); }
/// <summary> /// Adds commercial options tab to tabstrip. /// </summary> /// <param name="tabStrip">Tab strip to add to</param> /// <param name="tabIndex">Index number of tab</param> public ComConsumptionPanel(UITabstrip tabStrip, int tabIndex) { // Add tab. UIPanel panel = PanelUtils.AddIconTab(tabStrip, Translations.Translate("RPR_OPT_CON"), tabIndex, tabIconNames, tabAtlasNames); // Initialise textfield arrays (first dimension, sub-services). SubServiceArrays(NumSubServices); // Initialise textfield arrays (second dimension, levels). for (int i = 0; i < NumSubServices; i++) { // Number of levels is either 3 (for the first two categories, low and high com), or 1 for the remainder. int levels = i < 2 ? NumLevels : 1; LevelArrays(i, levels); } // Headings. AddHeadings(panel); // Create residential per-person area textfields and labels. PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate(subServiceLables[LowCom]), "ZoningCommercialLow", "Thumbnails"); AddSubService(panel, true, LowCom); PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate(subServiceLables[HighCom]), "ZoningCommercialHigh", "Thumbnails"); AddSubService(panel, true, HighCom); PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate(subServiceLables[EcoCom]), "IconPolicyOrganic", "Ingame"); AddSubService(panel, false, EcoCom, label: Translations.Translate("RPR_CAT_ECO")); PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate(subServiceLables[Leisure]), "IconPolicyLeisure", "Ingame"); AddSubService(panel, false, Leisure, label: Translations.Translate(subServiceLables[Leisure])); PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate(subServiceLables[Tourist]), "IconPolicyTourist", "Ingame"); AddSubService(panel, false, Tourist, label: Translations.Translate(subServiceLables[Tourist])); // Populate initial values. PopulateFields(); // Add command buttons. AddButtons(panel); }
/// <summary> /// Adds industrial options tab to tabstrip. /// </summary> /// <param name="tabStrip">Tab strip to add to</param> /// <param name="tabIndex">Index number of tab</param> public IndConsumptionPanel(UITabstrip tabStrip, int tabIndex) { // Add tab. UIPanel panel = PanelUtils.AddIconTab(tabStrip, Translations.Translate("RPR_OPT_CON"), tabIndex, tabIconNames, tabAtlasNames); // Initialise textfield arrays (first dimension, sub-services). SubServiceArrays(NumSubServices); // Initialise textfield arrays (second dimension, levels). for (int i = 0; i < NumSubServices; i++) { // Number of levels is either 3 (for the first category, generic industry), or 2 for the remainder. int levels = i == 0 ? NumLevels : 2; LevelArrays(i, levels); } // Headings. AddHeadings(panel); // Create residential per-person area textfields and labels. PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate(subServiceLables[Generic]), "ZoningIndustrial", "Thumbnails"); AddSubService(panel, true, Generic); PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate(subServiceLables[Farming]), "IconPolicyFarming", "Ingame"); AddSubService(panel, false, Farming, true); PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate(subServiceLables[Forestry]), "IconPolicyForest", "Ingame"); AddSubService(panel, false, Forestry, true); PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate(subServiceLables[Oil]), "IconPolicyOil", "Ingame"); AddSubService(panel, false, Oil, true); PanelUtils.RowHeaderIcon(panel, ref currentY, Translations.Translate(subServiceLables[Ore]), "IconPolicyOre", "Ingame"); AddSubService(panel, false, Ore, true); // Populate initial values. PopulateFields(); // Add command buttons. AddButtons(panel); }