Reverted language code changes thruout the mod
- Added EID.DefaultLanguageCode
This commit is contained in:
1 parent
6e15cc3414
commit
d44fa187b7
44 files changed
+157
-154
No files matched your search
+35
-35
@@ -122,10 +122,10 @@ local dynamicSpriteCache = {} -- used to store sprite objects of collectible ico
|
||||
---@param id CollectibleType
|
||||
---@param description string
|
||||
---@param itemName string?
|
||||
---@param language EID_LanguageCode? @Default: "en"
|
||||
---@param language EID_LanguageCode? @Default: "en_us"
|
||||
function EID:addCollectible(id, description, itemName, language)
|
||||
itemName = itemName or nil
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
if id == -1 then
|
||||
EID:WriteErrorMsg("Trying to add collectible description to id = -1, which is not allowed! (Name: "..tostring(itemName).."; Description: "..tostring(description)..")")
|
||||
return
|
||||
@@ -141,10 +141,10 @@ end
|
||||
---@param id TrinketType
|
||||
---@param description string
|
||||
---@param itemName? string
|
||||
---@param language? EID_LanguageCode @Default: "en"
|
||||
---@param language? EID_LanguageCode @Default: "en_us"
|
||||
function EID:addTrinket(id, description, itemName, language)
|
||||
itemName = itemName or nil
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
if id == -1 then
|
||||
EID:WriteErrorMsg("Trying to add trinket description to id = -1, which is not allowed! (Name: "..tostring(itemName).."; Description: "..tostring(description)..")")
|
||||
return
|
||||
@@ -157,10 +157,10 @@ end
|
||||
---@param characterId PlayerType
|
||||
---@param description string
|
||||
---@param playerName? string @Default: "Modded Character"
|
||||
---@param language? EID_LanguageCode @Default: "en"
|
||||
---@param language? EID_LanguageCode @Default: "en_us"
|
||||
function EID:addCharacterInfo(characterId, description, playerName, language)
|
||||
playerName = playerName or "Modded Character"
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
if characterId == -1 then
|
||||
EID:WriteErrorMsg("Trying to add character description to id = -1, which is not allowed! (Name: "..tostring(playerName).."; Description: "..tostring(description)..")")
|
||||
return
|
||||
@@ -173,14 +173,14 @@ end
|
||||
---@param appendText? string | string[] @Text to be appended onto the description. Can be one string, or a table of two strings; one for doubling and one for tripling
|
||||
---@param numbersToMultiply? number | number[] @The number inside the text that should be multiplied. can be one number, or a table of numbers
|
||||
---@param maxMultiplier? number @Is what tripling (Golden+Mom's Box) should multiply the numbers by, normally 3. If it's less than 2, it also applies to doubling
|
||||
---@param language? EID_LanguageCode @Default: "en"
|
||||
---@param language? EID_LanguageCode @Default: "en_us"
|
||||
-- Example: My modded trinket gives +0.5 range and when tripled, adds homing instead of tripling the range boost:
|
||||
--- ```lua
|
||||
--- EID:addGoldenTrinketMetadata(Isaac.GetTrinketIdByName("Cool Trinket"), {"", "Homing tears"}, 0.5, 2)
|
||||
--- ```
|
||||
function EID:addGoldenTrinketMetadata(id, appendText, numbersToMultiply, maxMultiplier, language)
|
||||
maxMultiplier = maxMultiplier or 3
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
|
||||
if appendText == "" then appendText = nil
|
||||
elseif type(appendText) == "string" then appendText = {appendText} end
|
||||
@@ -199,13 +199,13 @@ end
|
||||
---@param appendText? string | string[] @Text to be appended onto the description. Can be one string, or a table of two strings; one for doubling and one for tripling
|
||||
---@param numbersToChange? number | number[] @The number inside the text that gets added towards. can be one number, or a table of numbers
|
||||
---@param additiveValues? number @Table of values that should be added to the number, if its doubled, tripled, or quadrupled
|
||||
---@param language? EID_LanguageCode @Default: "en"
|
||||
---@param language? EID_LanguageCode @Default: "en_us"
|
||||
-- Example: My modded trinket gives +5 range and when tripled, adds homing instead of tripling the range boost:
|
||||
--- ```lua
|
||||
--- EID:addGoldenTrinketMetadataAdditive(Isaac.GetTrinketIdByName("Cool Trinket"), {"", "Homing tears"}, 5, {1,2,3})
|
||||
--- ```
|
||||
function EID:addGoldenTrinketMetadataAdditive(id, appendText, numbersToChange, additiveValues, language)
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
|
||||
if appendText == "" then appendText = nil
|
||||
elseif type(appendText) == "string" then appendText = {appendText} end
|
||||
@@ -235,10 +235,10 @@ end
|
||||
---@param id Card
|
||||
---@param description string
|
||||
---@param itemName? string
|
||||
---@param language? EID_LanguageCode @Default: "en"
|
||||
---@param language? EID_LanguageCode @Default: "en_us"
|
||||
function EID:addCard(id, description, itemName, language)
|
||||
itemName = itemName or nil
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
if id == -1 then
|
||||
EID:WriteErrorMsg("Trying to add card description to id = -1, which is not allowed! (Name: "..tostring(itemName).."; Description: "..tostring(description)..")")
|
||||
return
|
||||
@@ -257,10 +257,10 @@ end
|
||||
---@param id PillEffect
|
||||
---@param description string
|
||||
---@param itemName? string
|
||||
---@param language? EID_LanguageCode @Default: "en"
|
||||
---@param language? EID_LanguageCode @Default: "en_us"
|
||||
function EID:addPill(id, description, itemName, language)
|
||||
itemName = itemName or nil
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
if id == -1 then
|
||||
EID:WriteErrorMsg("Trying to add pill description to id = -1, which is not allowed! (Name: "..tostring(itemName).."; Description: "..tostring(description)..")")
|
||||
return
|
||||
@@ -278,11 +278,11 @@ end
|
||||
---@param id PillEffect
|
||||
---@param description string
|
||||
---@param itemName? string
|
||||
---@param language? EID_LanguageCode @Default: "en"
|
||||
---@param language? EID_LanguageCode @Default: "en_us"
|
||||
function EID:addHorsePill(id, description, itemName, language)
|
||||
if not EID.isRepentance then return end
|
||||
itemName = itemName or nil
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
if id == -1 then
|
||||
EID:WriteErrorMsg("Trying to add horsepill description to id = -1, which is not allowed! (Name: "..tostring(itemName).."; Description: "..tostring(description)..")")
|
||||
return
|
||||
@@ -306,10 +306,10 @@ end
|
||||
---@param characterId PlayerType
|
||||
---@param description string
|
||||
---@param playerName? string
|
||||
---@param language? EID_LanguageCode @Default: "en"
|
||||
---@param language? EID_LanguageCode @Default: "en_us"
|
||||
function EID:addBirthright(characterId, description, playerName, language)
|
||||
playerName = playerName or nil
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
if characterId == -1 then
|
||||
EID:WriteErrorMsg("Trying to add Birthright description to id = -1, which is not allowed! (Name: "..tostring(characterId).."; Description: "..tostring(description)..")")
|
||||
return
|
||||
@@ -321,9 +321,9 @@ end
|
||||
---Creates a new transformation with a given unique name and a display name
|
||||
---@param uniqueName string
|
||||
---@param displayName string
|
||||
---@param language? EID_LanguageCode @Default: "en"
|
||||
---@param language? EID_LanguageCode @Default: "en_us"
|
||||
function EID:createTransformation(uniqueName, displayName, language)
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
if EID.CustomTransformations[uniqueName] == nil then
|
||||
EID.CustomTransformations[uniqueName] = {}
|
||||
end
|
||||
@@ -436,10 +436,10 @@ end
|
||||
---@param subtype? integer @If `nil` or `-1`, it will affect all subtypes of that entity
|
||||
---@param entityName string
|
||||
---@param description string
|
||||
---@param language? EID_LanguageCode @Default: "en"
|
||||
---@param language? EID_LanguageCode @Default: "en_us"
|
||||
function EID:addEntity(id, variant, subtype, entityName, description, language)
|
||||
subtype = subtype or -1
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
if id == EntityType.ENTITY_EFFECT then
|
||||
EID.effectList[variant] = true
|
||||
end
|
||||
@@ -470,13 +470,13 @@ end
|
||||
---This spell should be added with the "Custom Poop API" library to actually appear in-game.
|
||||
---Example:
|
||||
---```lua
|
||||
---EID:addCustomPoopSpell("MYPOOP", "I Made This Poop", "{{PoopSpell1}}", "Can be throwed to deal damage", "en")
|
||||
---EID:addCustomPoopSpell("MYPOOP", "I Made This Poop", "{{PoopSpell1}}", "Can be throwed to deal damage", "en_us")
|
||||
---```
|
||||
---@param token string @The name of the spell in the Custom Poop API code
|
||||
---@param name string @The name of the spell as it should appear in the description
|
||||
---@param icon string @Markup icon of the poop
|
||||
---@param description string
|
||||
---@param language? EID_LanguageCode @Default: "en"
|
||||
---@param language? EID_LanguageCode @Default: "en_us"
|
||||
function EID:addCustomPoopSpell(token, name, icon, description, language)
|
||||
EID.descriptions[language]["poopSpells"][token] = {icon, name, description, EID._currentMod}
|
||||
end
|
||||
@@ -764,12 +764,12 @@ end
|
||||
function EID:getDescriptionEntry(objTable, objIdentifier, noFallback)
|
||||
if not objIdentifier then
|
||||
if noFallback then return EID.descriptions[EID:getLanguage()][objTable]
|
||||
else return EID.descriptions[EID:getLanguage()][objTable] or EID.descriptions["en"][objTable] end
|
||||
else return EID.descriptions[EID:getLanguage()][objTable] or EID.descriptions[EID.DefaultLanguageCode][objTable] end
|
||||
else
|
||||
local translatedTable = EID.descriptions[EID:getLanguage()][objTable]
|
||||
local description
|
||||
if noFallback then description = translatedTable and translatedTable[objIdentifier]
|
||||
else description = (translatedTable and translatedTable[objIdentifier]) or (EID.descriptions["en"][objTable] and EID.descriptions["en"][objTable][objIdentifier]) end
|
||||
else description = (translatedTable and translatedTable[objIdentifier]) or (EID.descriptions[EID.DefaultLanguageCode][objTable] and EID.descriptions[EID.DefaultLanguageCode][objTable][objIdentifier]) end
|
||||
--Try looking for a -1 that would encompass all subtypes of the variant
|
||||
-- Safety check for if the identifier contains "."(dot) 1-2 times and only contains numbers
|
||||
local strNoDots, numDots = string.gsub(objIdentifier, "%.","")
|
||||
@@ -796,9 +796,9 @@ end
|
||||
---@return string
|
||||
function EID:getDescriptionEntryEnglish(objTable, objID)
|
||||
if not objID then
|
||||
return EID.descriptions["en"][objTable]
|
||||
return EID.descriptions[EID.DefaultLanguageCode][objTable]
|
||||
else
|
||||
return EID.descriptions["en"][objTable] and EID.descriptions["en"][objTable][objID]
|
||||
return EID.descriptions[EID.DefaultLanguageCode][objTable] and EID.descriptions[EID.DefaultLanguageCode][objTable][objID]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -892,7 +892,7 @@ function EID:getTransformationName(id)
|
||||
-- get translated custom name
|
||||
local customTransform = EID.CustomTransformations[id]
|
||||
if customTransform ~= nil then
|
||||
return customTransform[EID:getLanguage()] or customTransform["en"] or id
|
||||
return customTransform[EID:getLanguage()] or customTransform[EID.DefaultLanguageCode] or id
|
||||
end
|
||||
return id
|
||||
end
|
||||
@@ -909,7 +909,7 @@ function EID:getObjectName(Type, Variant, SubType)
|
||||
local tableEntry = EID:getDescriptionData(Type, Variant, SubType)
|
||||
local name = nil
|
||||
if tableEntry ~= nil then
|
||||
if tableEntry[2] ~= nil and tableEntry[2] ~= "" and tableEntry[2] ~= EID.descriptions["en"][tableName][SubType] then
|
||||
if tableEntry[2] ~= nil and tableEntry[2] ~= "" and tableEntry[2] ~= EID.descriptions[EID.DefaultLanguageCode][tableName][SubType] then
|
||||
name = tableEntry[2]
|
||||
end
|
||||
end
|
||||
@@ -917,18 +917,18 @@ function EID:getObjectName(Type, Variant, SubType)
|
||||
if tableName == "collectibles" then
|
||||
if EID.itemConfig:GetCollectible(SubType) == nil then return fallbackName end
|
||||
local vanillaName = EID.itemConfig:GetCollectible(SubType).Name
|
||||
local englishName = EID.descriptions["en"][tableName][SubType] and EID.descriptions["en"][tableName][SubType][2]
|
||||
local englishName = EID.descriptions[EID.DefaultLanguageCode][tableName][SubType] and EID.descriptions[EID.DefaultLanguageCode][tableName][SubType][2]
|
||||
return name or (not string.find(vanillaName, "^#") and vanillaName) or englishName or vanillaName
|
||||
elseif tableName == "trinkets" then
|
||||
local adjustedSubtype = EID:getAdjustedSubtype(Type, Variant, SubType)
|
||||
if EID.itemConfig:GetTrinket(adjustedSubtype) == nil then return fallbackName end
|
||||
local vanillaName = EID.itemConfig:GetTrinket(adjustedSubtype).Name
|
||||
local englishName = EID.descriptions["en"][tableName][adjustedSubtype] and EID.descriptions["en"][tableName][adjustedSubtype][2]
|
||||
local englishName = EID.descriptions[EID.DefaultLanguageCode][tableName][adjustedSubtype] and EID.descriptions[EID.DefaultLanguageCode][tableName][adjustedSubtype][2]
|
||||
return name or (not string.find(vanillaName, "^#") and vanillaName) or englishName or vanillaName
|
||||
elseif tableName == "cards" then
|
||||
if EID.itemConfig:GetCard(SubType) == nil then return fallbackName end
|
||||
local vanillaName = EID.itemConfig:GetCard(SubType).Name
|
||||
local englishName = EID.descriptions["en"][tableName][SubType] and EID.descriptions["en"][tableName][SubType][2]
|
||||
local englishName = EID.descriptions[EID.DefaultLanguageCode][tableName][SubType] and EID.descriptions[EID.DefaultLanguageCode][tableName][SubType][2]
|
||||
return name or (not string.find(vanillaName, "^#") and vanillaName) or englishName or vanillaName
|
||||
elseif tableName == "pills" or tableName == "horsepills" then
|
||||
local adjustedSubtype = EID:getAdjustedSubtype(Type, Variant, SubType)
|
||||
@@ -981,7 +981,7 @@ function EID:getPillName(pillID, isHorsepill)
|
||||
else
|
||||
vanillaName = EID.itemConfig:GetPillEffect(pillID - 1).Name
|
||||
end
|
||||
name = name and name[2] or (not string.find(vanillaName, "^#") and vanillaName) or EID.descriptions["en"][tableName][pillID][2] or vanillaName
|
||||
name = name and name[2] or (not string.find(vanillaName, "^#") and vanillaName) or EID.descriptions[EID.DefaultLanguageCode][tableName][pillID][2] or vanillaName
|
||||
name = string.gsub(name,"I'm Excited!!!","I'm Excited!!") -- prevent markup trigger
|
||||
return name
|
||||
end
|
||||
@@ -1239,7 +1239,7 @@ function EID:getTransformationIcon(str)
|
||||
return EID.InlineIcons["ERROR"]
|
||||
end
|
||||
if tonumber(str) ~= nil then
|
||||
str = EID.descriptions["en"].transformations[tonumber(str + 1)]
|
||||
str = EID.descriptions[EID.DefaultLanguageCode].transformations[tonumber(str + 1)]
|
||||
end
|
||||
local transformSprite = EID:getIcon(str:gsub(" ", ""))
|
||||
if transformSprite[1] == "ERROR" then
|
||||
|
||||
@@ -1150,7 +1150,7 @@ function EID:handleBagOfCraftingRendering(ignoreRefreshRate)
|
||||
-- Nothing in our recipe list passed the test; try checking English names as a backup
|
||||
if #IDsToCheck == 0 then
|
||||
local curLang = EID:getLanguage()
|
||||
EID.Config["Language"] = "en"
|
||||
EID.Config["Language"] = EID.DefaultLanguageCode
|
||||
for _,id in ipairs(sortedIDs) do
|
||||
local searchValid = EID:BoCSCheckItemName(EID:getObjectName(5, 100, id))
|
||||
if (searchValid) then table.insert(IDsToCheck, id) end
|
||||
|
||||
@@ -57,7 +57,7 @@ end
|
||||
|
||||
EID:AddCallback("EIDCallbacks.SEARCH_NAME_CONVERSION", function(_, searchString)
|
||||
-- TODO : make english search inside ko_kr language setting (priotity low though)
|
||||
if EID:getLanguage() == "ko" then
|
||||
if EID:getLanguage() == "ko_kr" then
|
||||
return EID.engKeystrokeToKor(searchString)
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -20,7 +20,7 @@ end
|
||||
-- Optional parameters: replaceText, language, extraTable
|
||||
-- Example usage: EID:addCondition(myDevilishItemID, EID.IsGreedMode, "{{GreedMode}} Reduces shop prices by 1 for each optional Nightmare wave completed")
|
||||
function EID:addCondition(ID, ownedID, text, replaceText, language, extraTable)
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
if replaceText then text = {text, replaceText} end
|
||||
local modifierText = newModdedCondition(text, language)
|
||||
if type(ownedID) ~= "function" then
|
||||
@@ -37,7 +37,7 @@ end
|
||||
-- Optional parameters: text2, language, extraTable
|
||||
-- Example usage: EID:addSynergyCondition(myHappyLittleItemID, {CollectibleType.COLLECTIBLE_BRIMSTONE, CollectibleType.COLLECTIBLE_SULFUR}, "Turns your laser into a smiley face that charms enemies")
|
||||
function EID:addSynergyCondition(ID1, ID2, text1, text2, language, extraTable)
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
local modifierText1 = newModdedCondition(text1, language)
|
||||
local modifierText2 = newModdedCondition(text2, language)
|
||||
EID:AddSynergyConditional(ID1, ID2, modifierText1, modifierText2, extraTable)
|
||||
@@ -49,7 +49,7 @@ end
|
||||
-- Optional parameters: replaceText, language, extraTable, includeTainted
|
||||
-- Example usage: EID:addPlayerCondition(myAngstyItemID, PlayerType.PLAYER_EVE, "Gives Eve extra mascara (2x Damage multiplier)")
|
||||
function EID:addPlayerCondition(ID, playerID, text, replaceText, language, extraTable, includeTainted)
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
if replaceText then text = {text, replaceText} end
|
||||
local modifierText = newModdedCondition(text, language)
|
||||
EID:AddPlayerConditional(ID, playerID, modifierText, extraTable, includeTainted)
|
||||
@@ -61,7 +61,7 @@ end
|
||||
-- or, if you provide newNumber, it changes numberToDouble to that (technically, it's just a find/replace pair, any strings work)
|
||||
-- Example usage: EID:addToGeneralCondition(myVeryHealthyItemID, "bingeEaterBuffs", "↑ {{Speed}} +0.15 Speed#↓ {{Tears}} -0.5 Tears#↓ {{Damage}} -0.5 Damage")
|
||||
function EID:addToGeneralCondition(ID, locTable, text, numberToDouble, newNumber, language)
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
if numberToDouble then
|
||||
newNumber = newNumber or numberToDouble * 2
|
||||
text = { numberToDouble, newNumber, text }
|
||||
@@ -103,7 +103,7 @@ end
|
||||
-- Shortcut function for adding BFFS conditions; this is slightly more complex since it supports trinkets
|
||||
-- Example usage: EID:addBFFSCondition(myBasicFamiliarID, nil, 3.5)
|
||||
function EID:addBFFSCondition(ID, text, numberToDouble, newNumber, language)
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
if numberToDouble then
|
||||
newNumber = newNumber or numberToDouble * 2
|
||||
text = { numberToDouble, newNumber, text }
|
||||
@@ -119,7 +119,7 @@ end
|
||||
|
||||
-- Shortcut function for adding Hive Mind conditions; by default, it will show with BFFS too, unless you pass in allowBFFS as false
|
||||
function EID:addHiveMindCondition(ID, text, numberToDouble, newNumber, language, allowBFFS)
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
if allowBFFS == nil then allowBFFS = true end
|
||||
EID.HiveMindFamiliars[ID] = true
|
||||
if not allowBFFS then EID.BFFSIgnore[ID] = true end
|
||||
|
||||
@@ -4,7 +4,7 @@ local showDebugChars = false
|
||||
|
||||
-- check integrity of language files
|
||||
|
||||
local languageFilesToCheck = {"fr"} -- EID.Languages -- single file check example {"ko"}
|
||||
local languageFilesToCheck = {"fr"} -- EID.Languages -- single file check example {"ko_kr"}
|
||||
|
||||
-- count English entries for stats
|
||||
local count = 0
|
||||
@@ -16,7 +16,7 @@ function EID:countEntries(t)
|
||||
end
|
||||
end
|
||||
end
|
||||
EID:countEntries(EID.descriptions["en"])
|
||||
EID:countEntries(EID.descriptions[EID.DefaultLanguageCode])
|
||||
local enUSEntries = count
|
||||
EID:WriteDebugMsg("English entries: "..enUSEntries)
|
||||
|
||||
@@ -84,7 +84,7 @@ for _, lang in ipairs(languageFilesToCheck) do
|
||||
end
|
||||
|
||||
local progress = { 0, 0 }
|
||||
EID:compareTables(EID.descriptions["en"], EID.descriptions[lang], lang, progress)
|
||||
EID:compareTables(EID.descriptions[EID.DefaultLanguageCode], EID.descriptions[lang], lang, progress)
|
||||
|
||||
local errors = (enUSEntries - progress[1])-progress[2]
|
||||
EID:WriteDebugMsg("Errors found: "..errors .." / "..enUSEntries)
|
||||
|
||||
@@ -22,10 +22,10 @@ EID.GridEntityWhitelist = setmetatable({}, {
|
||||
---@param variant integer
|
||||
---@param name string
|
||||
---@param description string
|
||||
---@param language? EID_LanguageCode @Default: "en"
|
||||
---@param language? EID_LanguageCode @Default: "en_us"
|
||||
function EID:addGridEntity(type, variant, name, description, language)
|
||||
variant = variant or 0
|
||||
language = language or "en"
|
||||
language = language or EID.DefaultLanguageCode
|
||||
|
||||
EID:CreateDescriptionTableIfMissing("custom", language)
|
||||
EID.descriptions[language].custom["-999." .. type .. "." .. variant] = {
|
||||
@@ -96,10 +96,10 @@ local function SacrificeRoomCondition(_)
|
||||
end
|
||||
|
||||
local function SacrificeRoomCallback(descObj)
|
||||
descObj.ObjSubType = math.min(#EID.descriptions["en"].sacrifice, descObj.Entity.VarData + 1)
|
||||
descObj.ObjSubType = math.min(#EID.descriptions[EID.DefaultLanguageCode].sacrifice, descObj.Entity.VarData + 1)
|
||||
-- Get sacrifice name by subtype
|
||||
descObj.Name = EID:getDescriptionEntry("sacrificeHeader") ..
|
||||
" (" .. descObj.ObjSubType .. "/" .. #EID.descriptions["en"].sacrifice .. ")"
|
||||
" (" .. descObj.ObjSubType .. "/" .. #EID.descriptions[EID.DefaultLanguageCode].sacrifice .. ")"
|
||||
|
||||
descObj.Description = EID:getDescriptionEntry("sacrifice", descObj.ObjSubType)[3]
|
||||
local curCounter = descObj.ObjSubType or 1
|
||||
|
||||
@@ -625,7 +625,7 @@ function EID:ItemReminderHandlePoopSpells(player)
|
||||
|
||||
local ignoreExisting = false
|
||||
if customPoop == nil then --If the poop still doesn't exist, use the unkown one instead
|
||||
customPoop = EID:getDescriptionEntry("poopSpells")["Unknown"] or EID.descriptions["en"]["poopSpells"]["Unknown"]
|
||||
customPoop = EID:getDescriptionEntry("poopSpells")["Unknown"] or EID.descriptions[EID.DefaultLanguageCode]["poopSpells"]["Unknown"]
|
||||
ignoreExisting = true
|
||||
end
|
||||
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
-- Variable that contains the default language code of the mod (English)
|
||||
EID.DefaultLanguageCode = "en_us"
|
||||
|
||||
-- List of all valid languages
|
||||
EID.Languages = {
|
||||
"en", -- English
|
||||
"en_us", -- English
|
||||
"fr", -- French
|
||||
"pt", -- Portuguese
|
||||
"pt_br", -- Brazilian Portuguese
|
||||
"ru", -- Russian
|
||||
"es", -- Spanish
|
||||
"spa", -- Spanish
|
||||
"it", -- Italian
|
||||
"bg", -- Bulgarian
|
||||
"bul", -- Bulgarian
|
||||
"pl", -- Polish
|
||||
"de", -- German
|
||||
"tr", -- Turkish
|
||||
"ko", -- Korean
|
||||
"tr_tr", -- Turkish
|
||||
"ko_kr", -- Korean
|
||||
"zh_cn", -- Simplified Chinese
|
||||
"ja", -- Japanese
|
||||
"cs", -- Czech
|
||||
"nl", -- Dutch
|
||||
"uk", -- Ukrainian
|
||||
"el", -- Greek
|
||||
"ro", -- Romanian
|
||||
"ja_jp", -- Japanese
|
||||
"cs_cz", -- Czech
|
||||
"nl_nl", -- Dutch
|
||||
"uk_ua", -- Ukrainian
|
||||
"el_gr", -- Greek
|
||||
"ro_ro", -- Romanian
|
||||
"vi" -- Vietnamese
|
||||
}
|
||||
|
||||
@@ -29,36 +32,36 @@ EID.BreakUtf8CharsLanguage = {
|
||||
|
||||
--#region Luadoc definitions
|
||||
---@alias EID_LanguageCode
|
||||
---| "bg" @Bulgarian
|
||||
---| "cs" @Czech
|
||||
---| "bul" @Bulgarian
|
||||
---| "cs_cz" @Czech
|
||||
---| "de" @German
|
||||
---| "el" @Greek
|
||||
---| "en" @English
|
||||
---| "es" @Spanish
|
||||
---| "el_gr" @Greek
|
||||
---| "en_us" @English
|
||||
---| "spa" @Spanish
|
||||
---| "fr" @French
|
||||
---| "it" @Italian
|
||||
---| "ja" @Japanese
|
||||
---| "ko" @Korean
|
||||
---| "nl" @Dutch
|
||||
---| "ja_jp" @Japanese
|
||||
---| "ko_kr" @Korean
|
||||
---| "nl_nl" @Dutch
|
||||
---| "pl" @Polish
|
||||
---| "pt_br" @Brasilian Portuguese
|
||||
---| "pt" @Portuguese
|
||||
---| "ro" @Romanian
|
||||
---| "ro_ro" @Romanian
|
||||
---| "ru" @Russian
|
||||
---| "tr" @Turkish
|
||||
---| "uk" @Ukrainian
|
||||
---| "tr_tr" @Turkish
|
||||
---| "uk_ua" @Ukrainian
|
||||
---| "vi" @Vietnamese
|
||||
---| "zh_cn" @Simplified Chinese
|
||||
--#endregion
|
||||
|
||||
-- Map the game's built-in language option strings to EID's
|
||||
EID.LanguageMap = {
|
||||
["jp"] = "ja",
|
||||
["es"] = "es",
|
||||
["jp"] = "ja_jp",
|
||||
["es"] = "spa",
|
||||
["de"] = "de",
|
||||
["fr"] = "fr",
|
||||
["ru"] = "ru",
|
||||
["kr"] = "ko",
|
||||
["kr"] = "ko_kr",
|
||||
["zh"] = "zh_cn",
|
||||
}
|
||||
|
||||
@@ -72,7 +75,7 @@ function EID:getLanguage()
|
||||
lang = "auto"
|
||||
end
|
||||
if lang == "auto" then
|
||||
local langToReturn = Options and EID.LanguageMap[Options.Language] or "en" -- Use game language, if available.
|
||||
local langToReturn = Options and EID.LanguageMap[Options.Language] or EID.DefaultLanguageCode -- Use game language, if available.
|
||||
-- don't do any updating if on a Repentance version before v1.7.9b
|
||||
if Isaac.RunCallback ~= nil then
|
||||
for _, callbackData in pairs(Isaac.GetCallbacks("EID_EVALUATE_AUTO_LANG")) do
|
||||
@@ -92,7 +95,7 @@ end
|
||||
function EID:LoadLanguagePacks(gameVersion)
|
||||
--transformation infos
|
||||
local _, _ = pcall(require, "descriptions." .. gameVersion .. ".transformations")
|
||||
--languages
|
||||
--load languages
|
||||
for _, languageCode in ipairs(EID.Languages) do
|
||||
local wasSuccessful, err = pcall(require, "descriptions." .. gameVersion .. "." .. languageCode)
|
||||
if not wasSuccessful and not string.find(err, "not found") then
|
||||
|
||||
@@ -198,5 +198,5 @@ end
|
||||
-- this made more sense when this file was only executed when --luadebug was present
|
||||
-- https://www.youtube.com/watch?v=msDuNZyYAIQ
|
||||
if (debug and os.date("%m/%d") == "04/01") then
|
||||
EID.descriptions["en"].sacrifice[1][3] = "{{Coin}} 50% chance of winning 1 coin at Sacrifice#75% chance if you're a genetic freak#!!! If you add Kurt Angle to the mix, your chances of winning drastically go down"
|
||||
EID.descriptions[EID.DefaultLanguageCode].sacrifice[1][3] = "{{Coin}} 50% chance of winning 1 coin at Sacrifice#75% chance if you're a genetic freak#!!! If you add Kurt Angle to the mix, your chances of winning drastically go down"
|
||||
end
|
||||
Reference in new issue
Block a user