Exemple #1
0
        public override void Draw(Rect rect)
        {
            var vGrid = rect.GetVGrid(GUIPlus.LargePadding, 40f, -1f, 10f);

            var l = new ListingPlus();

            l.Begin(vGrid[1]);

            l.Label("This mod was brought to you by:".Bold());
            l.GapLine();
            l.End();

            l.BeginScrollView(vGrid[2], ref _scrollPosition, ref _viewRect);

            l.Label(Persistent.GetCredits());

            l.Gap();

            l.Label("A special thanks to everyone above and countless others who have helped along the way.");
            l.Label(("❤️".Color("FF0011") + " Jaxe".Italic()).Bold());

            l.Gap();

            l.EndScrollView(ref _viewRect);
        }
Exemple #2
0
        public override void DoWindowContents(Rect inRect)
        {
            var listing = new ListingPlus();

            listing.Begin(inRect);
            listing.Label("RimHUD has automatically deactivated due to the following error(s):".Bold());
            listing.Label(_info.Message);
            if (_info.IsExternalError)
            {
                listing.Label(_info.PossibleMod == null ? "The error appears to be from outside RimHUD." : $"The error appears to be have been caused by the mod '{_info.PossibleMod.Bold()}'.", color: Color.yellow);
            }
            listing.Gap();
            listing.Label("Stacktrace:".Bold(), font: GameFont.Tiny);
            listing.End();

            var grid = inRect.GetVGrid(0f, listing.CurHeight, -1f, GUIPlus.SmallButtonHeight + GUIPlus.MediumPadding);

            Widgets.DrawMenuSection(grid[2]);

            var stacktraceRect = grid[2].ContractedBy(GUIPlus.SmallPadding);
            var stacktraceList = new ListingPlus();

            stacktraceList.BeginScrollView(stacktraceRect, ref _scrollPosition, ref _scrollView);
            stacktraceList.Label(_info.StackTrace, font: GameFont.Tiny);
            stacktraceList.EndScrollView(ref _scrollView);

            grid[3].yMin += GUIPlus.MediumPadding;
            var buttonGrid = grid[3].GetHGrid(GUIPlus.MediumPadding, ButtonWidth, -1f, ButtonWidth, ButtonWidth);

            if (GUIPlus.DrawButton(buttonGrid[1], "Copy to clipboard", font: GameFont.Tiny))
            {
                GUIUtility.systemCopyBuffer = $"[[RimHUD Auto-deactivation report]]\n{_info.Text}";
                Mod.Message("RimHUD Auto-deactivation details copied to clipboard");
            }
            if (GUIPlus.DrawButton(buttonGrid[3], "Reactivate", font: GameFont.Tiny))
            {
                Close();
                State.Activated = true;
            }
            if (GUIPlus.DrawButton(buttonGrid[4], "Close", font: GameFont.Tiny))
            {
                Close();
            }
        }
Exemple #3
0
        protected override void DrawContent(Rect rect)
        {
            var vGrid = rect.GetVGrid(GUIPlus.LargePadding, -1f, 70f);
            var l     = new ListingPlus();

            l.BeginScrollView(vGrid[1], ref _scrollPosition, ref _scrollView);

            foreach (var preset in LayoutPreset.UserList)
            {
                if (_selected == null)
                {
                    _selected = preset;
                }
                if (l.RadioButton_NewTemp(preset.Label, _selected == preset))
                {
                    _selected = preset;
                }
            }

            l.EndScrollView(ref _scrollView);

            l.Begin(vGrid[2]);

            var buttonGrid = l.GetButtonGrid(-1f, -1f);

            if (GUIPlus.DrawButton(buttonGrid[1], Lang.Get("Dialog_Presets.Delete"), enabled: _selected?.IsUserMade ?? false))
            {
                ConfirmDelete();
            }
            if (GUIPlus.DrawButton(buttonGrid[2], Lang.Get("Button.Close")))
            {
                Close();
            }

            l.End();
        }
Exemple #4
0
        public override void Draw(Rect rect)
        {
            var hGrid = rect.GetHGrid(GUIPlus.LargePadding, -1f, -1f);
            var l     = new ListingPlus();

            var selected = _selected;

            l.BeginScrollView(hGrid[1], ref _scrollPosition, ref _viewRect);

            l.Label(Lang.Get("Theme.HudColors").Bold());
            l.GapLine();
            l.ColorOptionSelect(Theme.MainTextColor, ref _selected);
            l.ColorOptionSelect(Theme.DisabledColor, ref _selected);
            l.ColorOptionSelect(Theme.CriticalColor, ref _selected);
            l.ColorOptionSelect(Theme.WarningColor, ref _selected);
            l.ColorOptionSelect(Theme.InfoColor, ref _selected);
            l.ColorOptionSelect(Theme.GoodColor, ref _selected);
            l.ColorOptionSelect(Theme.ExcellentColor, ref _selected);
            l.ColorOptionSelect(Theme.BarBackgroundColor, ref _selected);
            l.ColorOptionSelect(Theme.BarMainColor, ref _selected);
            l.ColorOptionSelect(Theme.BarLowColor, ref _selected);
            l.ColorOptionSelect(Theme.BarThresholdColor, ref _selected);
            l.ColorOptionSelect(Theme.SelectorTextColor, ref _selected);
            l.ColorOptionSelect(Theme.SelectorBackgroundColor, ref _selected);
            l.ColorOptionSelect(Theme.LineColor, ref _selected);
            l.Gap();

            l.Label(Lang.Get("Theme.FactionColors").Bold());
            l.GapLine();
            l.ColorOptionSelect(Theme.FactionOwnColor, ref _selected);
            l.ColorOptionSelect(Theme.FactionAlliedColor, ref _selected);
            l.ColorOptionSelect(Theme.FactionIndependentColor, ref _selected);
            l.ColorOptionSelect(Theme.FactionHostileColor, ref _selected);
            l.ColorOptionSelect(Theme.FactionWildColor, ref _selected);
            l.Gap();

            l.Label(Lang.Get("Theme.SkillColors").Bold());
            l.GapLine();
            l.ColorOptionSelect(Theme.SkillMinorPassionColor, ref _selected);
            l.ColorOptionSelect(Theme.SkillMajorPassionColor, ref _selected);
            l.Gap();

            var hasBubbles = Mod_Bubbles.Instance.IsActive;

            l.Label(Lang.Get("Integration.Bubbles.Colors").Bold());
            l.GapLine();
            l.ColorOptionSelect(Mod_Bubbles.ForeColor, ref _selected, hasBubbles);
            l.ColorOptionSelect(Mod_Bubbles.BackColor, ref _selected, hasBubbles);
            l.ColorOptionSelect(Mod_Bubbles.SelectedForeColor, ref _selected, hasBubbles);
            l.ColorOptionSelect(Mod_Bubbles.SelectedBackColor, ref _selected, hasBubbles);

            l.EndScrollView(ref _viewRect);

            l.Begin(hGrid[2]);

            if (_selected != null)
            {
                if (_selected != selected)
                {
                    ParseColor();
                }

                l.Label(Lang.Get("Dialog_Config.Tab.Colors.Editor", _selected.Label).Bold());
                l.GapLine();
                l.RangeSliderEntry(_hue, ref _hueText, 1);
                l.RangeSliderEntry(_saturation, ref _saturationText, 2);
                l.RangeSliderEntry(_lightness, ref _lightnessText, 3);
                l.RangeSliderEntry(_alpha, ref _alphaText, 4);
                l.GapLine();
                var newColor = Color.HSVToRGB(_hue.Value.ToPercentageFloat(), _saturation.Value.ToPercentageFloat(), _lightness.Value.ToPercentageFloat());
                newColor.a      = _alpha.Value.ToPercentageFloat();
                _selected.Value = newColor;

                var sampleRect = l.GetRect(30f);
                Widgets.DrawBoxSolid(sampleRect, _selected.Value);
            }

            l.End();
        }