Adjust grid display - labors without skills use different tiles, and skills without labors have a red background

develop
Quietust 2012-08-27 09:04:32 -05:00
parent f562871867
commit faf3bdf2b7
1 changed files with 14 additions and 3 deletions

@ -630,11 +630,9 @@ void viewscreen_unitlaborsst::render()
int col_offset = col + first_column; int col_offset = col + first_column;
fg = 15; fg = 15;
bg = 0; bg = 0;
char c = 0xFA;
if ((col_offset == sel_column) && (row_offset == sel_row)) if ((col_offset == sel_column) && (row_offset == sel_row))
fg = 9; fg = 9;
if ((columns[col_offset].labor != unit_labor::NONE) && (unit->status.labors[columns[col_offset].labor]))
bg = 7;
char c = '-';
if (columns[col_offset].skill != job_skill::NONE) if (columns[col_offset].skill != job_skill::NONE)
{ {
df::unit_skill *skill = binsearch_in_vector<df::unit_skill,df::enum_field<df::job_skill,int16_t>>(unit->status.current_soul->skills, &df::unit_skill::id, columns[col_offset].skill); df::unit_skill *skill = binsearch_in_vector<df::unit_skill,df::enum_field<df::job_skill,int16_t>>(unit->status.current_soul->skills, &df::unit_skill::id, columns[col_offset].skill);
@ -645,7 +643,20 @@ void viewscreen_unitlaborsst::render()
level = NUM_SKILL_LEVELS - 1; level = NUM_SKILL_LEVELS - 1;
c = skill_levels[level].abbrev; c = skill_levels[level].abbrev;
} }
else
c = '-';
}
if (columns[col_offset].labor != unit_labor::NONE)
{
if (unit->status.labors[columns[col_offset].labor])
{
bg = 7;
if (columns[col_offset].skill == job_skill::NONE)
c = 0xF9;
}
} }
else
bg = 4;
Screen::paintTile(Screen::Pen(c, fg, bg), 1 + name_width + 1 + prof_width + 1 + col, 3 + row); Screen::paintTile(Screen::Pen(c, fg, bg), 1 + name_width + 1 + prof_width + 1 + col, 3 + row);
} }
} }