Make get_religion_string ifs more readable, add dwarfified profession string to get_profession_string

develop
Ryan Dwyer 2023-11-09 01:34:47 -08:00
parent 7516e6f268
commit 78b7926d50
1 changed files with 5 additions and 3 deletions

@ -35,10 +35,10 @@ function get_religion_string(religion_id, religion_type)
if religion_id == -1 then return end
local entity
local spheres = {}
if religion_type == 0 then
if religion_type == df.temple_deity_type.Deity then
entity = df.historical_figure.find(religion_id)
add_spheres(entity, spheres)
elseif religion_type == 1 then
elseif religion_type == df.temple_deity_type.Religion then
entity = df.historical_entity.find(religion_id)
if entity then
for _, deity in ipairs(entity.relations.deities) do
@ -51,7 +51,9 @@ function get_religion_string(religion_id, religion_type)
end
function get_profession_string(profession)
return df.profession[profession]:gsub('_', ' ')
local profession_string = df.profession[profession]:gsub('_', ' ')
local dwarfified_string = profession_string:gsub('[Mm][Aa][Nn]', 'dwarf')
return profession_string + " " + dwarfified_string
end
function LocationSelectorOverlay:init()