Exemple #1
0
        public void Draw(Rect canvas)
        {
            (Rect label, Rect field) = canvas.Split(0.75f);
            UiHelper.Label(label, _techLevelText);

            (Rect comp, Rect tech) = field.Split(0.3f);

            if (Widgets.ButtonText(comp, _comparison.AsOperator()))
            {
                Find.WindowStack.Add(new FloatMenu(_comparisonOptions));
            }

            if (Widgets.ButtonText(tech, $"TechLevel_{_techLevel}".TranslateSimple().CapitalizeFirst()))
            {
                Find.WindowStack.Add(new FloatMenu(_techLevelOptions));
            }
        }
Exemple #2
0
        public void Draw(Rect canvas)
        {
            (Rect label, Rect field) = canvas.Split(0.75f);
            UiHelper.Label(label, _priceText);

            (Rect button, Rect input) = field.Split(0.3f);

            if (Widgets.ButtonText(button, _comparison.AsOperator()))
            {
                Find.WindowStack.Add(new FloatMenu(_comparisonOptions));
            }

            if (!UiHelper.NumberField(input, out int value, ref _priceBuffer, ref _priceBufferValid))
            {
                return;
            }

            _price = value;
            Dirty.Set(true);
        }