Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to change position of look around windows #36804

Merged
merged 4 commits into from
Apr 11, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6618,7 +6618,17 @@ look_around_result game::look_around( catacurses::window w_info, tripoint &cente
}

int la_y = 0;
int la_x = TERMX - panel_width;
int la_x = 0;
std::string position = get_option<std::string>( "LOOKAROUND_POSITION" );
if( position == "left" ) {
if( get_option<std::string>( "SIDEBAR_POSITION" ) == "right" ) {
la_x = panel_manager::get_manager().get_width_left();
} else {
la_x = panel_manager::get_manager().get_width_left() - panel_width;
}
} else if( position == "right" ) {
Kilvoctu marked this conversation as resolved.
Show resolved Hide resolved
la_x = TERMX - panel_width;
}
int la_h = height;
int la_w = panel_width;
w_info = catacurses::newwin( la_h, la_w, point( la_x, la_y ) );
Expand Down
6 changes: 6 additions & 0 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1481,6 +1481,12 @@ void options_manager::add_options_interface()
false
);

add( "LOOKAROUND_POSITION", "interface", translate_marker( "Look around position" ),
translate_marker( "Switch between look around panel being left or right." ),
{ { "left", translate_marker( "Left" ) }, { "right", translate_marker( "Right" ) } },
"right"
);

add( "PICKUP_POSITION", "interface", translate_marker( "Pickup position" ),
translate_marker( "Switch between pickup panel being left, right, or overlapping the sidebar." ),
{ { "left", translate_marker( "Left" ) }, { "right", translate_marker( "Right" ) }, { "overlapping", translate_marker( "Overlapping" ) } },
Expand Down