Reverted sort.lua. Changed orders sort by material keybing from T to M.

develop
Mikhail 2023-09-18 12:28:34 +03:00
parent ebb190e356
commit 7d3786586a
2 changed files with 38 additions and 38 deletions

@ -136,7 +136,7 @@ function OrdersOverlay:init()
widgets.HotkeyLabel{ widgets.HotkeyLabel{
frame={t=0, l=52}, frame={t=0, l=52},
label='sort by mat', label='sort by mat',
key='CUSTOM_CTRL_T', key='CUSTOM_CTRL_M',
auto_width=true, auto_width=true,
on_activate=do_sort_mat, on_activate=do_sort_mat,
}, },

@ -212,7 +212,7 @@ local function melee_skill_effectiveness(unit)
end end
local function get_melee_skill_effectiveness_rating(unit) local function get_melee_skill_effectiveness_rating(unit)
return get_rating(melee_skill_effectiveness(unit), 350000, 2750000, 64, 52, 40, 28) return get_rating(melee_skill_effectiveness(unit), 350000, 2350000, 78, 64, 49, 35)
end end
local function make_sort_by_melee_skill_effectiveness_desc() local function make_sort_by_melee_skill_effectiveness_desc()
@ -272,7 +272,7 @@ local function ranged_skill_effectiveness(unit)
end end
local function get_ranged_skill_effectiveness_rating(unit) local function get_ranged_skill_effectiveness_rating(unit)
return get_rating(ranged_skill_effectiveness(unit), 0, 800000, 72, 52, 31, 11) return get_rating(ranged_skill_effectiveness(unit), 0, 500000, 90, 62, 44, 27)
end end
local function make_sort_by_ranged_skill_effectiveness_desc(list) local function make_sort_by_ranged_skill_effectiveness_desc(list)
@ -345,41 +345,41 @@ end
-- Statistical rating that is higher for dwarves that are mentally stable -- Statistical rating that is higher for dwarves that are mentally stable
local function get_mental_stability(unit) local function get_mental_stability(unit)
local altruism = unit.status.current_soul.personality.traits.ALTRUISM local ALTRUISM = unit.status.current_soul.personality.traits.ALTRUISM
local anxiety_propensity = unit.status.current_soul.personality.traits.ANXIETY_PROPENSITY local ANXIETY_PROPENSITY = unit.status.current_soul.personality.traits.ANXIETY_PROPENSITY
local bravery = unit.status.current_soul.personality.traits.BRAVERY local BRAVERY = unit.status.current_soul.personality.traits.BRAVERY
local cheer_propensity = unit.status.current_soul.personality.traits.CHEER_PROPENSITY local CHEER_PROPENSITY = unit.status.current_soul.personality.traits.CHEER_PROPENSITY
local curious = unit.status.current_soul.personality.traits.CURIOUS local CURIOUS = unit.status.current_soul.personality.traits.CURIOUS
local discord = unit.status.current_soul.personality.traits.DISCORD local DISCORD = unit.status.current_soul.personality.traits.DISCORD
local dutifulness = unit.status.current_soul.personality.traits.DUTIFULNESS local DUTIFULNESS = unit.status.current_soul.personality.traits.DUTIFULNESS
local emotionally_obsessive = unit.status.current_soul.personality.traits.EMOTIONALLY_OBSESSIVE local EMOTIONALLY_OBSESSIVE = unit.status.current_soul.personality.traits.EMOTIONALLY_OBSESSIVE
local humor = unit.status.current_soul.personality.traits.HUMOR local HUMOR = unit.status.current_soul.personality.traits.HUMOR
local love_propensity = unit.status.current_soul.personality.traits.LOVE_PROPENSITY local LOVE_PROPENSITY = unit.status.current_soul.personality.traits.LOVE_PROPENSITY
local perseverence = unit.status.current_soul.personality.traits.PERSEVERENCE local PERSEVERENCE = unit.status.current_soul.personality.traits.PERSEVERENCE
local politeness = unit.status.current_soul.personality.traits.POLITENESS local POLITENESS = unit.status.current_soul.personality.traits.POLITENESS
local privacy = unit.status.current_soul.personality.traits.PRIVACY local PRIVACY = unit.status.current_soul.personality.traits.PRIVACY
local stress_vulnerability = unit.status.current_soul.personality.traits.STRESS_VULNERABILITY local STRESS_VULNERABILITY = unit.status.current_soul.personality.traits.STRESS_VULNERABILITY
local tolerant = unit.status.current_soul.personality.traits.TOLERANT local TOLERANT = unit.status.current_soul.personality.traits.TOLERANT
local craftsmanship = setbelief.getUnitBelief(unit, df.value_type['CRAFTSMANSHIP']) local CRAFTSMANSHIP = setbelief.getUnitBelief(unit, df.value_type['CRAFTSMANSHIP'])
local family = setbelief.getUnitBelief(unit, df.value_type['FAMILY']) local FAMILY = setbelief.getUnitBelief(unit, df.value_type['FAMILY'])
local harmony = setbelief.getUnitBelief(unit, df.value_type['HARMONY']) local HARMONY = setbelief.getUnitBelief(unit, df.value_type['HARMONY'])
local independence = setbelief.getUnitBelief(unit, df.value_type['INDEPENDENCE']) local INDEPENDENCE = setbelief.getUnitBelief(unit, df.value_type['INDEPENDENCE'])
local knowledge = setbelief.getUnitBelief(unit, df.value_type['KNOWLEDGE']) local KNOWLEDGE = setbelief.getUnitBelief(unit, df.value_type['KNOWLEDGE'])
local leisure_time = setbelief.getUnitBelief(unit, df.value_type['LEISURE_TIME']) local LEISURE_TIME = setbelief.getUnitBelief(unit, df.value_type['LEISURE_TIME'])
local nature = setbelief.getUnitBelief(unit, df.value_type['NATURE']) local NATURE = setbelief.getUnitBelief(unit, df.value_type['NATURE'])
local skill = setbelief.getUnitBelief(unit, df.value_type['SKILL']) local SKILL = setbelief.getUnitBelief(unit, df.value_type['SKILL'])
-- calculate the rating using the defined variables -- Calculate the rating using the defined variables
local rating = (craftsmanship * -0.01) + (family * -0.09) + (harmony * 0.05) local rating = (CRAFTSMANSHIP * -0.01) + (FAMILY * -0.09) + (HARMONY * 0.05)
+ (independence * 0.06) + (knowledge * -0.30) + (leisure_time * 0.24) + (INDEPENDENCE * 0.06) + (KNOWLEDGE * -0.30) + (LEISURE_TIME * 0.24)
+ (nature * 0.27) + (skill * -0.21) + (altruism * 0.13) + (NATURE * 0.27) + (SKILL * -0.21) + (ALTRUISM * 0.13)
+ (anxiety_propensity * -0.06) + (bravery * 0.06) + (ANXIETY_PROPENSITY * -0.06) + (BRAVERY * 0.06)
+ (cheer_propensity * 0.41) + (curious * -0.06) + (discord * 0.14) + (CHEER_PROPENSITY * 0.41) + (CURIOUS * -0.06) + (DISCORD * 0.14)
+ (dutifulness * -0.03) + (emotionally_obsessive * -0.13) + (DUTIFULNESS * -0.03) + (EMOTIONALLY_OBSESSIVE * -0.13)
+ (humor * -0.05) + (love_propensity * 0.15) + (perseverence * -0.07) + (HUMOR * -0.05) + (LOVE_PROPENSITY * 0.15) + (PERSEVERENCE * -0.07)
+ (politeness * -0.14) + (privacy * 0.03) + (stress_vulnerability * -0.20) + (POLITENESS * -0.14) + (PRIVACY * 0.03) + (STRESS_VULNERABILITY * -0.20)
+ (tolerant * -0.11) + (TOLERANT * -0.11)
return rating return rating
end end