コード例 #1
0
static void draw_recipe_tabs( const catacurses::window &w, const std::string &tab, TAB_MODE mode )
{
    werase( w );
    int width = getmaxx( w );
    for( int i = 0; i < width; i++ ) {
        mvwputch( w, 2, i, BORDER_COLOR, LINE_OXOX );
    }

    mvwputch( w, 2,  0, BORDER_COLOR, LINE_OXXO ); // |^
    mvwputch( w, 2, width - 1, BORDER_COLOR, LINE_OOXX ); // ^|

    switch( mode ) {
        case NORMAL: {
            int pos_x = 2;//draw the tabs on each other
            int tab_step = 3;//step between tabs, two for tabs border
            for( const auto &tt : craft_cat_list ) {
                draw_tab( w, pos_x, normalized_names[tt], tab == tt );
                pos_x += utf8_width( normalized_names[tt] ) + tab_step;
            }
            break;
        }
        case FILTERED:
            draw_tab( w, 2, _( "Searched" ), true );
            break;
        case BATCH:
            draw_tab( w, 2, _( "Batch" ), true );
            break;
    }

    wrefresh( w );
}
コード例 #2
0
void draw_tabs(WINDOW* w, std::string sTab)
{
 for (int i = 1; i < 79; i++) {
  mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
  mvwputch(w, 4, i, c_ltgray, LINE_OXOX);
  mvwputch(w, 24, i, c_ltgray, LINE_OXOX);

  if (i > 2 && i < 24) {
   mvwputch(w, i, 0, c_ltgray, LINE_XOXO);
   mvwputch(w, i, 79, c_ltgray, LINE_XOXO);
  }
 }

 draw_tab(w, 8, "STATS", (sTab == "STATS") ? true : false);
 draw_tab(w, 24, "TRAITS", (sTab == "TRAITS") ? true : false);
 draw_tab(w, 41, "SKILLS", (sTab == "SKILLS") ? true : false);
 draw_tab(w, 58, "DESCRIPTION", (sTab == "DESCRIPTION") ? true : false);

 mvwputch(w, 2,  0, c_ltgray, LINE_OXXO); // |^
 mvwputch(w, 2, 79, c_ltgray, LINE_OOXX); // ^|

 mvwputch(w, 4, 0, c_ltgray, LINE_XXXO); // |-
 mvwputch(w, 4, 79, c_ltgray, LINE_XOXX); // -|

 mvwputch(w, 24, 0, c_ltgray, LINE_XXOO); // |_
 mvwputch(w, 24, 79, c_ltgray, LINE_XOOX); // _|
}
コード例 #3
0
void draw_tabs(WINDOW* w, std::string sTab)
{
 for (int i = 1; i < 79; i++) {
  mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
  mvwputch(w, 4, i, c_ltgray, LINE_OXOX);
  mvwputch(w, 24, i, c_ltgray, LINE_OXOX);

  if (i > 2 && i < 24) {
   mvwputch(w, i, 0, c_ltgray, LINE_XOXO);
   mvwputch(w, i, 79, c_ltgray, LINE_XOXO);
  }
 }

 int x = 2;
 // TODO: align prettily, find how much space will be free and distribute
 draw_tab(w, x, _("STATS"), (sTab == "STATS") ? true : false);
 x += utf8_width(_("STATS")) + 5;
 draw_tab(w, x, _("TRAITS"), (sTab == "TRAITS") ? true : false);
 x += utf8_width(_("TRAITS")) + 5;
 draw_tab(w, x, _("PROFESSION"), (sTab == "PROFESSION") ? true : false);
 x += utf8_width(_("PROFESSION")) + 5;
 draw_tab(w, x, _("SKILLS"), (sTab == "SKILLS") ? true : false);
 x += utf8_width(_("SKILLS")) + 5;
 draw_tab(w, x, _("DESCRIPTION"), (sTab == "DESCRIPTION") ? true : false);

 mvwputch(w, 2,  0, c_ltgray, LINE_OXXO); // |^
 mvwputch(w, 2, 79, c_ltgray, LINE_OOXX); // ^|

 mvwputch(w, 4, 0, c_ltgray, LINE_XXXO); // |-
 mvwputch(w, 4, 79, c_ltgray, LINE_XOXX); // -|

 mvwputch(w, 24, 0, c_ltgray, LINE_XXOO); // |_
 mvwputch(w, 24, 79, c_ltgray, LINE_XOOX); // _|
}
コード例 #4
0
void worldfactory::draw_worldgen_tabs(WINDOW *w, unsigned int current)
{
    werase(w);

    for (int i = 1; i < FULL_SCREEN_WIDTH - 1; i++) {
        mvwputch(w, 2, i, BORDER_COLOR, LINE_OXOX);
        mvwputch(w, FULL_SCREEN_HEIGHT - 1, i, BORDER_COLOR, LINE_OXOX);

        if (i > 2 && i < FULL_SCREEN_HEIGHT - 1) {
            mvwputch(w, i, 0, BORDER_COLOR, LINE_XOXO);
            mvwputch(w, i, FULL_SCREEN_WIDTH - 1, BORDER_COLOR, LINE_XOXO);
        }
    }

    int x = 2;
    for (size_t i = 0; i < tab_strings.size(); ++i) {
        draw_tab(w, x, tab_strings[i], (i == current) ? true : false);
        x += utf8_width( tab_strings[i] ) + 7;
    }

    mvwputch(w, 2, 0, BORDER_COLOR, LINE_OXXO); // |^
    mvwputch(w, 2, FULL_SCREEN_WIDTH - 1, BORDER_COLOR, LINE_OOXX); // ^|

    mvwputch(w, 4, 0, BORDER_COLOR, LINE_XOXO); // |
    mvwputch(w, 4, FULL_SCREEN_WIDTH - 1, BORDER_COLOR, LINE_XOXO); // |

    mvwputch(w, FULL_SCREEN_HEIGHT - 1, 0, BORDER_COLOR, LINE_XXOO); // |_
    mvwputch(w, FULL_SCREEN_HEIGHT - 1, FULL_SCREEN_WIDTH - 1, BORDER_COLOR, LINE_XOOX); // _|
}
コード例 #5
0
void worldfactory::draw_worldgen_tabs(WINDOW *w, int current, std::vector<std::string> tabs)
{
    wclear(w);

    for (int i = 1; i < 79; i++) {
        mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
        mvwputch(w, 24, i, c_ltgray, LINE_OXOX);

        if (i > 2 && i < 24) {
            mvwputch(w, i, 0, c_ltgray, LINE_XOXO);
            mvwputch(w, i, 79, c_ltgray, LINE_XOXO);
        }
    }

    int x = 2;
    for (int i = 0; i < tabs.size(); ++i) {
        draw_tab(w, x, tabs[i], (i == current) ? true : false);
        x += utf8_width(tabs[i].c_str()) + 5;
    }

    mvwputch(w, 2, 0, c_ltgray, LINE_OXXO); // |^
    mvwputch(w, 2, 79, c_ltgray, LINE_OOXX); // ^|

    mvwputch(w, 4, 0, c_ltgray, LINE_XOXO); // |
    mvwputch(w, 4, 79, c_ltgray, LINE_XOXO); // |

    mvwputch(w, 24, 0, c_ltgray, LINE_XXOO); // |_
    mvwputch(w, 24, 79, c_ltgray, LINE_XOOX);// _|
}
コード例 #6
0
void draw_bionics_tabs( const catacurses::window &win, const size_t active_num,
                        const size_t passive_num, const bionic_tab_mode current_mode )
{
    werase( win );

    const int width = getmaxx( win );
    mvwhline( win, 2, 0, LINE_OXOX, width );

    const std::string active_tab_name = string_format( _( "ACTIVE (%i)" ), active_num );
    const std::string passive_tab_name = string_format( _( "PASSIVE (%i)" ), passive_num );
    const int tab_step = 3;
    int tab_x = 1;
    draw_tab( win, tab_x, active_tab_name, current_mode == TAB_ACTIVE );
    tab_x += tab_step + utf8_width( active_tab_name );
    draw_tab( win, tab_x, passive_tab_name, current_mode == TAB_PASSIVE );

    wrefresh( win );
}