Update dwarfmonitor's happiness display

develop
lethosor 2014-11-08 14:54:28 -05:00
parent ba56f369e5
commit 2484f89542
2 changed files with 18 additions and 18 deletions

@ -110,7 +110,7 @@ if (BUILD_SUPPORTED)
DFHACK_PLUGIN(digFlood digFlood.cpp) DFHACK_PLUGIN(digFlood digFlood.cpp)
add_subdirectory(diggingInvaders) add_subdirectory(diggingInvaders)
DFHACK_PLUGIN(drybuckets drybuckets.cpp) DFHACK_PLUGIN(drybuckets drybuckets.cpp)
#DFHACK_PLUGIN(dwarfmonitor dwarfmonitor.cpp) DFHACK_PLUGIN(dwarfmonitor dwarfmonitor.cpp)
DFHACK_PLUGIN(embark-tools embark-tools.cpp) DFHACK_PLUGIN(embark-tools embark-tools.cpp)
DFHACK_PLUGIN(eventful eventful.cpp LINK_LIBRARIES lua) DFHACK_PLUGIN(eventful eventful.cpp LINK_LIBRARIES lua)
DFHACK_PLUGIN(fastdwarf fastdwarf.cpp) DFHACK_PLUGIN(fastdwarf fastdwarf.cpp)

@ -84,20 +84,20 @@ static color_value monitor_colors[] =
static int get_happiness_cat(df::unit *unit) static int get_happiness_cat(df::unit *unit)
{ {
int happy = unit->status.happiness; int stress = unit->status.current_soul->personality.stress_level;
if (happy == 0) // miserable if (stress >= 500000)
return 0; return 0;
else if (happy <= 25) // very unhappy else if (stress >= 250000)
return 1; return 1;
else if (happy <= 50) // unhappy else if (stress >= 100000)
return 2; return 2;
else if (happy <= 75) // fine else if (stress >= 60000)
return 3; return 3;
else if (happy <= 125) // quite content else if (stress >= 30000)
return 4; return 4;
else if (happy <= 150) // happy else if (stress >= 0)
return 5; return 5;
else // ecstatic else
return 6; return 6;
} }