diff --git a/descriptions/rep/en_us.lua b/descriptions/rep/en_us.lua index a24d1062..0b0470f2 100644 --- a/descriptions/rep/en_us.lua +++ b/descriptions/rep/en_us.lua @@ -88,7 +88,7 @@ local repCollectibles={ [211] = {"211", "Spiderbaby", "Spawn 3-5 Blue Spiders upon taking damage"}, -- Spiderbaby [214] = {"214", "Anemic", "↑ +1.5 Range up#Leave a trail of damaging creep upon taking damage"}, -- Anemic [218] = {"218", "Placenta", "↑ +1 Health up#Heals 1 Red Heart#Chance to heal half a heart every minute"}, -- Placenta - [222] = {"222", "Anti-Gravity", "Holding the fire buttons causes tears to hover in midair#When released, they will all shoot in the direction they were fired#↑ +2 Fire Rate up"}, -- Anti-Gravity + [222] = {"222", "Anti-Gravity", "Holding the fire buttons causes tears to hover in midair#When released, they will all shoot in the direction they were fired#↑ +1 Fire Rate up"}, -- Anti-Gravity [224] = {"224", "Cricket's Body", "Tears split in 4 on hit#Split tears deal half your damage#↑ +0.5 Fire Rate up#↓ -20% Range down"}, -- Cricket's Body [228] = {"228", "Mom's Perfume", "15% chance to shoot Fear tears#↑ +0.5 Fire Rate up"}, -- Mom's Perfume [230] = {"230", "Abaddon", "↑ +1.5 Damage up#↑ +0.2 Speed up#Fear tears#Converts all Red Heart Containers into Black Hearts#+2 Black Hearts"}, -- Abaddon @@ -125,7 +125,7 @@ local repCollectibles={ [307] = {"307", "Capricorn", "↑ +1 Health up#↑ +0.5 Damage up#↑ +0.1 Speed up#↑ +0.75 Range up#↑ +0.5 Fire Rate up#Gives one bomb, coin and key"}, -- Capricorn [308] = {"308", "Aquarius", "Leave a trail of creep#Creep deals 66% your damage per second#Creep synergizes with tear effects"}, -- Aquarius [309] = {"309", "Pisces", "↑ +0.5 Fire Rate up#Increases tear knockback"}, - [310] = {"310", "Eve's Mascara", "↑ 200% Damage up#↓ -33% Tears down#↓ -0.5 Shot Speed down"}, + [310] = {"310", "Eve's Mascara", "↑ +100% Damage up#↓ -33% Tears down#↓ -0.5 Shot Speed down"}, [314] = {"314", "Thunder Thighs", "↑ +1 Health up#↓ -0.4 Speed down#Heals 1 Red Heart#Destroy rocks when walking over them"}, -- Thunder Thighs [315] = {"315", "Strange Attractor", "Magnetic tears#Affects enemies, pickups and trinkets#Items will be attracted to where the tear lands"}, -- Strange Attractor [320] = {"320", "???'s Only Friend", "Controllable Fly#Deals 3.5 contact damage per tick"}, -- ???'s Only Friend diff --git a/eid_api.lua b/eid_api.lua index 7aab22d9..724ea6e9 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -199,7 +199,8 @@ function EID:addColor(shortcut, kColor, callback) end -- Overrides all potentially displayed texts and permanently displays the given texts. Can be turned of again using the "EID:hidePermanentText()" function -function EID:displayPermanentText(descriptionObject) +function EID:displayPermanentText(descriptionObject, permName1, permName2) + descriptionObject.PermanentTextEnglish = EID:getDescriptionEntryEnglish(permName1, permName2) EID.permanentDisplayTextObj = descriptionObject EID.isDisplayingPermanent = true end @@ -264,8 +265,11 @@ end -- returns the current text position function EID:getTextPosition() local posVector = Vector(EID.UsedPosition.X, EID.UsedPosition.Y) - for _, modifier in pairs(EID.PositionModifiers) do - posVector = posVector + modifier + -- Only apply position modifiers when not in Local Mode + if EID.CurrentScaleType == "Size" then + for _, modifier in pairs(EID.PositionModifiers) do + posVector = posVector + modifier + end end return posVector end @@ -367,6 +371,13 @@ function EID:getDescriptionEntry(objTable, objID, noFallback) else return (translatedTable and translatedTable[objID]) or (EID.descriptions["en_us"][objTable] and EID.descriptions["en_us"][objTable][objID]) end end end +function EID:getDescriptionEntryEnglish(objTable, objID) + if not objID then + return EID.descriptions["en_us"][objTable] + else + return EID.descriptions["en_us"][objTable] and EID.descriptions["en_us"][objTable][objID] + end +end -- returns the description data table related to a given id, variant and subtype -- falls back to english if it doesnt exist @@ -915,7 +926,7 @@ function EID:CheckGlitchedItemConfig(id) local localizedNames = EID:getDescriptionEntry("GlitchedItemText") local item = EID.itemConfig:GetCollectible(id) if not item then return "" end - local attributes = "" + local attributes = "#" for _,v in ipairs(itemConfigItemAttributes) do local val = item[v] if val ~= 0 then @@ -1211,6 +1222,16 @@ function EID:fixDefinedFont() EID.Config["TextboxWidth"] = EID.descriptions[curLang].fonts[1].textboxWidth or EID.DefaultConfig["TextboxWidth"] return true end +-- Check if a given font name is valid for the currently selected language +function EID:canUseFontType(fontType) + local curLang = EID.Config["Language"] + for _, v in ipairs(EID.descriptions[curLang].fonts) do + if fontType == v.name then + return true + end + end + return false +end -- Creates a copy of a KColor object. This prevents overwriting existing function EID:copyKColor(colorObj) diff --git a/eid_bagofcrafting.lua b/eid_bagofcrafting.lua index 805ccbaf..8cd60cda 100644 --- a/eid_bagofcrafting.lua +++ b/eid_bagofcrafting.lua @@ -174,6 +174,7 @@ local componentShifts = { local poolToIcon = { [0]="{{TreasureRoom}}",[1]="{{Shop}}",[2]="{{BossRoom}}",[3]="{{DevilRoom}}",[4]="{{AngelRoom}}", [5]="{{SecretRoom}}",[7]="{{PoopRoomIcon}}",[8]="{{GoldenChestRoomIcon}}",[9]="{{RedChestRoomIcon}}",[12]="{{CursedRoom}}",[26]="{{Planetarium}}" } +-- local copies of our XML data in case it's slightly faster local CraftingMaxItemID = EID.XMLMaxItemID local CraftingFixedRecipes = EID.XMLRecipes local CraftingItemPools = EID.XMLItemPools @@ -208,7 +209,7 @@ local function sortAllItems() end end) end --- delay the initial sort until needed, as it's a tad slow +-- delay the initial sort until needed, in case of modded items local sortNeeded = true local recheckPickups = false @@ -350,28 +351,27 @@ function EID:simulateBagOfCrafting(componentsTable) end -- The main function that takes 8 ingredients and tells you what collectible you will get in return +-- Only pass in a table with 8 valid ingredients!!! function EID:calculateBagOfCrafting(componentsTable) + -- ingredients must be sorted by ID for the RNG shifting to be accurate, so make a local copy local components = {table.unpack(componentsTable)} - if components == nil or #components ~= 8 then - return 0 - end - - customRNGSeed = lastSeedUsed table.sort(components) local componentsAsString = table.concat(components, ",") - --Check the fixed recipes. Currently, the fixed recipes ignore item unlock status + -- Check the fixed recipes. Currently, the fixed recipes ignore item unlock status local cacheResult = CraftingFixedRecipes[componentsAsString] if cacheResult ~= nil then return cacheResult, cacheResult end - + -- Check the recipes already calculated for this seed cacheResult = calculatedRecipes[componentsAsString] local lockedResult = lockedRecipes[componentsAsString] - if cacheResult ~= nil then return cacheResult, lockedResult end + + -- Count up the ingredients, and shift the RNG based on the components in the bag + customRNGSeed = lastSeedUsed local compTotalWeight = 0 local compCounts = {} for i = 1, #componentShifts do @@ -384,6 +384,7 @@ function EID:calculateBagOfCrafting(componentsTable) RNGNext() end customRNGShift = componentShifts[7] + local poolWeights = { {idx = 0, weight = 1}, {idx = 1, weight = 2}, @@ -401,11 +402,8 @@ function EID:calculateBagOfCrafting(componentsTable) end local totalWeight = 0 - local itemWeights = {} - - local maxItemID = CraftingMaxItemID - for i = 1, maxItemID do + for i = 1, CraftingMaxItemID do itemWeights[i] = 0 end @@ -414,6 +412,7 @@ function EID:calculateBagOfCrafting(componentsTable) local qualityMin = 0 local qualityMax = 1 local n = compTotalWeight + -- Devil, Angel, and Secret Room Pools have a 5 point penalty if (poolWeight.idx >= 3) and (poolWeight.idx <= 5) then n = n - 5 end @@ -456,8 +455,8 @@ function EID:calculateBagOfCrafting(componentsTable) --That 2nd pick could also be achievement locked but we're ignoring that... local firstOption = nil while true do - local t = nextFloat() - local target = t * totalWeight + local t = nextFloat() -- number between 0 and 1 + local target = t * totalWeight -- number between 0 and total weight of possible results for k,v in ipairs(itemWeights) do target = target - v if target < 0 then @@ -510,31 +509,14 @@ local function qualitySort(a, b) end end --- simple table of tables copy function, for modded recipe support (to make a local copy of the XML data tables so we can then add on to them) -local function deepcopy(orig) - local orig_type = type(orig) - local copy - if orig_type == 'table' then - copy = {} - for orig_key, orig_value in next, orig, nil do - copy[deepcopy(orig_key)] = deepcopy(orig_value) - end - setmetatable(copy, deepcopy(getmetatable(orig))) - else -- number, string, boolean, etc - copy = orig - end - return copy -end - local moddedCrafting = false -- Check for modded items past the known max item ID on game start (can also support game updates) -- Only works if the new items are at Weight 1.0 in their item pools, but better than nothing local function GameStartCrafting() - if not EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_TMTRAINER) and EID.itemConfig:GetCollectible(EID.XMLMaxItemID+1) ~= nil then - -- Items past max ID detected; copy our XML tables so we can add to them - CraftingMaxItemID = EID.XMLMaxItemID - CraftingItemPools = deepcopy(EID.XMLItemPools) - CraftingItemQualities = deepcopy(EID.XMLItemQualities) + if EID.Config["BagOfCraftingModdedRecipes"] and not EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_TMTRAINER) and EID.itemConfig:GetCollectible(EID.XMLMaxItemID+1) ~= nil then + dofile("eid_xmldata") + -- Items past max ID detected + CraftingMaxItemID = EID.XMLMaxItemID -- XMLMaxItemID is never modified -- Add new item qualities local coll = EID.itemConfig:GetCollectible(CraftingMaxItemID+1) while coll ~= nil do @@ -559,9 +541,8 @@ local function GameStartCrafting() moddedCrafting = true sortNeeded = true elseif moddedCrafting then - CraftingMaxItemID = EID.XMLMaxItemID - CraftingItemPools = EID.XMLItemPools - CraftingItemQualities = EID.XMLItemQualities + -- we had modded items; they have since been disabled + dofile("eid_xmldata") moddedCrafting = false sortNeeded = true end @@ -768,7 +749,7 @@ end local function getFloorItemsString(showPreviews, roomItems) local floorString = "" if #EID.BagItems >0 then - if showPreviews and #EID.BagItems >= 8 then + if showPreviews and #EID.BagItems == 8 then local recipe = EID:calculateBagOfCrafting(EID.BagItems) floorString = floorString .. "{{Collectible"..recipe.."}} " end @@ -916,7 +897,7 @@ function EID:handleBagOfCraftingRendering() end -- Determine if we should display anything at all - if EID.isHidden or craftingIsHidden or game.Challenge == Challenge.CHALLENGE_CANTRIPPED then + if ((EID.isHidden or craftingIsHidden) and EID.MCMCompat_isDisplayingEIDTab ~= "Crafting") or game.Challenge == Challenge.CHALLENGE_CANTRIPPED then return elseif EID.Config["BagOfCraftingHideInBattle"] then if Isaac.CountBosses() > 0 or Isaac.CountEnemies() > 0 then @@ -934,7 +915,7 @@ function EID:handleBagOfCraftingRendering() end -- Display the result of the 8 items in our bag if applicable - if (showCraftingResult or EID.Config["BagOfCraftingDisplayMode"] == "Preview Only") and #EID.BagItems >= 8 then + if (showCraftingResult or EID.Config["BagOfCraftingDisplayMode"] == "Preview Only") and #EID.BagItems == 8 then local craftingResult, backupResult = EID:calculateBagOfCrafting(EID.BagItems) if (backupResult ~= craftingResult) then EID.TabPreviewID = backupResult end local descriptionObj = EID:getDescriptionObj(5, 100, craftingResult) diff --git a/eid_config.lua b/eid_config.lua index 1da7fe72..e924a5f1 100644 --- a/eid_config.lua +++ b/eid_config.lua @@ -75,10 +75,10 @@ EID.UserConfig = { -- Toggle obstruction based hiding, when the player has flight -- Default = true ["DisableObstructionOnFlight"] = true, - -- If set to true, the mod will no longer display a warning if the save game doesn't have achievements unlocked - -- This also disables warnings for using an outdated game version and for having potentially modded Bag of Crafting recipes + -- If set to true, the mod will no longer display critical warnings during the start of a new game + -- Current warnings are: Achievements are locked, outdated game version, and potentially having inaccurate modded Bag of Crafting recipes -- Default = false - ["DisableAchievementCheck"] = false, + ["DisableStartOfRunWarnings"] = false, ---------- Display Modes ----------- @@ -275,6 +275,11 @@ EID.UserConfig = { -- Display recipes as 8 icons instead of grouped ingredients -- Default = false ["BagOfCraftingDisplayIcons"] = false, + -- Enable or disable basic modded item support + -- Only modded items with a weight of 1.0 in their item pools are supported, as we can't determine modded item pool weight + -- If you have a lot of modded items, it will slow down game launch + -- Default = true + ["BagOfCraftingModdedRecipes"] = true, -- Set the keybinding to toggle the crafting display, so you can see descriptions of items/pickups on the floor -- Look into the AB+ or Repentance documentation for the key names here: https://wofsauge.github.io/IsaacDocs/rep/enums/Keyboard.html -- Default = Keyboard.KEY_F3 @@ -390,7 +395,7 @@ EID.DefaultConfig = { ["InitiallyHidden"] = false, ["HideInBattle"] = false, ["DisableObstructionOnFlight"] = true, - ["DisableAchievementCheck"] = false, + ["DisableStartOfRunWarnings"] = false, ["DisableOnCurse"] = true, ["DisableOnAltPath"] = true, ["DisableOnAprilFoolsChallenge"] = true, @@ -432,6 +437,7 @@ EID.DefaultConfig = { ["BagOfCraftingDisplayIcons"] = false, ["BagOfCraftingHideInBattle"] = true, ["BagOfCraftingDisplayMode"] = "Recipe List", + ["BagOfCraftingModdedRecipes"] = true, ["CraftingHideKey"] = Keyboard.KEY_F3, ["CraftingHideButton"] = -1, ["CraftingResultKey"] = Keyboard.KEY_F4, diff --git a/eid_modifiers.lua b/eid_modifiers.lua index 9b793c65..f28b0639 100644 --- a/eid_modifiers.lua +++ b/eid_modifiers.lua @@ -120,6 +120,15 @@ local function BlackRuneCallback(descObj) return VoidCallback(descObj, true) end +-- Handle Item Collection description addition +local function ItemCollectionPageCallback(descObj) + descObj.Name = "{{"..EID.Config["ItemCollectionColor"].."}}"..descObj.Name + local text = EID:getDescriptionEntry("CollectionPageInfo") + + EID:appendToDescription(descObj, "#{{Warning}} "..text) + return descObj +end + if REPENTANCE then -- Handle Birthright @@ -403,20 +412,13 @@ if REPENTANCE then return descObj end - -- Handle Item Collection description addition - local function ItemCollectionPageCallback(descObj) - descObj.Name = "{{"..EID.Config["ItemCollectionColor"].."}}"..descObj.Name - local text = EID:getDescriptionEntry("CollectionPageInfo") - - EID:appendToDescription(descObj, "#{{Warning}} "..text) - return descObj - end -------------------------------- -- Although individual conditions/callbacks work well for mods to be able to add through the API, -- As we kept adding callbacks for vanilla items, a lot of code got repeated over and over -- This one-condition setup fixes that and can only help performance -- It also allows us to pick the order that modifiers are appended to descriptions (stats/effects first, then reroll/flip/recharge info) + -- REPENTANCE-ONLY MODIFIERS local function EIDConditions(descObj) -- currently, only pickup descriptions have modifiers if descObj.ObjType ~= 5 then return false end @@ -430,8 +432,6 @@ if REPENTANCE then -- Using magic numbers here in case it's slightly faster, and because the callback names give context -- Check Birthright first because it overwrites the description instead of appending to it if descObj.ObjSubType == 619 then table.insert(callbacks, BirthrightCallback) end - - if EID:requiredForCollectionPage(descObj.ObjSubType) then table.insert(callbacks, ItemCollectionPageCallback) end if collectiblesOwned[664] then table.insert(callbacks, BingeEaterCallback) end if collectiblesOwned[59] then table.insert(callbacks, BookOfBelialCallback) end @@ -439,7 +439,7 @@ if REPENTANCE then if collectiblesOwned[706] or (EID.absorbedItems[706] and collectiblesOwned[477]) then table.insert(callbacks, AbyssCallback) end if collectiblesOwned[711] and EID:getEntityData(descObj.Entity, "EID_FlipItemID") then table.insert(callbacks, FlipCallback) end - if (collectiblesOwned[723] or (EID.absorbedItems[723] and collectiblesOwned[477])) and descObj.ObjSubType ~= 668 then table.insert(callbacks, SpindownDiceCallback) end + if EID.Config["SpindownDiceResults"] > 0 and (collectiblesOwned[723] or (EID.absorbedItems[723] and collectiblesOwned[477])) and descObj.ObjSubType ~= 668 then table.insert(callbacks, SpindownDiceCallback) end -- Card / Rune Callbacks elseif descObj.ObjVariant == PickupVariant.PICKUP_TAROTCARD then @@ -466,6 +466,7 @@ if REPENTANCE then end +-- AFTERBIRTH+ OR REPENTANCE MODIFIERS local function EIDConditionsAB(descObj) -- currently, only pickup descriptions have modifiers if descObj.ObjType ~= 5 then return false end @@ -476,6 +477,8 @@ local function EIDConditionsAB(descObj) -- Collectible Pedestal Callbacks if descObj.ObjVariant == PickupVariant.PICKUP_COLLECTIBLE then + if EID:requiredForCollectionPage(descObj.ObjSubType) then table.insert(callbacks, ItemCollectionPageCallback) end + if EID.Config["DisplayVoidStatInfo"] then if collectiblesOwned[477] then table.insert(callbacks, VoidCallback) end if blackRuneOwned then table.insert(callbacks, BlackRuneCallback) end diff --git a/main.lua b/main.lua index 541e53a6..d5b43f5f 100644 --- a/main.lua +++ b/main.lua @@ -384,6 +384,7 @@ local scaleMin = 0.1 local scaleMax = 2 local scaleSpeed = 0.01 -- scale size per frame local scaleToBigger = true +EID.CurrentScaleType = "Size" -- Size or LocalModeSize; checked by EID:getTextPosition() to not apply modifiers in local mode local scaleHoldFrame = 0 local function handleScaleKey() local scaleKey = EID.Config["SizeHotkey"] @@ -392,26 +393,20 @@ local function handleScaleKey() if Input.IsButtonPressed(scaleKey, 0) then if scaleHoldFrame > 60 then EID.MCM_OptionChanged = true - local scaleConfigName = (EID.Config["DisplayMode"] == "local" and "LocalModeSize" or "Size") + local newScale if scaleToBigger then - local newScale = EID.Scale + scaleSpeed - - EID.Scale = newScale - EID.Config[scaleConfigName] = newScale - + newScale = EID.Scale + scaleSpeed if newScale > scaleMax then scaleToBigger = false end else - local newScale = EID.Scale - scaleSpeed - - EID.Scale = newScale - EID.Config[scaleConfigName] = newScale - + newScale = EID.Scale - scaleSpeed if newScale < scaleMin then scaleToBigger = true end end + EID.Scale = newScale + EID.Config[EID.CurrentScaleType] = newScale else scaleHoldFrame = scaleHoldFrame + 1 end @@ -420,24 +415,18 @@ local function handleScaleKey() if Input.IsButtonTriggered(scaleKey, 0) then EID.MCM_OptionChanged = true scaleHoldFrame = 0 - local scale - local scaleConfigName = (EID.Config["DisplayMode"] == "local" and "LocalModeSize" or "Size") - - scale = EID.Scale + local scale = EID.Scale -- switch between 1, 1.5 and 0.5 - if math.abs(scale - 1) < 0.01 then scale = 1.5 elseif math.abs(scale - 1.5) < 0.01 then scale = 0.5 - elseif math.abs(scale - 0.5) < 0.01 then - scale = 1 else scale = 1 end - EID.Config[scaleConfigName] = scale + EID.Config[EID.CurrentScaleType] = scale EID.Scale = scale end end @@ -551,11 +540,11 @@ function EID:printDescription(desc) local curLanguage = EID.Config["Language"] if curLanguage ~= "en_us" then EID.Config["Language"] = "en_us" - local englishName = EID:getObjectName(desc.ObjType, desc.ObjVariant, desc.ObjSubType) + local englishName = desc.PermanentTextEnglish or EID:getObjectName(desc.ObjType, desc.ObjVariant, desc.ObjSubType) EID.Config["Language"] = curLanguage if EID.Config["TranslateItemName"] == 1 then curName = englishName - elseif EID.Config["TranslateItemName"] == 3 and curName ~= englishName and not EID.isDisplayingPermanent then + elseif EID.Config["TranslateItemName"] == 3 and curName ~= englishName then curName = curName.." ("..englishName..")" end end @@ -738,40 +727,31 @@ function EID:renderIndicator(entity) sprite.Color = Color(1, 1, 1, 1, 0, 0, 0) EID:renderEntity(entity, sprite, entityPos) end - if REPENTANCE then - if isMirrorRoom then - sprite.FlipX = false - end - end -end - -function EID:ScaleValue(entity) - if entity.Variant == EffectVariant.DICE_FLOOR then - EID.Scale = EID.Config["Size"] - EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"]) - elseif EID.Config["DisplayMode"] == "local" then - EID.Scale = EID.Config["LocalModeSize"] + if isMirrorRoom then + sprite.FlipX = false end end function EID:PositionLocalMode(entity) - if EID.Config["DisplayMode"] == "local" then + -- don't use Local Mode for descriptions without an entity (or dice floors) + if EID.Config["DisplayMode"] == "local" and entity and entity.Variant ~= EffectVariant.DICE_FLOOR then + EID.Scale = EID.Config["LocalModeSize"] + EID.CurrentScaleType = "LocalModeSize" local textBoxWidth = EID.Config["LocalModeCentered"] and tonumber(EID.Config["TextboxWidth"])/2 * EID.Scale or -30 local textPosOffset = Vector(-textBoxWidth, 20) EID:alterTextPos(Isaac.WorldToScreen(entity.Position + textPosOffset)) - if REPENTANCE then - if isMirrorRoom then - EID:alterTextPos(Isaac.WorldToScreen(entity.Position + textPosOffset * Vector(-1,0))) - local screenCenter = EID:getScreenSize()/2 - EID.UsedPosition.X = EID.UsedPosition.X - (EID.UsedPosition-screenCenter).X * 2 - end + if isMirrorRoom then + EID:alterTextPos(Isaac.WorldToScreen(entity.Position + textPosOffset * Vector(-1,0))) + local screenCenter = EID:getScreenSize()/2 + EID.UsedPosition.X = EID.UsedPosition.X - (EID.UsedPosition-screenCenter).X * 2 end if entity:ToPickup() and entity:ToPickup():IsShopItem() then EID:alterTextPos(Isaac.WorldToScreen(entity.Position + textPosOffset)) end else - EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"]) EID.Scale = EID.Config["Size"] + EID.CurrentScaleType = "Size" + EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"]) end end @@ -803,7 +783,7 @@ local lastMousePos = Vector(0,0) local lastMouseMove = 0 function EID:handleHoverHUD() - local mousePos = Isaac.WorldToScreen(Input.GetMousePosition(true)) + local mousePos = Isaac.WorldToScreen(Input.GetMousePosition(true)) * 2 if mousePos:Distance(lastMousePos) > 2 then lastMousePos = mousePos lastMouseMove = game:GetFrameCount() @@ -812,12 +792,13 @@ function EID:handleHoverHUD() return nil end if EID.Config["ShowCursor"] then - EID.CursorSprite:Render(Vector(mousePos.X, mousePos.Y), nullVector, nullVector) + EID.CursorSprite:Render(Vector(mousePos.X / 2, mousePos.Y / 2), nullVector, nullVector) end for k, v in pairs(EID.HUDElements) do local hudElement = EID:handleHUDElement(v) if hudElement.x <= mousePos.X and (hudElement.x + hudElement.width) >= mousePos.X and hudElement.y <= mousePos.Y and (hudElement.y + hudElement.height) >= mousePos.Y then - return hudElement.descriptionObj() or nil + local result = hudElement.descriptionObj() + if result then return result end end end return nil @@ -904,28 +885,30 @@ local function attemptPathfind(entity) return success end -local hasShownAchievementWarning = false -local function renderAchievementInfo() - if REPENTANCE and not EID.Config.DisableAchievementCheck and game:GetFrameCount() < 10*30 then +local hasShownStartWarning = false +local function checkStartOfRunWarnings() + if REPENTANCE and not EID.Config["DisableStartOfRunWarnings"] and game:GetFrameCount() < 10*30 then -- Old Repentance version check; update this to check for the existence of the newest mod API function EID uses -- 1.7.6 (Nov. 16, 2021): The Options object (to read the game's options like HUD Offset) if Options == nil then local demoDescObj = EID:getDescriptionObj(-999, -1, 1) demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or "" demoDescObj.Description = EID:getDescriptionEntry("OldGameVersionWarningText") or "" - EID:displayPermanentText(demoDescObj) - hasShownAchievementWarning = true + EID:displayPermanentText(demoDescObj, "AchievementWarningTitle") + hasShownStartWarning = true -- Bag of Crafting modded items check - elseif EID.player:HasCollectible(710) and EID:DetectModdedItems() and EID.Config.DisplayBagOfCrafting ~= "never" and (EID.Config.BagOfCraftingDisplayMode == "Recipe List" or EID.Config.BagOfCraftingDisplayMode == "Preview Only") then + elseif EID:PlayersHaveCollectible(710) and EID:DetectModdedItems() and EID.Config.DisplayBagOfCrafting ~= "never" and + (EID.Config.BagOfCraftingDisplayMode == "Recipe List" or EID.Config.BagOfCraftingDisplayMode == "Preview Only") then local demoDescObj = EID:getDescriptionObj(-999, -1, 1) demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or "" demoDescObj.Description = EID:getDescriptionEntry("ModdedRecipesWarningText") or "" - EID:displayPermanentText(demoDescObj) - hasShownAchievementWarning = true + EID:displayPermanentText(demoDescObj, "AchievementWarningTitle") + hasShownStartWarning = true -- Achievements Locked Check (do we have Cube of Meat or Book of Revelations unlocked?) else local characterID = EID.player:GetPlayerType() - --ID 21 = Tainted Isaac. Tainted characters have definitely beaten Mom! (Fixes Tainted Lost's item pools ruining this check) + -- ID 21 = Tainted Isaac. Tainted characters have definitely beaten Mom! + -- (Fixes Tainted Lost's item pools, and potentially modded character's mechanics, ruining this check) if characterID < 21 and game.Challenge == 0 and not EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_TMTRAINER) then local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS) if not hasBookOfRevelationsUnlocked then @@ -934,13 +917,13 @@ local function renderAchievementInfo() local demoDescObj = EID:getDescriptionObj(-999, -1, 1) demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or "" demoDescObj.Description = EID:getDescriptionEntry("AchievementWarningText") or "" - EID:displayPermanentText(demoDescObj) - hasShownAchievementWarning = true + EID:displayPermanentText(demoDescObj, "AchievementWarningTitle") + hasShownStartWarning = true end end end end - elseif hasShownAchievementWarning then + elseif hasShownStartWarning then EID:hidePermanentText() end end @@ -960,22 +943,26 @@ local function onRender(t) EID.OptionChanged = EID.MCM_OptionChanged EID.MCM_OptionChanged = false EID:resumeCoroutines() - + EID.isDisplaying = false EID:setPlayer() + -- Do not check our hotkeys while a tab that can modify the hotkey is open + if EID.MCMCompat_isDisplayingEIDTab ~= "Visuals" then + -- scale key must be handled before resetting to non-local mode + handleScaleKey() + if Input.IsButtonTriggered(EID.Config["HideKey"], 0) or Input.IsButtonTriggered(EID.Config["HideButton"], EID.player.ControllerIndex) then + EID.isHidden = not EID.isHidden + end + end + EID:PositionLocalMode() -- default to non-local mode to fix MCM / Bag errors EID.TabPreviewID = 0 - if Input.IsButtonTriggered(EID.Config["HideKey"], 0) or Input.IsButtonTriggered(EID.Config["HideButton"], EID.player.ControllerIndex) then - EID.isHidden = not EID.isHidden - end - - handleScaleKey() - - if ModConfigMenu and ModConfigMenu.IsVisible and ModConfigMenu.Config["Mod Config Menu"].HideHudInMenu and EID.MCMCompat_isDisplayingEIDTab ~= "Visuals" and EID.MCMCompat_isDisplayingEIDTab ~= "Crafting" then --if the mod config menu exists, is opened and Hide Hud is enabled, and ModConfigMenu isn't currently in the "Visuals" or "Crafting" tab of EID + -- If MCM is open, don't show anything unless we're in a tab labeled as "Visuals" or "Crafting" + if ModConfigMenu and ModConfigMenu.IsVisible and ModConfigMenu.Config["Mod Config Menu"].HideHudInMenu and EID.MCMCompat_isDisplayingEIDTab ~= "Visuals" and EID.MCMCompat_isDisplayingEIDTab ~= "Crafting" then return end - renderAchievementInfo() + checkStartOfRunWarnings() EID:renderMCMDummyDescription() if EID.GameVersion == "ab+" then @@ -985,11 +972,18 @@ local function onRender(t) EID:removeTextPosModifier("Schoolbag") end else - if EID.player.SubType == 21 or EID.player.SubType == 25 then -- T-Isaac, T-Blue Baby + -- Tainted Isaac and Tainted ??? + if EID.player.SubType == 21 or EID.player.SubType == 25 then EID:addTextPosModifier("Tained HUD", Vector(0,30)) else EID:removeTextPosModifier("Tained HUD") end + -- Magdalene Birthright + if EID.player.SubType == 1 and EID.player:HasCollectible(619) then + EID:addTextPosModifier("18 Heart HUD", Vector(0,5)) + else + EID:removeTextPosModifier("18 Heart HUD") + end end if EID.isHidden then @@ -1008,10 +1002,13 @@ local function onRender(t) if REPENTANCE and EID.player:HasCollectible(710) then local success = EID:handleBagOfCraftingRendering() + -- If the Bag of Crafting did rendering, don't display any other description if success then return end end + -- If we're in the Crafting options tab, the only rendering we want to happen is the Bag of Crafting + if EID.MCMCompat_isDisplayingEIDTab == "Crafting" then return end EID.lastDescriptionEntity = nil EID.lastDist = 10000 @@ -1049,15 +1046,14 @@ local function onRender(t) local closest = EID.lastDescriptionEntity - + + -- if no entity in range, display Sacrifice Room information if EID.lastDist / 40 > tonumber(EID.Config["MaxDistance"]) then if game:GetRoom():GetType() == RoomType.ROOM_SACRIFICE and EID.Config["DisplaySacrificeInfo"] then local curRoomIndex = game:GetLevel():GetCurrentRoomIndex() local curCounter = EID.sacrificeCounter[curRoomIndex] or 1 local sacrificeDesc = EID:getDescriptionObj(-999, -1, curCounter) sacrificeDesc.Name = sacrificeDesc.Name.." ("..curCounter.."/12)" - EID:alterTextPos(Vector(EID.Config["XPosition"], EID.Config["YPosition"])) - EID.Scale = EID.Config["Size"] EID:printDescription(sacrificeDesc) end return @@ -1072,11 +1068,9 @@ local function onRender(t) --Handle Indicators EID:renderIndicator(closest) - --Local Mode + --Position the description under the entity in Local Mode EID:PositionLocalMode(closest) - --Scale Value - EID:ScaleValue(closest) --Handle GetData Entities (specific) if EID.Config["EnableEntityDescriptions"] and EID:getEntityData(closest, "EID_Description") then local desc = EID:getEntityData(closest, "EID_Description") @@ -1100,9 +1094,10 @@ local function onRender(t) -- force the default glitchy description if option is off if not EID.Config["DisplayGlitchedItemInfo"] then glitchedObj.Description = glitchedDesc - -- grab the Item Config info if eid_tmtrainer.lua hasn't taken care of it - elseif not debug then - glitchedObj.Description = EID:CheckGlitchedItemConfig(closest.SubType) .. glitchedDesc + -- grab the Item Config info if eid_tmtrainer.lua hasn't taken care of it, and it hasn't been done before + elseif not debug and glitchedObj.Description == glitchedDesc then + EID:addCollectible(closest.SubType, EID:CheckGlitchedItemConfig(closest.SubType) .. glitchedDesc) + glitchedObj = EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType) end EID:printDescription(glitchedObj) @@ -1293,6 +1288,11 @@ if EID.MCMLoaded or REPENTANCE then end end end + -- DisableAchievementCheck has been renamed, convert the setting to the new one (this can be removed in a few updates) + if savedEIDConfig["DisableAchievementCheck"] then + EID.Config["DisableStartOfRunWarnings"] = savedEIDConfig["DisableAchievementCheck"] + end + EID.isHidden = EID.Config["InitiallyHidden"] EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"]) EID.Scale = EID.Config["Size"] diff --git a/mod_config_menu.lua b/mod_config_menu.lua index 6c43464d..93d98713 100644 --- a/mod_config_menu.lua +++ b/mod_config_menu.lua @@ -35,7 +35,7 @@ local function renderDummyDesc(reload) demoDescObj.Name = EID:getDescriptionEntry("MCM","DemoObjectName") demoDescObj.Transformation = EID:getDescriptionEntry("MCM","DemoObjectTransformation") demoDescObj.Description = EID:getDescriptionEntry("MCM","DemoObjectText") - EID:displayPermanentText(demoDescObj) + EID:displayPermanentText(demoDescObj, "MCM", "DemoObjectName") end -- get list of all defined fonts per language file @@ -143,6 +143,56 @@ function EID:AddBooleanSetting(category, optionName, displayText, params) ) end +function EID:AddNumberSetting(category, optionName, displayText, minimum, maximum, params) + if type(params) ~= "table" then params = {} end + if params.repOnly and not REPENTANCE then return end + MCM.AddSetting( + "EID", category, + { + Type = ModConfigMenu.OptionType.NUMBER, + CurrentSetting = params.currentSettingFunc or function() + return (params.indexOf and AnIndexOf(params.indexOf, EID.Config[optionName])) or EID.Config[optionName] + end, + Minimum = minimum, + Maximum = maximum, + ModifyBy = params.modifyBy or 1, + Display = params.displayFunc or function() + if params.displayingTab then EID.MCMCompat_isDisplayingEIDTab = params.displayingTab end + return displayText .. ": " .. ((params.displayTable and params.displayTable[EID.Config[optionName]]) or EID.Config[optionName]) + end, + OnChange = params.onChangeFunc or function(currentNum) + EID.Config[optionName] = (params.indexOf and params.indexOf[currentNum]) or currentNum + EID.MCM_OptionChanged = true + end, + Info = params.infoText or {} + } + ) +end + +function EID:AddScrollSetting(category, optionName, displayText, scrollTable, params) + if type(params) ~= "table" then params = {} end + if params.repOnly and not REPENTANCE then return end + MCM.AddSetting( + "EID", category, + { + Type = ModConfigMenu.OptionType.SCROLL, + CurrentSetting = params.currentSettingFunc or function() + return AnIndexOf(scrollTable, EID.Config[optionName]) - 1 + end, + Display = params.displayFunc or function() + if params.displayingTab then EID.MCMCompat_isDisplayingEIDTab = params.displayingTab end + return displayText .. ": $scroll" .. (AnIndexOf(scrollTable, EID.Config[optionName]) - 1) .. " " .. + EID.Config[optionName] .. (params.label or "") + end, + OnChange = params.onChangeFunc or function(currentNum) + EID.Config[optionName] = scrollTable[currentNum + 1] + EID.MCM_OptionChanged = true + end, + Info = params.infoText or {} + } + ) +end + function EID:AddHotkeySetting(category, optionName, displayText, infoText, isController) if (type(infoText) == "string") then infoText = {infoText} end local optionType = ModConfigMenu.OptionType.KEYBIND_KEYBOARD @@ -211,8 +261,16 @@ if MCMLoaded then MCM.AddSpace("EID", "Info") MCM.AddText("EID", "Info", function() return EID.isHidden and"~~~~~~~~~~~~~~~~~~~~~~~~~~~" or "" end) MCM.AddText("EID", "Info", function() return EID.isHidden and"~~~~~ CURRENTLY HIDDEN! ~~~~~" or "" end) - MCM.AddText("EID", "Info", function() return EID.isHidden and"~~~~~~~~ F2 to show ~~~~~~~~~" or "" end) - + MCM.AddText("EID", "Info", function() + EID.MCMCompat_isDisplayingEIDTab = "" + if EID.Config["HideKey"] ~= -1 or EID.Config["HideButton"] ~= -1 then + local hotkeyString = InputHelper.KeyboardToString[EID.Config["HideKey"]] or InputHelper.ControllerToString[EID.Config["HideButton"]] + return EID.isHidden and ("~~~~~~~ " .. hotkeyString .." to show ~~~~~~~~") or "" + else + return EID.isHidden and"~~ bind a key/button in the General tab to show ~~" or "" + end + end) + --------------------------------------------------------------------------- ---------------------------------General----------------------------------- -- Language @@ -245,329 +303,49 @@ if MCMLoaded then ) -- Item Name Language local translateStates = {"English", "Current Language", "Current + English"} - MCM.AddSetting( - "EID", - "General", - { - Type = ModConfigMenu.OptionType.NUMBER, - CurrentSetting = function() - return EID.Config["TranslateItemName"] - end, - Minimum = 1, - Maximum = 3, - Display = function() - return "Name Language: " .. translateStates[EID.Config["TranslateItemName"]] - end, - OnChange = function(currentNum) - EID.Config["TranslateItemName"] = currentNum - end, - Info = {"If translated names are available,","this changes how item names are displayed."} - } - ) + EID:AddNumberSetting("General", "TranslateItemName", "Name Language", 1, 3, {displayTable = translateStates, + infoText = {"If translated names are available,","this changes how item names are displayed."}}) - -- Hide Key - EID:AddHotkeySetting("General", - "HideKey", "Toggle (Keyboard)", + -- Hide Keys + EID:AddHotkeySetting("General", "HideKey", "Toggle (Keyboard)", "Press this key to toggle the description display", false) - EID:AddHotkeySetting("General", - "HideButton", "Toggle (Controller)", + EID:AddHotkeySetting("General", "HideButton", "Toggle (Controller)", "Press this button to toggle the description display (Left Stick or Right Stick recommended; most other buttons will not work)", true) MCM.AddSpace("EID", "General") - -- Position X - MCM.AddSetting( - "EID", - "General", - { - Type = ModConfigMenu.OptionType.NUMBER, - CurrentSetting = function() - return EID.Config["XPosition"] - end, - Minimum = 0, - Maximum = 500, - ModifyBy = 5, - Display = function() - return "Position X: " .. EID.Config["XPosition"] - end, - OnChange = function(currentNum) - EID.Config["XPosition"] = currentNum - EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"]) - end, - Info = {"Default = 60"} - } - ) - -- Position Y - MCM.AddSetting( - "EID", - "General", - { - Type = ModConfigMenu.OptionType.NUMBER, - CurrentSetting = function() - return EID.Config["YPosition"] - end, - Minimum = 0, - Maximum = 500, - ModifyBy = 5, - Display = function() - return "Position Y: " .. EID.Config["YPosition"] - end, - OnChange = function(currentNum) - EID.Config["YPosition"] = currentNum - EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"]) - end, - Info = {"Default = 45"} - } - ) - -- Line Height - MCM.AddSetting( - "EID", - "General", - { - Type = ModConfigMenu.OptionType.NUMBER, - CurrentSetting = function() - return EID.Config["LineHeight"] - end, - Minimum = 1, - Maximum = 100, - Display = function() - return "Line Height: " .. EID.Config["LineHeight"] - end, - OnChange = function(currentNum) - EID.Config["LineHeight"] = currentNum - EID.MCM_OptionChanged = true - end, - Info = {"Default = 11","Line height will automatically change when changing a font/language"} - } - ) - -- Textbox Width - MCM.AddSetting( - "EID", - "General", - { - Type = ModConfigMenu.OptionType.NUMBER, - CurrentSetting = function() - return EID.Config["TextboxWidth"] - end, - Minimum = 1, - Maximum = 500, - ModifyBy = 5, - Display = function() - return "Textbox Width: " .. EID.Config["TextboxWidth"] - end, - OnChange = function(currentNum) - EID.Config["TextboxWidth"] = currentNum - EID.MCM_OptionChanged = true - end, - Info = {"Default = 130, varies per language","Width of the EID textbox, in pixels"} - } - ) - + -- Position / Textbox Size + EID:AddNumberSetting("General", "XPosition", "Position X", 0, 500, {modifyBy = 5, infoText = "Default = 60"}) + EID:AddNumberSetting("General", "YPosition", "Position Y", 0, 500, {modifyBy = 5, infoText = "Default = 45"}) + EID:AddNumberSetting("General", "LineHeight", "Line Height", 1, 30, {infoText = "Default = 11 (varies per language)"}) + EID:AddNumberSetting("General", "TextboxWidth", "Textbox Width", 1, 500, {modifyBy = 5, infoText = "Default = 130 (varies per language)"}) MCM.AddSpace("EID", "General") - -- Initial hiding - MCM.AddSetting( - "EID", - "General", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["InitiallyHidden"] - end, - Display = function() - local onOff = "False" - if EID.Config["InitiallyHidden"] then - onOff = "True" - end - return 'Is initially Hidden: ' .. onOff - end, - OnChange = function(currentBool) - EID.Config["InitiallyHidden"] = currentBool - end - } - ) + EID:AddBooleanSetting("General", "InitiallyHidden", "Is Initially Hidden") + EID:AddBooleanSetting("General", "DisableStartOfRunWarnings", "Start of Run Warnings", {offText = "Enabled", onText = "Disabled", + repOnly = true, infoText = "Toggle the achievement, outdated game version, and modded crafting recipes warnings"}) - if REPENTANCE then - -- disable the warnings that display at the start of new runs - MCM.AddSetting( - "EID", - "General", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisableAchievementCheck"] - end, - Display = function() - local onOff = "Enabled" - if EID.Config["DisableAchievementCheck"] then - onOff = "Disabled" - end - return "Start of Run Warnings: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisableAchievementCheck"] = currentBool - end, - Info = {"Toggle the achievement, outdated game version, and modded crafting recipes warnings"} - } - ) - end + EID:AddBooleanSetting("General", "DisableOnCurse", 'Show on "Curse of the Blind"', {offText = "True", onText = "False"}) + EID:AddBooleanSetting("General", "DisableOnAprilFoolsChallenge", "Show on April Fools Challenge", {offText = "True", onText = "False"}) + EID:AddBooleanSetting("General", "DisableOnAltPath", "Show Hidden Alt-Path Item", {offText = "True", onText = "False", + repOnly = true, infoText = "Show the description for the blind item in Downpour/Mines/etc."}) - -- Disable on Curse - MCM.AddSetting( - "EID", - "General", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisableOnCurse"] - end, - Display = function() - local onOff = "True" - if EID.Config["DisableOnCurse"] then - onOff = "False" - end - return 'Show on "Curse of Blind": ' .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisableOnCurse"] = currentBool - end - } - ) - -- Disable April Fools - MCM.AddSetting( - "EID", - "General", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisableOnAprilFoolsChallenge"] - end, - Display = function() - local onOff = "True" - if EID.Config["DisableOnAprilFoolsChallenge"] then - onOff = "False" - end - return 'Show on April Fools Challenge: ' .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisableOnAprilFoolsChallenge"] = currentBool - end - } - ) - - if REPENTANCE then - -- Disable Alt Item option - MCM.AddSetting( - "EID", - "General", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisableOnAltPath"] - end, - Display = function() - local onOff = "True" - if EID.Config["DisableOnAltPath"] then - onOff = "False" - end - return 'Show hidden alt-Path Item: ' .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisableOnAltPath"] = currentBool - end - } - ) - end - - --------ShowUnidentifiedPillDescriptions--------- - MCM.AddSetting( - "EID", - "General", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["ShowUnidentifiedPillDescriptions"] - end, - Display = function() - local onOff = "False" - if EID.Config["ShowUnidentifiedPillDescriptions"] then - onOff = "True" - end - return "Show Unidentified Pill Effects: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["ShowUnidentifiedPillDescriptions"] = currentBool - end - } - ) - MCM.AddSetting( - "EID", - "General", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["HideInBattle"] - end, - Display = function() - local onOff = "False" - if EID.Config["HideInBattle"] then - onOff = "True" - end - return "Hide in Battle: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["HideInBattle"] = currentBool - end, - Info = {"Hides the descriptions when in a fight"} - } - ) + EID:AddBooleanSetting("General", "ShowUnidentifiedPillDescriptions", "Show Unidentified Pill Effects") + EID:AddBooleanSetting("General", "HideInBattle", "Hide in Battle", {infoText = "Hides the descriptions when in a fight"}) MCM.AddSpace("EID", "General") --indicator local indicators = {"arrow", "blink", "border", "highlight", "none"} - MCM.AddSetting( - "EID", - "General", - { - Type = ModConfigMenu.OptionType.NUMBER, - CurrentSetting = function() - return AnIndexOf(indicators, EID.Config["Indicator"]) - end, - Minimum = 1, - Maximum = 5, - Display = function() - return "Indicator: " .. EID.Config["Indicator"] - end, - OnChange = function(currentNum) - EID.Config["Indicator"] = indicators[currentNum] - end, - Info = {"Highlights the currently described item"} - } - ) + EID:AddNumberSetting("General", "Indicator", "Indicator", 1, 5, {indexOf = indicators, + infoText = {"Change how the currently described item is marked"}}) MCM.AddSpace("EID", "General") -- maxDistance local distances = {1, 1.5, 2, 3, 4, 5, 6, 7, 8, 9, 10} - MCM.AddSetting( - "EID", - "General", - { - Type = ModConfigMenu.OptionType.SCROLL, - CurrentSetting = function() - return AnIndexOf(distances, EID.Config["MaxDistance"]) - 1 - end, - Display = function() - return "Max Distance: $scroll" .. - AnIndexOf(distances, EID.Config["MaxDistance"]) - 1 .. " " .. EID.Config["MaxDistance"] .. " Grids" - end, - OnChange = function(currentNum) - EID.Config["MaxDistance"] = distances[currentNum + 1] - end, - Info = {"Distance to the object until descriptions are displayed."} - } - ) + EID:AddScrollSetting("General", "MaxDistance", "Max Distance", distances, {label = " Grids", + infoText = "Distance to the object until descriptions are displayed."}) --------Reset to default MCM.AddSpace("EID", "General") @@ -579,8 +357,15 @@ if MCMLoaded then Type = ModConfigMenu.OptionType.BOOLEAN, CurrentSetting = function() return true end, Display = function() return "<---- RESET CONFIG TO DEFAULT ---->" end, - OnChange = function(currentBool) EID.Config = EID.DefaultConfig end, - Info = {"Press this reset the config back to its default values"} + OnChange = function(currentBool) + local resetFont = (EID.Config["FontType"] ~= "default") + for k,v in pairs(EID.DefaultConfig) do EID.Config[k] = v end + EID.MCM_OptionChanged = true + EID.RefreshBagTextbox = true + if resetFont then EID:loadFont(EID.modPath .. "resources/font/eid_"..EID.Config["FontType"]..".fnt") end + renderDummyDesc(true) + end, + Info = {"Press this to reset the config back to its default values"} } ) @@ -599,247 +384,49 @@ if MCMLoaded then EID:AddBooleanSetting("Display", "DisplayCraneInfo", "Crane Game Infos", {repOnly = true}) EID:AddBooleanSetting("Display", "DisplayVoidStatInfo", "Void Stat Increase Infos") - local diceSteps = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} - if REPENTANCE then - - MCM.AddSpace("EID", "Display") + local diceSteps = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} + -- Spindown Dice Settings + if REPENTANCE then MCM.AddSpace("EID", "Display") end - -- Spindown Dice results - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.SCROLL, - CurrentSetting = function() - return AnIndexOf(diceSteps, EID.Config["SpindownDiceResults"]) - 1 - end, - Display = function() - return "Spindown Dice: $scroll" .. - AnIndexOf(diceSteps, EID.Config["SpindownDiceResults"]) - 1 .. " " .. EID.Config["SpindownDiceResults"] .. " Items" - end, - OnChange = function(currentNum) - EID.Config["SpindownDiceResults"] = diceSteps[currentNum + 1] - end, - Info = {"Preview of Items resulting when using the Spindown dice X times"} - } - ) - -- - -- Display IDs for Spindown Dice results - EID:AddBooleanSetting("Display", "SpindownDiceDisplayID", "Display IDs", - {repOnly = true, infoText = "Display IDs for Spindown Dice results"}) - -- Display names for Spindown Dice results - EID:AddBooleanSetting("Display", "SpindownDiceDisplayName", "Display names", - {repOnly = true, infoText = "Display names for Spindown Dice results"}) - - -- Spindown Dice skip locked items - EID:AddBooleanSetting("Display", "SpindownDiceSkipLocked", "Skip Locked Items", - {repOnly = true, infoText = "Skip locked items in the preview just as the dice will; the method to check for unlock status is not perfect, though"}) - end + EID:AddScrollSetting("Display", "SpindownDiceResults", "Spindown Dice", diceSteps, {repOnly = true, label = " Items", + infoText = "Number of item previews when holding Spindown Dice"}) + + -- Display IDs for Spindown Dice results + EID:AddBooleanSetting("Display", "SpindownDiceDisplayID", "Display IDs", + {repOnly = true, infoText = "Display IDs for Spindown Dice results"}) + -- Display names for Spindown Dice results + EID:AddBooleanSetting("Display", "SpindownDiceDisplayName", "Display names", + {repOnly = true, infoText = "Display names for Spindown Dice results"}) + -- Spindown Dice skip locked items + EID:AddBooleanSetting("Display", "SpindownDiceSkipLocked", "Skip Locked Items", + {repOnly = true, infoText = "Skip locked items in the preview just as the dice will; the method to check for unlock status is not perfect, though"}) --------Obstruction--------- MCM.AddSpace("EID", "Display") - MCM.AddText("EID", "Display", "Display Infos when obstructed") + MCM.AddText("EID", "Display", "Display Infos when Obstructed") - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisableObstructionOnFlight"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisableObstructionOnFlight"] then - onOff = "True" - end - return "Show again when having flight: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisableObstructionOnFlight"] = currentBool - end - } - ) + EID:AddBooleanSetting("Display", "DisableObstructionOnFlight", "Show again when you have Flight") + EID:AddBooleanSetting("Display", "DisplayObstructedCardInfo", "Obstructed Card Infos") + EID:AddBooleanSetting("Display", "DisplayObstructedPillInfo", "Obstructed Pill Infos") + EID:AddBooleanSetting("Display", "DisplayObstructedSoulstoneInfo", "Obstructed Soulstone Infos", {repOnly = true}) - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplayObstructedCardInfo"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisplayObstructedCardInfo"] then - onOff = "True" - end - return "Card Infos: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplayObstructedCardInfo"] = currentBool - end - } - ) - - if REPENTANCE then - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplayObstructedSoulstoneInfo"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisplayObstructedSoulstoneInfo"] then - onOff = "True" - end - return "Soulstone Infos: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplayObstructedSoulstoneInfo"] = currentBool - end - } - ) - end - - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplayObstructedPillInfo"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisplayObstructedPillInfo"] then - onOff = "True" - end - return "Pill Infos: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplayObstructedPillInfo"] = currentBool - end - } - ) - + -------Shop Spoilers------- MCM.AddSpace("EID", "Display") MCM.AddText("EID", "Display", "Display Infos in Shops") - ------------CARDS-------------- - - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplayCardInfoShop"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisplayCardInfoShop"] then - onOff = "True" - end - return "Card Infos: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplayCardInfoShop"] = currentBool - end - } - ) - - ------------PILLS-------------- - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplayPillInfoShop"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisplayPillInfoShop"] then - onOff = "True" - end - return "Pill Infos: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplayPillInfoShop"] = currentBool - end - } - ) + EID:AddBooleanSetting("Display", "DisplayCardInfoShop", "Shop Card Infos") + EID:AddBooleanSetting("Display", "DisplayPillInfoShop", "Shop Pill Infos") + EID:AddBooleanSetting("Display", "DisplaySoulstoneInfoShop", "Shop Soulstone Infos", {repOnly = true}) + + ----"Options?" Spoilers---- if REPENTANCE then - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplaySoulstoneInfoShop"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisplaySoulstoneInfoShop"] then - onOff = "True" - end - return "Soulstone Infos: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplaySoulstoneInfoShop"] = currentBool - end - } - ) - MCM.AddSpace("EID", "Display") MCM.AddText("EID", "Display", "Interaction with 'Options?'") - - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplayCardInfoOptions?"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisplayCardInfoOptions?"] then - onOff = "True" - end - return "Card Infos when spawned by 'Options?': " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplayCardInfoOptions?"] = currentBool - end - } - ) - - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplayPillInfoOptions?"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisplayPillInfoOptions?"] then - onOff = "True" - end - return "Pill Infos when spawned by 'Options?': " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplayPillInfoOptions?"] = currentBool - end - } - ) end + + EID:AddBooleanSetting("Display", "DisplayCardInfoOptions?", "'Options?' Card Infos", {repOnly = true}) + EID:AddBooleanSetting("Display", "DisplayPillInfoOptions?", "'Options?' Pill Infos", {repOnly = true}) + --------------------------------------------------------------------------- ---------------------------------Visuals----------------------------------- -- Font Type @@ -858,125 +445,46 @@ if MCMLoaded then return "Font Type: " .. EID.Config["FontType"] end, OnChange = function(currentNum) - EID.Config["FontType"] = fontNames[currentNum] - EID.lineHeight = fonts[currentNum].lineHeight - EID.Config["TextboxWidth"] = fonts[currentNum].textboxWidth - EID:fixDefinedFont() - local fontFile = EID.Config["FontType"] or "default" - EID:loadFont(EID.modPath .. "resources/font/eid_"..fontFile..".fnt") + if EID:canUseFontType(fontNames[currentNum]) then + EID.MCM_OptionChanged = true + EID.Config["FontType"] = fontNames[currentNum] + EID.Config["LineHeight"] = fonts[currentNum].lineHeight or EID.Config["LineHeight"] + EID.Config["TextboxWidth"] = fonts[currentNum].textboxWidth or EID.Config["TextboxWidth"] + local fontFile = EID.Config["FontType"] or "default" + EID:loadFont(EID.modPath .. "resources/font/eid_"..fontFile..".fnt") + end end } ) -- Display Mode - -- Note: MCM's dummy desc doesn't play well with changing this at the moment! local displayModes = {"default", "local"} - local displayModeTips = {"default: text will be displayed in the top-left of the screen.", "local: text will be displayed under the described object."} - MCM.AddSetting( - "EID", - "Visuals", - { - Type = ModConfigMenu.OptionType.NUMBER, - CurrentSetting = function() - return AnIndexOf(displayModes, EID.Config["DisplayMode"]) - end, - Minimum = 1, - Maximum = #displayModes, - Display = function() - return "Display mode: " .. EID.Config["DisplayMode"] - end, - OnChange = function(currentNum) - EID.Config["DisplayMode"] = displayModes[currentNum] - end, - Info = function() - return {"Changes display mode of descriptions", displayModeTips[AnIndexOf(displayModes, EID.Config["DisplayMode"])]} - end - } - ) + EID:AddNumberSetting("Visuals", "DisplayMode", "Display Mode", 1, #displayModes, {indexOf = displayModes, + infoText = {"Changes display mode of descriptions", "Default: Text is displayed in the top left", "Local: Text is displayed under the described object"}}) - -- SCALE - local textScales = {0.5, 0.75, 1, 1.25, 1.5, 2} - MCM.AddSetting( - "EID", - "Visuals", - { - Type = ModConfigMenu.OptionType.NUMBER, - CurrentSetting = function() - if EID.Config["DisplayMode"] == "local" then - return AnIndexOf(textScales, EID.Config["LocalModeSize"]) - else - return AnIndexOf(textScales, EID.Config["Size"]) - end - end, - Minimum = 1, - Maximum = 6, - Display = function() - if EID.Config["DisplayMode"] == "local" then - return "Text Size (Local mode): " .. EID.Config["LocalModeSize"] - else - return "Text Size: " .. EID.Config["Size"] - end - end, - OnChange = function(currentNum) - EID.MCM_OptionChanged = true - if EID.Config["DisplayMode"] == "local" then - EID.Config["LocalModeSize"] = textScales[currentNum] - else - EID.Config["Size"] = textScales[currentNum] - end - EID.Scale = textScales[currentNum] - end, - Info = {"Change text size","CAN BE HARD TO READ IN SOME SETTINGS!"} - } - ) + -- Scale/Size + EID:AddNumberSetting("Visuals", "Size", "Text Size", 0.5, 2, {modifyBy = 0.25, onChangeFunc = + function(currentNum) + EID.MCM_OptionChanged = true + currentNum = currentNum - (currentNum % 0.25) + EID.Config["Size"] = currentNum + end}) + EID:AddNumberSetting("Visuals", "LocalModeSize", "Text Size (Local Mode)", 0.5, 2, {modifyBy = 0.25, onChangeFunc = + function(currentNum) + EID.MCM_OptionChanged = true + currentNum = currentNum - (currentNum % 0.25) + EID.Config["LocalModeSize"] = currentNum + end}) -- SCALE Hotkey EID:AddHotkeySetting("Visuals", "SizeHotkey", "Toggle Size (Keyboard)", - {"Press this key to change the text size.", "Hold this key to smoothly change the text size"}, false) - + {"Press this key to change the text size.", "Hold this key to smoothly change the text size."}, false) -- Local Mode Centered or not - MCM.AddSetting( - "EID", - "Visuals", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["LocalModeCentered"] - end, - Display = function() - local onOff = "False" - if EID.Config["LocalModeCentered"] then - onOff = "True" - end - return "Local mode centered: " .. onOff - end, - OnChange = function(currentBool) - EID.MCM_OptionChanged = true - EID.Config["LocalModeCentered"] = currentBool - end - } - ) + EID:AddBooleanSetting("Visuals", "LocalModeCentered", "Local Mode Centered") -- Transparency local transparencies = {0.1, 0.175, 0.25, 0.3, 0.4, 0.5, 0.6, 0.75, 0.8, 0.9, 1} - MCM.AddSetting( - "EID", - "Visuals", - { - Type = ModConfigMenu.OptionType.SCROLL, - CurrentSetting = function() - return AnIndexOf(transparencies, EID.Config["Transparency"]) - 1 - end, - Display = function() - return "Transparency: $scroll" .. - AnIndexOf(transparencies, EID.Config["Transparency"]) - 1 .. " " .. EID.Config["Transparency"] - end, - OnChange = function(currentNum) - EID.MCM_OptionChanged = true - EID.Config["Transparency"] = transparencies[currentNum + 1] - end - } - ) + EID:AddScrollSetting("Visuals", "Transparency", "Transparency", transparencies) MCM.AddSpace("EID", "Visuals") @@ -991,25 +499,7 @@ if MCMLoaded then -------Mod indicator for modded items--------- local modIndicatorDisplays = {"Both","Name only","Icon only", "None"} - MCM.AddSetting( - "EID", - "Visuals", - { - Type = ModConfigMenu.OptionType.NUMBER, - CurrentSetting = function() - return AnIndexOf(modIndicatorDisplays, EID.Config["ModIndicatorDisplay"]) - end, - Minimum = 1, - Maximum = #modIndicatorDisplays, - Display = function() - return "Mod indicator displayed for: " .. EID.Config["ModIndicatorDisplay"] - end, - OnChange = function(currentNum) - EID.MCM_OptionChanged = true - EID.Config["ModIndicatorDisplay"] = modIndicatorDisplays[currentNum] - end - } - ) + EID:AddNumberSetting("Visuals", "ModIndicatorDisplay", "Display Mod Indicator", 1, #modIndicatorDisplays, {indexOf = modIndicatorDisplays}) --------------------------------------------------------------------------- -----------------------------BAG OF CRAFTING------------------------------- @@ -1017,144 +507,44 @@ if MCMLoaded then if REPENTANCE then -- Bag of Crafting Display local bagDisplays = {"always","hold","never"} - MCM.AddSetting( - "EID", - "Crafting", - { - Type = ModConfigMenu.OptionType.NUMBER, - CurrentSetting = function() - return AnIndexOf(bagDisplays, EID.Config["DisplayBagOfCrafting"]) - end, - Minimum = 1, - Maximum = 3, - Display = function() - EID.MCMCompat_isDisplayingEIDTab = "Crafting" - return "Show Display: " .. EID.Config["DisplayBagOfCrafting"] - end, - OnChange = function(currentNum) - EID.MCM_OptionChanged = true - EID.Config["DisplayBagOfCrafting"] = bagDisplays[currentNum] - end, - Info = {"Always = Always show Results, Hold = Show when holding up bag, Never = Never show results"} - } - ) + EID:AddNumberSetting("Crafting", "DisplayBagOfCrafting", "Show Display", 1, #bagDisplays, { displayingTab = "Crafting", indexOf = bagDisplays, infoText = {"Always = Always show Results", "Hold = Show when holding up bag", "Never = Disable Bag of Crafting feature"}}) + -- Bag of Crafting Display Mode local bagDisplayModes = {"Recipe List","Preview Only","No Recipes","Pickups Only"} - MCM.AddSetting( - "EID", - "Crafting", - { - Type = ModConfigMenu.OptionType.NUMBER, - CurrentSetting = function() - return AnIndexOf(bagDisplayModes, EID.Config["BagOfCraftingDisplayMode"]) - end, - Minimum = 1, - Maximum = 4, - Display = function() - return "Display Mode: " .. EID.Config["BagOfCraftingDisplayMode"] - end, - OnChange = function(currentNum) - EID.MCM_OptionChanged = true - EID.Config["BagOfCraftingDisplayMode"] = bagDisplayModes[currentNum] - end, - Info = {"Toggle showing a list of recipes, an item preview when bag is full, what item pool/quality you might get, or only the floor pickups"} - } - ) + EID:AddNumberSetting("Crafting", "BagOfCraftingDisplayMode", "Display Mode", 1, #bagDisplayModes, { indexOf = bagDisplayModes, + infoText = {"Toggle showing a list of recipes, an item preview when bag is full, what item pool/quality you might get, or only the floor pickups"}}) + -- Bag of Crafting Hide in Battle - EID:AddBooleanSetting("Crafting", "BagOfCraftingHideInBattle", "Hide in Battle", - {onText = "Yes", offText = "No", - infoText = "Hides the recipe list when in a fight"}) + EID:AddBooleanSetting("Crafting", "BagOfCraftingHideInBattle", "Hide in Battle", {onText = "Yes", offText = "No", + infoText = "Hides the recipe list when in a fight"}) -- Bag of Crafting 8 icons toggle - EID:AddBooleanSetting("Crafting", "BagOfCraftingDisplayIcons", "Show Recipes/Best Bag as", - {onText = "8 Icons", offText = "Groups", - infoText = "Choose if you want recipes (and the Best Quality bag in No Recipes Mode) shown as 8 icons, or as grouped ingredients"}) + EID:AddBooleanSetting("Crafting", "BagOfCraftingDisplayIcons", "Show Recipes/Best Bag as", {onText = "8 Icons", offText = "Groups", + infoText = "Choose if you want recipes (and the Best Quality bag in No Recipes Mode) shown as 8 icons, or as grouped ingredients"}) + -- Modded Recipes toggle + EID:AddBooleanSetting("Crafting", "BagOfCraftingModdedRecipes", "Load Modded Item Recipes", { + infoText = {"Enable or disable basic modded item support", "If you have a lot of modded items, it will slow down game launch"}}) MCM.AddSpace("EID", "Crafting") MCM.AddText("EID", "Crafting", function() return "Recipe List Options" end) -- Bag of Crafting results per page - MCM.AddSetting( - "EID", - "Crafting", - { - Type = ModConfigMenu.OptionType.SCROLL, - CurrentSetting = function() - return AnIndexOf(diceSteps, EID.Config["BagOfCraftingResults"]) - 1 - end, - Display = function() - return "Displayed Results: $scroll" .. - AnIndexOf(diceSteps, EID.Config["BagOfCraftingResults"]) - 1 .. " " .. EID.Config["BagOfCraftingResults"] - end, - OnChange = function(currentNum) - EID.MCM_OptionChanged = true - EID.Config["BagOfCraftingResults"] = diceSteps[currentNum + 1] - end, - Info = {"Page size for the preview of items currently craftable with Bag of Crafting"} - } - ) + local bagSteps = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} + EID:AddScrollSetting("Crafting", "BagOfCraftingResults", "Displayed Recipes", bagSteps, + { infoText = "Page size for the preview of items currently craftable with Bag of Crafting"}) + -- Bag of Crafting thorough recipe checks local combSteps = {8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18} - MCM.AddSetting( - "EID", - "Crafting", - { - Type = ModConfigMenu.OptionType.SCROLL, - CurrentSetting = function() - return AnIndexOf(combSteps, EID.Config["BagOfCraftingCombinationMax"]) - 1 - end, - Display = function() - return "Thorough Calculations: $scroll" .. - AnIndexOf(combSteps, EID.Config["BagOfCraftingCombinationMax"]) - 1 .. " " .. EID.Config["BagOfCraftingCombinationMax"] - end, - OnChange = function(currentNum) - EID.Config["BagOfCraftingCombinationMax"] = combSteps[currentNum + 1] - end, - Info = {"Get every recipe for the X best components; setting this high will cause lag spikes (12 = 500 combinations, 14 = 3,000, 16 = 13,000)"} - } - ) + EID:AddScrollSetting("Crafting", "BagOfCraftingCombinationMax", "Thorough Calculations", combSteps, + { infoText = {"Get every recipe for the X best components; setting this high slows down recipe checking", "(12 = 500 combinations, 14 = 3,000, 16 = 13,000)"}}) + -- Bag of Crafting random recipe checks local calcSteps = {200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200} - MCM.AddSetting( - "EID", - "Crafting", - { - Type = ModConfigMenu.OptionType.SCROLL, - CurrentSetting = function() - return AnIndexOf(calcSteps, EID.Config["BagOfCraftingRandomResults"]) - 1 - end, - Display = function() - return "Random Calculations: $scroll" .. - AnIndexOf(calcSteps, EID.Config["BagOfCraftingRandomResults"]) - 1 .. " " .. EID.Config["BagOfCraftingRandomResults"] - end, - OnChange = function(currentNum) - EID.Config["BagOfCraftingRandomResults"] = calcSteps[currentNum + 1] - end, - Info = {"An additional X number of randomly chosen recipes will be checked, changing each pickup spawn/despawn or refresh"} - } - ) + EID:AddScrollSetting("Crafting", "BagOfCraftingRandomResults", "Random Calculations", calcSteps, + { infoText = "An additional X number of randomly chosen recipes will be checked, changing each pickup spawn/despawn or refresh"}) + -- Bag of Crafting item names - MCM.AddSetting( - "EID", - "Crafting", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["BagOfCraftingDisplayNames"] - end, - Display = function() - local onOff = "False" - if EID.Config["BagOfCraftingDisplayNames"] then - onOff = "True" - end - return "Show Item Names: " .. onOff - end, - OnChange = function(currentBool) - EID.MCM_OptionChanged = true - EID.Config["BagOfCraftingDisplayNames"] = currentBool - end, - Info = {"If on, each result takes two lines; lower your displayed results accordingly"} - } - ) + EID:AddBooleanSetting("Crafting", "BagOfCraftingDisplayNames", "Show Item Names", + { infoText = "If on, each recipe result takes two lines, one for the item name, one for the recipe"}) MCM.AddSpace("EID", "Crafting")