- [FIX] Gamepad redefine was not working correctly
- [FIX] ESC can't be reassigned - [NEW] cursor keys, space, cursor pad and button A can always be used to move around menus.
This commit is contained in:
@@ -370,7 +370,7 @@ function update_menu()
|
|||||||
|
|
||||||
redraw_menu_hab()
|
redraw_menu_hab()
|
||||||
|
|
||||||
if btnp(keyShoot) or padp(btnShoot) then
|
if btnp(keyShoot) or btnp(KEY_SPACE) or padp(BTN_A) or padp(btnShoot) then
|
||||||
if menu_sel==0 then
|
if menu_sel==0 then
|
||||||
game_exit()
|
game_exit()
|
||||||
game_init()
|
game_init()
|
||||||
@@ -382,10 +382,10 @@ function update_menu()
|
|||||||
menu_count=0
|
menu_count=0
|
||||||
menu_state=2
|
menu_state=2
|
||||||
end
|
end
|
||||||
elseif btnp(keyDown) or padp(btnDown) then
|
elseif btnp(keyDown) or btnp(KEY_DOWN) or padp(BTN_DOWN) padp(btnDown) then
|
||||||
menu_sel=menu_sel+1
|
menu_sel=menu_sel+1
|
||||||
if menu_sel==3 then menu_sel=0 end
|
if menu_sel==3 then menu_sel=0 end
|
||||||
elseif btnp(keyUp) or padp(btnUp) then
|
elseif btnp(keyUp) or btnp(KEY_UP) or padp(BTN_UP) or padp(btnUp) then
|
||||||
menu_sel=menu_sel-1
|
menu_sel=menu_sel-1
|
||||||
if menu_sel==-1 then menu_sel=2 end
|
if menu_sel==-1 then menu_sel=2 end
|
||||||
elseif btnp(KEY_M) then
|
elseif btnp(KEY_M) then
|
||||||
@@ -402,7 +402,7 @@ function update_menu()
|
|||||||
if menu_count==0 then
|
if menu_count==0 then
|
||||||
text("PULSA TECLA PER A AMUNT", 20, 24, 13)
|
text("PULSA TECLA PER A AMUNT", 20, 24, 13)
|
||||||
local key = btnp();
|
local key = btnp();
|
||||||
if key ~= 0 then
|
if key ~= 0 and key~=KEY_ESCAPE then
|
||||||
menu_count = 1
|
menu_count = 1
|
||||||
keyUp=key
|
keyUp=key
|
||||||
setconf("keyup", keyUp)
|
setconf("keyup", keyUp)
|
||||||
@@ -410,7 +410,7 @@ function update_menu()
|
|||||||
elseif menu_count==1 then
|
elseif menu_count==1 then
|
||||||
text("PULSA TECLA PER A AVALL", 20, 24, 13)
|
text("PULSA TECLA PER A AVALL", 20, 24, 13)
|
||||||
local key = btnp();
|
local key = btnp();
|
||||||
if key ~= 0 then
|
if key ~= 0 and key~=KEY_ESCAPE then
|
||||||
menu_count = 2
|
menu_count = 2
|
||||||
keyDown=key
|
keyDown=key
|
||||||
setconf("keydown", keyDown)
|
setconf("keydown", keyDown)
|
||||||
@@ -418,7 +418,7 @@ function update_menu()
|
|||||||
elseif menu_count==2 then
|
elseif menu_count==2 then
|
||||||
text("PULSA TECLA PER A ESQUERRA", 14, 24, 13)
|
text("PULSA TECLA PER A ESQUERRA", 14, 24, 13)
|
||||||
local key = btnp();
|
local key = btnp();
|
||||||
if key ~= 0 then
|
if key ~= 0 and key~=KEY_ESCAPE then
|
||||||
menu_count = 3
|
menu_count = 3
|
||||||
keyLeft=key
|
keyLeft=key
|
||||||
setconf("keleft", keyLeft)
|
setconf("keleft", keyLeft)
|
||||||
@@ -426,7 +426,7 @@ function update_menu()
|
|||||||
elseif menu_count==3 then
|
elseif menu_count==3 then
|
||||||
text("PULSA TECLA PER A DRETA", 20, 24, 13)
|
text("PULSA TECLA PER A DRETA", 20, 24, 13)
|
||||||
local key = btnp();
|
local key = btnp();
|
||||||
if key ~= 0 then
|
if key ~= 0 and key~=KEY_ESCAPE then
|
||||||
menu_count = 4
|
menu_count = 4
|
||||||
keyRight=key
|
keyRight=key
|
||||||
setconf("keyright", keyRight)
|
setconf("keyright", keyRight)
|
||||||
@@ -434,7 +434,7 @@ function update_menu()
|
|||||||
elseif menu_count==4 then
|
elseif menu_count==4 then
|
||||||
text("PULSA TECLA PER A DISPAR", 18, 24, 13)
|
text("PULSA TECLA PER A DISPAR", 18, 24, 13)
|
||||||
local key = btnp();
|
local key = btnp();
|
||||||
if key ~= 0 then
|
if key ~= 0 and key~=KEY_ESCAPE then
|
||||||
menu_count = 0
|
menu_count = 0
|
||||||
menu_state = 0
|
menu_state = 0
|
||||||
keyShoot=key
|
keyShoot=key
|
||||||
@@ -445,7 +445,7 @@ function update_menu()
|
|||||||
if menu_count==0 then
|
if menu_count==0 then
|
||||||
text("PULSA BOTÓ PER A AMUNT", 22, 24, 13)
|
text("PULSA BOTÓ PER A AMUNT", 22, 24, 13)
|
||||||
local btn = padp();
|
local btn = padp();
|
||||||
if btn ~= 0 then
|
if btn ~= -1 then
|
||||||
menu_count = 1
|
menu_count = 1
|
||||||
btnUp=btn
|
btnUp=btn
|
||||||
setconf("btnup", btnUp)
|
setconf("btnup", btnUp)
|
||||||
@@ -453,7 +453,7 @@ function update_menu()
|
|||||||
elseif menu_count==1 then
|
elseif menu_count==1 then
|
||||||
text("PULSA BOTÓ PER A AVALL", 22, 24, 13)
|
text("PULSA BOTÓ PER A AVALL", 22, 24, 13)
|
||||||
local btn = padp();
|
local btn = padp();
|
||||||
if btn ~= 0 then
|
if btn ~= -1 then
|
||||||
menu_count = 2
|
menu_count = 2
|
||||||
btnDown=btn
|
btnDown=btn
|
||||||
setconf("btndown", btnDown)
|
setconf("btndown", btnDown)
|
||||||
@@ -461,7 +461,7 @@ function update_menu()
|
|||||||
elseif menu_count==2 then
|
elseif menu_count==2 then
|
||||||
text("PULSA BOTÓ PER A ESQUERRA", 16, 24, 13)
|
text("PULSA BOTÓ PER A ESQUERRA", 16, 24, 13)
|
||||||
local btn = padp();
|
local btn = padp();
|
||||||
if btn ~= 0 then
|
if btn ~= -1 then
|
||||||
menu_count = 3
|
menu_count = 3
|
||||||
btnLeft=btn
|
btnLeft=btn
|
||||||
setconf("keleft", btnLeft)
|
setconf("keleft", btnLeft)
|
||||||
@@ -469,7 +469,7 @@ function update_menu()
|
|||||||
elseif menu_count==3 then
|
elseif menu_count==3 then
|
||||||
text("PULSA BOTÓ PER A DRETA", 22, 24, 13)
|
text("PULSA BOTÓ PER A DRETA", 22, 24, 13)
|
||||||
local btn = padp();
|
local btn = padp();
|
||||||
if btn ~= 0 then
|
if btn ~= -1 then
|
||||||
menu_count = 4
|
menu_count = 4
|
||||||
btnRight=btn
|
btnRight=btn
|
||||||
setconf("btnright", btnRight)
|
setconf("btnright", btnRight)
|
||||||
@@ -477,7 +477,7 @@ function update_menu()
|
|||||||
elseif menu_count==4 then
|
elseif menu_count==4 then
|
||||||
text("PULSA BOTÓ PER A DISPAR", 20, 24, 13)
|
text("PULSA BOTÓ PER A DISPAR", 20, 24, 13)
|
||||||
local btn = padp();
|
local btn = padp();
|
||||||
if btn ~= 0 then
|
if btn ~= -1 then
|
||||||
menu_count = 0
|
menu_count = 0
|
||||||
menu_state = 0
|
menu_state = 0
|
||||||
btnShoot=btn
|
btnShoot=btn
|
||||||
|
|||||||
Reference in New Issue
Block a user