Skip to content

Commit

Permalink
improve output
Browse files Browse the repository at this point in the history
  • Loading branch information
Timmeey86 committed Aug 23, 2024
1 parent e8c6fd9 commit ec24f37
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"g_i18n",
"g_currentMission",
"Mission00",
"g_modsDirectory"
"g_modsDirectory",
"printCallstack",
"Logging"
]
}
4 changes: 2 additions & 2 deletions modDesc.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="79">
<author>Farmsim Tim</author>
<version>1.0.0.3</version>
<version>1.0.0.6</version>
<title>
<en>A Height Type Debugger</en>
<de>A Height Type Debugger</de>
Expand All @@ -23,7 +23,7 @@
<en>There are %d height types, but the map can only handle %d types.</en>
<de>Es gibt %d Height Types, aber die Karte kann nur %d Typen verarbeiten.</de>
</text>
<text name="user_text_good">
<text name="user_text_intro_good">
<en>There are %d height types and the map can handle %d types.</en>
<de>Es gibt %d Height Types und die Karte kann %d Typen verarbeiten.</de>
</text>
Expand Down
20 changes: 12 additions & 8 deletions scripts/HeightTypeDebugger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ DensityMapHeightManager.addDensityMapHeightType = Utils.prependedFunction(Densit

if currentXMLFile == nil then
currentIndex = currentIndex + 1
currentXMLFile = "unidentified script mod"
currentXMLFile = "unidentified (search log for \"UNID_HT_REG\")"
Logging.error("UNID_HT_REG: A mod registered height types through script. The mod name should be visible in the following call stack:")
printCallstack()
end
local alreadyExists = manager.fillTypeNameToHeightType[fillTypeName] ~= nil
if not heightTypeMapping[currentIndex] then
Expand All @@ -34,8 +36,14 @@ DensityMapHeightManager.loadDensityMapHeightTypes = Utils.prependedFunction(Dens
if xmlFile ~= nil then
source = getXMLFilename(xmlFile)
end
currentXMLFile = source
currentIndex = currentIndex + 1

-- Compact premium expansion into one entry
if source == "data/foliage/carrot/carrot.xml" or source == "data/foliage/parsnip/parsnip.xml" then
currentXMLFile = "data/foliage/beetRoot/beetRoot.xml"
else
currentXMLFile = source
currentIndex = currentIndex + 1
end
end)

DensityMapHeightManager.loadDensityMapHeightTypes = Utils.appendedFunction(DensityMapHeightManager.loadDensityMapHeightTypes, function(...)
Expand All @@ -46,11 +54,7 @@ local function getModName(path)
if path == "data/maps/maps_densityMapHeightTypes.xml" then
return g_i18n:getText("base_game")
elseif path == "data/foliage/beetRoot/beetRoot.xml" then
return g_i18n:getText("premium_expansion") .. "#1"
elseif path == "data/foliage/carrot/carrot.xml" then
return g_i18n:getText("premium_expansion") .. "#2"
elseif path == "data/foliage/parsnip/parsnip.xml" then
return g_i18n:getText("premium_expansion") .. "#3"
return g_i18n:getText("premium_expansion")
elseif string.find(path, "pdlc/forestry") then
return g_i18n:getText("platinum_expansion")
elseif path:sub(1, #g_modsDirectory) == g_modsDirectory then
Expand Down

0 comments on commit ec24f37

Please sign in to comment.