Controls.select_weapon_count needs to be incremented differently to get non-0 when we want to select the laser type weapon; Readded jumping from first to last item in newmenu and vice versa
This commit is contained in:
parent
53c9fa987f
commit
01e522e6e7
|
@ -1,5 +1,9 @@
|
|||
D1X-Rebirth Changelog
|
||||
|
||||
20110211
|
||||
--------
|
||||
main/gamecntl.c, main/kconfig.c, main/newmenu.c: Controls.select_weapon_count needs to be incremented differently to get non-0 when we want to select the laser type weapon; Readded jumping from first to last item in newmenu and vice versa
|
||||
|
||||
20110210
|
||||
--------
|
||||
main/automap.c, main/gauges.c, main/gauges.h, main/kconfig.c, main/newmenu.c, main/newmenu.h: Fixed broken FlightSim indicator on Automap; Fixed Assert for using mouse buttons in kconfig (which can react to UP and DOWN states); Added scrolling support for menus flagged tiny_mode and all_text
|
||||
|
|
|
@ -198,8 +198,9 @@ void do_weapon_n_item_stuff()
|
|||
CycleSecondary ();
|
||||
Controls.cycle_secondary_count = 0;
|
||||
}
|
||||
if (Controls.select_weapon_count)
|
||||
if (Controls.select_weapon_count > 0)
|
||||
{
|
||||
Controls.select_weapon_count--;
|
||||
do_weapon_select(Controls.select_weapon_count>4?Controls.select_weapon_count-5:Controls.select_weapon_count,Controls.select_weapon_count>4?1:0);
|
||||
Controls.select_weapon_count = 0;
|
||||
}
|
||||
|
|
|
@ -1164,7 +1164,7 @@ void kconfig_read_controls(d_event *event, int automap_flag)
|
|||
for (i = 0, j = 0; i < 28; i += 3, j++)
|
||||
if (kc_d1x[i].value < 255 && kc_d1x[i].value == event_key_get_raw(event))
|
||||
{
|
||||
Controls.select_weapon_count = j;
|
||||
Controls.select_weapon_count = j+1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -1191,7 +1191,7 @@ void kconfig_read_controls(d_event *event, int automap_flag)
|
|||
for (i = 1, j = 0; i < 29; i += 3, j++)
|
||||
if (kc_d1x[i].value < 255 && kc_d1x[i].value == event_joystick_get_button(event))
|
||||
{
|
||||
Controls.select_weapon_count = j;
|
||||
Controls.select_weapon_count = j+1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -1218,7 +1218,7 @@ void kconfig_read_controls(d_event *event, int automap_flag)
|
|||
for (i = 2, j = 0; i < 30; i += 3, j++)
|
||||
if (kc_d1x[i].value < 255 && kc_d1x[i].value == event_mouse_get_button(event))
|
||||
{
|
||||
Controls.select_weapon_count = j;
|
||||
Controls.select_weapon_count = j+1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -570,6 +570,17 @@ void newmenu_scroll(newmenu *menu, int amount)
|
|||
if (first == last) // nothing to do for us
|
||||
return;
|
||||
|
||||
if (menu->citem == last && amount == 1) // if citem == last item and we want to go down one step, go to first item
|
||||
{
|
||||
newmenu_scroll(menu, -menu->nitems);
|
||||
return;
|
||||
}
|
||||
if (menu->citem == first && amount == -1) // if citem == first item and we want to go up one step, go to last item
|
||||
{
|
||||
newmenu_scroll(menu, menu->nitems);
|
||||
return;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
if (amount > 0) // down the list
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue