Skip to content

Commit

Permalink
Fix tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
Kilvoctu committed Dec 22, 2024
1 parent c3da515 commit df5c9c2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/gpkey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ std::string convert_to_gamepad( const std::string keybind_in_pre )
keybind_out = gp_triangle;
} else if( keybind_in == "e" ) {
keybind_out = gp_square;
} else if( keybind_in == "c" ) { //replace references of examine terrain/furnish to examine all
keybind_out = gp_square;
} else if( keybind_in == "f" ) {
keybind_out = gp_r1;
} else if( keybind_in == "g" ) {
Expand All @@ -90,8 +92,12 @@ std::string convert_to_gamepad( const std::string keybind_in_pre )
keybind_out = string_format( "%s", gp_rstick_right );
} else if( keybind_in == "D" ) {
keybind_out = string_format( "%s%s", l_mod, gp_triangle );
} else if( keybind_in == "B" ) { //replace references of drop to multidrop
keybind_out = string_format( "%s%s", l_mod, gp_triangle );
} else if( keybind_in == "E" ) {
keybind_out = string_format( "%s%s", l_mod, gp_square );
} else if( keybind_in == "N" ) { //replace references of pickup adjacent to pickup nearby
keybind_out = string_format( "%s%s", l_mod, gp_square );
} else if( keybind_in == "F" ) {
keybind_out = string_format( "%s%s", l_mod, gp_r1 );
} else if( keybind_in == "G" ) {
Expand Down Expand Up @@ -150,8 +156,19 @@ std::string convert_to_gamepad( const std::string keybind_in_pre )
keybind_out = gp_left;
} else if( keybind_in == "RIGHT" ) {
keybind_out = gp_right;
//handle diagonals
} else if( keybind_in == "HOME" ) { //NW
keybind_out = string_format( "%s%s", l_mod, gp_up_left );
} else if( keybind_in == "PPAGE" ) { //NE
keybind_out = string_format( "%s%s", l_mod, gp_up_right );
} else if( keybind_in == "END" ) { //SW
keybind_out = string_format( "%s%s", l_mod, gp_down_left );
} else if( keybind_in == "NPAGE" ) { //SE
keybind_out = string_format( "%s%s", l_mod, gp_down_right );
} else if( keybind_in == "ESC" ) {
keybind_out = gp_circle;
} else if( keybind_in == "S" ) { //replace references of save to main menu (where save exists)
keybind_out = gp_circle;
} else if( keybind_in == "RETURN" ) {
keybind_out = gp_cross;
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "item.h"
#include "line.h"
#include "game.h"
#include "gpkey.h"
#include "options.h"
#include "point.h"
#include "popup.h"
Expand Down Expand Up @@ -2528,7 +2529,7 @@ void replace_keybind_tag( std::string &input )
}
} else {
keybind_desc = enumerate_as_string( keys.begin(), keys.end(), []( const input_event & k ) {
return colorize( '\'' + k.long_description() + '\'', c_yellow );
return colorize( '\'' + convert_to_gamepad ( k.long_description() ) + '\'', c_yellow );
}, enumeration_conjunction::or_ );
}
std::string to_replace = string_format( "%s%s%s", keybind_tag_start, keybind_full,
Expand Down

0 comments on commit df5c9c2

Please sign in to comment.