From 59e0b5d6a6ff0b6c1ba448838305614ec477d27e Mon Sep 17 00:00:00 2001 From: Eila Attwood Date: Thu, 6 Feb 2020 13:14:52 +0200 Subject: [PATCH] Added position query for spray can and markers actions. --- src/iuse.cpp | 10 +++++++--- src/iuse_actor.cpp | 9 +++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/iuse.cpp b/src/iuse.cpp index 4c29b83d8e89a..d9bfb3f1e4a54 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -5507,7 +5507,11 @@ int iuse::artifact( player *p, item *it, bool, const tripoint & ) int iuse::spray_can( player *p, item *it, bool, const tripoint & ) { - return handle_ground_graffiti( *p, it, _( "Spray what?" ), p->pos() ); + const cata::optional dest_ = choose_adjacent( _( "Spray where?" ) ); + if( !dest_ ) { + return 0; + } + return handle_ground_graffiti( *p, it, _( "Spray what?" ), dest_.value() ); } int iuse::handle_ground_graffiti( player &p, item *it, const std::string &prefix, @@ -5532,7 +5536,7 @@ int iuse::handle_ground_graffiti( player &p, item *it, const std::string &prefix if( grave ) { p.add_msg_if_player( m_info, _( "You blur the inscription on the grave." ) ); } else { - p.add_msg_if_player( m_info, _( "You manage to get rid of the message on the ground." ) ); + p.add_msg_if_player( m_info, _( "You manage to get rid of the message on the surface." ) ); } } else { return 0; @@ -5542,7 +5546,7 @@ int iuse::handle_ground_graffiti( player &p, item *it, const std::string &prefix if( grave ) { p.add_msg_if_player( m_info, _( "You carve an inscription on the grave." ) ); } else { - p.add_msg_if_player( m_info, _( "You write a message on the ground." ) ); + p.add_msg_if_player( m_info, _( "You write a message on the surface." ) ); } move_cost = 2 * message.length(); } diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index 4953878b494dd..ae096b6dbfc02 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -1678,7 +1678,7 @@ int inscribe_actor::use( player &p, item &it, bool t, const tripoint & ) const if( on_terrain && on_items ) { uilist imenu; imenu.text = string_format( _( "%s on what?" ), verb ); - imenu.addentry( 0, true, MENU_AUTOASSIGN, _( "The ground" ) ); + imenu.addentry( 0, true, MENU_AUTOASSIGN, _( "The terrain" ) ); imenu.addentry( 1, true, MENU_AUTOASSIGN, _( "An item" ) ); imenu.query(); choice = imenu.ret; @@ -1693,7 +1693,12 @@ int inscribe_actor::use( player &p, item &it, bool t, const tripoint & ) const } if( choice == 0 ) { - return iuse::handle_ground_graffiti( p, &it, string_format( _( "%s what?" ), verb ), p.pos() ); + const cata::optional dest_ = choose_adjacent( _( "Write where?" ) ); + if( !dest_ ) { + return 0; + } + return iuse::handle_ground_graffiti( p, &it, string_format( _( "%s what?" ), verb ), + dest_.value() ); } item_location loc = game_menus::inv::titled_menu( g->u, _( "Inscribe which item?" ) );