You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
350 lines
10 KiB
350 lines
10 KiB
ctrl_Left = 0
|
|
ctrl_Right = 0
|
|
ctrl_Up = 0
|
|
ctrl_Down = 0
|
|
ctrl_A = 0
|
|
ctrl_B = 0
|
|
ctrl_X = 0
|
|
ctrl_L = 0
|
|
ctrl_R = 0
|
|
ctrl_Select = 0
|
|
ctrl_Start = 0
|
|
ctrl_L2 = 0
|
|
ctrl_R2 = 0
|
|
ctrl_Exit = 0
|
|
ctrl_Menu1 = 0
|
|
ctrl_Menu2 = 0
|
|
walk_zone = 0
|
|
if (ctrl_Left == 0 && ctrl_Right == 0 && (!keyboard_check(global.opkeybtn_right)) && keyboard_check(global.opkeybtn_left))
|
|
{
|
|
ctrl_Left = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if (ctrl_Left == 0 && ctrl_Right == 0 && (!keyboard_check(global.opkeybtn_left)) && keyboard_check(global.opkeybtn_right))
|
|
{
|
|
ctrl_Right = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if (ctrl_Up == 0 && ctrl_Down == 0 && (!keyboard_check(global.opkeybtn_down)) && keyboard_check(global.opkeybtn_up))
|
|
{
|
|
ctrl_Up = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if (ctrl_Up == 0 && ctrl_Down == 0 && (!keyboard_check(global.opkeybtn_up)) && keyboard_check(global.opkeybtn_down))
|
|
{
|
|
ctrl_Down = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if keyboard_check(global.opkeybtn_a)
|
|
{
|
|
ctrl_A = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if keyboard_check(global.opkeybtn_b)
|
|
{
|
|
ctrl_B = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if keyboard_check(global.opkeybtn_x)
|
|
{
|
|
ctrl_X = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if keyboard_check(global.opkeybtn_l)
|
|
{
|
|
ctrl_L = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if (global.opaimstyle == 1 && keyboard_check(global.opkeybtn_l2))
|
|
{
|
|
ctrl_L2 = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if keyboard_check(global.opkeybtn_r)
|
|
{
|
|
ctrl_R = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if keyboard_check(global.opkeybtn_r2)
|
|
{
|
|
ctrl_R2 = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if keyboard_check(global.opkeybtn_select)
|
|
{
|
|
ctrl_Select = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if keyboard_check(global.opkeybtn_start)
|
|
{
|
|
ctrl_Start = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if keyboard_check(global.opkeybtn_exit)
|
|
{
|
|
ctrl_Exit = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if keyboard_check(global.opkeybtn_menu1)
|
|
{
|
|
ctrl_Menu1 = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if keyboard_check(global.opkeybtn_menu2)
|
|
{
|
|
ctrl_Menu2 = 1
|
|
global.controltype = 0
|
|
global.joydetected = 0
|
|
}
|
|
if (gamepad_is_supported() && (!global.compatibilitymode))
|
|
{
|
|
if (gamepad_is_connected(global.gamepadIndex) && global.opxjoyenable)
|
|
{
|
|
if global.opxjoyvib
|
|
gamepad_set_vibration(global.gamepadIndex, global.vibL, global.vibR)
|
|
xjoyx = gamepad_axis_value(global.gamepadIndex, gp_axislh)
|
|
xjoyy = gamepad_axis_value(global.gamepadIndex, gp_axislv)
|
|
if is_walkzone(xjoyx, xjoyy, 1)
|
|
walk_zone = 1
|
|
if is_past_deadzone(xjoyx, xjoyy, 1)
|
|
{
|
|
if (ctrl_Left == 0 && ctrl_Right == 0 && xjoyx < (-((global.opxjoydz / 200))))
|
|
{
|
|
ctrl_Left = (-xjoyx)
|
|
global.controltype = 2
|
|
}
|
|
if (ctrl_Left == 0 && ctrl_Right == 0 && xjoyx > (global.opxjoydz / 200))
|
|
{
|
|
ctrl_Right = xjoyx
|
|
global.controltype = 2
|
|
}
|
|
if (ctrl_Up == 0 && ctrl_Down == 0 && xjoyy < (-((global.opxjoydz / 200))))
|
|
{
|
|
ctrl_Up = 1
|
|
global.controltype = 2
|
|
}
|
|
if (ctrl_Up == 0 && ctrl_Down == 0 && xjoyy > (global.opxjoydz / 200))
|
|
{
|
|
ctrl_Down = 1
|
|
global.controltype = 2
|
|
}
|
|
}
|
|
if (ctrl_Left == 0 && ctrl_Right == 0 && gamepad_button_check(global.gamepadIndex, gp_padl))
|
|
{
|
|
ctrl_Left = 1
|
|
global.controltype = 2
|
|
walk_zone = 0
|
|
}
|
|
if (ctrl_Left == 0 && ctrl_Right == 0 && gamepad_button_check(global.gamepadIndex, gp_padr))
|
|
{
|
|
ctrl_Right = 1
|
|
global.controltype = 2
|
|
walk_zone = 0
|
|
}
|
|
if (ctrl_Up == 0 && ctrl_Down == 0 && gamepad_button_check(global.gamepadIndex, gp_padu))
|
|
{
|
|
ctrl_Up = 1
|
|
global.controltype = 2
|
|
walk_zone = 0
|
|
}
|
|
if (ctrl_Up == 0 && ctrl_Down == 0 && gamepad_button_check(global.gamepadIndex, gp_padd))
|
|
{
|
|
ctrl_Down = 1
|
|
global.controltype = 2
|
|
walk_zone = 0
|
|
}
|
|
if (ctrl_A == 0 && gamepad_button_check(global.gamepadIndex, global.opxjoybtn_a))
|
|
{
|
|
ctrl_A = 1
|
|
global.controltype = 2
|
|
}
|
|
if (ctrl_B == 0 && gamepad_button_check(global.gamepadIndex, global.opxjoybtn_b))
|
|
{
|
|
ctrl_B = 1
|
|
global.controltype = 2
|
|
}
|
|
if (ctrl_X == 0 && gamepad_button_check(global.gamepadIndex, global.opxjoybtn_x))
|
|
{
|
|
ctrl_X = 1
|
|
global.controltype = 2
|
|
}
|
|
if (ctrl_L == 0 && gamepad_button_check(global.gamepadIndex, global.opxjoybtn_l))
|
|
{
|
|
ctrl_L = 1
|
|
global.controltype = 2
|
|
}
|
|
if (global.opaimstyle == 1 && ctrl_L2 == 0 && gamepad_button_check(global.gamepadIndex, global.opxjoybtn_l2))
|
|
{
|
|
ctrl_L2 = 1
|
|
global.controltype = 2
|
|
}
|
|
if (ctrl_R == 0 && gamepad_button_check(global.gamepadIndex, global.opxjoybtn_r))
|
|
{
|
|
ctrl_R = 1
|
|
global.controltype = 2
|
|
}
|
|
if (ctrl_R2 == 0 && gamepad_button_check(global.gamepadIndex, global.opxjoybtn_r2))
|
|
{
|
|
ctrl_R2 = 1
|
|
global.controltype = 2
|
|
}
|
|
if (ctrl_Select == 0 && gamepad_button_check(global.gamepadIndex, global.opxjoybtn_sel))
|
|
{
|
|
ctrl_Select = 1
|
|
global.controltype = 2
|
|
}
|
|
if (ctrl_Start == 0 && gamepad_button_check(global.gamepadIndex, global.opxjoybtn_str))
|
|
{
|
|
ctrl_Start = 1
|
|
global.controltype = 2
|
|
}
|
|
if (ctrl_Exit == 0 && gamepad_button_check(global.gamepadIndex, global.opxjoybtn_exit))
|
|
{
|
|
ctrl_Exit = 1
|
|
global.controltype = 2
|
|
}
|
|
if (ctrl_Menu1 == 0 && gamepad_button_check(global.gamepadIndex, global.opxjoybtn_menu1))
|
|
{
|
|
ctrl_Menu1 = 1
|
|
global.controltype = 2
|
|
}
|
|
if (ctrl_Menu2 == 0 && gamepad_button_check(global.gamepadIndex, global.opxjoybtn_menu2))
|
|
{
|
|
ctrl_Menu2 = 1
|
|
global.controltype = 2
|
|
}
|
|
}
|
|
}
|
|
if gamepad_is_supported()
|
|
{
|
|
if (gamepad_is_connected(global.opjoyid) && global.joydetected && global.compatibilitymode)
|
|
{
|
|
xjoyx = gamepad_axis_value(global.opjoyid, global.opjoybtn_xax)
|
|
xjoyy = gamepad_axis_value(global.opjoyid, global.opjoybtn_yax)
|
|
if is_past_deadzone(xjoyx, xjoyy, 0)
|
|
{
|
|
if is_walkzone(xjoyx, xjoyy, 0)
|
|
walk_zone = 1
|
|
if (ctrl_Left == 0 && ctrl_Right == 0 && xjoyx < (-((global.opxjoydz / 200))))
|
|
{
|
|
ctrl_Left = (-xjoyx)
|
|
global.controltype = 1
|
|
}
|
|
if (ctrl_Left == 0 && ctrl_Right == 0 && xjoyx > (global.opxjoydz / 200))
|
|
{
|
|
ctrl_Right = xjoyx
|
|
global.controltype = 1
|
|
}
|
|
if (ctrl_Up == 0 && ctrl_Down == 0 && xjoyy < (-((global.opxjoydz / 200))))
|
|
{
|
|
ctrl_Up = 1
|
|
global.controltype = 1
|
|
}
|
|
if (ctrl_Up == 0 && ctrl_Down == 0 && xjoyy > (global.opxjoydz / 200))
|
|
{
|
|
ctrl_Down = 1
|
|
global.controltype = 1
|
|
}
|
|
}
|
|
if (ctrl_Left == 0 && ctrl_Right == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_padl - 1)))
|
|
{
|
|
ctrl_Left = 1
|
|
global.controltype = 1
|
|
walk_zone = 0
|
|
}
|
|
if (ctrl_Left == 0 && ctrl_Right == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_padr - 1)))
|
|
{
|
|
ctrl_Right = 1
|
|
global.controltype = 1
|
|
walk_zone = 0
|
|
}
|
|
if (ctrl_Up == 0 && ctrl_Down == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_padu - 1)))
|
|
{
|
|
ctrl_Up = 1
|
|
global.controltype = 1
|
|
walk_zone = 0
|
|
}
|
|
if (ctrl_Up == 0 && ctrl_Down == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_padd - 1)))
|
|
{
|
|
ctrl_Down = 1
|
|
global.controltype = 1
|
|
walk_zone = 0
|
|
}
|
|
if (ctrl_A == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_a - 1)))
|
|
{
|
|
ctrl_A = 1
|
|
global.controltype = 1
|
|
}
|
|
if (ctrl_B == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_b - 1)))
|
|
{
|
|
ctrl_B = 1
|
|
global.controltype = 1
|
|
}
|
|
if (ctrl_X == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_x - 1)))
|
|
{
|
|
ctrl_X = 1
|
|
global.controltype = 1
|
|
}
|
|
if (ctrl_L == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_l - 1)))
|
|
{
|
|
ctrl_L = 1
|
|
global.controltype = 1
|
|
}
|
|
if (global.opaimstyle == 1 && ctrl_L2 == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_l2 - 1)))
|
|
{
|
|
ctrl_L2 = 1
|
|
global.controltype = 1
|
|
}
|
|
if (ctrl_R == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_r - 1)))
|
|
{
|
|
ctrl_R = 1
|
|
global.controltype = 1
|
|
}
|
|
if (ctrl_R2 == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_r2 - 1)))
|
|
{
|
|
ctrl_R2 = 1
|
|
global.controltype = 1
|
|
}
|
|
if (ctrl_Select == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_sel - 1)))
|
|
{
|
|
ctrl_Select = 1
|
|
global.controltype = 1
|
|
}
|
|
if (ctrl_Start == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_str - 1)))
|
|
{
|
|
ctrl_Start = 1
|
|
global.controltype = 1
|
|
}
|
|
if (ctrl_Exit == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_exit - 1)))
|
|
{
|
|
ctrl_Exit = 1
|
|
global.controltype = 1
|
|
}
|
|
if (ctrl_Menu1 == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_menu1 - 1)))
|
|
{
|
|
ctrl_Menu1 = 1
|
|
global.controltype = 1
|
|
}
|
|
if (ctrl_Menu2 == 0 && gamepad_button_check(global.opjoyid, (global.opjoybtn_menu2 - 1)))
|
|
{
|
|
ctrl_Menu2 = 1
|
|
global.controltype = 1
|
|
}
|
|
}
|
|
}
|