From ddb06573dfa0b2c18facadecb9d44c98a37927eb Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 26 Oct 2023 12:32:36 +0200 Subject: [PATCH] crossbow:: weapon selection in menu --- config.cpp | 15 +++++++++++++++ menus.cpp | 3 +++ 2 files changed, 18 insertions(+) diff --git a/config.cpp b/config.cpp index defe5e16..a1863696 100644 --- a/config.cpp +++ b/config.cpp @@ -1538,6 +1538,21 @@ EX void initConfig() { "neon mode", 'M' ); + param_enum(bow::weapon, "pc_class", "pc_class", bow::weapon) + -> editable({{"blade", "Standard Rogue weapon. Bump into a monster to hit. Most monsters attack you the same way."}, + {"crossbow", "Hits all monsters in a straight line, but slow to reload. Press 'f' or click the crossbow icon to target."}}, + "weapon selection", 'w') + -> set_value_to = [] (bow::eWeapon wpn) { bool b = game_active; if(wpn != bow::weapon) stop_game(); bow::weapon = wpn; if(b) start_game(); }; + param_enum(bow::style, "bow_style", "bow_style", bow::style) + -> editable({{"bull line", "Can go in either direction on odd shapes. 3 turns to reload."}, + {"geodesic", "Graph geodesic: any sequence of tiles is OK as long as there are no shortcuts. 4 turns to reload."}}, + "crossbow straight line style", 'l') + -> set_value_to = [] (bow::eCrossbowStyle s) { bool b = game_active; if(s != bow::style) stop_game(); bow::style = s; if(b) start_game(); }; + param_b(bow::bump_to_shoot, "bump_to_shoot", true)->editable("bump to shoot", 'b'); + + param_enum(vid.msgleft, "message_style", "message style", 2) + -> editable({{"centered", ""}, {"left-aligned", ""}, {"line-broken", ""}}, "message style", 'a'); + addsaverenum(neon_nofill, "neon_nofill"); param_b(noshadow, "noshadow"); param_b(bright, "bright"); diff --git a/menus.cpp b/menus.cpp index fd0a0693..6277d835 100644 --- a/menus.cpp +++ b/menus.cpp @@ -660,6 +660,9 @@ EX void showChangeMode() { multi::cpid = 0; menuitem_land_structure('l'); + dialog::addBoolItem(XLAT("weapon selection"), bow::weapon, 'b'); + dialog::add_action_confirmed([] { pushScreen(bow::showMenu); }); + dialog::addBoolItem(XLAT("puzzle/exploration mode"), peace::on, 'p'); dialog::add_action_push(peace::showMenu);