Skip to content

Commit 78b7926

Browse files
author
Ryan Dwyer
committed
Make get_religion_string ifs more readable, add dwarfified profession string to get_profession_string
1 parent 7516e6f commit 78b7926

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

plugins/lua/sort/locationselector.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ function get_religion_string(religion_id, religion_type)
3535
if religion_id == -1 then return end
3636
local entity
3737
local spheres = {}
38-
if religion_type == 0 then
38+
if religion_type == df.temple_deity_type.Deity then
3939
entity = df.historical_figure.find(religion_id)
4040
add_spheres(entity, spheres)
41-
elseif religion_type == 1 then
41+
elseif religion_type == df.temple_deity_type.Religion then
4242
entity = df.historical_entity.find(religion_id)
4343
if entity then
4444
for _, deity in ipairs(entity.relations.deities) do
@@ -51,7 +51,9 @@ function get_religion_string(religion_id, religion_type)
5151
end
5252

5353
function get_profession_string(profession)
54-
return df.profession[profession]:gsub('_', ' ')
54+
local profession_string = df.profession[profession]:gsub('_', ' ')
55+
local dwarfified_string = profession_string:gsub('[Mm][Aa][Nn]', 'dwarf')
56+
return profession_string + " " + dwarfified_string
5557
end
5658

5759
function LocationSelectorOverlay:init()

0 commit comments

Comments
 (0)