Fixed controll bugs, Enabled controller config menu, PS2 like layout is finished, Testing is needed on Xbox and PS2 dual stick modes

This commit is contained in:
Soniccd123
2024-12-16 23:56:45 -03:00
committed by Stefanos Kornilios Mitsis Poiitidis
parent c458e6c466
commit 1e03ff65d8
2 changed files with 33 additions and 17 deletions

View File

@@ -764,7 +764,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
// MENUPAGE_OPTIONS = 41
{ "FET_OPT", MENUPAGE_NONE, MENUPAGE_NONE, nil, nil,
#ifdef GTA_HANDHELD
#ifdef RW_DC
MENUACTION_CHANGEMENU, "FET_CTL", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS },
#else
MENUACTION_CHANGEMENU, "FET_CTL", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC },

View File

@@ -1607,6 +1607,8 @@ int16 CPad::GetSteeringLeftRight(void)
{
if (NewState.X)
return 0;
if (NewState.A && ((NewState.LeftStickX < -64) || (NewState.LeftStickX > 64)))
return 0;
return NewState.LeftStickX;
}
case 1: //PS2 Mode
@@ -1618,6 +1620,8 @@ int16 CPad::GetSteeringLeftRight(void)
{
if (NewState.LeftTrigger > 128)
return 0;
if (NewState.A && ((NewState.RightTrigger > 128) || (NewState.LeftTrigger > 128)))
return 0;
return NewState.LeftStickX;
}
}
@@ -2003,8 +2007,8 @@ bool CPad::GetLookLeft(void)
}
else
{
if (NewState.A)
return CPad::GetPad(0)->GetAnaloguePadLeft();
if (NewState.A && (NewState.LeftStickX < -64))
return true;
}
case 1: //PS2 Mode
if (CPad::GetPad(0)->IsDualAnalog)
@@ -2014,8 +2018,8 @@ bool CPad::GetLookLeft(void)
}
else
{
if (NewState.B)
return CPad::GetPad(0)->GetAnaloguePadLeft();
if (NewState.B && (NewState.LeftTrigger > 128))
return true;
}
}
#else
@@ -2024,6 +2028,8 @@ bool CPad::GetLookLeft(void)
#endif
return false;
}
bool CPad::GetLookRight(void)
@@ -2041,8 +2047,8 @@ bool CPad::GetLookRight(void)
}
else
{
if (NewState.A)
return CPad::GetPad(0)->GetAnaloguePadRight();
if (NewState.A && (NewState.LeftStickX > 64))
return true;
}
case 1: //PS2 Mode
if (CPad::GetPad(0)->IsDualAnalog)
@@ -2052,8 +2058,8 @@ bool CPad::GetLookRight(void)
}
else
{
if (NewState.B)
return CPad::GetPad(0)->GetAnaloguePadRight();
if (NewState.B && (NewState.RightTrigger > 128))
return true;
}
}
#else
@@ -2061,6 +2067,8 @@ bool CPad::GetLookRight(void)
return !!(NewState.RightShoulder2 && !NewState.LeftShoulder2);
#endif
return false;
}
@@ -2102,6 +2110,8 @@ bool CPad::GetLookBehindForCar(void)
#endif
return false;
}
bool CPad::GetLookBehindForPed(void)
@@ -2136,6 +2146,8 @@ bool CPad::GetLookBehindForPed(void)
return !!NewState.RightShock;
#endif
return false;
}
bool CPad::GetHorn(void)
@@ -2424,11 +2436,13 @@ int16 CPad::GetBrake(void)
case 1: //PS2 Mode
if (CPad::GetPad(0)->IsDualAnalog)
{
return NewState.X;
if(NewState.X)
return 255;
}
else
{
return NewState.X;
if(NewState.X)
return 255;
}
}
#else
@@ -2685,11 +2699,13 @@ int16 CPad::GetAccelerate(void)
case 1: //PS2 Mode
if (CPad::GetPad(0)->IsDualAnalog)
{
return NewState.A;
if(NewState.A)
return 255;
}
else
{
return NewState.A;
if(NewState.A)
return 255;
}
}
@@ -3568,7 +3584,7 @@ float axis = 0;
}
else
{
if (NewState.X)
if (!NewState.X)
return 0;
axis = NewState.LeftStickX;
}
@@ -3579,7 +3595,7 @@ float axis = 0;
}
else
{
if (NewState.LeftTrigger > 128)
if (!(NewState.LeftTrigger > 128))
return 0;
axis = NewState.LeftStickX;
}
@@ -3614,7 +3630,7 @@ int16 axis = 0;
}
else
{
if (NewState.X)
if (!NewState.X)
return 0;
axis = NewState.LeftStickY;
}
@@ -3625,7 +3641,7 @@ int16 axis = 0;
}
else
{
if (NewState.LeftTrigger > 128)
if (!(NewState.LeftTrigger > 128))
return 0;
axis = NewState.LeftStickY;
}