Initial commit

This commit is contained in:
Ambroise Garel
2025-07-22 10:22:50 +02:00
parent 16f53c8a47
commit edb28205cd
422 changed files with 17001 additions and 2 deletions

View File

@@ -0,0 +1,29 @@
Library.objectNames = {}
do
local namesTable = {
["F-16C_50"] = "F-16C",
["FA-18C_hornet"] = "F/A-18C",
["speedboat"] = "speedboat"
}
function Library.objectNames.get(obj)
if not obj then return "nothing" end
-- First, try to find a custom name in the names table
local typeName = obj:getTypeName()
if typeName and namesTable[typeName] then
return namesTable[typeName]
end
-- Else, try to find a display name in the description
local desc = obj:getDesc()
if desc and desc.DisplayName then
return desc.DisplayName
end
-- If nothing else was found, return the internal typename
if not typeName then return "unknown" end
return typeName
end
end