Skip to content

Commit

Permalink
Merge branch 'inventory-symbols' of https://github.com/brezerk/Catacl…
Browse files Browse the repository at this point in the history
…ysm-DDA into merge3-a
  • Loading branch information
KA101 committed Apr 16, 2015
2 parents f3d4ac2 + e8bb7ec commit c888d7d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/advanced_inv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,13 @@ void advanced_inventory::print_items( advanced_inventory_pane &pane, bool active
}
}

std::string item_name = it.display_name();
if ( OPTIONS["ITEM_SYMBOLS"] ) {
item_name = string_format("%c %s", it.symbol(), item_name.c_str());
}

//print item name
trim_and_print( window, 6 + x, compact ? 1 : 4, max_name_length, thiscolor, "%s", it.display_name().c_str() );
trim_and_print( window, 6 + x, compact ? 1 : 4, max_name_length, thiscolor, "%s", item_name.c_str() );

//print src column
// TODO: specify this is coming from a vehicle!
Expand Down
3 changes: 3 additions & 0 deletions src/inventory_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ void inventory_selector::print_column(const itemstack_vector &items, size_t y, s
if (it.invlet != 0) {
mvwputch(w_inv, cur_line, y, invlet_color, it.invlet);
}
if (OPTIONS["ITEM_SYMBOLS"]) {
item_name = string_format("%c %s", it.symbol(), item_name.c_str());
}
trim_and_print(w_inv, cur_line, y + 2, w - 2, name_color, "%s", item_name.c_str());
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,10 @@ void initOptions()
_("If true, show item health bars instead of reinforced, scratched etc. text."),
true
);
OPTIONS["ITEM_SYMBOLS"] = cOpt("interface", _("Show item symbols"),
_("If true, show item symbols in inventory and pick up menu."),
false
);

mOptionsSort["interface"]++;

Expand Down
6 changes: 5 additions & 1 deletion src/pickup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,12 @@ void Pickup::pick_up(int posx, int posy, int min)
} else {
wprintw(w_pickup, " - ");
}
std::string item_name = here[cur_it].display_name();
if (OPTIONS["ITEM_SYMBOLS"]) {
item_name = string_format("%c %s", here[cur_it].symbol(), item_name.c_str());
}
trim_and_print(w_pickup, 1 + (cur_it % maxitems), 6, pickupW - 4, icolor,
"%s", here[cur_it].display_name().c_str());
"%s", item_name.c_str());
}
}

Expand Down

0 comments on commit c888d7d

Please sign in to comment.