summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/docs/keybind.txt1
-rw-r--r--crawl-ref/docs/options_guide.txt10
-rw-r--r--crawl-ref/settings/init.txt1
-rw-r--r--crawl-ref/settings/menu_colours.txt2
-rw-r--r--crawl-ref/source/acr.cc6
-rw-r--r--crawl-ref/source/cmd-keys.h1
-rw-r--r--crawl-ref/source/enum.h1
-rw-r--r--crawl-ref/source/externs.h3
-rw-r--r--crawl-ref/source/initfile.cc3
-rw-r--r--crawl-ref/source/menu.cc2
-rw-r--r--crawl-ref/source/shopping.cc17
11 files changed, 39 insertions, 8 deletions
diff --git a/crawl-ref/docs/keybind.txt b/crawl-ref/docs/keybind.txt
index c8e4ccc27a..1f66def090 100644
--- a/crawl-ref/docs/keybind.txt
+++ b/crawl-ref/docs/keybind.txt
@@ -98,6 +98,7 @@ I CMD_DISPLAY_SPELLS
[ CMD_LIST_ARMOUR
] CMD_LIST_EQUIPMENT
) CMD_LIST_WEAPONS
+$ CMD_LIST_GOLD
\ CMD_DISPLAY_KNOWN_OBJECTS
# CMD_CHARACTER_DUMP
diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt
index bcbbd9a3d4..bd72eb905c 100644
--- a/crawl-ref/docs/options_guide.txt
+++ b/crawl-ref/docs/options_guide.txt
@@ -67,7 +67,7 @@ The contents of this text are:
show_beam, item_stack_summary_minimum, list_rotten,
mlist_min_height, msg_max_height,
mlist_allow_alternate_layout, mlist_targetting, classic_hud,
- menu_colour, menu_colour_prefix_id, menu_colour_prefix_class,
+ menu_colour, menu_colour_prefix_class, menu_colour_shops,
message_colour, force_more_message,
msg_condense_repeats
4-k Missiles.
@@ -1213,6 +1213,7 @@ menu_colour = <match>:<colour>:<regex>
help (the manual)
inventory (inventory and pickup menus)
pickup (specific to pickup menus)
+ shop (shop menus)
notes (the ?: screen)
resists (the % screen)
spell (the Z and I screens)
@@ -1293,9 +1294,14 @@ menu_colour_prefix_class = false
the 'a' slot, the string the regexes will match against is
"weapon a - an uncursed dagger (weapon)".
+menu_colour_shops = true
+ If this option is set to true the shop menu will be coloured
+ according to the menu colours (using tags "shop" or "any");
+ otherwise the lines are coloured alternately white or lightgrey.
+
message_colour = <colour>:[<channel>:]<regex>
message_colour allows you to override colours for individual
- messages. For instance, if you find the low hp warning to be
+ messages. For instance, if you find the low hp warning to be
insufficiently attention grabbing, you could do something like
message_colour = yellow:LOW HITPOINT WARNING
You can also narrow the message match to a specific channel:
diff --git a/crawl-ref/settings/init.txt b/crawl-ref/settings/init.txt
index 2e726d5139..b7fc1eb00a 100644
--- a/crawl-ref/settings/init.txt
+++ b/crawl-ref/settings/init.txt
@@ -237,6 +237,7 @@ include = travel_stoppers.txt
##### Colours (messages and menus) #####
#
menu_colour_prefix_class = true
+# menu_colour_shops = false
# Food is colour coded in standard_colours.txt as follows:
include = standard_colours.txt
diff --git a/crawl-ref/settings/menu_colours.txt b/crawl-ref/settings/menu_colours.txt
index 321c023392..7eacf0ecb3 100644
--- a/crawl-ref/settings/menu_colours.txt
+++ b/crawl-ref/settings/menu_colours.txt
@@ -60,5 +60,5 @@ menu = $evil:.*evil_item.*
#
menu = lightred:.*equipped.* cursed
menu = lightgreen:.*equipped.*
+menu = red: cursed
menu = green:uncursed
-menu = red:cursed
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 53e35ab5d2..1bf74dc7a4 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -1260,6 +1260,7 @@ static bool _cmd_is_repeatable(command_type cmd, bool is_again = false)
case CMD_LIST_ARMOUR:
case CMD_LIST_JEWELLERY:
case CMD_LIST_EQUIPMENT:
+ case CMD_LIST_GOLD:
case CMD_CHARACTER_DUMP:
case CMD_DISPLAY_COMMANDS:
case CMD_DISPLAY_INVENTORY:
@@ -2416,6 +2417,11 @@ void process_command( command_type cmd )
get_invent(OSEL_EQUIP);
break;
+ case CMD_LIST_GOLD:
+ mprf("You have %d gold piece%s.",
+ you.gold, (you.gold > 1) ? "s" : "");
+ break;
+
case CMD_INSCRIBE_ITEM:
prompt_inscribe_item();
break;
diff --git a/crawl-ref/source/cmd-keys.h b/crawl-ref/source/cmd-keys.h
index bdf2c8baa5..1f5b4ba60e 100644
--- a/crawl-ref/source/cmd-keys.h
+++ b/crawl-ref/source/cmd-keys.h
@@ -83,6 +83,7 @@
{'=', CMD_ADJUST_INVENTORY},
{'?', CMD_DISPLAY_COMMANDS},
{'!', CMD_ANNOTATE_LEVEL},
+{'$', CMD_LIST_GOLD},
{CONTROL('D'), CMD_MACRO_ADD},
{'~', CMD_MACRO_ADD},
#ifdef WIZARD
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 44852ac7ee..b4e0a3e47d 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -460,6 +460,7 @@ enum command_type
CMD_LIST_ARMOUR,
CMD_LIST_JEWELLERY,
CMD_LIST_EQUIPMENT,
+ CMD_LIST_GOLD,
CMD_ZAP_WAND,
CMD_CAST_SPELL,
CMD_MEMORISE_SPELL,
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 7a0556c495..7279150d0e 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -1094,7 +1094,7 @@ public:
bool has_action_energy() const;
void check_redraw(const coord_def &oldpos) const;
void apply_location_effects();
-
+
void moveto(const coord_def& c);
bool move_to_pos(const coord_def &newpos);
@@ -1810,6 +1810,7 @@ public:
std::vector<message_colour_mapping> message_colour_mappings;
bool menu_colour_prefix_class; // Prefix item class to string
+ bool menu_colour_shops; // Use menu colours in shops?
std::vector<menu_sort_condition> sort_menus;
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 55e6e64aac..3d09caef7d 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -912,6 +912,7 @@ void game_options::reset_options()
sound_mappings.clear();
menu_colour_mappings.clear();
menu_colour_prefix_class = false;
+ menu_colour_shops = true;
message_colour_mappings.clear();
drop_filter.clear();
map_file_name.clear();
@@ -2745,6 +2746,8 @@ void game_options::read_option_line(const std::string &str, bool runscript)
}
else BOOL_OPTION(menu_colour_prefix_class);
else BOOL_OPTION_NAMED("menu_color_prefix_class", menu_colour_prefix_class);
+ else BOOL_OPTION(menu_colour_shops);
+ else BOOL_OPTION_NAMED("menu_color_shops", menu_colour_shops);
else if (key == "message_colour" || key == "message_color")
{
add_message_colour_mappings(field);
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc
index 03dba10ef3..996c07239d 100644
--- a/crawl-ref/source/menu.cc
+++ b/crawl-ref/source/menu.cc
@@ -1170,7 +1170,7 @@ int menu_colour(const std::string &text, const std::string &prefix,
{
const colour_mapping &cm = Options.menu_colour_mappings[i];
if ((cm.tag.empty() || cm.tag == "any" || cm.tag == tag
- || cm.tag == "inventory" && tag == "pickup")
+ || cm.tag == "inventory" && tag == "pickup")
&& cm.pattern.matches(tmp_text) )
{
return (cm.colour);
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc
index 3568d5d79d..4e9f6eb3f6 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -104,7 +104,7 @@ static void _list_shop_keys(const std::string &purchasable)
std::string pkeys = _purchase_keys(purchasable);
if (!pkeys.empty())
- pkeys = "[" + pkeys + "] Buy Item";
+ pkeys = "[" + pkeys + "] Select Item";
snprintf(buf, sizeof buf,
"[<w>x</w>/<w>Esc</w>] Exit [<w>v</w>] Examine Items %s",
@@ -117,7 +117,7 @@ static void _list_shop_keys(const std::string &purchasable)
fs = formatted_string::parse_string(
"[<w>?</w>/<w>*</w>] Inventory "
- "[<w>\\</w>] Known Items");
+ "[<w>\\</w>] Known Items [<w>Enter</w>] Make Purchase");
fs.cprintf("%*s", get_number_of_cols() - fs.length() - 1, "");
fs.display();
}
@@ -193,7 +193,18 @@ static std::string _shop_print_stock( const std::vector<int>& stock,
else
cprintf("%c - ", c);
- textcolor(i % 2 ? LIGHTGREY : WHITE);
+
+ if (Options.menu_colour_shops)
+ {
+ // Colour stock according to menu colours.
+ const std::string colprf = menu_colour_item_prefix(mitm[stock[i]]);
+ const int col = menu_colour(mitm[stock[i]].name(DESC_NOCAP_A),
+ colprf, "shop");
+ textcolor(col != -1 ? col : LIGHTGREY);
+ }
+ else
+ textcolor(i % 2 ? LIGHTGREY : WHITE);
+
cprintf("%-56s%5d gold",
mitm[stock[i]].name(DESC_NOCAP_A, false, id).c_str(),
gp_value);