示例#1
0
        protected override void Resize(Rect rect)
        {
            base.Resize(rect);

            Vector2 panelMargin = Style.SizePanelMargin;

            PanelPawnList.Resize(new Rect(rect.xMin, rect.yMin, 110, 560));
            PanelRandomize.Resize(new Rect(PanelPawnList.PanelRect.xMax + panelMargin.x,
                                           PanelPawnList.PanelRect.yMin, 64, 64));
            PanelName.Resize(new Rect(PanelRandomize.PanelRect.xMax + panelMargin.x,
                                      PanelRandomize.PanelRect.yMin, 460, 64));
            PanelSaveLoad.Resize(new Rect(PanelName.PanelRect.xMax + panelMargin.x,
                                          PanelName.PanelRect.yMin, 284, 64));

            PanelAge.Resize(new Rect(PanelPawnList.PanelRect.xMax + panelMargin.x,
                                     PanelRandomize.PanelRect.yMax + panelMargin.y, 226, 64));
            PanelAppearance.Resize(new Rect(PanelAge.PanelRect.xMin, PanelAge.PanelRect.yMax + panelMargin.y,
                                            226, 405));

            PanelBackstory.Resize(new Rect(PanelAge.PanelRect.xMax + panelMargin.x, PanelAge.PanelRect.yMin,
                                           320, 120));
            PanelTraits.Resize(new Rect(PanelBackstory.PanelRect.xMin, PanelBackstory.PanelRect.yMax + panelMargin.y,
                                        320, 156));
            PanelHealth.Resize(new Rect(PanelBackstory.PanelRect.xMin, PanelTraits.PanelRect.yMax + panelMargin.y,
                                        320, 180));

            PanelSkills.Resize(new Rect(PanelBackstory.PanelRect.xMax + panelMargin.x, PanelBackstory.PanelRect.yMin,
                                        262, 362));
            PanelIncapable.Resize(new Rect(PanelSkills.PanelRect.xMin, PanelSkills.PanelRect.yMax + panelMargin.y,
                                           260, 103));
        }
        protected override void Resize(Rect rect)
        {
            base.Resize(rect);

            Vector2 panelMargin = Style.SizePanelMargin;

            // Pawn list
            PawnListMode pawnListMode    = PrepareCarefully.Instance.State.PawnListMode;
            float        pawnListWidth   = 168;
            float        minimizedHeight = 36;
            float        maximizedHeight = rect.height - panelMargin.y - minimizedHeight;

            if (pawnListMode == PawnListMode.ColonyPawnsMaximized)
            {
                PanelColonyPawns.Resize(new Rect(rect.xMin, rect.yMin, pawnListWidth, maximizedHeight));
                PanelWorldPawns.Resize(new Rect(PanelColonyPawns.PanelRect.x, PanelColonyPawns.PanelRect.yMax + panelMargin.y, pawnListWidth, minimizedHeight));
            }
            else if (pawnListMode == PawnListMode.WorldPawnsMaximized)
            {
                PanelColonyPawns.Resize(new Rect(rect.xMin, rect.yMin, pawnListWidth, minimizedHeight));
                PanelWorldPawns.Resize(new Rect(PanelColonyPawns.PanelRect.x, PanelColonyPawns.PanelRect.yMax + panelMargin.y, pawnListWidth, maximizedHeight));
            }
            else
            {
                float listHeight = Mathf.Floor((rect.height - panelMargin.y) * 0.5f);
                PanelColonyPawns.Resize(new Rect(rect.xMin, rect.yMin, pawnListWidth, listHeight));
                PanelWorldPawns.Resize(new Rect(PanelColonyPawns.PanelRect.x, PanelColonyPawns.PanelRect.yMax + panelMargin.y, pawnListWidth, listHeight));
            }

            // Randomize, Age and Save/Load
            PanelRandomize.Resize(new Rect(PanelColonyPawns.PanelRect.xMax + panelMargin.x,
                                           PanelColonyPawns.PanelRect.yMin, 64, 64));
            PanelName.Resize(new Rect(PanelRandomize.PanelRect.xMax + panelMargin.x,
                                      PanelRandomize.PanelRect.yMin, 402, 64));
            PanelSaveLoad.Resize(new Rect(PanelName.PanelRect.xMax + panelMargin.x,
                                          PanelName.PanelRect.yMin, 284, 64));

            // Age and Appearance
            float columnSize1 = 226;

            PanelAge.Resize(new Rect(PanelColonyPawns.PanelRect.xMax + panelMargin.x,
                                     PanelRandomize.PanelRect.yMax + panelMargin.y, columnSize1, 64));
            PanelAppearance.Resize(new Rect(PanelAge.PanelRect.xMin, PanelAge.PanelRect.yMax + panelMargin.y,
                                            columnSize1, 414));

            // Faction, Backstory, Traits and Health
            float columnSize2        = 304;
            float factionPanelHeight = pawnListMode == PawnListMode.WorldPawnsMaximized ? 70 : 0;

            PanelFaction.Resize(new Rect(PanelAge.PanelRect.xMax + panelMargin.x, PanelAge.PanelRect.yMin,
                                         columnSize2, factionPanelHeight));
            float backstoryTop = PanelFaction.PanelRect.yMax + (pawnListMode == PawnListMode.WorldPawnsMaximized ? panelMargin.y : 0);

            PanelBackstory.Resize(new Rect(PanelFaction.PanelRect.xMin, backstoryTop,
                                           columnSize2, 95));
            PanelTraits.Resize(new Rect(PanelBackstory.PanelRect.xMin, PanelBackstory.PanelRect.yMax + panelMargin.y,
                                        columnSize2, 142));
            float healthHeight = pawnListMode == PawnListMode.WorldPawnsMaximized ? 147 : 229;

            PanelHealth.Resize(new Rect(PanelBackstory.PanelRect.xMin, PanelTraits.PanelRect.yMax + panelMargin.y,
                                        columnSize2, healthHeight));

            // Skills and Incapable Of
            float columnSize3 = 218;

            PanelSkills.Resize(new Rect(PanelFaction.PanelRect.xMax + panelMargin.x, PanelFaction.PanelRect.yMin,
                                        columnSize3, 362));
            PanelIncapable.Resize(new Rect(PanelSkills.PanelRect.xMin, PanelSkills.PanelRect.yMax + panelMargin.y,
                                           columnSize3, 116));
        }