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\" или отключите отображение Крафт-Мешка, если ваши рецепты неверны#(Это предупреждение можно выключить в конфиге)" diff --git a/descriptions/rep/spa.lua b/descriptions/rep/spa.lua index 5cfbb81b..b0828677 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)" diff --git a/eid_api.lua b/eid_api.lua index b09e8904..2a42295f 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 @@ -865,7 +865,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 @@ -874,12 +874,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 93fa1553..3b7421a2 100644 --- a/eid_bagofcrafting.lua +++ b/eid_bagofcrafting.lua @@ -609,6 +609,26 @@ local function qualitySort(a, b) 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 @@ -674,8 +694,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 local customDescObj = EID:getDescriptionObj(5, 100, 710) customDescObj.Description = "" @@ -740,8 +760,8 @@ function EID:handleBagOfCraftingRendering() local curRoomIndex = Game():GetLevel():GetCurrentRoomDesc().SafeGridIndex - local roomItems = {} local results = {} + local roomItems = {} local pickups = Isaac.FindByType(5, -1, -1, true, false) if EID.bagOfCraftingCurPickupCount ~= #pickups then @@ -804,7 +824,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,mostValuableBag) .. "#" .. bestResult .. "#") end + if (bestQuality > bagQuality) then EID:appendToDescription(customDescObj, bestQualityDesc .. " " .. bestQuality .. "#{{Blank}} " .. tableToCraftingIconsFunc(self,mostValuableBag, true) .. "#" .. bestResult .. "#") end EID:printDescription(customDescObj) return true @@ -841,27 +861,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 @@ -1003,7 +1004,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_config.lua b/eid_config.lua index dbdcb0e9..d67428c0 100644 --- a/eid_config.lua +++ b/eid_config.lua @@ -72,6 +72,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) @@ -293,6 +308,9 @@ EID.DefaultConfig = { ["HUDOffset"] = 10, ["XPosition"] = 60, ["YPosition"] = 45, + ["DisplayMode"] = "default", + ["LocalScale"] = 0.5, + ["LocalModeCentered"] = true, ["MaxDistance"] = 5, ["Indicator"] = "none", ["HideKey"] = Keyboard.KEY_F2, 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 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) + diff --git a/main.lua b/main.lua index 35109459..3f68a9f9 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 = "3.100" EID.DefaultConfig.Version = EID.Config.Version EID.isHidden = false EID.player = nil @@ -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,36 @@ 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["DisplayMode"] == "local" then + EID.Scale = EID.Config["LocalScale"] + end +end + +function EID:PositionLocalMode(entity) + 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 + 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 + textPosOffset)) + 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) @@ -689,6 +720,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 +736,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 +822,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 +878,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)) diff --git a/mod_config_menu.lua b/mod_config_menu.lua index b6810411..c141f2cf 100644 --- a/mod_config_menu.lua +++ b/mod_config_menu.lua @@ -888,6 +888,32 @@ if MCMLoaded then end } ) + + -- 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.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 + } + ) + -- SCALE local textScales = {0.5, 0.75, 1, 1.25, 1.5, 2} MCM.AddSetting( @@ -896,19 +922,53 @@ 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() - return "Text Size: " .. EID.Config["Scale"] + if EID.Config["DisplayMode"] == "local" then + return "Text Size (Local mode): " .. EID.Config["LocalScale"] + else + 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!"} } ) + -- Transparency + 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.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}