Exemple #1
0
        private void JobTitle(ref float widestWidth)
        {
            var jobTitleLabel = AddUIComponent <UILabel>();

            jobTitleLabel.name          = "JobTitleLabel";
            jobTitleLabel.text          = "Job Title".TranslateCitizen();
            jobTitleLabel.textScale     = 0.9f;
            jobTitleLabel.isInteractive = false;

            var jobTitleInputField = UiUtils.CreateCitizenJobField(this, "JobTitle", (component, value) =>
            {
                if (!CustomizeItExtendedCitizenTool.instance.CustomJobTitles.TryGetValue(SelectedCitizenID,
                                                                                         out string _))
                {
                    CustomizeItExtendedCitizenTool.instance.CustomJobTitles.Add(SelectedCitizenID, value);
                }
                else
                {
                    CustomizeItExtendedCitizenTool.instance.CustomJobTitles[SelectedCitizenID] = value;
                }
            });

            Inputs.Add(jobTitleInputField);
            _labels.Add(jobTitleLabel);

            if (jobTitleLabel.width + UiUtils.FieldWidth + UiUtils.FieldMargin * 6 > widestWidth)
            {
                widestWidth = jobTitleLabel.width + UiUtils.FieldWidth + UiUtils.FieldMargin * 6;
            }
        }