Esempio n. 1
0
        public static void OnGUI(UnitEntityData ch, float indent = 100)
        {
            var targetString = ch == null
                    ? "creation of ".green() + "new characters" + "\nNote:".yellow().bold()
                               + " This value applies to ".orange() + "all saves".yellow().bold() + " and in the main menu".orange()
                   : $"when leveling up ".green() + ch.CharacterName.orange().bold() + "\nNote:".yellow().bold()
                               + " This applies only to the ".orange() + "current save.".yellow().bold();

            using (UI.HorizontalScope()) {
                UI.Space(indent);
                UI.Label($"Configure multiclass classes and gestalt flags to use during {targetString}".green());
                UI.Space(25);
                UI.Toggle("Show Class Descriptions", ref settings.toggleMulticlassShowClassDescriptions);
            }
            UI.Space(15);
            MigrationOptions(indent);
            var options       = MulticlassOptions.Get(ch);
            var classes       = Game.Instance.BlueprintRoot.Progression.CharacterClasses;
            var mythicClasses = Game.Instance.BlueprintRoot.Progression.CharacterMythics;
            var showDesc      = settings.toggleMulticlassShowClassDescriptions;

            if (ch != null)
            {
                using (UI.HorizontalScope()) {
                    UI.Space(indent);
                    UI.Label($"Character Level".cyan().bold(), UI.Width(300));
                    UI.Space(25);
                    UI.Label(ch.Progression.CharacterLevel.ToString().orange().bold());
                }
                UI.Space(25);
            }
            foreach (var cl in classes)
            {
                if (PickerRow(ch, cl, options, indent))
                {
                    MulticlassOptions.Set(ch, options);
                    Mod.Trace("MulticlassOptions.Set");
                }
            }
            UI.Space(10);
            UI.Div(indent);
            UI.Space(-3);
            if (showDesc)
            {
                using (UI.HorizontalScope()) {
                    UI.Space(indent); UI.Label("Mythic".cyan());
                }
            }
            foreach (var mycl in mythicClasses)
            {
                if (PickerRow(ch, mycl, options, indent))
                {
                    MulticlassOptions.Set(ch, options);
                    Mod.Trace("MulticlassOptions.Set");
                }
            }
        }
Esempio n. 2
0
        public static void OnGUI(HashSet <string> multiclassSet, float indent = 100)
        {
            var classes       = Game.Instance.BlueprintRoot.Progression.CharacterClasses;
            var mythicClasses = Game.Instance.BlueprintRoot.Progression.CharacterMythics;

            foreach (var cl in classes)
            {
                PickerRow(cl, multiclassSet, indent);
            }
            UI.Div(indent, 20);
            foreach (var mycl in mythicClasses)
            {
                using (UI.HorizontalScope()) {
                    PickerRow(mycl, multiclassSet, indent);
                }
            }
        }
Esempio n. 3
0
        public static void OnGUI()
        {
            UI.HStack("Settings", 1,
                      () => {
                UI.ActionButton("Reset UI", () => Main.SetNeedsResetGameUI());
                25.space();
                UI.Label("Tells the game to reset the in game UI.".green() + " Warning".yellow() + " Using this in dialog or the book will dismiss that dialog which may break progress so use with care".orange());
            },
                      () => {
                UI.Toggle("Enable Game Development Mode", ref Main.settings.toggleDevopmentMode);
                UI.Space(25);
                UI.Label("This turns on the developer console which lets you access cheat commands, shows a FPS window (hide with F11), etc".green());
            },
                      () => UI.Label(""),
                      () => UI.EnumGrid("Log Level", ref Main.settings.loggingLevel, UI.AutoWidth()),
                      () => UI.Label(""),
                      () => UI.Toggle("Strip HTML (colors) from Native Console", ref Main.settings.stripHtmlTagsFromNativeConsole),
#if DEBUG
                      () => UI.Toggle("Strip HTML (colors) from Logs Tab in Unity Mod Manager", ref Main.settings.stripHtmlTagsFromUMMLogsTab),
#endif
                      () => UI.Toggle("Display guids in most tooltips, use shift + left click on items/abilities to copy guid to clipboard", ref Main.settings.toggleGuidsClipboard),
                      () => { }
                      );
#if DEBUG
            UI.Div(0, 25);
            UI.HStack("Localizaton", 1,
                      () => {
                var cultureInfo = Thread.CurrentThread.CurrentUICulture;
                var cultures    = CultureInfo.GetCultures(CultureTypes.AllCultures).OrderBy(ci => ci.DisplayName).ToList();
                using (UI.VerticalScope()) {
                    using (UI.HorizontalScope()) {
                        UI.Label("Current Cultrue".cyan(), UI.Width(275));
                        UI.Space(25);
                        UI.Label($"{cultureInfo.DisplayName}({cultureInfo.Name})".orange());
                    }
                    if (UI.GridPicker <CultureInfo>("Culture", ref uiCulture, cultures, null, ci => ci.DisplayName, ref cultureSearchText, 8, UI.rarityButtonStyle, UI.Width(UI.ummWidth - 350)))
                    {
                        // can we set it?
                    }
                }
            },
                      () => { }
                      );
#endif
        }
Esempio n. 4
0
        public static void OnGUI(UnitEntityData ch,
                                 IEnumerable <BlueprintScriptableObject> blueprints,
                                 float indent = 0, float remainingWidth = 0,
                                 Func <String, String> titleFormater = null,
                                 NamedTypeFilter typeFilter          = null
                                 )
        {
            if (titleFormater == null)
            {
                titleFormater = (t) => t.orange().bold();
            }
            int index = 0;

            if (needsLayout)
            {
                foreach (BlueprintScriptableObject blueprint in blueprints)
                {
                    var actions = blueprint.GetActions();
                    if (actions.Any(a => a.isRepeatable))
                    {
                        hasRepeatableAction = true;
                    }
                    int actionCount = actions.Sum(action => action.canPerform(blueprint, ch) ? 1 : 0);
                    maxActions = Math.Max(actionCount, maxActions);
                }
                needsLayout = false;
            }
            if (hasRepeatableAction)
            {
                UI.BeginHorizontal();
                UI.Space(553);
                UI.ActionIntTextField(
                    ref repeatCount,
                    "repeatCount",
                    (limit) => { },
                    () => { },
                    UI.Width(160));
                UI.Space(40);
                UI.Label("Parameter".cyan() + ": " + $"{repeatCount}".orange(), UI.ExpandWidth(false));
                repeatCount = Math.Max(1, repeatCount);
                repeatCount = Math.Min(100, repeatCount);
                UI.EndHorizontal();
            }
            UI.Div(indent);
            foreach (BlueprintScriptableObject blueprint in blueprints)
            {
                UI.BeginHorizontal();
                UI.Space(indent);
                var actions = blueprint.GetActions().Where(action => action.canPerform(blueprint, ch)).ToArray();
                var titles  = actions.Select(a => a.name);
                var title   = blueprint.name;
                if (titles.Contains("Remove"))
                {
                    title = title.cyan().bold();
                }
                else
                {
                    title = titleFormater(title);
                }

                UI.Label(title, UI.Width(550 - indent));
                int actionCount = actions != null?actions.Count() : 0;

                for (int ii = 0; ii < maxActions; ii++)
                {
                    if (ii < actionCount)
                    {
                        BlueprintAction action = actions[ii];
                        // TODO -don't show increase or decrease actions until we redo actions into a proper value editor that gives us Add/Remove and numeric item with the ability to show values.  For now users can edit ranks in the Facts Editor
                        if (action.name == "<" || action.name == ">")
                        {
                            UI.Space(164); continue;
                        }
                        var   actionName = action.name;
                        float extraSpace = 0;
                        if (action.isRepeatable)
                        {
                            actionName += (action.isRepeatable ? $" {repeatCount}" : "");
                            extraSpace  = 20 * (float)Math.Ceiling(Math.Log10((double)repeatCount));
                        }
                        UI.ActionButton(actionName, () => { action.action(blueprint, ch, repeatCount); }, UI.Width(160 + extraSpace));
                        UI.Space(10);
                    }
                    else
                    {
                        UI.Space(174);
                    }
                }
                UI.Space(30);
                String typeString = blueprint.GetType().Name;
                if (typeFilter?.collator != null)
                {
                    var collatorString = typeFilter.collator(blueprint);
                    if (!typeString.Contains(collatorString))
                    {
                        typeString += $" : {collatorString}".yellow();
                    }
                }
                Rect rect        = GUILayoutUtility.GetLastRect();
                var  description = blueprint.GetDescription();
                if (description != null && description.Length > 0)
                {
                    description = $"\n{description.green()}";
                }
                else
                {
                    description = "";
                }
                if (settings.showComponents && blueprint.ComponentsArray != null)
                {
                    String componentStr = String.Join <object>(" ", blueprint.ComponentsArray).grey();
                    if (description.Length == 0)
                    {
                        description = componentStr;
                    }
                    else
                    {
                        description = componentStr + description;
                    }
                }
                if (settings.showElements && blueprint.ElementsArray != null)
                {
                    String elementsStr = String.Join <object>(" ", blueprint.ElementsArray).yellow();
                    if (description.Length == 0)
                    {
                        description = elementsStr;
                    }
                    else
                    {
                        description = elementsStr + "\n" + description;
                    }
                }
                if (settings.showAssetIDs)
                {
                    UI.Label(typeString.cyan());
                    GUILayout.TextField(blueprint.AssetGuid, UI.Width(450));
                    UI.EndHorizontal();
                    if (description.Length > 0)
                    {
                        UI.BeginHorizontal();
                        UI.Label("", UI.Width(rect.x));
                        UI.Label(blueprint.GetDescription().green()); //,
                        UI.EndHorizontal();
                    }
                }
                else
                {
                    float width = remainingWidth - rect.xMax;
                    UI.Label(typeString.cyan() + " " + description, UI.Width(800));
                    //UI.Label($"{remainingWidth} - {rect.xMax} = {width}" + typeString + " " + description, UI.Width(800));
                    UI.EndHorizontal();
                }
#if false
                String description = blueprint.GetDescription();
                if (description.Length > 0)
                {
                    UI.BeginHorizontal();
                    UI.Space(684 + maxActions * 154);
                    UI.Label($"{description.green()}");
                    UI.EndHorizontal();
                }
#endif
                UI.Div(indent);
                index++;
            }
        }
Esempio n. 5
0
        public static void OnGUI()
        {
            var player        = Game.Instance.Player;
            var filterChoices = GetPartyFilterChoices();

            if (filterChoices == null)
            {
                return;
            }

            charToAdd    = null;
            charToRemove = null;
            var characterListFunc = UI.TypePicker <List <UnitEntityData> >(
                null,
                ref Main.settings.selectedPartyFilter,
                filterChoices
                );
            var characterList = characterListFunc.func();
            var mainChar      = GameHelper.GetPlayerCharacter();

            if (characterListFunc.name == "Nearby")
            {
                UI.Slider("Nearby Distance", ref nearbyRange, 1f, 200, 25, 0, " meters", UI.Width(250));
                characterList = characterList.OrderBy((ch) => ch.DistanceTo(mainChar)).ToList();
            }
            UI.Space(20);
            int chIndex = 0;

            respecableCount = 0;
            var  selectedCharacter = GetSelectedCharacter();
            bool isWide            = Main.IsWide;

            foreach (UnitEntityData ch in characterList)
            {
                var classData = ch.Progression.Classes;
                // TODO - understand the difference between ch.Progression and ch.Descriptor.Progression
                UnitProgressionData      progression = ch.Descriptor.Progression;
                BlueprintStatProgression xpTable     = BlueprintRoot.Instance.Progression.XPTable;
                int level       = progression.CharacterLevel;
                int mythicLevel = progression.MythicExperience;
                var spellbooks  = ch.Spellbooks;
                var spellCount  = spellbooks.Sum((sb) => sb.GetAllKnownSpells().Count());
                using (UI.HorizontalScope()) {
                    UI.Label(ch.CharacterName.orange().bold(), UI.Width(200));
                    UI.Space(25);
                    float distance = mainChar.DistanceTo(ch);;
                    UI.Label(distance < 1 ? "" : distance.ToString("0") + "m", UI.Width(75));
                    UI.Space(25);
                    UI.Label("lvl".green() + $": {level}", UI.Width(75));
                    // Level up code adapted from Bag of Tricks https://www.nexusmods.com/pathfinderkingmaker/mods/2
                    if (player.AllCharacters.Contains(ch))
                    {
                        if (progression.Experience < xpTable.GetBonus(level + 1) && level < 20)
                        {
                            UI.ActionButton("+1", () => {
                                progression.AdvanceExperienceTo(xpTable.GetBonus(level + 1), true);
                            }, UI.Width(70));
                        }
                        else if (progression.Experience >= xpTable.GetBonus(level + 1) && level < 20)
                        {
                            UI.Label("LvUp".cyan().italic(), UI.Width(70));
                        }
                        else
                        {
                            UI.Space(74);
                        }
                    }
                    else
                    {
                        UI.Space(74);
                    }
                    UI.Space(25);
                    UI.Label($"my".green() + $": {mythicLevel}", UI.Width(100));
                    if (player.AllCharacters.Contains(ch))
                    {
                        if (progression.MythicExperience < 10)
                        {
                            UI.ActionButton("+1", () => {
                                progression.AdvanceMythicExperience(progression.MythicExperience + 1, true);
                            }, UI.Width(70));
                        }
                        else
                        {
                            UI.Label("max".cyan(), UI.Width(70));
                        }
                    }
                    else
                    {
                        UI.Space(74);
                    }
                    UI.Space(35);
                    if (!isWide)
                    {
                        ActionsGUI(ch);
                    }
                    UI.Wrap(!Main.IsWide, 303, 0);
                    bool showClasses = ch == selectedCharacter && selectedToggle == ToggleChoice.Classes;
                    if (UI.DisclosureToggle($"{classData.Count} Classes", ref showClasses))
                    {
                        if (showClasses)
                        {
                            selectedCharacter = ch; selectedToggle = ToggleChoice.Classes; Logger.Log($"selected {ch.CharacterName}");
                        }
                        else
                        {
                            selectedToggle = ToggleChoice.None;
                        }
                    }
                    bool showStats = ch == selectedCharacter && selectedToggle == ToggleChoice.Stats;
                    if (UI.DisclosureToggle("Stats", ref showStats, true, isWide ? 150 : 200))
                    {
                        if (showStats)
                        {
                            selectedCharacter = ch; selectedToggle = ToggleChoice.Stats;
                        }
                        else
                        {
                            selectedToggle = ToggleChoice.None;
                        }
                    }
                    UI.Wrap(Main.IsNarrow, 279);
                    bool showFacts = ch == selectedCharacter && selectedToggle == ToggleChoice.Facts;
                    if (UI.DisclosureToggle("Facts", ref showFacts, true, isWide ? 150 : 200))
                    {
                        if (showFacts)
                        {
                            selectedCharacter = ch; selectedToggle = ToggleChoice.Facts;
                        }
                        else
                        {
                            selectedToggle = ToggleChoice.None;
                        }
                    }
                    bool showBuffs = ch == selectedCharacter && selectedToggle == ToggleChoice.Buffs;
                    if (UI.DisclosureToggle("Buffs", ref showBuffs, true, isWide ? 150 : 200))
                    {
                        if (showBuffs)
                        {
                            selectedCharacter = ch; selectedToggle = ToggleChoice.Buffs;
                        }
                        else
                        {
                            selectedToggle = ToggleChoice.None;
                        }
                    }
                    UI.Wrap(Main.IsNarrow, 304);
                    bool showAbilities = ch == selectedCharacter && selectedToggle == ToggleChoice.Abilities;
                    if (UI.DisclosureToggle("Abilities", ref showAbilities, true))
                    {
                        if (showAbilities)
                        {
                            selectedCharacter = ch; selectedToggle = ToggleChoice.Abilities;
                        }
                        else
                        {
                            selectedToggle = ToggleChoice.None;
                        }
                    }
                    UI.Space(25);
                    if (spellCount > 0)
                    {
                        bool showSpells = ch == selectedCharacter && selectedToggle == ToggleChoice.Spells;
                        if (UI.DisclosureToggle($"{spellCount} Spells", ref showSpells, true))
                        {
                            if (showSpells)
                            {
                                selectedCharacter = ch; selectedToggle = ToggleChoice.Spells;
                            }
                            else
                            {
                                selectedToggle = ToggleChoice.None;
                            }
                        }
                    }
                    else
                    {
                        UI.Space(180);
                    }
                    if (isWide)
                    {
                        ActionsGUI(ch);
                    }
                }
                if (!Main.IsWide)
                {
                    UI.Div(20, 20);
                }
                if (selectedCharacter != spellbookEditCharacter)
                {
                    editSpellbooks         = false;
                    spellbookEditCharacter = null;
                }
                if (selectedCharacter != multiclassEditCharacter)
                {
                    editMultiClass          = false;
                    multiclassEditCharacter = null;
                }
                if (ch == selectedCharacter && selectedToggle == ToggleChoice.Classes)
                {
#if DEBUG
                    UI.Div(100, 20);
                    using (UI.HorizontalScope()) {
                        UI.Space(100);
                        UI.Toggle("Multiple Classes On Level-Up", ref settings.toggleMulticlass, 0);
                        if (settings.toggleMulticlass)
                        {
                            UI.Space(39);
                            if (UI.DisclosureToggle("Config".orange().bold(), ref editMultiClass))
                            {
                                multiclassEditCharacter = selectedCharacter;
                            }
                            UI.Space(25);
                            UI.Label("Experimental Preview ".magenta() + "See 'Level Up + Multiclass' for more options".green());
                        }
                        else
                        {
                            UI.Space(50);  UI.Label("Experimental Preview ".magenta());
                        }
                    }
#endif
                    UI.Div(100, 20);
                    if (editMultiClass)
                    {
                        var multiclassSet = ch.GetMulticlassSet();
                        MulticlassPicker.OnGUI(multiclassSet);
                        ch.SetMulticlassSet(multiclassSet);
                    }
                    else
                    {
                        var prog = ch.Descriptor.Progression;
                        using (UI.HorizontalScope()) {
                            UI.Space(100);
                            UI.Label("Character Level".cyan(), UI.Width(250));
                            UI.ActionButton("<", () => prog.CharacterLevel = Math.Max(0, prog.CharacterLevel - 1), UI.AutoWidth());
                            UI.Space(25);
                            UI.Label("level".green() + $": {prog.CharacterLevel}", UI.Width(100f));
                            UI.ActionButton(">", () => prog.CharacterLevel = Math.Min(20, prog.CharacterLevel + 1), UI.AutoWidth());
                            UI.Space(25);
                            UI.ActionButton("Reset", () => ch.resetClassLevel(), UI.Width(125));
                            UI.Space(23);
                            UI.Label("This directly changes your character level but will not change exp or adjust any features associated with your character. To do a normal level up use +1 Lvl above".green());
                        }
                        UI.Div(0, 25);
                        using (UI.HorizontalScope()) {
                            UI.Space(100);
                            UI.Label("Mythic Level".cyan(), UI.Width(250));
                            UI.ActionButton("<", () => prog.MythicLevel = Math.Max(0, prog.MythicLevel - 1), UI.AutoWidth());
                            UI.Space(25);
                            UI.Label("my lvl".green() + $": {prog.MythicLevel}", UI.Width(100f));
                            UI.ActionButton(">", () => prog.MythicLevel = Math.Min(10, prog.MythicLevel + 1), UI.AutoWidth());
                            UI.Space(175);
                            UI.Label("This directly changes your mythic level but will not adjust any features associated with your character. To do a normal mythic level up use +1 my above".green());
                        }
                        foreach (var cd in classData)
                        {
                            UI.Div(100, 20);
                            using (UI.HorizontalScope()) {
                                UI.Space(100);
                                UI.Label(cd.CharacterClass.Name.orange(), UI.Width(250));
                                UI.ActionButton("<", () => cd.Level = Math.Max(0, cd.Level - 1), UI.AutoWidth());
                                UI.Space(25);
                                UI.Label("level".green() + $": {cd.Level}", UI.Width(100f));
                                var maxLevel = cd.CharacterClass.Progression.IsMythic ? 10 : 20;
                                UI.ActionButton(">", () => cd.Level = Math.Min(maxLevel, cd.Level + 1), UI.AutoWidth());
                                UI.Space(175);
                                UI.Label(cd.CharacterClass.Description.green(), UI.AutoWidth());
                            }
                        }
                    }
                }
                if (ch == selectedCharacter && selectedToggle == ToggleChoice.Stats)
                {
                    UI.Div(100, 20, 755);
                    var alignment = ch.Descriptor.Alignment.Value;
                    using (UI.HorizontalScope()) {
                        UI.Space(100);
                        UI.Label("Alignment", UI.Width(425));
                        UI.Label($"{alignment.Name()}".color(alignment.Color()).bold(), UI.Width(1250f));
                    }
                    using (UI.HorizontalScope()) {
                        UI.Space(528);
                        int alignmentIndex = Array.IndexOf(alignments, alignment);
                        var titles         = alignments.Select(
                            a => a.Acronym().color(a.Color()).bold()).ToArray();
                        if (UI.SelectionGrid(ref alignmentIndex, titles, 3, UI.Width(250f)))
                        {
                            ch.Descriptor.Alignment.Set(alignments[alignmentIndex]);
                        }
                    }
                    UI.Div(100, 20, 755);
                    using (UI.HorizontalScope()) {
                        UI.Space(100);
                        UI.Label("Size", UI.Width(425));
                        var size = ch.Descriptor.State.Size;
                        UI.Label($"{size}".orange().bold(), UI.Width(175));
                    }
                    using (UI.HorizontalScope()) {
                        UI.Space(528);
                        UI.EnumGrid(
                            () => ch.Descriptor.State.Size,
                            (s) => ch.Descriptor.State.Size = s,
                            3, UI.Width(600));
                    }
                    using (UI.HorizontalScope()) {
                        UI.Space(528);
                        UI.ActionButton("Reset", () => { ch.Descriptor.State.Size = ch.Descriptor.OriginalSize; }, UI.Width(197));
                    }
                    UI.Div(100, 20, 755);
                    foreach (StatType obj in Enum.GetValues(typeof(StatType)))
                    {
                        StatType        statType        = (StatType)obj;
                        ModifiableValue modifiableValue = ch.Stats.GetStat(statType);
                        if (modifiableValue != null)
                        {
                            String key         = $"{ch.CharacterName}-{statType.ToString()}";
                            var    storedValue = statEditorStorage.ContainsKey(key) ? statEditorStorage[key] : modifiableValue.BaseValue;
                            var    statName    = statType.ToString();
                            if (statName == "BaseAttackBonus" || statName == "SkillAthletics")
                            {
                                UI.Div(100, 20, 755);
                            }
                            using (UI.HorizontalScope()) {
                                UI.Space(100);
                                UI.Label(statName, UI.Width(400f));
                                UI.Space(25);
                                UI.ActionButton(" < ", () => {
                                    modifiableValue.BaseValue -= 1;
                                    storedValue = modifiableValue.BaseValue;
                                }, UI.AutoWidth());
                                UI.Space(20);
                                UI.Label($"{modifiableValue.BaseValue}".orange().bold(), UI.Width(50f));
                                UI.ActionButton(" > ", () => {
                                    modifiableValue.BaseValue += 1;
                                    storedValue = modifiableValue.BaseValue;
                                }, UI.AutoWidth());
                                UI.Space(25);
                                UI.ActionIntTextField(ref storedValue, statType.ToString(), (v) => {
                                    modifiableValue.BaseValue = v;
                                }, null, UI.Width(75));
                                statEditorStorage[key] = storedValue;
                            }
                        }
                    }
                }
                if (ch == selectedCharacter && selectedToggle == ToggleChoice.Facts)
                {
                    FactsEditor.OnGUI(ch, ch.Progression.Features.Enumerable.ToList());
                }
                if (ch == selectedCharacter && selectedToggle == ToggleChoice.Buffs)
                {
                    FactsEditor.OnGUI(ch, ch.Descriptor.Buffs.Enumerable.ToList());
                }
                if (ch == selectedCharacter && selectedToggle == ToggleChoice.Abilities)
                {
                    FactsEditor.OnGUI(ch, ch.Descriptor.Abilities.Enumerable.ToList());
                }
                if (ch == selectedCharacter && selectedToggle == ToggleChoice.Spells)
                {
                    UI.Space(20);
                    var names  = spellbooks.Select((sb) => sb.Blueprint.GetDisplayName()).ToArray();
                    var titles = names.Select((name, i) => $"{name} ({spellbooks.ElementAt(i).CasterLevel})").ToArray();
                    if (spellbooks.Any())
                    {
                        using (UI.HorizontalScope()) {
                            UI.SelectionGrid(ref selectedSpellbook, titles, 7, UI.Width(1581));
                            if (selectedSpellbook > names.Count())
                            {
                                selectedSpellbook = 0;
                            }
                            //                        UI.DisclosureToggle("Edit", ref editSpellbooks);
                        }
                        var spellbook = spellbooks.ElementAt(selectedSpellbook);
                        if (editSpellbooks)
                        {
                            spellbookEditCharacter = ch;
                            var blueprints = BlueprintExensions.GetBlueprints <BlueprintSpellbook>().OrderBy((bp) => bp.GetDisplayName());
                            BlueprintListUI.OnGUI(ch, blueprints, 100);
                        }
                        else
                        {
                            var maxLevel    = spellbook.Blueprint.MaxSpellLevel;
                            var casterLevel = spellbook.CasterLevel;
                            using (UI.HorizontalScope()) {
                                UI.EnumerablePicker <int>(
                                    "Spell Level".bold() + " (count)",
                                    ref selectedSpellbookLevel,
                                    Enumerable.Range(0, casterLevel + 1),
                                    0,
                                    (lvl) => {
                                    var levelText  = lvl <= casterLevel ? $"L{lvl}".bold() : $"L{lvl}".grey();
                                    var knownCount = spellbook.GetKnownSpells(lvl).Count();
                                    var countText  = knownCount > 0 ? $" ({knownCount})".white() : "";
                                    return(levelText + countText);
                                },
                                    UI.AutoWidth()
                                    );
                                if (casterLevel < maxLevel)
                                {
                                    UI.ActionButton("+1 Caster Level", () => spellbook.AddBaseLevel());
                                }
                            }
                            FactsEditor.OnGUI(ch, spellbook, selectedSpellbookLevel);
                        }
                    }
#if false
                    else
                    {
                        spellbookEditCharacter = ch;
                        editSpellbooks         = true;
                        var blueprints = BlueprintExensions.GetBlueprints <BlueprintSpellbook>().OrderBy((bp) => bp.GetDisplayName());
                        BlueprintListUI.OnGUI(ch, blueprints, 100);
                    }
#endif
                }
                if (selectedCharacter != GetSelectedCharacter())
                {
                    selectedCharacterIndex = characterList.IndexOf(selectedCharacter);
                }
                chIndex += 1;
            }
            UI.Space(25);
            if (respecableCount > 0)
            {
                UI.Label($"{respecableCount} characters".yellow().bold() + " can be respecced. Pressing Respec will close the mod window and take you to character level up".orange());
                UI.Label("WARNING".yellow().bold() + " this feature is ".orange() + "EXPERIMENTAL".yellow().bold() + " and uses unreleased and likely buggy code.".orange());
                UI.Label("BACK UP".yellow().bold() + " before playing with this feature.You will lose your mythic ranks but you can restore them in this Party Editor.".orange());
            }
            UI.Space(25);
            if (charToAdd != null)
            {
                UnitEntityDataUtils.AddCompanion(charToAdd);
            }
            if (charToRemove != null)
            {
                UnitEntityDataUtils.RemoveCompanion(charToRemove);
            }
        }
Esempio n. 6
0
        public static bool PickerRow(UnitEntityData ch, BlueprintCharacterClass cl, MulticlassOptions options, float indent = 100)
        {
            var changed  = false;
            var showDesc = settings.toggleMulticlassShowClassDescriptions;

            if (showDesc)
            {
                UI.Div(indent, 15);
            }
            var cd                = ch?.Progression.GetClassData(cl);
            var chArchetype       = cd?.Archetypes.FirstOrDefault <BlueprintArchetype>();
            var archetypeOptions  = options.ArchetypeOptions(cl);
            var showGestaltToggle = false;

            if (ch != null && cd != null)
            {
                var classes            = ch?.Progression.Classes;
                var classCount         = classes?.Count(x => !x.CharacterClass.IsMythic);
                var gestaltCount       = classes?.Count(cd => !cd.CharacterClass.IsMythic && ch.IsClassGestalt(cd.CharacterClass));
                var mythicCount        = classes.Count(x => x.CharacterClass.IsMythic);
                var mythicGestaltCount = classes.Count(cd => cd.CharacterClass.IsMythic && ch.IsClassGestalt(cd.CharacterClass));

                showGestaltToggle = ch.IsClassGestalt(cd.CharacterClass) ||
                                    !cd.CharacterClass.IsMythic && classCount - gestaltCount > 1 ||
                                    cd.CharacterClass.IsMythic && mythicCount - mythicGestaltCount > 1;
            }
            var charHasClass = cd != null && chArchetype == null;
            // Class Toggle
            var canSelectClass = MulticlassOptions.CanSelectClassAsMulticlass(ch, cl);

            using (UI.HorizontalScope()) {
                UI.Space(indent);
                var optionsHasClass = options.Contains(cl);
                UI.ActionToggle(
                    charHasClass ? cl.Name.orange() + $" ({cd.Level})".orange() : cl.Name,
                    () => optionsHasClass,
                    (v) => {
                    if (v)
                    {
                        archetypeOptions = options.Add(cl);
                        if (chArchetype != null)
                        {
                            archetypeOptions.Add(chArchetype);
                            options.SetArchetypeOptions(cl, archetypeOptions);
                        }
                    }
                    else
                    {
                        options.Remove(cl);
                    }
                    var action = v ? "Add".green() : "Del".yellow();
                    Mod.Trace($"PickerRow - {action} class: {cl.HashKey()} - {options} -> {options.Contains(cl)}");
                    changed = true;
                },
                    () => !canSelectClass,
                    350);
                UI.Space(247);
                using (UI.VerticalScope()) {
                    if (!canSelectClass)
                    {
                        UI.Label("to select this class you must unselect at least one of your other existing classes".orange());
                    }
                    if (optionsHasClass && chArchetype != null && archetypeOptions.Empty())
                    {
                        UI.Label($"due to existing archetype, {chArchetype.Name.yellow()},  this multiclass option will only be applied during respec.".orange());
                    }
                    if (showGestaltToggle && chArchetype == null)
                    {
                        using (UI.HorizontalScope()) {
                            UI.Space(-150);
                            UI.ActionToggle("gestalt".grey(), () => ch.IsClassGestalt(cd.CharacterClass),
                                            (v) => {
                                ch.SetClassIsGestalt(cd.CharacterClass, v);
                                ch.Progression.UpdateLevelsForGestalt();
                                changed = true;
                            }, 125);
                            UI.Space(25);
                            UI.Label("this flag lets you not count this class in computing character level".green());
                        }
                    }
                    if (showDesc)
                    {
                        using (UI.HorizontalScope()) {
                            UI.Label(cl.Description.StripHTML().green());
                        }
                    }
                }
            }
            // Archetypes
            using (UI.HorizontalScope()) {
                var showedGestalt = false;
                UI.Space(indent);
                var archetypes = cl.Archetypes;
                if (options.Contains(cl) && archetypes.Any() || chArchetype != null || charHasClass)
                {
                    UI.Space(50);
                    using (UI.VerticalScope()) {
                        foreach (var archetype in cl.Archetypes)
                        {
                            if (showDesc)
                            {
                                UI.Div();
                            }
                            using (UI.HorizontalScope()) {
                                var hasArch = archetypeOptions.Contains(archetype);
                                UI.ActionToggle(
                                    archetype == chArchetype ? cd.ArchetypesName().orange() + $" ({cd.Level})".orange() : archetype.Name,
                                    () => hasArch,
                                    (v) => {
                                    if (v)
                                    {
                                        archetypeOptions.AddExclusive(archetype);
                                    }
                                    else
                                    {
                                        archetypeOptions.Remove(archetype);
                                    }
                                    options.SetArchetypeOptions(cl, archetypeOptions);
                                    var action = v ? "Add".green() : "Del".yellow();
                                    Mod.Trace($"PickerRow -  {action}  - arch: {archetype.HashKey()} - {archetypeOptions}");
                                    changed = true;
                                },
                                    () => !canSelectClass,
                                    300);
                                UI.Space(250);
                                using (UI.VerticalScope()) {
                                    if (hasArch && archetype != chArchetype && (chArchetype != null || charHasClass))
                                    {
                                        if (chArchetype != null)
                                        {
                                            UI.Label($"due to existing archetype, {chArchetype.Name.yellow()}, this multiclass archetype will only be applied during respec.".orange());
                                        }
                                        else
                                        {
                                            UI.Label($"due to existing class, {cd.CharacterClass.Name.yellow()}, this multiclass archetype will only be applied during respec.".orange());
                                        }
                                    }
                                    else if (showGestaltToggle && archetype == chArchetype)
                                    {
                                        using (UI.HorizontalScope()) {
                                            UI.Space(-155);
                                            UI.ActionToggle("gestalt".grey(), () => ch.IsClassGestalt(cd.CharacterClass),
                                                            (v) => {
                                                ch.SetClassIsGestalt(cd.CharacterClass, v);
                                                ch.Progression.UpdateLevelsForGestalt();
                                                changed = true;
                                            }, 125);
                                            UI.Space(25);
                                            UI.Label("this flag lets you not count this class in computing character level".green());
                                            showedGestalt = true;
                                        }
                                    }
                                    if (showDesc)
                                    {
                                        using (UI.VerticalScope()) {
                                            if (showedGestalt)
                                            {
                                                UI.Label("this flag lets you not count this class in computing character level".green());
                                                UI.DivLast();
                                            }
                                            UI.Label(archetype.Description.StripHTML().green());
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(changed);
        }
Esempio n. 7
0
        public static void MigrationOptions(float indent)
        {
            if (!Main.IsInGame)
            {
                return;
            }
            var hasMulticlassMigration = settings.multiclassSettings.Count > 0 &&
                                         (settings.toggleAlwaysShowMigration || settings.perSave.multiclassSettings.Count == 0);
            var hasGestaltMigration = settings.excludeClassesFromCharLevelSets.Count > 0 &&
                                      (settings.toggleAlwaysShowMigration || settings.perSave.excludeClassesFromCharLevelSets.Count == 0);
            var hasLevelAsLegendMigration = settings.perSave.charIsLegendaryHero.Count > 0 &&
                                            (settings.toggleAlwaysShowMigration || settings.perSave.charIsLegendaryHero.Count == 0);
            var hasAvailableMigrations = hasMulticlassMigration || hasGestaltMigration || hasLevelAsLegendMigration;
            var migrationCount         = settings.multiclassSettings.Count + settings.excludeClassesFromCharLevelSets.Count + settings.charIsLegendaryHero.Count;

            if (migrationCount > 0)
            {
                using (UI.HorizontalScope()) {
                    UI.Space(indent);
                    UI.Toggle("Show Migrations", ref settings.toggleAlwaysShowMigration);
                    UI.Space(25);
                    UI.Label("toggle this if you want show older ToyBox settings for ".green() + "Multi-class selections, Gestalt Flags and Allow Levels Past 20 ".cyan());
                }
            }
            if (migrationCount > 0)
            {
                UI.Div(indent);
                if (hasAvailableMigrations)
                {
                    using (UI.HorizontalScope()) {
                        UI.Space(indent);
                        using (UI.VerticalScope()) {
                            UI.Label("the following options allow you to migrate previous settings that were stored in toybox to the new per setting save mechanism for ".green() + "Multi-class selections, Gestalt Flags and Allow Levels Past 20 ".cyan() + "\nNote:".orange() + "you may have configured this for a different save so use care in doing this migration".green());
                            if (hasMulticlassMigration)
                            {
                                using (UI.HorizontalScope()) {
                                    UI.Label("Multi-class settings", UI.Width(300));
                                    UI.Space(25);
                                    UI.Label($"{settings.multiclassSettings.Count}".cyan());
                                    UI.Space(25);
                                    UI.ActionButton("Migrate", () => { settings.perSave.multiclassSettings = settings.multiclassSettings; Settings.SavePerSaveSettings(); });
                                    UI.Space(25);
                                    UI.DangerousActionButton("Remove", "this will remove your old multiclass settings from ToyBox settings but does not affect any other saves that have already migrated them", ref areYouSure1, () => settings.multiclassSettings.Clear());
                                }
                            }
                            if (hasGestaltMigration)
                            {
                                using (UI.HorizontalScope()) {
                                    UI.Label("Gestalt Flags", UI.Width(300));
                                    UI.Space(25);
                                    UI.Label($"{settings.excludeClassesFromCharLevelSets.Count}".cyan());
                                    UI.Space(25);
                                    UI.ActionButton("Migrate", () => {
                                        settings.perSave.excludeClassesFromCharLevelSets = settings.excludeClassesFromCharLevelSets; Settings.SavePerSaveSettings();
                                        MultipleClasses.SyncAllGestaltState();
                                    });
                                    UI.Space(25);
                                    UI.DangerousActionButton("Remove", "this will remove your old gestalt flags from ToyBox settings but does not affect any other saves that have already migrated them", ref areYouSure2, () => settings.excludeClassesFromCharLevelSets.Clear());
                                }
                            }
                            if (hasLevelAsLegendMigration)
                            {
                                using (UI.HorizontalScope()) {
                                    UI.Label("Chars Able To Exceed Level 20", UI.Width(300));
                                    UI.Space(25);
                                    UI.Label($"{settings.charIsLegendaryHero.Count}".cyan());
                                    UI.Space(25);
                                    UI.ActionButton("Migrate", () => { settings.perSave.charIsLegendaryHero = settings.charIsLegendaryHero; Settings.SavePerSaveSettings(); });
                                    UI.Space(25);
                                    UI.DangerousActionButton("Remove", "this will remove your old Allow Level Past 20 flags from ToyBox settings but does not affect any other saves that have already migrated them", ref areYouSure3, () => settings.charIsLegendaryHero.Clear());
                                }
                            }
                        }
                    }
                    UI.Div(indent);
                }
            }
        }
Esempio n. 8
0
        static public void OnGUI <T>(String callerKey,
                                     UnitEntityData unit,
                                     List <T> facts,
                                     Func <T, BlueprintScriptableObject> blueprint,
                                     IEnumerable <BlueprintScriptableObject> blueprints,
                                     Func <T, String> title,
                                     Func <T, String> description          = null,
                                     Func <T, int> value                   = null,
                                     IEnumerable <BlueprintAction> actions = null
                                     )
        {
            bool searchChanged = false;

            if (actions == null)
            {
                actions = new List <BlueprintAction>();
            }
            if (callerKey != prevCallerKey)
            {
                searchChanged = true; showAll = false;
            }
            prevCallerKey = callerKey;
            var mutatorLookup = actions.Distinct().ToDictionary(a => a.name, a => a);

            UI.BeginHorizontal();
            UI.Space(100);
            UI.ActionTextField(ref searchText, "searhText", null, () => { searchChanged = true; }, UI.Width(320));
            UI.Space(25);
            UI.Label("Limit", UI.ExpandWidth(false));
            UI.ActionIntTextField(ref searchLimit, "searchLimit", null, () => { searchChanged = true; }, UI.Width(175));
            if (searchLimit > 1000)
            {
                searchLimit = 1000;
            }
            UI.Space(25);
            UI.Toggle("Show GUIDs", ref Main.settings.showAssetIDs);
            UI.Space(25);
            UI.Toggle("Dividers", ref Main.settings.showDivisions);
            UI.Space(25);
            searchChanged |= UI.DisclosureToggle("Show All".orange().bold(), ref showAll);
            UI.EndHorizontal();
            UI.BeginHorizontal();
            UI.Space(100);
            UI.ActionButton("Search", () => { searchChanged = true; }, UI.AutoWidth());
            UI.Space(25);
            if (matchCount > 0 && searchText.Length > 0)
            {
                String matchesText = "Matches: ".green().bold() + $"{matchCount}".orange().bold();
                if (matchCount > searchLimit)
                {
                    matchesText += " => ".cyan() + $"{searchLimit}".cyan().bold();
                }
                UI.Label(matchesText, UI.ExpandWidth(false));
            }
#if false
            UI.Label("Repeat Count", UI.ExpandWidth(false));
            UI.ActionIntTextField(
                ref repeatCount,
                "repeatCount",
                (limit) => { },
                () => { },
                UI.Width(200));
#endif
            UI.EndHorizontal();

            if (showAll)
            {
                // TODO - do we need this logic or can we make blueprint filtering fast enough to do keys by key searching?
                //if (filteredBPs == null || searchChanged) {
                UpdateSearchResults(searchText, searchLimit, blueprints);
                //}
                BlueprintListUI.OnGUI(unit, filteredBPs, 100);
                return;
            }
            var terms = searchText.Split(' ').Select(s => s.ToLower()).ToHashSet();

            BlueprintAction add      = mutatorLookup.GetValueOrDefault("Add", null);
            BlueprintAction remove   = mutatorLookup.GetValueOrDefault("Remove", null);
            BlueprintAction decrease = mutatorLookup.GetValueOrDefault("<", null);
            BlueprintAction increase = mutatorLookup.GetValueOrDefault(">", null);

            mutatorLookup.Remove("Add");
            mutatorLookup.Remove("Remove");
            mutatorLookup.Remove("<");
            mutatorLookup.Remove(">");

            BlueprintScriptableObject toAdd      = null;
            BlueprintScriptableObject toRemove   = null;
            BlueprintScriptableObject toIncrease = null;
            BlueprintScriptableObject toDecrease = null;
            var toValues = new Dictionary <String, BlueprintScriptableObject>();
            var sorted   = facts.OrderBy((f) => title(f));
            matchCount = 0;
            UI.Div(100);
            foreach (var fact in sorted)
            {
                if (fact == null)
                {
                    continue;
                }
                var    bp        = blueprint(fact);
                String name      = title(fact);
                String nameLower = name.ToLower();
                if (name != null && name.Length > 0 && (searchText.Length == 0 || terms.All(term => nameLower.Contains(term))))
                {
                    matchCount++;
                    UI.BeginHorizontal();
                    UI.Space(100);
                    UI.Label($"{name}".cyan().bold(), UI.Width(400));
                    UI.Space(30);
                    if (value != null)
                    {
                        var v = value(fact);
                        decrease.BlueprintActionButton(unit, bp, () => { toDecrease = bp; }, 50);
                        UI.Space(10f);
                        UI.Label($"{v}".orange().bold(), UI.Width(30));
                        increase.BlueprintActionButton(unit, bp, () => { toIncrease = bp; }, 50);
                    }
#if false
                    UI.Space(30);
                    add.BlueprintActionButton(unit, bp, () => { toAdd = bp; }, 150);
#endif
                    UI.Space(30);
                    remove.BlueprintActionButton(unit, bp, () => { toRemove = bp; }, 150);
#if false
                    foreach (var action in actions)
                    {
                        action.MutatorButton(unit, bp, () => { toValues[action.name] = bp; }, 150);
                    }
#endif
                    if (description != null)
                    {
                        UI.Space(30);
                        var assetID = Main.settings.showAssetIDs ? blueprint(fact).AssetGuid.magenta() + " " : "";
                        UI.Label(assetID + description(fact).green(), UI.AutoWidth());
                    }
                    UI.EndHorizontal();
                    UI.Div(100);
                }
            }
            if (toAdd != null)
            {
                add.action(toAdd, unit, repeatCount); toAdd = null;
            }
            if (toRemove != null)
            {
                remove.action(toRemove, unit, repeatCount); toRemove = null;
            }
            if (toDecrease != null)
            {
                decrease.action(toDecrease, unit, repeatCount); toDecrease = null;
            }
            if (toIncrease != null)
            {
                increase.action(toIncrease, unit, repeatCount); toIncrease = null;
            }
            foreach (var item in toValues)
            {
                var muator = mutatorLookup[item.Key];
                if (muator != null)
                {
                    muator.action(item.Value, unit, repeatCount);
                }
            }
            toValues.Clear();
        }
Esempio n. 9
0
        public static void OnGUI()
        {
            if (Main.IsInGame)
            {
                UI.BeginHorizontal();
                UI.Space(25);
                UI.Label("increment".cyan(), UI.AutoWidth());
                var increment = UI.IntTextField(ref settings.increment, null, UI.Width(150));
                UI.Space(25);
                UI.Toggle("Dividers", ref settings.showDivisions);
                UI.EndHorizontal();
                var mainChar = Game.Instance.Player.MainCharacter.Value;
                var kingdom  = KingdomState.Instance;
                UI.Div(0, 25);
                UI.HStack("Resources", 1,
                          () => {
                    var money = Game.Instance.Player.Money;
                    UI.Label("Gold".cyan(), UI.Width(150));
                    UI.Label(money.ToString().orange().bold(), UI.Width(200));
                    UI.ActionButton($"Gain {increment}", () => Game.Instance.Player.GainMoney(increment), UI.AutoWidth());
                    UI.ActionButton($"Lose {increment}", () => {
                        var loss = Math.Min(money, increment);
                        Game.Instance.Player.GainMoney(-loss);
                    }, UI.AutoWidth());
                },
                          () => {
                    var exp = mainChar.Progression.Experience;
                    UI.Label("Experience".cyan(), UI.Width(150));
                    UI.Label(exp.ToString().orange().bold(), UI.Width(200));
                    UI.ActionButton($"Gain {increment}", () => {
                        Game.Instance.Player.GainPartyExperience(increment);
                    }, UI.AutoWidth());
                });
                if (kingdom != null)
                {
                    UI.Div(0, 25);
                    UI.HStack("Kingdom", 1,
                              () => {
                        UI.Label("Finances".cyan(), UI.Width(150));
                        UI.Label(kingdom.Resources.Finances.ToString().orange().bold(), UI.Width(200));
                        UI.ActionButton($"Gain {increment}", () => {
                            kingdom.Resources += KingdomResourcesAmount.FromFinances(increment);
                        }, UI.AutoWidth());
                        UI.ActionButton($"Lose {increment}", () => {
                            kingdom.Resources -= KingdomResourcesAmount.FromFinances(increment);
                        }, UI.AutoWidth());
                    },
                              () => {
                        UI.Label("Materials".cyan(), UI.Width(150));
                        UI.Label(kingdom.Resources.Materials.ToString().orange().bold(), UI.Width(200));
                        UI.ActionButton($"Gain {increment}", () => {
                            kingdom.Resources += KingdomResourcesAmount.FromMaterials(increment);
                        }, UI.AutoWidth());
                        UI.ActionButton($"Lose {increment}", () => {
                            kingdom.Resources -= KingdomResourcesAmount.FromMaterials(increment);
                        }, UI.AutoWidth());
                    },
                              () => {
                        UI.Label("Favors".cyan(), UI.Width(150));
                        UI.Label(kingdom.Resources.Favors.ToString().orange().bold(), UI.Width(200));
                        UI.ActionButton($"Gain {increment}", () => {
                            kingdom.Resources += KingdomResourcesAmount.FromFavors(increment);
                        }, UI.AutoWidth());
                        UI.ActionButton($"Lose {increment}", () => {
                            kingdom.Resources -= KingdomResourcesAmount.FromFavors(increment);
                        }, UI.AutoWidth());
                    });
                }
            }
            UI.Div(0, 25);
            UI.HStack("Combat", 4,
                      () => UI.ActionButton("Rest All", () => CheatsCombat.RestAll()),
                      () => UI.ActionButton("Empowered", () => CheatsCombat.Empowered("")),
                      () => UI.ActionButton("Full Buff Please", () => CheatsCombat.FullBuffPlease("")),
                      () => UI.ActionButton("Remove Buffs", () => Actions.RemoveAllBuffs()),
                      () => UI.ActionButton("Remove Death's Door", () => CheatsCombat.DetachDebuff()),
                      () => UI.ActionButton("Kill All Enemies", () => CheatsCombat.KillAll()),
                      () => UI.ActionButton("Summon Zoo", () => CheatsCombat.SpawnInspectedEnemiesUnderCursor(""))
                      );
            UI.Div(0, 25);
            UI.HStack("Common", 4,
                      () => UI.ActionButton("Teleport Party To You", () => Actions.TeleportPartyToPlayer()),
                      () => UI.ActionButton("Go To Global Map", () => Actions.TeleportToGlobalMap()),
                      () => UI.ActionButton("Perception Checks", () => Actions.RunPerceptionTriggers()),
                      () => {
                UI.ActionButton("Set Perception to 40", () => {
                    CheatsCommon.StatPerception();
                    Actions.RunPerceptionTriggers();
                });
            },
                      () => UI.ActionButton("Change Weather", () => CheatsCommon.ChangeWeather("")),
                      () => UI.ActionButton("Give All Items", () => CheatsUnlock.CreateAllItems("")),
                      //                    () => { UI.ActionButton("Change Party", () => { Actions.ChangeParty(); }); },
                      () => { }
                      );
            UI.Div(0, 25);
            UI.HStack("Unlocks", 4, () => {
                UI.ActionButton("All Mythic Paths", () => Actions.UnlockAllMythicPaths());
                UI.Space(25);
                UI.Label("Warning! Using this might break your game somehow. Recommend for experimental tinkering like trying out different builds, and not for actually playing the game.".green());
            });
            UI.Div(0, 25);
            UI.HStack("Preview", 0, () => {
                UI.Toggle("Dialog Results", ref settings.previewDialogResults, 0);
                UI.Toggle("Dialog Alignment", ref settings.previewAlignmentRestrictedDialog, 0);
                UI.Toggle("Random Encounters", ref settings.previewRandomEncounters, 0);
                UI.Toggle("Events", ref settings.previewEventResults, 0);
            });
            UI.Div(0, 25);
            UI.HStack("Tweaks", 1,
                      () => UI.Toggle("Object Highlight Toggle Mode", ref settings.highlightObjectsToggle, 0),
                      () => UI.Toggle("Whole Team Moves Same Speed", ref settings.toggleMoveSpeedAsOne, 0),

                      () => UI.Toggle("Infinite Abilities", ref settings.toggleInfiniteAbilities, 0),
                      () => UI.Toggle("Infinite Spell Casts", ref settings.toggleInfiniteSpellCasts, 0),

                      () => UI.Toggle("Unlimited Actions During Turn", ref settings.toggleUnlimitedActionsPerTurn, 0),
                      () => UI.Toggle("Infinite Charges On Items", ref settings.toggleInfiniteItems, 0),

                      () => UI.Toggle("Instant Cooldown", ref settings.toggleInstantCooldown, 0),
                      () => UI.Toggle("Spontaneous Caster Scroll Copy", ref settings.toggleSpontaneousCopyScrolls, 0),

                      () => UI.Toggle("Disable Equipment Restrictions", ref settings.toggleEquipmentRestrictions, 0),
                      () => UI.Toggle("Disable Dialog Restrictions", ref settings.toggleDialogRestrictions, 0),

                      () => UI.Toggle("No Friendly Fire On AOEs", ref settings.toggleNoFriendlyFireForAOE, 0),
                      () => UI.Toggle("Free Meta-Magic", ref settings.toggleMetamagicIsFree, 0),

                      () => UI.Toggle("No Fog Of War", ref settings.toggleNoFogOfWar, 0),
                      () => UI.Toggle("No Material Components", ref settings.toggleMaterialComponent, 0),
                      //() => UI.Toggle("Restore Spells & Skills After Combat", ref settings.toggleRestoreSpellsAbilitiesAfterCombat,0),
                      //() => UI.Toggle("Access Remote Characters", ref settings.toggleAccessRemoteCharacters,0),
                      //() => UI.Toggle("Show Pet Portraits", ref settings.toggleShowAllPartyPortraits,0),
                      () => UI.Toggle("Instant Rest After Combat", ref settings.toggleInstantRestAfterCombat, 0),
                      () => UI.Toggle("Auto Load Last Save On Launch", ref settings.toggleAutomaticallyLoadLastSave, 0),
                      () => { }
                      );
            UI.Div(153, 25);
            UI.HStack("", 1,
                      () => UI.EnumGrid("Disable Attacks Of Opportunity", ref settings.noAttacksOfOpportunitySelection, 0, UI.AutoWidth()),
                      () => UI.EnumGrid("Can Move Through", ref settings.allowMovementThroughSelection, 0, UI.AutoWidth()),
                      () => { UI.Space(328); UI.Label("This allows characters you control to move through the selected category of units during combat".green(), UI.AutoWidth()); }
#if false
                      () => { UI.Slider("Collision Radius Multiplier", ref settings.collisionRadiusMultiplier, 0f, 2f, 1f, 1, "", UI.AutoWidth()); },
Esempio n. 10
0
        public static void OnGUI()
        {
            if (Main.IsInGame)
            {
                UI.BeginHorizontal();
                UI.Space(25);
                UI.Label("increment".cyan(), UI.AutoWidth());
                var increment = UI.IntTextField(ref settings.increment, null, UI.Width(150));
                UI.Space(25);
                UI.Toggle("Dividers", ref settings.showDivisions);
                UI.EndHorizontal();
                var mainChar = Game.Instance.Player.MainCharacter.Value;
                var kingdom  = KingdomState.Instance;
                UI.Div(0, 25);
                UI.HStack("Resources", 1,
                          () => {
                    var money = Game.Instance.Player.Money;
                    UI.Label("Gold".cyan(), UI.Width(150));
                    UI.Label(money.ToString().orange().bold(), UI.Width(200));
                    UI.ActionButton($"Gain {increment}", () => { Game.Instance.Player.GainMoney(increment); }, UI.AutoWidth());
                    UI.ActionButton($"Lose {increment}", () => {
                        var loss = Math.Min(money, increment);
                        Game.Instance.Player.GainMoney(-loss);
                    }, UI.AutoWidth());
                },
                          () => {
                    var exp = mainChar.Progression.Experience;
                    UI.Label("Experience".cyan(), UI.Width(150));
                    UI.Label(exp.ToString().orange().bold(), UI.Width(200));
                    UI.ActionButton($"Gain {increment}", () => {
                        Game.Instance.Player.GainPartyExperience(increment);
                    }, UI.AutoWidth());
                });
                if (kingdom != null)
                {
                    UI.Div(0, 25);
                    UI.HStack("Kingdom", 1,
                              () => {
                        UI.Label("Finances".cyan(), UI.Width(150));
                        UI.Label(kingdom.Resources.Finances.ToString().orange().bold(), UI.Width(200));
                        UI.ActionButton($"Gain {increment}", () => {
                            kingdom.Resources += KingdomResourcesAmount.FromFinances(increment);
                        }, UI.AutoWidth());
                        UI.ActionButton($"Lose {increment}", () => {
                            kingdom.Resources -= KingdomResourcesAmount.FromFinances(increment);
                        }, UI.AutoWidth());
                    },
                              () => {
                        UI.Label("Materials".cyan(), UI.Width(150));
                        UI.Label(kingdom.Resources.Materials.ToString().orange().bold(), UI.Width(200));
                        UI.ActionButton($"Gain {increment}", () => {
                            kingdom.Resources += KingdomResourcesAmount.FromMaterials(increment);
                        }, UI.AutoWidth());
                        UI.ActionButton($"Lose {increment}", () => {
                            kingdom.Resources -= KingdomResourcesAmount.FromMaterials(increment);
                        }, UI.AutoWidth());
                    },
                              () => {
                        UI.Label("Favors".cyan(), UI.Width(150));
                        UI.Label(kingdom.Resources.Favors.ToString().orange().bold(), UI.Width(200));
                        UI.ActionButton($"Gain {increment}", () => {
                            kingdom.Resources += KingdomResourcesAmount.FromFavors(increment);
                        }, UI.AutoWidth());
                        UI.ActionButton($"Lose {increment}", () => {
                            kingdom.Resources -= KingdomResourcesAmount.FromFavors(increment);
                        }, UI.AutoWidth());
                    });
                }
            }
            UI.Div(0, 25);
            UI.HStack("Combat", 4,
                      () => { UI.ActionButton("Rest All", () => { CheatsCombat.RestAll(); }); },
                      () => { UI.ActionButton("Empowered", () => { CheatsCombat.Empowered(""); }); },
                      () => { UI.ActionButton("Full Buff Please", () => { CheatsCombat.FullBuffPlease(""); }); },
                      () => { UI.ActionButton("Remove Buffs", () => { Actions.RemoveAllBuffs(); }); },
                      () => { UI.ActionButton("Remove Death's Door", () => { CheatsCombat.DetachDebuff(); }); },
                      () => { UI.ActionButton("Kill All Enemies", () => { CheatsCombat.KillAll(); }); },
                      () => { UI.ActionButton("Summon Zoo", () => { CheatsCombat.SpawnInspectedEnemiesUnderCursor(""); }); }
                      );
            UI.Div(0, 25);
            UI.HStack("Common", 4,
                      () => { UI.ActionButton("Teleport Party To You", () => { Actions.TeleportPartyToPlayer(); }); },
                      () => { UI.ActionButton("Perception Checks", () => { Actions.RunPerceptionTriggers(); }); },
                      () => {
                UI.ActionButton("Set Perception to 40", () => {
                    CheatsCommon.StatPerception();
                    Actions.RunPerceptionTriggers();
                });
            },
                      () => { UI.ActionButton("Change Weather", () => { CheatsCommon.ChangeWeather(""); }); },
                      () => { UI.ActionButton("Give All Items", () => { CheatsUnlock.CreateAllItems(""); }); },
                      //                    () => { UI.ActionButton("Change Party", () => { Actions.ChangeParty(); }); },
                      () => { }
                      );
            UI.Div(0, 25);
            UI.HStack("Unlocks", 4, () => {
                UI.ActionButton("All Mythic Paths", () => { Actions.UnlockAllMythicPaths(); });
                UI.Space(25);
                UI.Label("Warning! Using this might break your game somehow. Recommend for experimental tinkering like trying out different builds, and not for actually playing the game.".green());
            });
            UI.Div(0, 25);
            UI.HStack("Preview", 0, () => {
                UI.Toggle("Dialog Results", ref settings.previewDialogResults, 0);
                UI.Toggle("Dialog Alignment", ref settings.previewAlignmentRestrictedDialog, 0);
                UI.Toggle("Random Encounters", ref settings.previewRandomEncounters, 0);
                UI.Toggle("Events", ref settings.previewEventResults, 0);
            });
            UI.Div(0, 25);
            UI.HStack("Tweaks", 1,
                      () => { UI.Toggle("Object Highlight Toggle Mode", ref settings.highlightObjectsToggle, 0); },
                      () => { UI.Toggle("Whole Team Moves Same Speed", ref settings.toggleMoveSpeedAsOne, 0); },

                      () => { UI.Toggle("Infinite Abilities", ref settings.toggleInfiniteAbilities, 0); },
                      () => { UI.Toggle("Infinite Spell Casts", ref settings.toggleInfiniteSpellCasts, 0); },

                      () => { UI.Toggle("Unlimited Actions During Turn", ref settings.toggleUnlimitedActionsPerTurn, 0); },
                      () => { UI.Toggle("Infinite Charges On Items", ref settings.toggleInfiniteItems, 0); },

                      () => { UI.Toggle("Instant Cooldown", ref settings.toggleInstantCooldown, 0); },
                      () => { UI.Toggle("Spontaneous Caster Scroll Copy", ref settings.toggleSpontaneousCopyScrolls, 0); },

                      () => { UI.Toggle("Disable Equipment Restrictions", ref settings.toggleEquipmentRestrictions, 0); },
                      () => { UI.Toggle("Disable Dialog Restrictions", ref settings.toggleDialogRestrictions, 0); },

                      () => { UI.Toggle("No Friendly Fire On AOEs", ref settings.toggleNoFriendlyFireForAOE, 0); },
                      () => { UI.Toggle("Free Meta-Magic", ref settings.toggleMetamagicIsFree, 0); },

                      () => { UI.Toggle("No Fog Of War", ref settings.toggleNoFogOfWar, 0); },
                      () => { UI.Toggle("No Material Components", ref settings.toggleMaterialComponent, 0); },
                      //() => { UI.Toggle("Restore Spells & Skills After Combat", ref settings.toggleRestoreSpellsAbilitiesAfterCombat,0); },
                      //() => { UI.Toggle("Access Remote Characters", ref settings.toggleAccessRemoteCharacters,0); },
                      //() => { UI.Toggle("Show Pet Portraits", ref settings.toggleShowAllPartyPortraits,0); },
                      () => { UI.Toggle("Instant Rest After Combat", ref settings.toggleInstantRestAfterCombat, 0); },
                      () => { UI.Toggle("Auto Load Last Save On Launch", ref settings.toggleAutomaticallyLoadLastSave, 0); },
                      () => { }
                      );
            UI.Div(153, 25);
            UI.HStack("", 1,
                      () => {
                UI.EnumGrid("Disable Attacks Of Opportunity",
                            ref settings.noAttacksOfOpportunitySelection, 0, UI.AutoWidth());
            },
                      () => {
                UI.EnumGrid("Can Move Through", ref settings.allowMovementThroughSelection, 0, UI.AutoWidth());
            },
                      () => { UI.Space(328); UI.Label("This allows characters you control to move through the selected category of units during combat".green(), UI.AutoWidth()); },
#if false
                      () => { UI.Slider("Collision Radius Multiplier", ref settings.collisionRadiusMultiplier, 0f, 2f, 1f, 1, "", UI.AutoWidth()); },
#endif
                      () => { }
                      );
            UI.Div(0, 25);
            UI.HStack("Level Up", 1,
                      () => { UI.Slider("Feature Selection Multiplier", ref settings.featsMultiplier, 0, 10, 1, "", UI.AutoWidth()); },
                      () => { UI.Toggle("Always Able To Level Up", ref settings.toggleNoLevelUpRestrictions, 0); },
                      () => { UI.Toggle("Add Full Hit Die Value", ref settings.toggleFullHitdiceEachLevel, 0); },
                      () => {
                UI.Toggle("Ignore Class And Feat Restrictions", ref settings.toggleIgnorePrerequisites, 0);
                UI.Space(25);
                UI.Label("Experimental".cyan() + ": in addition to regular leveling, this allows you to choose any mythic class each time you level up starting from level 1. This may have interesting and unexpected effects. Backup early and often...".green());
            },
                      () => { UI.Toggle("Ignore Prerequisites When Choosing A Feat", ref settings.toggleFeaturesIgnorePrerequisites, 0); },
                      () => { UI.Toggle("Ignore Caster Type And Spell Level Restrictions", ref settings.toggleIgnoreCasterTypeSpellLevel, 0); },
                      () => { UI.Toggle("Ignore Forbidden Archetypes", ref settings.toggleIgnoreForbiddenArchetype, 0); },
                      () => { UI.Toggle("Ignore Required Stat Values", ref settings.toggleIgnorePrerequisiteStatValue, 0); },
                      () => { UI.Toggle("Ignore Alignment When Choosing A Class", ref settings.toggleIgnoreAlignmentWhenChoosingClass, 0); },
                      () => { UI.Toggle("Skip Spell Selection", ref settings.toggleSkipSpellSelection, 0); },

#if false
                      // Do we need these or is it covered by toggleFeaturesIgnorePrerequisites
                      () => { UI.Toggle("Ignore Feat Prerequisites When Choosing A Class", ref settings.toggleIgnoreFeaturePrerequisitesWhenChoosingClass, 0); },
                      () => { UI.Toggle("Ignore Feat Prerequisits (List) When Choosing A Class", ref settings.toggle, 0); },
#endif

                      () => { }
                      );
            UI.Div(0, 25);
            UI.HStack("Multipliers", 1,
                      () => { UI.LogSlider("Experience", ref settings.experienceMultiplier, 0f, 20, 1, 1, "", UI.AutoWidth()); },
                      () => { UI.LogSlider("Money Earned", ref settings.moneyMultiplier, 0f, 20, 1, 1, "", UI.AutoWidth()); },
                      () => { UI.LogSlider("Vendor Sell Price", ref settings.vendorSellPriceMultiplier, 0f, 20, 1, 1, "", UI.AutoWidth()); },
                      () => { UI.LogSlider("Vendor Buy Price", ref settings.vendorBuyPriceMultiplier, 0f, 20, 1, 1, "", UI.AutoWidth()); },
                      () => { UI.Slider("Encumberance", ref settings.encumberanceMultiplier, 1, 100, 1, "", UI.AutoWidth()); },
                      () => { UI.LogSlider("Spells Per Day", ref settings.spellsPerDayMultiplier, 0f, 20, 1, 1, "", UI.AutoWidth()); },
                      () => { UI.LogSlider("Movement Speed", ref settings.partyMovementSpeedMultiplier, 0f, 20, 1, 1, "", UI.AutoWidth()); },
                      () => { UI.LogSlider("Travel Speed", ref settings.travelSpeedMultiplier, 0f, 20, 1, 1, "", UI.AutoWidth()); },
                      () => { UI.LogSlider("Companion Cost", ref settings.companionCostMultiplier, 0, 20, 1, 1, "", UI.AutoWidth()); },
                      () => { UI.LogSlider("Enemy HP Multiplier", ref settings.enemyBaseHitPointsMultiplier, 0f, 20, 1, 1, "", UI.AutoWidth()); },
                      () => { UI.LogSlider("Buff Duration", ref settings.buffDurationMultiplierValue, 0f, 100, 1, 1, "", UI.AutoWidth()); },
                      () => { }
                      );
            UI.Div(0, 25);
            UI.HStack("Dice Rolls", 1,
                      () => UI.EnumGrid("All Hits Critical", ref settings.allHitsCritical, 0, UI.AutoWidth()),
                      () => UI.EnumGrid("Roll With Avantage", ref settings.rollWithAdvantage, 0, UI.AutoWidth()),
                      () => UI.EnumGrid("Roll With Disavantage", ref settings.rollWithDisadvantage, 0, UI.AutoWidth()),
                      () => UI.EnumGrid("Always Roll 20", ref settings.alwaysRoll20, 0, UI.AutoWidth()),
                      () => UI.EnumGrid("Always Roll 1", ref settings.alwaysRoll1, 0, UI.AutoWidth()),
                      () => UI.EnumGrid("Never Roll 20", ref settings.neverRoll20, 0, UI.AutoWidth()),
                      () => UI.EnumGrid("Never Roll 1", ref settings.neverRoll1, 0, UI.AutoWidth()),
                      () => UI.EnumGrid("Always Roll 20 Initiative ", ref settings.roll20Initiative, 0, UI.AutoWidth()),
                      () => UI.EnumGrid("Always Roll 1 Initiative", ref settings.roll1Initiative, 0, UI.AutoWidth()),
                      () => { }
                      );
            UI.Div(0, 25);
            UI.HStack("Character Creation", 1,
                      () => { UI.Slider("Build Points (Main)", ref settings.characterCreationAbilityPointsPlayer, 1, 200, 25, "", UI.AutoWidth()); },
                      () => { UI.Slider("Build Points (Mercenary)", ref settings.characterCreationAbilityPointsMerc, 1, 200, 20, "", UI.AutoWidth()); },
                      () => { UI.Slider("Ability Max", ref settings.characterCreationAbilityPointsMax, 0, 50, 18, "", UI.AutoWidth()); },
                      () => { UI.Slider("Ability Min", ref settings.characterCreationAbilityPointsMin, 0, 50, 7, "", UI.AutoWidth()); },
                      () => { }
                      );
            UI.Div(0, 25);
            UI.HStack("Crusade", 1,
                      () => { UI.Toggle("Instant Events", ref settings.toggleInstantEvent, 0); },
                      () => {
                UI.Slider("Build Time Modifer", ref settings.kingdomBuildingTimeModifier, -10, 10, 0, 1, "", UI.AutoWidth());
                var instance = KingdomState.Instance;
                if (instance != null)
                {
                    instance.BuildingTimeModifier = settings.kingdomBuildingTimeModifier;
                }
            },
                      () => { }
                      );
            UI.Space(25);
        }
Esempio n. 11
0
        public static void OnGUI()
        {
#if DEBUG
            UI.Div(0, 25);
            var inventory = Game.Instance.Player.Inventory;
            var items     = inventory.ToList();
            UI.HStack("Inventory", 1,
                      () => {
                UI.ActionButton("Export", () => items.Export("inventory.json"), UI.Width(150));
                UI.Space(25);
                UI.ActionButton("Import", () => inventory.Import("inventory.json"), UI.Width(150));
                UI.Space(25);
                UI.ActionButton("Replace", () => inventory.Import("inventory.json", true), UI.Width(150));
            },
                      () => { }
                      );
#endif
            UI.Div(0, 25);
            UI.HStack("Loot", 1,
                      () => {
                UI.BindableActionButton(MassLootBox, UI.Width(200));
                UI.Space(5); UI.Label("Area exit loot screen useful with the mod Cleaner to clear junk loot mid dungeon leaving less clutter on the map".green());
            },
                      () => {
                UI.ActionButton("Reveal Ground Loot", () => LootHelper.ShowAllChestsOnMap(), UI.Width(200));
                UI.Space(210); UI.Label("Shows all chests/bags/etc on the map excluding hidden".green());
            },
                      () => {
                UI.ActionButton("Reveal Hidden Ground Loot", () => LootHelper.ShowAllChestsOnMap(true), UI.Width(200));
                UI.Space(210); UI.Label("Shows all chests/bags/etc on the map including hidden".green());
            },
                      () => {
                UI.ActionButton("Reveal Inevitable Loot", () => LootHelper.ShowAllInevitablePortalLoot(), UI.Width(200));
                UI.Space(210); UI.Label("Shows unlocked Inevitable Excess DLC rewards on the map".green());
            },
                      () => {
                UI.Toggle("Mass Loot Shows Everything When Leaving Map", ref settings.toggleMassLootEverything);
                UI.Space(100); UI.Label("Some items might be invisible until looted".green());
            },
                      () => {
                UI.Toggle("Color Items By Rarity", ref settings.toggleColorLootByRarity);
                UI.Space(25);
                using (UI.VerticalScope()) {
                    UI.Label($"This makes loot function like Diablo or Borderlands. {"Note: turning this off requires you to save and reload for it to take effect.".orange()}".green());
                    UI.Label("The coloring of rarity goes as follows:".green());
                    UI.HStack("Rarity".orange(), 1,
                              () => {
                        UI.Label("Trash".Rarity(RarityType.Trash).bold(), UI.rarityStyle, UI.Width(200));
                        UI.Space(5); UI.Label("Common".Rarity(RarityType.Common).bold(), UI.rarityStyle, UI.Width(200));
                        UI.Space(5); UI.Label("Uncommon".Rarity(RarityType.Uncommon).bold(), UI.rarityStyle, UI.Width(200));
                    },
                              () => {
                        UI.Space(3); UI.Label("Rare".Rarity(RarityType.Rare).bold(), UI.rarityStyle, UI.Width(200));
                        UI.Space(5); UI.Label("Epic".Rarity(RarityType.Epic).bold(), UI.rarityStyle, UI.Width(200));
                        UI.Space(5); UI.Label("Legendary".Rarity(RarityType.Legendary).bold(), UI.rarityStyle, UI.Width(200));
                    },
                              () => {
                        UI.Space(5); UI.Label("Mythic".Rarity(RarityType.Mythic).bold(), UI.rarityStyle, UI.Width(200));
                        UI.Space(5); UI.Label("Godly".Rarity(RarityType.Godly).bold(), UI.rarityStyle, UI.Width(200));
                        UI.Space(5); UI.Label("Notable".Rarity(RarityType.Notable).bold() + "*".orange().bold(), UI.rarityStyle, UI.Width(200));
                    },
                              () => {
                        UI.Space(3); UI.Label("*".orange().bold() + " Notable".Rarity(RarityType.Notable) + " denotes items that are deemed to be significant for plot reasons or have significant subtle properties".green(), UI.Width(615));
                    },
                              () => { }
                              );
                }

                // The following options let you configure loot filtering and auto sell levels:".green());
            },
#if false
                      () => UI.RarityGrid("Hide Level ", ref settings.lootFilterIgnore, 0, UI.AutoWidth()),
                      () => UI.RarityGrid("Auto Sell Level ", ref settings.lootFilterAutoSell, 0, UI.AutoWidth()),
#endif
                      () => { }
                      );
            UI.Div(0, 25);
            var isEmpty = true;
            UI.HStack("Loot Checklist", 1,
                      () => {
                var areaName = "";
                if (Main.IsInGame)
                {
                    areaName            = Game.Instance.CurrentlyLoadedArea.AreaDisplayName;
                    var areaPrivateName = Game.Instance.CurrentlyLoadedArea.name;
                    if (areaPrivateName != areaName)
                    {
                        areaName += $"\n({areaPrivateName})".yellow();
                    }
                }
                UI.Label(areaName.orange().bold(), UI.Width(300));
                UI.Label("Rarity: ".cyan(), UI.AutoWidth());
                UI.RarityGrid(ref settings.lootChecklistFilterRarity, 4, UI.AutoWidth());
            },
                      () => {
                UI.ActionTextField(
                    ref searchText,
                    "itemSearchText",
                    (text) => { },
                    () => { },
                    UI.Width(300));
                UI.Space(25); UI.Toggle("Show Friendly", ref settings.toggleLootChecklistFilterFriendlies);
                UI.Space(25); UI.Toggle("Blueprint", ref settings.toggleLootChecklistFilterBlueprint, UI.AutoWidth());
                UI.Space(25); UI.Toggle("Description", ref settings.toggleLootChecklistFilterDescription, UI.AutoWidth());
            },
                      () => {
                if (!Main.IsInGame)
                {
                    UI.Label("Not available in the Main Menu".orange()); return;
                }
                var presentGroups = LootHelper.GetMassLootFromCurrentArea().GroupBy(p => p.InteractionLoot != null ? "Containers" : "Units");
                var indent        = 3;
                using (UI.VerticalScope()) {
                    foreach (var group in presentGroups.Reverse())
                    {
                        var presents = group.AsEnumerable().OrderByDescending(p => {
                            var loot = p.GetLewtz(searchText);
                            if (loot.Count == 0)
                            {
                                return(0);
                            }
                            else
                            {
                                return((int)loot.Max(l => l.Rarity()));
                            }
                        });
                        var rarity = settings.lootChecklistFilterRarity;
                        var count  = presents.Where(p => p.Unit == null || (settings.toggleLootChecklistFilterFriendlies && !p.Unit.IsPlayersEnemy || p.Unit.IsPlayersEnemy) || (!settings.toggleLootChecklistFilterFriendlies && p.Unit.IsPlayersEnemy)).Count(p => p.GetLewtz(searchText).Lootable(rarity).Count() > 0);
                        UI.Label($"{group.Key.cyan()}: {count}");
                        UI.Div(indent);
                        foreach (var present in presents)
                        {
                            var pahtLewts = present.GetLewtz(searchText).Lootable(rarity).OrderByDescending(l => l.Rarity());
                            var unit      = present.Unit;
                            if (pahtLewts.Count() > 0 && (unit == null || (settings.toggleLootChecklistFilterFriendlies && !unit.IsPlayersEnemy || unit.IsPlayersEnemy) || (!settings.toggleLootChecklistFilterFriendlies && unit.IsPlayersEnemy)))
                            {
                                isEmpty = false;
                                UI.Div();
                                using (UI.HorizontalScope()) {
                                    UI.Space(indent);
                                    UI.Label($"{present.GetName()}".orange().bold(), UI.Width(325));
                                    if (present.InteractionLoot != null)
                                    {
                                        if (present.InteractionLoot?.Owner?.PerceptionCheckDC > 0)
                                        {
                                            UI.Label($" Perception DC: {present.InteractionLoot?.Owner?.PerceptionCheckDC}".green().bold(), UI.Width(125));
                                        }
                                        else
                                        {
                                            UI.Label($" Perception DC: NA".orange().bold(), UI.Width(125));
                                        }
                                        int?trickDc = present.InteractionLoot?.Owner?.Get <DisableDeviceRestrictionPart>()?.DC;
                                        if (trickDc > 0)
                                        {
                                            UI.Label($" Trickery DC: {trickDc}".green().bold(), UI.Width(125));
                                        }
                                        else
                                        {
                                            UI.Label($" Trickery DC: NA".orange().bold(), UI.Width(125));
                                        }
                                    }
                                    UI.Space(25);
                                    using (UI.VerticalScope()) {
                                        foreach (var lewt in pahtLewts)
                                        {
                                            var description = lewt.Blueprint.Description;
                                            var showBP      = settings.toggleLootChecklistFilterBlueprint;
                                            var showDesc    = settings.toggleLootChecklistFilterDescription && description != null && description.Length > 0;
                                            using (UI.HorizontalScope()) {
                                                //Main.Log($"rarity: {lewt.Blueprint.Rarity()} - color: {lewt.Blueprint.Rarity().color()}");
                                                UI.Label(lewt.Name.Rarity(lewt.Blueprint.Rarity()), showDesc || showBP ? UI.Width(350) : UI.AutoWidth());
                                                if (showBP)
                                                {
                                                    UI.Space(100); UI.Label(lewt.Blueprint.GetDisplayName().grey(), showDesc ? UI.Width(350) : UI.AutoWidth());
                                                }
                                                if (showDesc)
                                                {
                                                    UI.Space(100); UI.Label(description.StripHTML().green());
                                                }
                                            }
                                        }
                                    }
                                }
                                UI.Space(25);
                            }
                        }
                        UI.Space(25);
                    }
                }
            },
                      () => {
                if (isEmpty)
                {
                    using (UI.HorizontalScope()) {
                        UI.Label("No Loot Available".orange(), UI.AutoWidth());
                    }
                }
            }
                      );
        }
Esempio n. 12
0
        public static void OnGUI()
        {
            if (Main.IsInGame)
            {
                UI.HStack("Character Creation", 1,
                          () => UI.Toggle("Ignore Attribute Cap", ref settings.toggleIgnoreAttributeStatCapChargen, 0),
                          () => UI.Toggle("Ignore Remaining Attribute Points", ref settings.toggleIgnoreAttributePointsRemainingChargen, 0),
                          () => UI.Toggle("Ignore Alignment", ref settings.toggleIgnoreAttributeStatCapChargen, 0),

                          () => UI.Slider("Build Points (Main)", ref settings.characterCreationAbilityPointsPlayer, 1, 200, 25, "", UI.AutoWidth()),
                          () => UI.Slider("Build Points (Mercenary)", ref settings.characterCreationAbilityPointsMerc, 1, 200, 20, "", UI.AutoWidth()),
                          () => UI.Slider("Ability Max", ref settings.characterCreationAbilityPointsMax, 0, 50, 18, "", UI.AutoWidth()),
                          () => UI.Slider("Ability Min", ref settings.characterCreationAbilityPointsMin, 0, 50, 7, "", UI.AutoWidth()),
                          () => { }
                          );
                UI.Div(0, 25);
                UI.HStack("Level Up", 1,
                          () => UI.Slider("Feature Selection Multiplier", ref settings.featsMultiplier, 0, 10, 1, "", UI.AutoWidth()),
                          () => UI.Toggle("Always Able To Level Up", ref settings.toggleNoLevelUpRestrictions, 0),
                          () => UI.Toggle("Add Full Hit Die Value", ref settings.toggleFullHitdiceEachLevel, 0),
                          () => {
                    UI.Toggle("Ignore Class And Feat Restrictions", ref settings.toggleIgnorePrerequisites, 0);
                    UI.Space(25);
                    UI.Label("Experimental".cyan() + ": in addition to regular leveling, this allows you to choose any mythic class each time you level up starting from level 1. This may have interesting and unexpected effects. Backup early and often...".green());
                },
                          () => UI.Toggle("Ignore Prerequisites When Choosing A Feat", ref settings.toggleFeaturesIgnorePrerequisites, 0),
                          () => UI.Toggle("Ignore Caster Type And Spell Level Restrictions", ref settings.toggleIgnoreCasterTypeSpellLevel, 0),
                          () => UI.Toggle("Ignore Forbidden Archetypes", ref settings.toggleIgnoreForbiddenArchetype, 0),
                          () => UI.Toggle("Ignore Required Stat Values", ref settings.toggleIgnorePrerequisiteStatValue, 0),
                          () => UI.Toggle("Ignore Alignment When Choosing A Class", ref settings.toggleIgnoreAlignmentWhenChoosingClass, 0),
                          () => UI.Toggle("Skip Spell Selection", ref settings.toggleSkipSpellSelection, 0),
#if DEBUG
                          () => UI.Toggle("Lock Character Level", ref settings.toggleLockCharacterLevel, 0),
//                    () => UI.Toggle("Ignore Alignment Restrictions", ref settings.toggleIgnoreAlignmentRestriction, 0),
                          () => UI.Toggle("Ignore Remaining Attribute Points", ref settings.toggleIgnoreAttributePointsRemaining, 0),
                          () => UI.Toggle("Ignore Skill Cap", ref settings.toggleIgnoreSkillCap, 0),
                          () => UI.Toggle("Ignore Remaining Skill Points", ref settings.toggleIgnoreSkillPointsRemaining, 0),
#endif
#if false
                          // Do we need these or is it covered by toggleFeaturesIgnorePrerequisites
                          () => { UI.Toggle("Ignore Feat Prerequisites When Choosing A Class", ref settings.toggleIgnoreFeaturePrerequisitesWhenChoosingClass, 0); },
                          () => { UI.Toggle("Ignore Feat Prerequisits (List) When Choosing A Class", ref settings.toggle, 0); },
#endif

                          () => { }
                          );
#if DEBUG
                UI.Div(0, 25);
                UI.HStack("Multiple Classes", 1,
                          () => UI.Label("Experimental Preview".magenta(), UI.AutoWidth()),
                          () => {
                    UI.Toggle("Multiple Classes On Level-Up", ref settings.toggleMulticlass, 0);
                    UI.Space(25);
                    UI.Label("With this enabled you can configure characters in the Party Editor to gain levels in additional classes whenever they level up. Please go to Party Editor > Character > Classes to configure this".green());
                },
                          () => UI.Toggle("Use Highest Hit Die", ref settings.toggleTakeHighestHitDie, 0),
                          () => UI.Toggle("Use Highest Skill Points", ref settings.toggleTakeHighestSkillPoints, 0),
                          () => UI.Toggle("Use Highest BAB ", ref settings.toggleTakeHighestBAB, 0),
                          () => UI.Toggle("Use Highest Save By Recalc", ref settings.toggleTakeHighestSaveByRecalculation, 0),
                          () => UI.Toggle("Use Highest Save ", ref settings.toggleTakeHighestSaveByAlways, 0),
                          () => UI.Toggle("Use Recalculate Caster Levels", ref settings.toggleRecalculateCasterLevelOnLevelingUp, 0),
                          () => UI.Toggle("Restrict Caster Level To Current", ref settings.toggleRestrictCasterLevelToCharacterLevel, 0),
                          //() => { UI.Toggle("Restrict CL to Current (temp) ", ref settings.toggleRestrictCasterLevelToCharacterLevelTemporary, 0),
                          () => UI.Toggle("Restrict Class Level for Prerequisites to Caster Level", ref settings.toggleRestrictClassLevelForPrerequisitesToCharacterLevel, 0),
                          () => UI.Toggle("Fix Favored Class HP", ref settings.toggleFixFavoredClassHP, 0),
                          () => UI.Toggle("Always Receive Favored Class HP", ref settings.toggleAlwaysReceiveFavoredClassHP, 0),
                          () => UI.Toggle("Always Receive Favored Class HP Except Prestige", ref settings.toggleAlwaysReceiveFavoredClassHPExceptPrestige, 0),
                          () => { }
                          );
                if (settings.toggleMulticlass)
                {
                    UI.Div(0, 25);
                    UI.HStack("Character Generation", 1,
                              () =>
                              UI.Label("Choose default multiclass setting to use during creation of new characters".green(), UI.AutoWidth())
                              );
                    var multiclassSet = settings.charGenMulticlassSet;
                    MulticlassPicker.OnGUI(multiclassSet, 150);
                    settings.charGenMulticlassSet = multiclassSet;
                }
#endif
            }
        }