Car battery rework + french adjustments (#607)
* fixes and changes to the french descs * more improvements * final few fixes * fixed mistake in french desc * misc changes * few more updates * MANY changes - Updated some french descriptions - Overhauled french wisp descriptions - Updated technical stuff in the fr file (thanks siraxtas!) - Added missing golden trinket entry to fr - Added item pool stuff to fr - Added car battery stuff to fr - updated car battery modifier to match other modifiers - updated one english car battery description * 65+25 that's 100 quick maths * properly localized golden trinkets (french) * fix mistaké * Car battery rework + french adjustments --------- Co-authored-by: wofsauge <jan-.-@t-online.de>
This commit is contained in:
1 parent
42eeeff4cf
commit
85b7d61ce1
4 files changed
+207
-136
No files matched your search
+34
-4
@@ -227,11 +227,41 @@ local function SacrificeRoomCallback(descObj)
|
||||
return descObj
|
||||
end
|
||||
|
||||
-- Handle Car Battery description addition
|
||||
local function CarBatteryCallback(descObj)
|
||||
local text = EID:getDescriptionEntry("carBattery", descObj.ObjSubType)
|
||||
if text ~= nil then
|
||||
local iconStr = "#{{Collectible356}} "
|
||||
EID:appendToDescription(descObj, iconStr..text)
|
||||
local carBatteryBuff = EID:getDescriptionEntry("carBattery", descObj.ObjSubType)
|
||||
if carBatteryBuff ~= nil then
|
||||
-- String = append
|
||||
if type(carBatteryBuff) == "string" then
|
||||
local iconStr = "#{{Collectible356}} "
|
||||
EID:appendToDescription(descObj, iconStr..carBatteryBuff:gsub("#",iconStr))
|
||||
-- Table with 1 entry = replace
|
||||
elseif #carBatteryBuff == 1 then
|
||||
descObj.Description = carBatteryBuff[1]
|
||||
-- Table with 2+ entries = find and replace
|
||||
-- Entry 1 is replaced with entry 2, entry 3 is replaced with entry 4, etc.
|
||||
else
|
||||
local pos = 1
|
||||
while pos < #carBatteryBuff do
|
||||
local toFind = carBatteryBuff[pos]
|
||||
local replaceWith = carBatteryBuff[pos+1]
|
||||
|
||||
--"%d*%.?%d+" will grab every number group (1, 10, 0.5), this will allow us to not replace the "1" in "10" erroneously
|
||||
if (type(toFind) == "number") then
|
||||
local count = 0
|
||||
descObj.Description = string.gsub(descObj.Description, "%d*%.?%d+", function(s)
|
||||
if (s == tostring(toFind) and count == 0) then
|
||||
count = count + 1
|
||||
return "{{BlinkYellowGreen}}" .. replaceWith .. "{{CR}}"
|
||||
end
|
||||
end)
|
||||
-- Basic find+replace for non-numbers
|
||||
else
|
||||
descObj.Description = string.gsub(descObj.Description, tostring(toFind), "{{BlinkYellowGreen}}" .. replaceWith .. "{{CR}}", 1)
|
||||
end
|
||||
pos = pos + 2
|
||||
end
|
||||
end
|
||||
end
|
||||
return descObj
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user