Ejemplo n.º 1
0
        public static bool ShouldShowBar(this Pawn pawn)
        {
            ValidateArg.NotNull(pawn, nameof(pawn));

            if (_settings.ShowInspiredPawn && pawn.Inspired)
            {
                return(true);
            }

            if (_settings.ShowSickPawn && BCBManager.GetStatusFor(pawn).HasTendingHediff)
            {
                return(true);
            }

            if (_settings.ShowGuestPawn && (pawn.IsQuestLodger() || pawn.IsQuestHelper()))
            {
                return(true);
            }

            if (_settings.ShowDraftedPawn && pawn.Drafted)
            {
                return(true);
            }

            if ((pawn.mindState?.IsIdle ?? false) && GenDate.DaysPassed > 1)
            {
                return(true);
            }

            if (pawn.InMentalState)
            {
                return(true);
            }

            if (pawn.IsBurning())
            {
                return(true);
            }

            if (pawn.CurJob?.def == JobDefOf.FleeAndCower)
            {
                return(true);
            }

            MoodLevel shownMoodLevel = BetterColonistBarMod.ModSettings.ShownMoodLevel;

            return(BCBManager.GetBreakLevelFor(pawn).MoodLevel <= shownMoodLevel);
        }
Ejemplo n.º 2
0
        public static Color GetColor(this MoodLevel moodLevel)
        {
            switch (moodLevel)
            {
            case MoodLevel.Satisfied:
                return(MoodColor.Satisfied);

            case MoodLevel.Minor:
                return(MoodColor.Minor);

            case MoodLevel.Major:
                return(MoodColor.Major);

            case MoodLevel.Extreme:
                return(MoodColor.Extreme);

            default:
                return(MoodColor.Satisfied);
            }
        }
Ejemplo n.º 3
0
        public static Texture2D GetTexture(this MoodLevel moodLevel)
        {
            switch (moodLevel)
            {
            case MoodLevel.Satisfied:
                return(BCBTexture.Satisfied);

            case MoodLevel.Minor:
                return(BCBTexture.Minor);

            case MoodLevel.Major:
                return(BCBTexture.Major);

            case MoodLevel.Extreme:
                return(BCBTexture.Extreme);

            default:
                return(BCBTexture.Satisfied);
            }
        }
Ejemplo n.º 4
0
        private static void DrawColorOption(Listing_Standard listing, MoodLevel moodLevel)
        {
            Rect      rect = listing.GetRect(GenUI.ListSpacing);
            WidgetRow row  = new WidgetRow(rect.x, rect.y, UIDirection.RightThenDown, rect.width);

            if (row.ButtonIcon(moodLevel.GetTexture()))
            {
                Find.WindowStack.Add(new Dialog_ColorPicker(
                                         moodLevel.GetColor(),
                                         (color) =>
                {
                    switch (moodLevel)
                    {
                    case MoodLevel.Satisfied:
                        ModSettings.Satisfied = color;
                        BCBTexture.Satisfied  = SolidColorMaterials.NewSolidColorTexture(color);
                        break;

                    case MoodLevel.Minor:
                        ModSettings.Minor = color;
                        BCBTexture.Minor  = SolidColorMaterials.NewSolidColorTexture(color);
                        break;

                    case MoodLevel.Major:
                        ModSettings.Major = color;
                        BCBTexture.Major  = SolidColorMaterials.NewSolidColorTexture(color);
                        break;

                    case MoodLevel.Extreme:
                        ModSettings.Extreme = color;
                        BCBTexture.Extreme  = SolidColorMaterials.NewSolidColorTexture(color);
                        break;
                    }

                    ModSettings.UISettingsChanged = true;
                }));
            }

            row.GapButtonIcon();
            row.Label(moodLevel.ToString());
        }