/// <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 CommercialPanel(UITabstrip tabStrip, int tabIndex) { // Add tab. UIPanel panel = PanelUtils.AddTab(tabStrip, Translations.Translate("RPR_CAT_COM"), tabIndex); // Initialise textfield array. SetupArrays(NumSubServices); for (int i = 0; i < NumSubServices; i++) { int levels = i < 2 ? NumLevels : 1; areaFields[i] = new UITextField[levels]; floorFields[i] = new UITextField[levels]; extraFloorFields[i] = new UITextField[levels]; powerFields[i] = new UITextField[levels]; waterFields[i] = new UITextField[levels]; sewageFields[i] = new UITextField[levels]; garbageFields[i] = new UITextField[levels]; incomeFields[i] = new UITextField[levels]; } // Headings. AddHeadings(panel); // Create residential per-person area textfields and labels. RowHeaderIcon(panel, currentY, Translations.Translate(subServiceLables[LowCom]), "ZoningCommercialLow", "Thumbnails"); AddSubService(panel, true, LowCom); RowHeaderIcon(panel, currentY, Translations.Translate(subServiceLables[HighCom]), "ZoningCommercialHigh", "Thumbnails"); AddSubService(panel, true, HighCom); RowHeaderIcon(panel, currentY, Translations.Translate(subServiceLables[EcoCom]), "IconPolicyOrganic", "Ingame"); AddSubService(panel, false, EcoCom, label: Translations.Translate("RPR_CAT_ECO")); RowHeaderIcon(panel, currentY, Translations.Translate(subServiceLables[Leisure]), "IconPolicyLeisure", "Ingame"); AddSubService(panel, false, Leisure, label: Translations.Translate(subServiceLables[Leisure])); RowHeaderIcon(panel, 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 IndustrialPanel(UITabstrip tabStrip, int tabIndex) { // Add tab. UIPanel panel = PanelUtils.AddTab(tabStrip, Translations.Translate("RPR_CAT_IND"), tabIndex); // Initialise textfield array. SetupArrays(NumSubServices); for (int i = 0; i < NumSubServices; i++) { int levels = i == 0 ? NumLevels : 2; areaFields[i] = new UITextField[levels]; floorFields[i] = new UITextField[levels]; extraFloorFields[i] = new UITextField[levels]; powerFields[i] = new UITextField[levels]; waterFields[i] = new UITextField[levels]; sewageFields[i] = new UITextField[levels]; garbageFields[i] = new UITextField[levels]; incomeFields[i] = new UITextField[levels]; } // Headings. AddHeadings(panel); // Create residential per-person area textfields and labels. RowHeaderIcon(panel, currentY, Translations.Translate(subServiceLables[Generic]), "ZoningIndustrial", "Thumbnails"); AddSubService(panel, true, Generic); RowHeaderIcon(panel, currentY, Translations.Translate(subServiceLables[Farming]), "IconPolicyFarming", "Ingame"); AddSubService(panel, false, Farming, true); RowHeaderIcon(panel, currentY, Translations.Translate(subServiceLables[Forestry]), "IconPolicyForest", "Ingame"); AddSubService(panel, false, Forestry, true); RowHeaderIcon(panel, currentY, Translations.Translate(subServiceLables[Oil]), "IconPolicyOil", "Ingame"); AddSubService(panel, false, Oil, true); RowHeaderIcon(panel, currentY, Translations.Translate(subServiceLables[Ore]), "IconPolicyOre", "Ingame"); AddSubService(panel, false, Ore, true); // Populate initial values. PopulateFields(); // Add command buttons. AddButtons(panel); }
/// <summary> /// Adds mod options tab to tabstrip. /// </summary> /// <param name="tabStrip">Tab strip to add to</param> /// <param name="tabIndex">Index number of tab</param> internal ModOptionsPanel(UITabstrip tabStrip, int tabIndex) { // Add tab and helper. UIPanel panel = PanelUtils.AddTab(tabStrip, Translations.Translate("RPR_OPT_MOD"), tabIndex); UIHelper helper = new UIHelper(panel); panel.autoLayout = true; // Language dropdown. UIDropDown languageDrop = PanelUtils.AddPlainDropDown(panel, Translations.Translate("TRN_CHOICE"), Translations.LanguageList, Translations.Index); languageDrop.eventSelectedIndexChanged += (control, index) => { Translations.Index = index; SettingsUtils.SaveSettings(); }; // Hotkey control. panel.gameObject.AddComponent <OptionsKeymapping>(); }
/// <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 ResidentialPanel(UITabstrip tabStrip, int tabIndex) { // Add tab. UIPanel panel = PanelUtils.AddTab(tabStrip, Translations.Translate("RPR_CAT_RES"), tabIndex); // Set residential flag. notResidential = false; // Initialise textfield array. SetupArrays(NumSubServices); for (int i = 0; i < NumSubServices; i++) { areaFields[i] = new UITextField[NumLevels]; floorFields[i] = new UITextField[NumLevels]; powerFields[i] = new UITextField[NumLevels]; waterFields[i] = new UITextField[NumLevels]; sewageFields[i] = new UITextField[NumLevels]; garbageFields[i] = new UITextField[NumLevels]; incomeFields[i] = new UITextField[NumLevels]; } // Headings. AddHeadings(panel); // Create residential per-person area textfields and labels. RowHeaderIcon(panel, currentY, Translations.Translate("RPR_CAT_RLO"), "ZoningResidentialLow", "Thumbnails"); AddSubService(panel, true, LowRes); RowHeaderIcon(panel, currentY, Translations.Translate("RPR_CAT_RHI"), "ZoningResidentialHigh", "Thumbnails"); AddSubService(panel, true, HighRes); RowHeaderIcon(panel, currentY, Translations.Translate("RPR_CAT_ERL"), "IconPolicySelfsufficient", "Ingame"); AddSubService(panel, true, LowEcoRes); RowHeaderIcon(panel, 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 OfficePanel(UITabstrip tabStrip, int tabIndex) { // Add tab. UIPanel panel = PanelUtils.AddTab(tabStrip, Translations.Translate("RPR_CAT_OFF"), tabIndex); // Initialise textfield array. SetupArrays(NumSubServices); for (int i = 0; i < NumSubServices; i++) { int levels = i == 0 ? NumLevels : 1; areaFields[i] = new UITextField[levels]; floorFields[i] = new UITextField[levels]; extraFloorFields[i] = new UITextField[levels]; powerFields[i] = new UITextField[levels]; waterFields[i] = new UITextField[levels]; sewageFields[i] = new UITextField[levels]; garbageFields[i] = new UITextField[levels]; incomeFields[i] = new UITextField[levels]; } // Headings. AddHeadings(panel); // Create residential per-person area textfields and labels. RowHeaderIcon(panel, currentY, Translations.Translate(subServiceLables[Office]), "ZoningOffice", "Thumbnails"); AddSubService(panel, true, Office); RowHeaderIcon(panel, 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); }