Ejemplo n.º 1
0
        public static void OnGUI(Rect rect)
        {
            var grid = rect.GetHGrid(4f, 200f, -1f);

            var typeListing = new Listing_Standard();

            typeListing.Begin(MainButtonsConfig.IsReady ? grid[1] : rect);

            if (MainButtonsConfig.IsReady)
            {
                if (typeListing.RadioButton_NewTemp("Reorderer.MainButtons".Translate(), _typeSelected == 0))
                {
                    _typeSelected = 0;
                }
                if (typeListing.RadioButton_NewTemp("Reorderer.DesignationCategories".Translate(), _typeSelected == 1))
                {
                    _typeSelected = 1;
                }
            }
            else
            {
                typeListing.Label("Reorderer.NotReady".Translate());
            }

            typeListing.NewColumn();

            typeListing.End();

            if (!MainButtonsConfig.IsReady)
            {
                return;
            }

            if (_typeSelected == 0)
            {
                MainButtonsConfig.OnGUI(grid[2]);
            }
            else if (_typeSelected == 1)
            {
                DesignationCategoryConfig.OnGUI(grid[2]);
            }
        }
 private static void Postfix(MainButtonsRoot __instance) => MainButtonsConfig.Init(__instance);