コード例 #1
0
        public override void DoEditInterface(Listing_ScenEdit listing)
        {
            Rect scenPartRect = listing.GetScenPartRect(this, RowHeight * 5f);
            Rect rect         = scenPartRect.TopPartPixels(RowHeight);

            Text.Anchor = TextAnchor.LowerRight;
            Widgets.Label(rect.LeftHalf().Rounded(), "knownFriendlyFactions".Translate());
            Text.Anchor = TextAnchor.UpperLeft;
            Widgets.TextFieldNumeric(rect.RightHalf().Rounded(), ref factionsFriendly, ref bufFriendly);

            rect.y     += RowHeight;
            Text.Anchor = TextAnchor.LowerRight;
            Widgets.Label(rect.LeftHalf().Rounded(), "knownHostileFactions".Translate());
            Text.Anchor = TextAnchor.UpperLeft;
            Widgets.TextFieldNumeric(rect.RightHalf().Rounded(), ref factionsHostile, ref bufHostile, 1);


            rect.y     += RowHeight;
            Text.Anchor = TextAnchor.LowerRight;
            Widgets.Label(rect.LeftHalf().Rounded(), "factionCap".Translate());
            Text.Anchor = TextAnchor.UpperLeft;
            Widgets.TextFieldNumeric(rect.RightHalf().Rounded(), ref factionCap, ref bufFactionCap, 2, 50);

            Text.Anchor = TextAnchor.UpperLeft;
            GUI.enabled = false;
            var hintRect = listing.GetRect(RowHeight * 2);

            hintRect.y = rect.y + RowHeight;
            listing.GetRect(RowHeight * -2); // Gah, getting this to work -.-
            Widgets.TextArea(hintRect, "knownFactionsRecommendation".Translate());
            GUI.enabled = true;
        }