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 all 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
19 changes: 18 additions & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6619,6 +6619,14 @@ look_around_result game::look_around( catacurses::window w_info, tripoint &cente

int la_y = 0;
int la_x = TERMX - panel_width;
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;
}
}
int la_h = height;
int la_w = panel_width;
w_info = catacurses::newwin( la_h, la_w, point( la_x, la_y ) );
Expand Down Expand Up @@ -6757,7 +6765,16 @@ look_around_result game::look_around( catacurses::window w_info, tripoint &cente

int panel_width = panel_manager::get_manager().get_current_layout().begin()->get_width();
int height = pixel_minimap_option ? TERMY - getmaxy( w_pixel_minimap ) : TERMY;
w_info = catacurses::newwin( height, panel_width, point( TERMX - panel_width, 0 ) );
int la_x = TERMX - panel_width;
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;
}
}
w_info = catacurses::newwin( height, panel_width, point( la_x, 0 ) );
} else if( action == "LEVEL_UP" || action == "LEVEL_DOWN" ) {
if( !allow_zlev_move ) {
continue;
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