| 1927 | } |
| 1928 | |
| 1929 | void viewscreen_unitlaborsst::render() |
| 1930 | { |
| 1931 | if (Screen::isDismissed(this)) |
| 1932 | return; |
| 1933 | |
| 1934 | dfhack_viewscreen::render(); |
| 1935 | |
| 1936 | auto dim = Screen::getWindowSize(); |
| 1937 | |
| 1938 | Screen::clear(); |
| 1939 | Screen::drawBorder(" Dwarf Manipulator - Manage Labors "); |
| 1940 | |
| 1941 | Screen::paintString(Screen::Pen(' ', 7, 0), col_offsets[DISP_COLUMN_STRESS], 2, "Stress"); |
| 1942 | Screen::paintTile(Screen::Pen('\373', 7, 0), col_offsets[DISP_COLUMN_SELECTED], 2); |
| 1943 | Screen::paintString(Screen::Pen(' ', 7, 0), col_offsets[DISP_COLUMN_NAME], 2, "Name"); |
| 1944 | |
| 1945 | string detail_str; |
| 1946 | if (detail_mode == DETAIL_MODE_SQUAD) { |
| 1947 | detail_str = "Squad"; |
| 1948 | } else if (detail_mode == DETAIL_MODE_JOB) { |
| 1949 | detail_str = "Job"; |
| 1950 | } else if (detail_mode == DETAIL_MODE_PROFESSION) { |
| 1951 | detail_str = "Profession"; |
| 1952 | } else { |
| 1953 | detail_str = "Goal"; |
| 1954 | } |
| 1955 | Screen::paintString(Screen::Pen(' ', 7, 0), col_offsets[DISP_COLUMN_DETAIL], 2, detail_str); |
| 1956 | |
| 1957 | for (int col = 0; col < col_widths[DISP_COLUMN_LABORS]; col++) |
| 1958 | { |
| 1959 | int col_offset = col + first_column; |
| 1960 | if (size_t(col_offset) >= NUM_COLUMNS) |
| 1961 | break; |
| 1962 | |
| 1963 | int8_t fg = columns[col_offset].color; |
| 1964 | int8_t bg = 0; |
| 1965 | |
| 1966 | if (col_offset == sel_column) |
| 1967 | { |
| 1968 | fg = 0; |
| 1969 | bg = 7; |
| 1970 | } |
| 1971 | |
| 1972 | Screen::paintTile(Screen::Pen(columns[col_offset].label[0], fg, bg), col_offsets[DISP_COLUMN_LABORS] + col, 1); |
| 1973 | Screen::paintTile(Screen::Pen(columns[col_offset].label[1], fg, bg), col_offsets[DISP_COLUMN_LABORS] + col, 2); |
| 1974 | df::profession profession = columns[col_offset].profession; |
| 1975 | if ((profession != profession::NONE) && (plotinfo->race_id != -1)) |
| 1976 | { |
| 1977 | auto graphics = world->raws.creatures.all[plotinfo->race_id]->graphics; |
| 1978 | Screen::paintTile( |
| 1979 | Screen::Pen(' ', fg, 0, |
| 1980 | graphics.profession_add_color[creature_graphics_role::DEFAULT][profession], |
| 1981 | graphics.profession_texpos[creature_graphics_role::DEFAULT][profession]), |
| 1982 | col_offsets[DISP_COLUMN_LABORS] + col, 3); |
| 1983 | } |
| 1984 | } |
| 1985 | |
| 1986 | for (int row = 0; row < num_rows; row++) |
nothing calls this directly
no test coverage detected