From dddb8f2447e60c2d0192da9531801f7253a56c4e Mon Sep 17 00:00:00 2001 From: Dezzelshipc <86155929+Dezzelshipc@users.noreply.github.com> Date: Sat, 4 Dec 2021 16:20:16 +1000 Subject: [PATCH 01/16] 1.7.7 rus --- descriptions/rep/ru.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/descriptions/rep/ru.lua b/descriptions/rep/ru.lua index 1a1aee3c..0d6078e8 100644 --- a/descriptions/rep/ru.lua +++ b/descriptions/rep/ru.lua @@ -333,7 +333,7 @@ local repCollectibles={ [697] = {"697", "Исчезающий близнец", "Спутник, который становится клоном босса при входе в комнату босса#Победа над ним создает дополнительный артефакт#Клон медленнее и имеет 75% от исходного здоровья босса"}, -- Vanishing Twin [698] = {"698", "Нечестивая парочка", "Два спутника, стоящие по бокам#Слёзы равны вашим, но только с 37.5% вашего урона"}, -- Twisted Pair [699] = {"699", "Ярость Азазеля", "Персонаж получает ярость, после каждой зачищенной комнаты#Через 4 комнаты он стреляет большим потоком Серы при входе в следующую комнату"}, -- Azazel's Rage - [700] = {"700", "Эхо-камера", "Когда персонаж использует карту, пилюлю или руну, он также использует копию каждой карты/пилюли/руны, которые использовались с момента получения Эхо-камеры"}, -- Echo Chamber + [700] = {"700", "Эхо-камера", "Когда персонаж использует карту, пилюлю или руну, он также использует копии 3 последних карт/пилюль/рун, которые использовались с момента получения Эхо-камеры"}, -- Echo Chamber [701] = {"701", "Гробница Исаака", "Создает старый сундук в начале каждого этажа#Может содержать:#1-3 синих сердца#3 брелока#Артефакт мамы или папы#Артефакт ангела"}, -- Isaac's Tomb [702] = {"702", "Мстительный дух", "После получения урона создает спутника-огонька до конца этажа#Максимум 6 спутников#Они стреляют огненными слезами, но не блокируют выстрелы"}, -- Vengeful Spirit [703] = {"703", "Исав Младший", "При использовании происходит переключение между текущим персонажем и Исавом-младшим, который имеет 3 черных сердца, +2 к урону и полет#Персонажи имеют независимые предметы и здоровье#!!! При его смерти, забег заканчивается"}, -- Esau Jr. @@ -674,10 +674,10 @@ EID.descriptions["ru"].tarotClothBuffs = { local repTrinkets={ [1] = {"1", "Проглоченный Пенни", "При получении урона, на пол падает 1 монетка#0-1 если вы играете за Хранителя"}, -- Swallowed Penny [10] = {"10", "Извивающийся червь", "Слезы двигаются волнами#↑ +0.4 к скорострельности#Дает спектральные слезы"}, -- Wiggle Worm - [11] = {"11", "Кольцевой червь", "Слезы движутся по спирали с большой скоростью#Дает спектральные слезы"}, -- Ring Worm + [11] = {"11", "Кольцевой червь", "Слезы движутся по спирали с большой скоростью#↑ +0.4 к скорострельности#Дает спектральные слезы"}, -- Ring Worm [15] = {"15", "Счастливый камень", "Шанс 33%, что на месте уничтоженного камня появится монета"},-- Lucky Rock [24] = {"24", "Пенни из задницы", "Каждая монета заставляет вас пукать#Пуки отталкивают и отравляют врагов"}, -- Butt Penny - [26] = {"26", "Крюкообразный червяк", "Слезы движутся угловатыми узорами#↑ +1.5 к дальности#Дает спектральные слезы"}, -- Hook Worm + [26] = {"26", "Крюкообразный червяк", "Слезы движутся угловатыми узорами#↑ +0.4 к скорострельности#↑ +1.5 к дальности#Дает спектральные слезы"}, -- Hook Worm [32] = {"32", "Вольная шляпка", "Каждую комнату дает эффект случайного гриба"}, -- Liberty Cap [33] = {"33", "Пуповина", "Когда у персонажа половина или нет красных сердец, появляется спутник Маленький Стивен#Высокий шанс создать спутника Близнеца при получении урона"}, -- Umbilical Cord [48] = {"48", "Потерянная страница", "При получении урона есть шанс нанести урон всем врагам в комнате#Чёрные сердца и {{Collectible35}} эффекты некрономикона наносят на 40 урона больше"}, -- A Missing Page @@ -689,7 +689,7 @@ local repTrinkets={ [69] = {"69", "Выцветшая фотокарточка", "Маскирует игрока случайным образом#Приводит врагов в замешательство#Позволяет открыть Странную дверь"}, -- Faded Polaroid [80] = {"80", "Черное перо", "↑ +0.5 к урону за каждый имеющийся Дьявольский артефакт"}, -- Black Feather [92] = {"92", "Треснувшая корона", "↑ Увеличение характеристик ваших предметов на 20% эффективнее"}, -- Cracked Crown - [96] = {"96", "Червь Уроборос", "Слезы летят по огромной дугообразной траектории#↑ +1.5 дальность стрельбы"}, -- Ouroboros Worm + [96] = {"96", "Червь Уроборос", "Слезы летят по огромной дугообразной траектории#↑ +0.4 к скорострельности#↑ +1.5 к дальности#Дает спектральные слезы#Шанс самонаводящейся слезы"}, -- Ouroboros Worm [101] = {"101", "Тусклая лампочка", "!!! Когда ваш активный предмет полностью разряжен:#↑ +1.5 к урону#↑ +0.5 к скорости#↑ +1.5 к дальности#↑ +0.5 к скорострельности#↑ +0.3 к скорости слезы#↑ +2 к удаче"}, [110] = {"110", "Серебряный доллар", " {{Shop}} Магазины появятся в Утробе и Трупе"}, [111] = {"111", "Кровавая корона", " {{TreasureRoom}} Комнаты Сокровищ появятся в Утробе и Трупе"}, -- Bloody Crown @@ -831,7 +831,7 @@ local repPills={ [48] = {"47", "- Скорость слезы", "↓ -0.15 к скорости полёта слезы"}, -- Shot Speed Down [49] = {"48", "+ Скорость слезы", "↑ +0.15 к скорости полёта слезы"}, -- Shot Speed Up [50] = {"49", "Экспериментальная пилюля", "↑ Повышает 1 случайную характеристику#↓ Понижает 1 случайную характеристику#Если есть {{Collectible654}} Фальшивая или обычная {{Collectible75}} Докторская степень, то повышения / понижения характеристики не будет"}, -- Experimental Pill - [9999] = {"", "Золотая пилюля", "Эффект случайной пилюли#Исчезает после нескольких использований"}, -- golden Pill + [9999] = {"", "Золотая пилюля", "Эффект случайной пилюли#Исчезает после нескольких использований"}, -- Golden Pill } EID:updateDescriptionsViaTable(repPills, EID.descriptions["ru"].pills) @@ -886,7 +886,7 @@ EID.descriptions["ru"].horsepills={ {"47", "- Скорость слезы", "↓ -0.3 к скорости полёта слезы"}, {"48", "+ Скорость слезы", "↑ +0.3 к скорости полёта слезы"}, {"49", "Экспериментальная пилюля", "↑ Дважды повышает 1 случайную характеристику#↓ Дважды понижает 1 случайную характеристику#Если есть {{Collectible654}} Фальшивая или обычная {{Collectible75}} Докторская степень, то повышения / понижения характеристики не будет"}, - [9999] = {"", "Золотая пилюля", "Эффект случайной лошадиной пилюли#Исчезает после нескольких использований"}, -- golden Pill + [9999] = {"", "Золотая пилюля", "Эффект случайной лошадиной пилюли#Исчезает после нескольких использований"}, -- Golden Pill } EID.descriptions["ru"].CraftingBagContent = "Мешок:" @@ -894,9 +894,12 @@ EID.descriptions["ru"].CraftingRoomContent = "Комната:" EID.descriptions["ru"].CraftingFloorContent = "Этаж:" EID.descriptions["ru"].CraftingBagQuality = "Качество в мешке:" EID.descriptions["ru"].CraftingBestQuality = "Лучшее качество:" +EID.descriptions["ru"].CraftingHideKey = "Спрятать:" +EID.descriptions["ru"].CraftingPreviewKey = "Показать:" EID.descriptions["ru"].CraftingResults = "Результаты:#(Листать: {{CONFIG_BoC_Toggle}} + {{ButtonY}} {{ButtonA}})" EID.descriptions["ru"].CraftingBagModError = "!!! {{ColorRed}}ОШИБКА:#{{ColorRed}}Эта функция на данный момент не поддерживается с установленными модами" EID.descriptions["ru"].AchievementWarningTitle = "{{ColorYellow}}!!! ВНИМАНИЕ !!!" -EID.descriptions["ru"].AchievementWarningText = "Достижения отключены!#Чтобы включить прогресс и достижения, вам сначала нужно убить Маму (Глубины II) без включенных модов#(Если вы уже убили Маму, то это сообщение баг и вы можете его игнорировать)" -EID.descriptions["ru"].OutdatedModWarningText = "Установлен устаревший мод, который уменьшает количество предметов! Это может привести к вылетам, особенно в зоне Второй части ножа!#Пожалуйста, удалите мод с устаревшим файлом resources/items.xml" +EID.descriptions["ru"].AchievementWarningText = "Достижения отключены!#Чтобы включить прогресс и достижения, вам сначала нужно убить Маму (Глубины II) без включенных модов#(Если вы уже убили Маму, то это сообщение баг и вы можете его игнорировать)#(Это предупреждение можно выключить в конфиге)" +EID.descriptions["ru"].OldGameVersionWarningText = "Ваша версия Repentance не обновлена!#Только самая последняя версия официально поддерживается#(Это предупреждение можно выключить в конфиге)" +EID.descriptions["ru"].ModdedRecipesWarningText = "Предметы из модов могут сделать расчёт крафтов неточным!#Используйте режим отображения \"No Recipes\" или отключите отображение Крафт-Мешка, если ваши рецепты неверны#(Это предупреждение можно выключить в конфиге)" From 7e8d818ba4c4dee08bdedaabb0fe47da5b69b5a0 Mon Sep 17 00:00:00 2001 From: kochetov2000 <67761691+kochetov2000@users.noreply.github.com> Date: Sat, 4 Dec 2021 16:12:30 +0300 Subject: [PATCH 02/16] Edit EID.Config["Scale"] on EID.Scale --- eid_api.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eid_api.lua b/eid_api.lua index 5659864d..31b947a5 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -591,7 +591,7 @@ function EID:filterIconMarkup(text, textPosX, textPosY) for word in string.gmatch(text, "{{.-}}") do local textposition = string.find(text, word) local lookup = EID:getIcon(word) - local preceedingTextWidth = EID:getStrWidth(string.sub(text, 0, textposition - 1)) * EID.Config["Scale"] + local preceedingTextWidth = EID:getStrWidth(string.sub(text, 0, textposition - 1)) * EID.Scale table.insert(spriteTable, {lookup, preceedingTextWidth}) text = string.gsub(text, word, EID:generatePlaceholderString(lookup[3]), 1) end @@ -612,13 +612,13 @@ function EID:renderInlineIcons(spriteTable, posX, posY) else spriteObj:Update() end - EID:renderIcon(spriteObj, posX + sprite[2] + Xoffset * EID.Config["Scale"], posY + Yoffset * EID.Config["Scale"]) + EID:renderIcon(spriteObj, posX + sprite[2] + Xoffset * EID.Scale, posY + Yoffset * EID.Scale) end end -- helper function to render Icons in specific EID settins function EID:renderIcon(spriteObj, posX, posY) - spriteObj.Scale = Vector(EID.Config["Scale"], EID.Config["Scale"]) + spriteObj.Scale = Vector(EID.Scale, EID.Scale) spriteObj.Color = Color(1, 1, 1, EID.Config["Transparency"], 0, 0, 0) spriteObj:Render(Vector(posX, posY), nullVector, nullVector) end @@ -664,7 +664,7 @@ function EID:filterColorMarkup(text, baseKColor) local lookup, isColor = EID:getColor(word, lastColor) if isColor then local preceedingText = string.sub(text, lastPosition, textposition - 1) - local preceedingTextWidth = EID:getStrWidth(preceedingText) * EID.Config["Scale"] + local preceedingTextWidth = EID:getStrWidth(preceedingText) * EID.Scale lastPosition = textposition table.insert(textPartsTable, {preceedingText, lastColor, preceedingTextWidth}) lastColor = lookup From 869fb45690b3874db254e2b2ced4d0519dc44cfa Mon Sep 17 00:00:00 2001 From: kochetov2000 <67761691+kochetov2000@users.noreply.github.com> Date: Sat, 4 Dec 2021 16:13:37 +0300 Subject: [PATCH 03/16] Add LocalMode and LocalScale settings --- eid_config.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/eid_config.lua b/eid_config.lua index 18e3557e..cf751cb8 100644 --- a/eid_config.lua +++ b/eid_config.lua @@ -59,6 +59,12 @@ EID.UserConfig = { -- Set Y Position (Height) of the descriptiontext -- Default = 45 ["YPosition"] = 45, + -- Sets the local rendering mode of the description text below currently inspected object + -- Default = false + ["LocalMode"] = false, + -- Change Size of the info boxes for LocalMode. Range: [0,...,1] + -- Default = 0.5 + ["LocalScale"] = 0.5, -- Set the distance to an item in which informations will be displayed (in Tiles) -- Default = 5 ["MaxDistance"] = 5, @@ -85,8 +91,7 @@ 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 check if the save game has achievements unlocked -- Default = false ["DisableAchievementCheck"] = false, @@ -306,6 +311,8 @@ EID.DefaultConfig = { ["HUDOffset"] = 10, ["XPosition"] = 60, ["YPosition"] = 45, + ["LocalMode"] = true, + ["LocalScale"] = 0.5, ["MaxDistance"] = 5, ["Indicator"] = "none", ["HideKey"] = Keyboard.KEY_F2, From a909826fd3352970f94cf56af1f72d1e06e50c3c Mon Sep 17 00:00:00 2001 From: kochetov2000 <67761691+kochetov2000@users.noreply.github.com> Date: Sat, 4 Dec 2021 16:19:37 +0300 Subject: [PATCH 04/16] Edit EID.Config["Scale"] on EID.Scale --- eid_debugging.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eid_debugging.lua b/eid_debugging.lua index 684403ae..8a6f26de 100644 --- a/eid_debugging.lua +++ b/eid_debugging.lua @@ -122,7 +122,7 @@ local function onDebugRender(t) for i, v in ipairs(charsToDebug) do local pos = EID.getTextPosition() + Vector(-5, - 15 + ((i - 1) * 14)) - EID:renderString(v, pos, Vector(EID.Config["Scale"], EID.Config["Scale"]), KColor(1, 1, 1, 1, 0, 0, 0)) + EID:renderString(v, pos, Vector(EID.Scale, EID.Scale), KColor(1, 1, 1, 1, 0, 0, 0)) if not showDebugChars then break @@ -130,3 +130,4 @@ local function onDebugRender(t) end end EID:AddCallback(ModCallbacks.MC_POST_RENDER, onDebugRender) + From c5585d5caa8ff6e3844038fb93d225eebf5120f3 Mon Sep 17 00:00:00 2001 From: kochetov2000 <67761691+kochetov2000@users.noreply.github.com> Date: Sat, 4 Dec 2021 16:20:18 +0300 Subject: [PATCH 05/16] Update main.lua --- main.lua | 112 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 46 deletions(-) diff --git a/main.lua b/main.lua index 3408214c..82c770bb 100644 --- a/main.lua +++ b/main.lua @@ -18,6 +18,7 @@ EID.player = nil EID.PositionModifiers = {} EID.DescModifiers = {} EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"]) +EID.Scale = EID.Config["Scale"] EID.isDisplaying = false EID.isDisplayingPermanent = false EID.permanentDisplayTextObj = nil @@ -216,7 +217,7 @@ end ---------------------------Printing Functions------------------------------ function EID:printDescription(desc) - local textScale = Vector(EID.Config["Scale"], EID.Config["Scale"]) + local textScale = Vector(EID.Scale, EID.Scale) local renderPos = EID:getTextPosition() local offsetX = 0 if EID.Config["ShowItemIcon"] then @@ -240,7 +241,7 @@ function EID:printDescription(desc) offsetX = offsetX + 14 EID:renderString( "{{" .. iconType .. subType .. "}}", - renderPos + (Vector(-3, -4) * EID.Config["Scale"]), + renderPos + (Vector(-3, -4) * EID.Scale), textScale, EID:getNameColor() ) @@ -253,11 +254,11 @@ function EID:printDescription(desc) end if EID.Config["ShowItemType"] and (itemType == 3 or itemType == 4) then local offsetY = 2 - if EID.Config["Scale"] < 1 then + if EID.Scale < 1 then offsetY = -1 end EID.IconSprite:Play(EID.ItemTypeAnm2Names[itemType]) - EID:renderIcon(EID.IconSprite, renderPos.X + offsetX * EID.Config["Scale"], renderPos.Y + offsetY * EID.Config["Scale"]) + EID:renderIcon(EID.IconSprite, renderPos.X + offsetX * EID.Scale, renderPos.Y + offsetY * EID.Scale) if itemType == 3 then -- Display Charge offsetX = offsetX + 1 @@ -270,14 +271,14 @@ function EID:printDescription(desc) else EID.InlineIconSprite2:SetFrame("numbers", curItemConfig.MaxCharges) end - EID:renderIcon(EID.InlineIconSprite2, renderPos.X + offsetX * EID.Config["Scale"], renderPos.Y + offsetY * EID.Config["Scale"]) + EID:renderIcon(EID.InlineIconSprite2, renderPos.X + offsetX * EID.Scale, renderPos.Y + offsetY * EID.Scale) offsetX = offsetX + 8 elseif itemType == 4 then -- familiar offsetX = offsetX + 8 end if not EID.Config["ShowItemName"] then - renderPos.Y = renderPos.Y + EID.lineHeight * EID.Config["Scale"] + renderPos.Y = renderPos.Y + EID.lineHeight * EID.Scale end end --Display Itemname @@ -300,12 +301,12 @@ function EID:printDescription(desc) end EID:renderString( curName, - renderPos + (Vector(offsetX, -3) * EID.Config["Scale"]), + renderPos + (Vector(offsetX, -3) * EID.Scale), textScale, EID:getNameColor() ) - renderPos.Y = renderPos.Y + EID.lineHeight * EID.Config["Scale"] + renderPos.Y = renderPos.Y + EID.lineHeight * EID.Scale end --Display Transformation @@ -324,13 +325,13 @@ function EID:printDescription(desc) local textOffsetY = math.min(0, (iconHeight - 9)) / 4 EID:renderString( transformationName, - renderPos + (Vector(iconWidth + 4, textOffsetY)* EID.Config["Scale"]), + renderPos + (Vector(iconWidth + 4, textOffsetY)* EID.Scale), textScale, EID:getTransformationColor() ) end if (EID.Config["TransformationIcons"] or EID.Config["TransformationText"]) then - renderPos.Y = renderPos.Y + transformLineHeight * EID.Config["Scale"] + renderPos.Y = renderPos.Y + transformLineHeight * EID.Scale end end end @@ -339,7 +340,7 @@ end function EID:printBulletPoints(description, renderPos) local textboxWidth = tonumber(EID.Config["TextboxWidth"]) - local textScale = Vector(EID.Config["Scale"], EID.Config["Scale"]) + local textScale = Vector(EID.Scale, EID.Scale) description = EID:replaceShortMarkupStrings(description) for line in string.gmatch(description, "([^#]+)") do @@ -351,13 +352,13 @@ function EID:printBulletPoints(description, renderPos) local bpIcon = EID:handleBulletpointIcon(lineToPrint) if EID:getIcon(bpIcon) ~= EID.InlineIcons["ERROR"] then lineToPrint = string.gsub(lineToPrint, bpIcon .. " ", "", 1) - textColor = EID:renderString(bpIcon, renderPos + Vector(-3 * EID.Config["Scale"], 0), textScale , textColor) + textColor = EID:renderString(bpIcon, renderPos + Vector(-3 * EID.Scale, 0), textScale , textColor) else textColor = EID:renderString(bpIcon, renderPos, textScale , textColor) end end - textColor = EID:renderString(lineToPrint, renderPos + Vector(12 * EID.Config["Scale"], 0), textScale, textColor) - renderPos.Y = renderPos.Y + EID.lineHeight * EID.Config["Scale"] + textColor = EID:renderString(lineToPrint, renderPos + Vector(12 * EID.Scale, 0), textScale, textColor) + renderPos.Y = renderPos.Y + EID.lineHeight * EID.Scale end end end @@ -376,7 +377,7 @@ EID:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, EID.onNewRoom) function EID:renderQuestionMark() EID.IconSprite:Play("CurseOfBlind") local pos = EID:getTextPosition() - EID:renderIcon(EID.IconSprite, pos.X + 5 * EID.Config["Scale"], pos.Y + 5 * EID.Config["Scale"]) + EID:renderIcon(EID.IconSprite, pos.X + 5 * EID.Scale, pos.Y + 5 * EID.Scale) end function EID:renderIndicator(entity) @@ -436,6 +437,34 @@ function EID:renderIndicator(entity) end end +function EID:ScaleValue(entity) + if entity.Variant == EffectVariant.DICE_FLOOR then + EID.Scale = EID.Config["Scale"] + EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"]) + elseif EID.Config["LocalMode"] then + EID.Scale = EID.Config["LocalScale"] + end +end + +function EID:PositionLocalMode(entity) + if EID.Config["LocalMode"] then + EID:alterTextPos(Isaac.WorldToScreen(entity.Position - Vector(35,-20))) + if REPENTANCE then + if isMirrorRoom then + EID:alterTextPos(Isaac.WorldToScreen(entity.Position - Vector(-35,-20))) + local screenCenter = EID:getScreenSize()/2 + EID.UsedPosition.X = EID.UsedPosition.X - (EID.UsedPosition-screenCenter).X * 2 + end + end + if entity:ToPickup() and entity:ToPickup():IsShopItem() then + EID:alterTextPos(Isaac.WorldToScreen(entity.Position - Vector(35,-40))) + end + else + EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"]) + EID.Scale = EID.Config["Scale"] + end +end + function EID:renderEntity(entity, sprite, position) if entity.Type == 5 and entity.Variant == 100 then sprite:RenderLayer(1, position, nullVector, nullVector) @@ -555,36 +584,19 @@ EID:AddCallback(ModCallbacks.MC_POST_UPDATE, EID.onGameUpdate) local hasShownAchievementWarning = false local function renderAchievementInfo() - if REPENTANCE and not EID.Config.DisableAchievementCheck 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 - elseif EID.player:HasCollectible(710) and EID:DetectModdedItems() and EID.Config.DisplayBagOfCrafting ~= "never" and not EID.Config.BagOfCraftingSimplifiedMode 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 - else - -- Achievements Locked Check (do we have Cube of Meat or Book of Revelations unlocked?) - local characterID = Game():GetPlayer(0):GetPlayerType() - --ID 21 = Tainted Isaac. Tainted characters have definitely beaten Mom! (Fixes Tainted Lost's item pools ruining this check) - if characterID < 21 and game.Challenge == 0 then - local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS) - if not hasBookOfRevelationsUnlocked then - local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT) - if not hasCubeOfMeatUnlocked then - local demoDescObj = EID:getDescriptionObj(-999, -1, 1) - demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or "" - demoDescObj.Description = EID:getDescriptionEntry("AchievementWarningText") or "" - EID:displayPermanentText(demoDescObj) - hasShownAchievementWarning = true - end + if REPENTANCE and not EID.Config.DisableAchievementCheck and game:GetFrameCount() < 10*30 and game.Challenge == 0 then + local characterID = Game():GetPlayer(0):GetPlayerType() + --ID 21 = Tainted Isaac. Tainted characters have definitely beaten Mom! (Fixes Tainted Lost's item pools ruining this check) + if characterID < 21 then + local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS) + if not hasBookOfRevelationsUnlocked then + local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT) + if not hasCubeOfMeatUnlocked then + local demoDescObj = EID:getDescriptionObj(-999, -1, 1) + demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or "" + demoDescObj.Description = EID:getDescriptionEntry("AchievementWarningText") or "" + EID:displayPermanentText(demoDescObj) + hasShownAchievementWarning = true end end end @@ -689,6 +701,8 @@ local function onRender(t) 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["Scale"] EID:printDescription(sacrificeDesc) end return @@ -703,6 +717,11 @@ local function onRender(t) --Handle Indicators EID:renderIndicator(closest) + --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") @@ -784,7 +803,7 @@ local function onRender(t) EID:renderString( "{{Pill"..pillColor.."}} "..EID:getDescriptionEntry("unidentifiedPill"), EID:getTextPosition(), - Vector(EID.Config["Scale"], EID.Config["Scale"]), + Vector(EID.Scale, EID.Scale), EID:getErrorColor() ) end @@ -840,6 +859,7 @@ if EID.MCMLoaded or REPENTANCE then end EID.isHidden = EID.Config["InitiallyHidden"] EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"]) + EID.Scale = EID.Config["Scale"] EID:loadFont(EID.modPath .. "resources/font/eid_"..EID.Config["FontType"]..".fnt") if REPENTANCE then EID:addTextPosModifier("HudOffset", Vector(((Options.HUDOffset * 10) * 2) - 20, (Options.HUDOffset * 10) - 10)) From a476328de2910e4aafd8921ba81a4c39de4e4473 Mon Sep 17 00:00:00 2001 From: kochetov2000 <67761691+kochetov2000@users.noreply.github.com> Date: Sat, 4 Dec 2021 16:21:35 +0300 Subject: [PATCH 06/16] Add LocalMode and Scale desc Room and Pickup --- mod_config_menu.lua | 102 +++++++++++++++++++++++++++++++++----------- 1 file changed, 76 insertions(+), 26 deletions(-) diff --git a/mod_config_menu.lua b/mod_config_menu.lua index 58304d09..8dd2698f 100644 --- a/mod_config_menu.lua +++ b/mod_config_menu.lua @@ -32,7 +32,7 @@ function EID:renderMCMDummyDescription() if hudOffset == nil and ScreenHelper then hudOffset = ScreenHelper.GetOffset() end - if REPENTANCE and Options then + if REPENTANCE then hudOffset = (Options.HUDOffset * 10) end EID.Config["HUDOffset"] = hudOffset @@ -285,29 +285,6 @@ if MCMLoaded 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"} - } - ) - -- Disable on Curse MCM.AddSetting( "EID", @@ -460,6 +437,29 @@ if MCMLoaded then Info = {"Distance to the object until descriptions are displayed."} } ) + + -- disable achievements + 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 "Achievement warning: " .. onOff + end, + OnChange = function(currentBool) + EID.Config["DisableAchievementCheck"] = currentBool + end, + Info = {"Use this to turn off the achievement warning"} + } + ) --------------------------------------------------------------------------- ---------------------------------Display----------------------------------- @@ -869,6 +869,29 @@ if MCMLoaded then end } ) + + -- LOCAL MODE + MCM.AddSetting( + "EID", + "Visuals", + { + Type = ModConfigMenu.OptionType.BOOLEAN, + CurrentSetting = function() + return EID.Config["LocalMode"] + end, + Display = function() + local onOff = "False" + if EID.Config["LocalMode"] then + onOff = "True" + end + return "Local Mode: " .. onOff + end, + OnChange = function(currentBool) + EID.Config["LocalMode"] = currentBool + end, + Info = {"Sets the local rendering mode of the description text below currently inspected object"} + } + ) -- SCALE local textScales = {0.5, 0.75, 1, 1.25, 1.5, 2} MCM.AddSetting( @@ -882,7 +905,11 @@ if MCMLoaded then Minimum = 1, Maximum = 6, Display = function() - return "Text Size: " .. EID.Config["Scale"] + if EID.Config["LocalMode"] then + return "Text Size (Pickup Description): " .. EID.Config["LocalScale"] + else + return "Text Size (All Description): " .. EID.Config["Scale"] + end end, OnChange = function(currentNum) EID.Config["Scale"] = textScales[currentNum] @@ -890,7 +917,30 @@ if MCMLoaded then Info = {"Change text size. CAN BE HARD TO READ IN SOME SETTINGS!"} } ) - + local textScales = {0.5, 0.75, 1, 1.25, 1.5, 2} + MCM.AddSetting( + "EID", + "Visuals", + { + Type = ModConfigMenu.OptionType.NUMBER, + CurrentSetting = function() + return AnIndexOf(textScales, EID.Config["Scale"]) + end, + Minimum = 1, + Maximum = 6, + Display = function() + if EID.Config["LocalMode"] then + return "Text Size (Room Description): " .. EID.Config["Scale"] + else + return "" + end + end, + OnChange = function(currentNum) + EID.Config["Scale"] = textScales[currentNum] + end, + Info = {"Change text size. CAN BE HARD TO READ IN SOME SETTINGS!"} + } + ) -- 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( From 1c8ca8fd77f38b110492f634b9de1e93470977d4 Mon Sep 17 00:00:00 2001 From: kochetov2000 <67761691+kochetov2000@users.noreply.github.com> Date: Sat, 4 Dec 2021 16:33:09 +0300 Subject: [PATCH 07/16] Add LocalMode and LocalScal settings --- eid_config.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eid_config.lua b/eid_config.lua index cf751cb8..07108dc2 100644 --- a/eid_config.lua +++ b/eid_config.lua @@ -91,7 +91,8 @@ EID.UserConfig = { -- Toggle obstruction based hiding, when the player has flight -- Default = true ["DisableObstructionOnFlight"] = true, - -- If set to true, the mod will no longer check if the save game has achievements unlocked + -- 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 -- Default = false ["DisableAchievementCheck"] = false, From 25e6de1bef22d4f647d3f4736a5280fd618adad0 Mon Sep 17 00:00:00 2001 From: kochetov2000 <67761691+kochetov2000@users.noreply.github.com> Date: Sat, 4 Dec 2021 16:36:00 +0300 Subject: [PATCH 08/16] Update main.lua --- main.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/main.lua b/main.lua index 82c770bb..a1e05053 100644 --- a/main.lua +++ b/main.lua @@ -585,6 +585,22 @@ local hasShownAchievementWarning = false local function renderAchievementInfo() if REPENTANCE and not EID.Config.DisableAchievementCheck and game:GetFrameCount() < 10*30 and game.Challenge == 0 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 + elseif EID.player:HasCollectible(710) and EID:DetectModdedItems() and EID.Config.DisplayBagOfCrafting ~= "never" and not EID.Config.BagOfCraftingSimplifiedMode 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 + else + -- Achievements Locked Check (do we have Cube of Meat or Book of Revelations unlocked?) local characterID = Game():GetPlayer(0):GetPlayerType() --ID 21 = Tainted Isaac. Tainted characters have definitely beaten Mom! (Fixes Tainted Lost's item pools ruining this check) if characterID < 21 then From c08bf6d5819061920690972a04335c6c5b2a0a5b Mon Sep 17 00:00:00 2001 From: kochetov2000 <67761691+kochetov2000@users.noreply.github.com> Date: Sat, 4 Dec 2021 16:41:17 +0300 Subject: [PATCH 09/16] Add LocalMode and Scale desc Room and Pickup --- mod_config_menu.lua | 72 ++++++++++++++++++++++++++++++--------------- 1 file changed, 48 insertions(+), 24 deletions(-) diff --git a/mod_config_menu.lua b/mod_config_menu.lua index 8dd2698f..da2a6458 100644 --- a/mod_config_menu.lua +++ b/mod_config_menu.lua @@ -32,7 +32,7 @@ function EID:renderMCMDummyDescription() if hudOffset == nil and ScreenHelper then hudOffset = ScreenHelper.GetOffset() end - if REPENTANCE then + if REPENTANCE and Options then hudOffset = (Options.HUDOffset * 10) end EID.Config["HUDOffset"] = hudOffset @@ -285,6 +285,29 @@ if MCMLoaded 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"} + } + ) + -- Disable on Curse MCM.AddSetting( "EID", @@ -437,29 +460,29 @@ if MCMLoaded then Info = {"Distance to the object until descriptions are displayed."} } ) - - -- disable achievements - 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 "Achievement warning: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisableAchievementCheck"] = currentBool - end, - Info = {"Use this to turn off the achievement warning"} - } - ) + + + + + + + + + + + + + + + + + + + + + + + --------------------------------------------------------------------------- ---------------------------------Display----------------------------------- @@ -1429,3 +1452,4 @@ if MCMLoaded then } ) end + From b8e47b3860da758e51189f1e375cfce90702154f Mon Sep 17 00:00:00 2001 From: kochetov2000 <67761691+kochetov2000@users.noreply.github.com> Date: Sat, 4 Dec 2021 16:42:13 +0300 Subject: [PATCH 10/16] Update mod_config_menu.lua --- mod_config_menu.lua | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/mod_config_menu.lua b/mod_config_menu.lua index da2a6458..5d288d94 100644 --- a/mod_config_menu.lua +++ b/mod_config_menu.lua @@ -460,29 +460,6 @@ if MCMLoaded then Info = {"Distance to the object until descriptions are displayed."} } ) - - - - - - - - - - - - - - - - - - - - - - - --------------------------------------------------------------------------- ---------------------------------Display----------------------------------- @@ -914,7 +891,6 @@ if MCMLoaded then end, Info = {"Sets the local rendering mode of the description text below currently inspected object"} } - ) -- SCALE local textScales = {0.5, 0.75, 1, 1.25, 1.5, 2} MCM.AddSetting( @@ -932,7 +908,6 @@ if MCMLoaded then return "Text Size (Pickup Description): " .. EID.Config["LocalScale"] else return "Text Size (All Description): " .. EID.Config["Scale"] - end end, OnChange = function(currentNum) EID.Config["Scale"] = textScales[currentNum] @@ -1452,4 +1427,3 @@ if MCMLoaded then } ) end - From cbe483e0282ce727edd5d7f3306305261221109a Mon Sep 17 00:00:00 2001 From: kochetov2000 <67761691+kochetov2000@users.noreply.github.com> Date: Sat, 4 Dec 2021 16:46:41 +0300 Subject: [PATCH 11/16] Update main.lua --- main.lua | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/main.lua b/main.lua index a1e05053..b0fa6966 100644 --- a/main.lua +++ b/main.lua @@ -584,8 +584,8 @@ EID:AddCallback(ModCallbacks.MC_POST_UPDATE, EID.onGameUpdate) local hasShownAchievementWarning = false local function renderAchievementInfo() - if REPENTANCE and not EID.Config.DisableAchievementCheck and game:GetFrameCount() < 10*30 and game.Challenge == 0 then - -- Old Repentance version check; update this to check for the existence of the newest mod API function EID uses + if REPENTANCE and not EID.Config.DisableAchievementCheck 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) @@ -601,18 +601,19 @@ local function renderAchievementInfo() hasShownAchievementWarning = true else -- Achievements Locked Check (do we have Cube of Meat or Book of Revelations unlocked?) - local characterID = Game():GetPlayer(0):GetPlayerType() - --ID 21 = Tainted Isaac. Tainted characters have definitely beaten Mom! (Fixes Tainted Lost's item pools ruining this check) - if characterID < 21 then - local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS) - if not hasBookOfRevelationsUnlocked then - local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT) - if not hasCubeOfMeatUnlocked then - local demoDescObj = EID:getDescriptionObj(-999, -1, 1) - demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or "" - demoDescObj.Description = EID:getDescriptionEntry("AchievementWarningText") or "" - EID:displayPermanentText(demoDescObj) - hasShownAchievementWarning = true + local characterID = Game():GetPlayer(0):GetPlayerType() + --ID 21 = Tainted Isaac. Tainted characters have definitely beaten Mom! (Fixes Tainted Lost's item pools ruining this check) + if characterID < 21 and game.Challenge == 0 then + local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS) + if not hasBookOfRevelationsUnlocked then + local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT) + if not hasCubeOfMeatUnlocked then + local demoDescObj = EID:getDescriptionObj(-999, -1, 1) + demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or "" + demoDescObj.Description = EID:getDescriptionEntry("AchievementWarningText") or "" + EID:displayPermanentText(demoDescObj) + hasShownAchievementWarning = true + end end end end From 390fdfae1ec428159c17314f2932d75779c88ed4 Mon Sep 17 00:00:00 2001 From: kochetov2000 <67761691+kochetov2000@users.noreply.github.com> Date: Sat, 4 Dec 2021 17:03:11 +0300 Subject: [PATCH 12/16] Update main.lua Upgrade version of mod --- main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.lua b/main.lua index b0fa6966..593479eb 100644 --- a/main.lua +++ b/main.lua @@ -8,8 +8,8 @@ local game = Game() require("eid_config") EID.Config = EID.UserConfig -EID.Config.Version = "3.2" -EID.ModVersion = "3.99" +EID.Config.Version = "3.3" +EID.ModVersion = "4.0" EID.DefaultConfig.Version = EID.Config.Version EID.isHidden = false EID.player = nil From 881c2cfd7b45809bbdc39432524f89bcce474765 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Sat, 4 Dec 2021 22:12:13 +0100 Subject: [PATCH 13/16] Fixed Local mode issues and added right alligned text mode for local mode --- eid_config.lua | 24 ++++++++++----- main.lua | 14 +++++---- mod_config_menu.lua | 72 ++++++++++++++++++++++++++------------------- 3 files changed, 67 insertions(+), 43 deletions(-) diff --git a/eid_config.lua b/eid_config.lua index 07108dc2..d8bac318 100644 --- a/eid_config.lua +++ b/eid_config.lua @@ -59,12 +59,6 @@ EID.UserConfig = { -- Set Y Position (Height) of the descriptiontext -- Default = 45 ["YPosition"] = 45, - -- Sets the local rendering mode of the description text below currently inspected object - -- Default = false - ["LocalMode"] = false, - -- Change Size of the info boxes for LocalMode. Range: [0,...,1] - -- Default = 0.5 - ["LocalScale"] = 0.5, -- Set the distance to an item in which informations will be displayed (in Tiles) -- Default = 5 ["MaxDistance"] = 5, @@ -96,6 +90,21 @@ EID.UserConfig = { -- Default = false ["DisableAchievementCheck"] = false, + -------Display Modes--------- + + -- Sets the display mode of the description text. + -- possible values: default, local + -- "default": text will be displayed in the top-left of the screen. + -- "local": text will be displayed under the described object. + -- Default = "default" + ["DisplayMode"] = "default", + -- Change Size of the info boxes for LocalMode. + -- Default = 0.5 + ["LocalScale"] = 0.5, + -- Changes the position of the text in local mode, relative to the described object to be centered. Set to false to make it left-aligned + -- Default = true + ["LocalModeCentered"] = true, + -------------CURSE------------- -- Disable informations when the floor has curse of the blind ( ? - Items) @@ -312,8 +321,9 @@ EID.DefaultConfig = { ["HUDOffset"] = 10, ["XPosition"] = 60, ["YPosition"] = 45, - ["LocalMode"] = true, + ["DisplayMode"] = "default", ["LocalScale"] = 0.5, + ["LocalModeCentered"] = true, ["MaxDistance"] = 5, ["Indicator"] = "none", ["HideKey"] = Keyboard.KEY_F2, diff --git a/main.lua b/main.lua index 593479eb..cbdbe4a6 100644 --- a/main.lua +++ b/main.lua @@ -9,7 +9,7 @@ local game = Game() require("eid_config") EID.Config = EID.UserConfig EID.Config.Version = "3.3" -EID.ModVersion = "4.0" +EID.ModVersion = "3.100" EID.DefaultConfig.Version = EID.Config.Version EID.isHidden = false EID.player = nil @@ -441,23 +441,25 @@ function EID:ScaleValue(entity) if entity.Variant == EffectVariant.DICE_FLOOR then EID.Scale = EID.Config["Scale"] EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"]) - elseif EID.Config["LocalMode"] then + elseif EID.Config["DisplayMode"] == "local" then EID.Scale = EID.Config["LocalScale"] end end function EID:PositionLocalMode(entity) - if EID.Config["LocalMode"] then - EID:alterTextPos(Isaac.WorldToScreen(entity.Position - Vector(35,-20))) + if EID.Config["DisplayMode"] == "local" then + 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 - Vector(-35,-20))) + 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 end if entity:ToPickup() and entity:ToPickup():IsShopItem() then - EID:alterTextPos(Isaac.WorldToScreen(entity.Position - Vector(35,-40))) + EID:alterTextPos(Isaac.WorldToScreen(entity.Position + textPosOffset)) end else EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"]) diff --git a/mod_config_menu.lua b/mod_config_menu.lua index 5d288d94..81cda46f 100644 --- a/mod_config_menu.lua +++ b/mod_config_menu.lua @@ -870,27 +870,31 @@ if MCMLoaded then } ) - -- LOCAL MODE + -- Display Mode + 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.BOOLEAN, + Type = ModConfigMenu.OptionType.NUMBER, CurrentSetting = function() - return EID.Config["LocalMode"] + return AnIndexOf(displayModes, EID.Config["DisplayMode"]) end, + Minimum = 1, + Maximum = #displayModes, Display = function() - local onOff = "False" - if EID.Config["LocalMode"] then - onOff = "True" - end - return "Local Mode: " .. onOff + return "Display mode: " .. EID.Config["DisplayMode"] end, - OnChange = function(currentBool) - EID.Config["LocalMode"] = currentBool + OnChange = function(currentNum) + EID.Config["DisplayMode"] = displayModes[currentNum] end, - Info = {"Sets the local rendering mode of the description text below currently inspected object"} + Info = function() + return {"Changes display mode of descriptions", displayModeTips[AnIndexOf(displayModes, EID.Config["DisplayMode"])]} + end } + ) + -- SCALE local textScales = {0.5, 0.75, 1, 1.25, 1.5, 2} MCM.AddSetting( @@ -899,46 +903,54 @@ if MCMLoaded then { Type = ModConfigMenu.OptionType.NUMBER, CurrentSetting = function() - return AnIndexOf(textScales, EID.Config["Scale"]) + if EID.Config["DisplayMode"] == "local" then + return AnIndexOf(textScales, EID.Config["LocalScale"]) + else + return AnIndexOf(textScales, EID.Config["Scale"]) + end end, Minimum = 1, Maximum = 6, Display = function() - if EID.Config["LocalMode"] then - return "Text Size (Pickup Description): " .. EID.Config["LocalScale"] + if EID.Config["DisplayMode"] == "local" then + return "Text Size (Local mode): " .. EID.Config["LocalScale"] else - return "Text Size (All Description): " .. EID.Config["Scale"] + return "Text Size: " .. EID.Config["Scale"] + end end, OnChange = function(currentNum) - EID.Config["Scale"] = textScales[currentNum] + if EID.Config["DisplayMode"] == "local" then + EID.Config["LocalScale"] = textScales[currentNum] + else + EID.Config["Scale"] = textScales[currentNum] + end + EID.Scale = textScales[currentNum] end, Info = {"Change text size. CAN BE HARD TO READ IN SOME SETTINGS!"} } ) - local textScales = {0.5, 0.75, 1, 1.25, 1.5, 2} + -- Transparency MCM.AddSetting( "EID", "Visuals", { - Type = ModConfigMenu.OptionType.NUMBER, + Type = ModConfigMenu.OptionType.BOOLEAN, CurrentSetting = function() - return AnIndexOf(textScales, EID.Config["Scale"]) + return EID.Config["LocalModeCentered"] end, - Minimum = 1, - Maximum = 6, Display = function() - if EID.Config["LocalMode"] then - return "Text Size (Room Description): " .. EID.Config["Scale"] - else - return "" + local onOff = "False" + if EID.Config["LocalModeCentered"] then + onOff = "True" end + return "Local mode centered: " .. onOff end, - OnChange = function(currentNum) - EID.Config["Scale"] = textScales[currentNum] - end, - Info = {"Change text size. CAN BE HARD TO READ IN SOME SETTINGS!"} + OnChange = function(currentBool) + EID.Config["LocalModeCentered"] = currentBool + end } - ) + ) + -- 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( From 937b80636f94a6d3070195a7232118059e22be15 Mon Sep 17 00:00:00 2001 From: AutisticGoat <83523192+AutisticGoat@users.noreply.github.com> Date: Sat, 4 Dec 2021 15:36:16 -0700 Subject: [PATCH 14/16] Warning changes and some pills names sorry for what i did with binge eater last time --- descriptions/rep/spa.lua | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/descriptions/rep/spa.lua b/descriptions/rep/spa.lua index 5cfbb81b..af0d8216 100644 --- a/descriptions/rep/spa.lua +++ b/descriptions/rep/spa.lua @@ -594,15 +594,15 @@ EID:updateDescriptionsViaTable(repCards, EID.descriptions["spa"].cards) ---------- Pills ---------- local repPills={ - [4] = {"3", "", "Intercambia el número de bombas por el de llaves#Las llaves y bombas de oro también se intercambian"}, - [12] = {"11", "", "↓ -0,6 de rango"}, - [13] = {"12", "", "↑ +0,75 de rango"}, - [42] = {"41", "", "Te ralentiza a ti y a los enemigos de la habitación"}, - [43] = {"42", "", "Aumenta tu velocidad y la de todos los enemigos de la habitación#Se vuelve a activas tras 30 y 60 segundos"}, + [4] = {"3", "Las bombas son la «clave»", "Intercambia el número de bombas por el de llaves#Las llaves y bombas de oro también se intercambian"}, + [12] = {"11", "- Alcance", "↓ -0,6 de alcance"}, + [13] = {"12", "+ Alcance", "↑ +0,75 de alcance"}, + [42] = {"41", "Tengo sueño...", "Te ralentiza a ti y a los enemigos de la habitación"}, + [43] = {"42", "¡¡¡TENGO MUCHA ENERGÍA!!!", "Aumenta tu velocidad y la de todos los enemigos de la habitación#Se vuelve a activas tras 30 y 60 segundos"}, - [48] = {"47", "", "↓ -0,15 de velocidad de disparo"}, - [49] = {"48", "", "↑ +0,15 de velocidad de disparo"}, - [50] = {"49", "", "↑ Aumenta una estadística aleatoria#↓ Disminuye otra estadística aleatoria#Si tienes PHD no bajará ninguna"}, + [48] = {"47", "- Velocidad de lágrimas", "↓ -0,15 de velocidad de disparo"}, + [49] = {"48", "+ Velocidad de lágrimas", "↑ +0,15 de velocidad de disparo"}, + [50] = {"49", "Píldora experimental", "↑ Aumenta una estadística aleatoria#↓ Disminuye otra estadística aleatoria#Si tienes PHD no bajará ninguna"}, [9999] = {"", "Píldora dorada", "Efecto de píldora de caballo aleatorio#Se destruye tras unos cuantos usos"}, -- golden Pill } EID:updateDescriptionsViaTable(repPills, EID.descriptions["spa"].pills) @@ -669,8 +669,18 @@ EID.descriptions["spa"].CraftingFloorContent = "Piso:" EID.descriptions["spa"].CraftingBagQuality = "Calidad:" EID.descriptions["spa"].CraftingBestQuality = "Mejor Calidad:" +EID.descriptions["spa"].CraftingHideKey = "Oculto:" +EID.descriptions["spa"].CraftingPreviewKey = "Prevista:" + +EID.descriptions["spa"].CraftingResults = "(Desplazar: mantén {{CONFIG_BoC_Toggle}} + {{ButtonY}} {{ButtonA}},#Bloquear: {{ButtonX}}, Refrescar: {{ButtonB}})" + + EID.descriptions["spa"].CraftingResults = "(Desplazar: Mantén {{CONFIG_BoC_Toggle}} + {{ButtonY}} {{ButtonA}},#Bloquear: {{ButtonX}}, Reiniciar: {{ButtonB}})" EID.descriptions["spa"].CraftingBagModError = "!!! {{ColorRed}}ERROR:#{{ColorRed}}El \"Cálculo de Recetas\" actualmente no funciona con mods que añaden objetos!#{{ColorRed}}Por favor desinstala los mods de objetos o desactiva las descripciones de Bag of Crafting en la configuración" EID.descriptions["spa"].AchievementWarningTitle = "{{ColorYellow}}!!! ADVERTENCIA !!!" -EID.descriptions["spa"].AchievementWarningText = "¡Los logros están deshabilitados!#Para poder progresar en el juego, primero debes matar a Mamá (Depths II) sin mods habilitados.#(Si ya derrotaste a Mamá, este mensaje es un bug, ignóralo)" -EID.descriptions["spa"].OutdatedModWarningText = "¡Un mod sin actualizar está reduciendo la cantidad de objetos! Esto puede causar crasheos, especialmente al entrar al area de la Pieza del cuchillo 2!#Por favor desinstala los mods con los archivos resources/items.xml desactualizados" \ No newline at end of file +EID.descriptions["spa"].AchievementWarningText = "¡Los logros están deshabilitados!#Para poder progresar en el juego, primero debes matar a Mamá (Depths II) sin mods habilitados.#(Si ya derrotaste a Mamá, este mensaje es un bug, ignóralo)#(Este aviso puede ser desactivado en la configuración)" +EID.descriptions["spa"].OutdatedModWarningText = "¡Un mod sin actualizar está reduciendo la cantidad de objetos! Esto puede causar crasheos, especialmente al entrar al area de la Pieza del cuchillo 2!#Por favor desinstala los mods con los archivos resources/items.xml desactualizados" + +EID.descriptions["spa"].OldGameVersionWarningText = "Tu versión de Repentance no es la más reciente#La versión más reciente es la única con soporte oficial#(Este aviso puede ser desactivado en la configuración)" + +EID.descriptions["spa"].ModdedRecipesWarningText = "Los objetos modeados pueden provocar cálculos incorrectos#Usa el modo No Recipes o desactiva el cálculo de la Bolsa de trabajo si es que los cálculos son incorrectos#(Este aviso puede ser desactivado en la configuración)" From 87a786ea1e30d3155245ec0215029468906dbee1 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Sun, 5 Dec 2021 01:24:25 +0100 Subject: [PATCH 15/16] Fixed Spanish languagepack unintentional yellow Exclamation mark --- descriptions/rep/spa.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/descriptions/rep/spa.lua b/descriptions/rep/spa.lua index af0d8216..b0828677 100644 --- a/descriptions/rep/spa.lua +++ b/descriptions/rep/spa.lua @@ -598,7 +598,7 @@ local repPills={ [12] = {"11", "- Alcance", "↓ -0,6 de alcance"}, [13] = {"12", "+ Alcance", "↑ +0,75 de alcance"}, [42] = {"41", "Tengo sueño...", "Te ralentiza a ti y a los enemigos de la habitación"}, - [43] = {"42", "¡¡¡TENGO MUCHA ENERGÍA!!!", "Aumenta tu velocidad y la de todos los enemigos de la habitación#Se vuelve a activas tras 30 y 60 segundos"}, + [43] = {"42", "¡¡TENGO MUCHA ENERGÍA!!", "Aumenta tu velocidad y la de todos los enemigos de la habitación#Se vuelve a activas tras 30 y 60 segundos"}, [48] = {"47", "- Velocidad de lágrimas", "↓ -0,15 de velocidad de disparo"}, [49] = {"48", "+ Velocidad de lágrimas", "↑ +0,15 de velocidad de disparo"}, From 6cb646ef3476c1b7712ae3b750e5fceb669ffcec Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Sun, 5 Dec 2021 01:26:15 +0100 Subject: [PATCH 16/16] Added Bag feature to colorize recipe parts that are fulfilled by bag content Improved bag of crafting calculator code quality a bit --- eid_api.lua | 14 +++++++-- eid_bagofcrafting.lua | 72 +++++++++++++++++++++++-------------------- eid_data.lua | 1 + 3 files changed, 52 insertions(+), 35 deletions(-) diff --git a/eid_api.lua b/eid_api.lua index 31b947a5..555ec9a6 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -852,7 +852,7 @@ end -- Result: "3{{Crafting1}}2{{Crafting2}}3{{Crafting3}}" local emptyPickupTable = {} for i=1,29 do emptyPickupTable[i] = 0 end -function EID:tableToCraftingIconsMerged(craftTable) +function EID:tableToCraftingIconsMerged(craftTable, indicateCompleteContent) local sortedList = {table.unpack(craftTable)} local filteredList = {table.unpack(emptyPickupTable)} for _,nr in ipairs(sortedList) do @@ -861,12 +861,22 @@ function EID:tableToCraftingIconsMerged(craftTable) local iconString = "" for nr,count in ipairs(filteredList) do if (count > 0) then - iconString = iconString..count.."{{Crafting"..nr.."}}" + local completedColoring = indicateCompleteContent and EID:bagContaingsItem(nr, count) and "{{ColorBagComplete}}" or "" + iconString = iconString..completedColoring..count.."{{Crafting"..nr.."}}{{CR}}" end end return iconString end +function EID:bagContaingsItem(itemID, itemCount) + local foundCount = 0 + for _, bagItem in ipairs(EID.BagItems) do + if bagItem == itemID then + foundCount = foundCount + 1 + end + end + return foundCount == itemCount +end function EID:handleHUDElement(hudElement) local alteredHudElement = {} diff --git a/eid_bagofcrafting.lua b/eid_bagofcrafting.lua index afe71839..bef639b9 100644 --- a/eid_bagofcrafting.lua +++ b/eid_bagofcrafting.lua @@ -615,6 +615,35 @@ local function calcFloorItems() end end +local function qualitySort(a, b) + if (pickupValues[a+1] == pickupValues[b+1]) then + return a > b + else + return pickupValues[a+1] > pickupValues[b+1] + end +end + +--this combination algorithm was adopted from this Java code: https://stackoverflow.com/a/16256122 +--note that it will run into duplicates, for example if you have eight pennies and a key, it can't tell the difference between +--PPPPPPPK (pennies 1-7) and PPPPPPPK (pennies 2-8) and PPPPPPPK (pennies 1-4,6-8) etc..., I don't know of a way to prevent that +local function combinations(arr, length, startPos, tempResult, randResults, newResults) + local length = length or 8 + local startPos = startPos or 1 + local tempResult = tempResult or {} + if (length == 0) then + local resultString = table.concat(tempResult,",") + if (randResults[resultString] == nil) then + randResults[resultString] = {table.unpack(tempResult)} + newResults[resultString] = {table.unpack(tempResult)} + end + return + end + for i = startPos, #arr-length+1 do + tempResult[8-length+1] = arr[i] + combinations(arr,length-1, i+1, tempResult, randResults, newResults) + end +end + --code from InputHelper in MCM local HotkeyToString = {} for key,num in pairs(Keyboard) do @@ -630,8 +659,8 @@ function EID:handleBagOfCraftingRendering() trackBagActivated() detectBagContentShift() - local tableToCraftingIcons = EID.tableToCraftingIconsMerged - if EID.Config["BagOfCraftingDisplayIcons"] then tableToCraftingIcons = EID.tableToCraftingIconsFull end + local tableToCraftingIconsFunc = EID.tableToCraftingIconsMerged + if EID.Config["BagOfCraftingDisplayIcons"] then tableToCraftingIconsFunc = EID.tableToCraftingIconsFull end --prevent our hotkeys from triggering as they're set if not ModConfigMenu or not ModConfigMenu.IsVisible then @@ -731,13 +760,6 @@ function EID:handleBagOfCraftingRendering() return false end - local function qualitySort(a, b) - if (pickupValues[a+1] == pickupValues[b+1]) then - return a > b - else - return pickupValues[a+1] > pickupValues[b+1] - end - end --sort by ingredient quality table.sort(itemQuery, qualitySort) @@ -787,7 +809,7 @@ function EID:handleBagOfCraftingRendering() local bestQualityDesc = EID:getDescriptionEntry("CraftingBestQuality") if (#EID.BagItems > 0) then EID:appendToDescription(customDescObj, bagQualityDesc .. " " .. bagQuality .. "#" .. bagResult .. "#") end - if (bestQuality > bagQuality) then EID:appendToDescription(customDescObj, bestQualityDesc .. " " .. bestQuality .. "#{{Blank}} " .. tableToCraftingIcons(self,mostValuableSimp) .. "#" .. bestResult .. "#") end + if (bestQuality > bagQuality) then EID:appendToDescription(customDescObj, bestQualityDesc .. " " .. bestQuality .. "#{{Blank}} " .. tableToCraftingIconsFunc(self, mostValuableSimp, true) .. "#" .. bestResult .. "#") end EID:printDescription(customDescObj) return true @@ -824,27 +846,8 @@ function EID:handleBagOfCraftingRendering() mostValuable[i] = itemQuery[i] end end - --this combination algorithm was adopted from this Java code: https://stackoverflow.com/a/16256122 - --note that it will run into duplicates, for example if you have eight pennies and a key, it can't tell the difference between - --PPPPPPPK (pennies 1-7) and PPPPPPPK (pennies 2-8) and PPPPPPPK (pennies 1-4,6-8) etc..., I don't know of a way to prevent that - local function combinations(arr, length, startPos, tempResult) - local length = length or 8 - local startPos = startPos or 1 - local tempResult = tempResult or {} - if (length == 0) then - local resultString = table.concat(tempResult,",") - if (randResults[resultString] == nil) then - randResults[resultString] = {table.unpack(tempResult)} - newResults[resultString] = {table.unpack(tempResult)} - end - return - end - for i = startPos, #arr-length+1 do - tempResult[8-length+1] = arr[i] - combinations(arr,length-1,i+1,tempResult) - end - end - if (#mostValuable >= 8) then combinations(mostValuable) end + + if (#mostValuable >= 8) then combinations(mostValuable, nil, nil, nil, randResults, newResults) end --do random pulls for some more recipe choices if (not skipRandom) then @@ -924,16 +927,18 @@ function EID:handleBagOfCraftingRendering() EID:appendToDescription(customDescObj, "!!! " .. hotkeyString .. "#") end + -- Bag content display if #EID.BagItems >0 then if #EID.BagItems >= 8 then local recipe = EID:calculateBagOfCrafting(EID.BagItems) EID:appendToDescription(customDescObj, "{{Collectible"..recipe.."}} ") end - local bagDesc = EID:getDescriptionEntry("CraftingBagContent").."(Beta)" + local bagDesc = EID:getDescriptionEntry("CraftingBagContent") EID:appendToDescription(customDescObj, bagDesc..EID:tableToCraftingIconsMerged(EID.BagItems).."#") --debug the bag order --EID:appendToDescription(customDescObj, EID:tableToCraftingIconsFull(EID.BagItems, false).."#") end + -- Room content display if #roomItems >0 then if #roomItems == 8 then local recipe = EID:calculateBagOfCrafting(roomItems) @@ -942,6 +947,7 @@ function EID:handleBagOfCraftingRendering() local roomDesc = EID:getDescriptionEntry("CraftingRoomContent") EID:appendToDescription(customDescObj, roomDesc..EID:tableToCraftingIconsMerged(roomItems).."#") end + -- Floot content display if #EID.bagOfCraftingFloorQuery >0 and #roomItems ~= #EID.bagOfCraftingFloorQuery then if #EID.bagOfCraftingFloorQuery == 8 then local recipe = EID:calculateBagOfCrafting(EID.bagOfCraftingFloorQuery) @@ -1025,7 +1031,7 @@ function EID:handleBagOfCraftingRendering() if v[3] then customDescObj.Description = customDescObj.Description.." {{Collectible" .. v[3] .. "}} " end end - customDescObj.Description = customDescObj.Description..tableToCraftingIcons(self,v[1]) + customDescObj.Description = customDescObj.Description..tableToCraftingIconsFunc(self, v[1], true) prevItem = v[2] end end diff --git a/eid_data.lua b/eid_data.lua index bd61f09c..c09b1015 100644 --- a/eid_data.lua +++ b/eid_data.lua @@ -307,6 +307,7 @@ EID.InlineColors = { ["ColorPastelBlue"] = KColor(0.3882, 0.5216, 1, 1), ["ColorLavender"] = KColor(0.7451, 0.3686, 1, 1), ["ColorLightOrange"] = KColor(1, 0.6353, 0.3686, 1), + ["ColorBagComplete"] = KColor(0, 1, 0, 0.6), -- Swag Colors -- Rainbow color effect