|
|
@ -97,16 +97,9 @@ local function get_sort()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
local function get_unit_search_key(unit)
|
|
|
|
|
|
|
|
return ('%s %s %s'):format(
|
|
|
|
|
|
|
|
dfhack.units.getReadableName(unit), -- last name is in english
|
|
|
|
|
|
|
|
dfhack.units.getProfessionName(unit),
|
|
|
|
|
|
|
|
dfhack.TranslateName(unit.name, false, true)) -- get untranslated last name
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local function get_cri_unit_search_key(cri_unit)
|
|
|
|
local function get_cri_unit_search_key(cri_unit)
|
|
|
|
return ('%s %s'):format(
|
|
|
|
return ('%s %s'):format(
|
|
|
|
cri_unit.un and get_unit_search_key(cri_unit.un) or '',
|
|
|
|
cri_unit.un and sortoverlay.get_unit_search_key(cri_unit.un) or '',
|
|
|
|
cri_unit.job_sort_name)
|
|
|
|
cri_unit.job_sort_name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -132,7 +125,7 @@ local function work_details_search(vec, data, text, incremental)
|
|
|
|
data.selected = work_details.selected_work_detail_index
|
|
|
|
data.selected = work_details.selected_work_detail_index
|
|
|
|
end
|
|
|
|
end
|
|
|
|
sortoverlay.single_vector_search(
|
|
|
|
sortoverlay.single_vector_search(
|
|
|
|
{get_search_key_fn=get_unit_search_key},
|
|
|
|
{get_search_key_fn=sortoverlay.get_unit_search_key},
|
|
|
|
vec, data, text, incremental)
|
|
|
|
vec, data, text, incremental)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -161,7 +154,7 @@ end
|
|
|
|
local function get_candidate_search_key(cand)
|
|
|
|
local function get_candidate_search_key(cand)
|
|
|
|
if not cand.un then return end
|
|
|
|
if not cand.un then return end
|
|
|
|
return ('%s %s'):format(
|
|
|
|
return ('%s %s'):format(
|
|
|
|
get_unit_search_key(cand.un),
|
|
|
|
sortoverlay.get_unit_search_key(cand.un),
|
|
|
|
serialize_skills(cand.un))
|
|
|
|
serialize_skills(cand.un))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -420,7 +413,7 @@ function InterrogationOverlay:init()
|
|
|
|
self:register_handler('INTERROGATING', justice.interrogation_list,
|
|
|
|
self:register_handler('INTERROGATING', justice.interrogation_list,
|
|
|
|
curry(sortoverlay.flags_vector_search,
|
|
|
|
curry(sortoverlay.flags_vector_search,
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get_search_key_fn=get_unit_search_key,
|
|
|
|
get_search_key_fn=sortoverlay.get_unit_search_key,
|
|
|
|
get_elem_id_fn=function(unit) return unit.id end,
|
|
|
|
get_elem_id_fn=function(unit) return unit.id end,
|
|
|
|
matches_filters_fn=self:callback('matches_filters'),
|
|
|
|
matches_filters_fn=self:callback('matches_filters'),
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -428,7 +421,7 @@ function InterrogationOverlay:init()
|
|
|
|
self:register_handler('CONVICTING', justice.conviction_list,
|
|
|
|
self:register_handler('CONVICTING', justice.conviction_list,
|
|
|
|
curry(sortoverlay.single_vector_search,
|
|
|
|
curry(sortoverlay.single_vector_search,
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get_search_key_fn=get_unit_search_key,
|
|
|
|
get_search_key_fn=sortoverlay.get_unit_search_key,
|
|
|
|
matches_filters_fn=self:callback('matches_filters'),
|
|
|
|
matches_filters_fn=self:callback('matches_filters'),
|
|
|
|
}))
|
|
|
|
}))
|
|
|
|
end
|
|
|
|
end
|
|
|
|