Skip to content

Commit

Permalink
Fixed handling of query page when clicking '1' (#3374)
Browse files Browse the repository at this point in the history
Fixes #3373
  • Loading branch information
Loobinex authored Jul 30, 2024
1 parent a926731 commit b2c689a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
11 changes: 5 additions & 6 deletions src/front_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -874,11 +874,10 @@ short get_status_panel_keyboard_action_inputs(void)
if (is_key_pressed(KC_1, KMod_NONE))
{
clear_key_pressed(KC_1);
fake_button_click(BID_INFO_TAB);
struct GuiButton* gbtn = get_gui_button(BID_QUERY_2);
if (gbtn != NULL)
{
if ((gbtn->flags & (LbBtnF_Visible | LbBtnF_Enabled)) != 0)
if (flag_is_set(gbtn->flags,(LbBtnF_Visible | LbBtnF_Enabled)))
{
if (menu_is_active(GMnu_QUERY))
{
Expand All @@ -890,10 +889,10 @@ short get_status_panel_keyboard_action_inputs(void)
fake_button_click(BID_INFO_TAB);
}
}
else
{
fake_button_click(BID_ROOM_TAB);
}
}
else
{
fake_button_click(BID_INFO_TAB);
}
}
if (is_key_pressed(KC_2, KMod_NONE))
Expand Down
16 changes: 2 additions & 14 deletions src/frontmenu_ingame_tabs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2046,24 +2046,12 @@ void maintain_player_page2(struct GuiButton *gbtn)
}
if(current_players_count > 4)
{

gbtn->pos_x = scale_ui_value(14);
gbtn->pos_y = scale_ui_value(374);
gbtn->scr_pos_x = scale_ui_value(14);
gbtn->scr_pos_y = scale_ui_value(374);
gbtn->width = scale_ui_value(52);
gbtn->height = scale_ui_value(20);
set_flag(gbtn->flags, (LbBtnF_Visible | LbBtnF_Enabled));
}
else
{
gbtn->pos_x = 0;
gbtn->pos_y = 0;
gbtn->scr_pos_x = 0;
gbtn->scr_pos_y = 0;
gbtn->width = 0;
gbtn->height = 0;
clear_flag(gbtn->flags, (LbBtnF_Visible | LbBtnF_Enabled));
}

}

void maintain_query_button(struct GuiButton *gbtn)
Expand Down
4 changes: 2 additions & 2 deletions src/frontmenu_ingame_tabs_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ struct GuiButtonInit creature_menu_buttons[] = {
};

struct GuiButtonInit query_menu_buttons[] = {
{LbBtnT_NormalBtn, BID_DEFAULT, 0, 0, gui_set_query, NULL, NULL, 0, 14, 374, 14, 374, 52, 20, gui_area_new_normal_button, GPS_rpanel_rpanel_btn_crinfo_act, GUIStr_GoToQueryMode, 0, {0}, 0, maintain_query_button },
{LbBtnT_NormalBtn, BID_QUERY_2, 0, 0, gui_switch_players_visible, NULL, NULL, 0, 74, 374, 74, 374, 52, 20, gui_area_new_normal_button, GPS_rpanel_rpanel_btn_nxpage_act, GUIStr_MoreInformation, 0, {0}, 0, maintain_player_page2 },
{LbBtnT_NormalBtn, BID_DEFAULT, 0, 0, gui_set_query, NULL, NULL, 0, 44, 374, 44, 374, 52, 20, gui_area_new_normal_button, GPS_rpanel_rpanel_btn_crinfo_act, GUIStr_GoToQueryMode, 0, {0}, 0, maintain_query_button },
{LbBtnT_NormalBtn, BID_QUERY_2, 0, 0, gui_switch_players_visible, NULL, NULL, 0, 14, 374, 14, 374, 52, 20, gui_area_new_normal_button, GPS_rpanel_rpanel_btn_nxpage_act, GUIStr_MoreInformation, 0, {0}, 0, maintain_player_page2 },
{LbBtnT_ToggleBtn, BID_QRY_IMPRSN, 0, 0, gui_set_tend_to, NULL, NULL, 1, 36, 190, 36, 190, 32, 26, gui_area_flash_cycle_button, GPS_rpanel_tendency_prisne_act, GUIStr_CreatureImprisonDesc, 0,{(long)&game.creatures_tend_imprison}, 1, maintain_prison_bar },
{LbBtnT_ToggleBtn, BID_QRY_FLEE, 0, 0, gui_set_tend_to, NULL, NULL, 2, 74, 190, 74, 190, 32, 26, gui_area_flash_cycle_button, GPS_rpanel_tendency_fleee_act, GUIStr_CreatureFleeDesc, 0,{(long)&game.creatures_tend_flee}, 1, NULL },
{LbBtnT_NormalBtn, BID_DEFAULT, 0, 0, NULL, NULL, NULL, 0, 4, 216, 4, 222,132, 24, gui_area_payday_button, GPS_rpanel_rpanel_payday_counter, GUIStr_PayTimeDesc, 0, {0}, 0, NULL },
Expand Down

0 comments on commit b2c689a

Please sign in to comment.