87_allow_NR_sequential
Added extra parameter to allow either or/both Neutral & Reverse in sequential shift mode. Even if commands set for Reverse/Neutral shift will shift out of Reverse for better games play (ie. R->1 when you're in a panic to go) git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@3738 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 049116084cf8f199e1eec15497cfdd63ea41168d Former-commit-id: 71de2a5365ee59969d846cf5fefbbe984e9818ee
This commit is contained in:
parent
1e37d64bee
commit
1c73f4cd3e
6 changed files with 35 additions and 10 deletions
|
@ -1189,8 +1189,13 @@ drive_mt(int index, tCarElt* car, tSituation *s)
|
|||
|| (cmd[CMD_UP_SHFT].type == GFCTRL_TYPE_KEYBOARD && keyInfo[lookUpKeyMap(cmd[CMD_UP_SHFT].val)].edgeUp)
|
||||
|| (cmd[CMD_UP_SHFT].type == GFCTRL_TYPE_JOY_ATOB && cmd[CMD_UP_SHFT].deadZone == 1))
|
||||
{
|
||||
if (HCtx[idx]->seqShftAllowNeutral || car->_gearCmd > -1)
|
||||
if (car->_gearCmd > -1)
|
||||
car->_gearCmd++;
|
||||
else if (HCtx[idx]->seqShftAllowNeutral && car->_gearCmd == -1)
|
||||
car->_gearCmd = 0;
|
||||
/* always allow up shift out of reverse to improve game play */
|
||||
else if (car->_gearCmd == -1)
|
||||
car->_gearCmd = 1;
|
||||
}
|
||||
|
||||
/* Down shifting command */
|
||||
|
@ -1199,8 +1204,12 @@ drive_mt(int index, tCarElt* car, tSituation *s)
|
|||
|| (cmd[CMD_DN_SHFT].type == GFCTRL_TYPE_KEYBOARD && keyInfo[lookUpKeyMap(cmd[CMD_DN_SHFT].val)].edgeUp)
|
||||
|| (cmd[CMD_DN_SHFT].type == GFCTRL_TYPE_JOY_ATOB && cmd[CMD_DN_SHFT].deadZone == 1))
|
||||
{
|
||||
if (HCtx[idx]->seqShftAllowNeutral || car->_gearCmd > 1)
|
||||
if (car->_gearCmd > 1)
|
||||
car->_gearCmd--;
|
||||
else if (HCtx[idx]->seqShftAllowNeutral && car->_gearCmd == 1)
|
||||
car->_gearCmd = 0;
|
||||
else if (HCtx[idx]->seqShftAllowReverse && car->_gearCmd < 2)
|
||||
car->_gearCmd = -1;
|
||||
}
|
||||
|
||||
/* Neutral gear command */
|
||||
|
|
|
@ -59,6 +59,7 @@ typedef struct HumanContext
|
|||
bool paramAbs;
|
||||
bool relButNeutral;
|
||||
bool seqShftAllowNeutral;
|
||||
bool seqShftAllowReverse;
|
||||
bool autoReverse;
|
||||
eDriveTrain driveTrain;
|
||||
int autoClutch;
|
||||
|
|
|
@ -207,6 +207,10 @@ HmReadPrefs(const int index)
|
|||
prm = GfParmGetStr(PrefHdle, sstring, HM_ATT_SEQSHFT_ALLOW_NEUTRAL, prm);
|
||||
HCtx[idx]->seqShftAllowNeutral = (prm == Yn[0]);
|
||||
|
||||
prm = GfParmGetStr(PrefHdle, defaultSettings, HM_ATT_SEQSHFT_ALLOW_REVERSE, Yn[HCtx[idx]->seqShftAllowReverse].c_str());
|
||||
prm = GfParmGetStr(PrefHdle, sstring, HM_ATT_SEQSHFT_ALLOW_REVERSE, prm);
|
||||
HCtx[idx]->seqShftAllowReverse = (prm == Yn[0]);
|
||||
|
||||
prm = GfParmGetStr(PrefHdle, sstring, HM_ATT_AUTOREVERSE, Yn[HCtx[idx]->autoReverse].c_str());
|
||||
HCtx[idx]->autoReverse = (prm == Yn[0]);
|
||||
}//HmReadPrefs
|
||||
|
|
|
@ -81,6 +81,7 @@
|
|||
|
||||
/* Tell if the sequential shifter can go to neutral */
|
||||
#define HM_ATT_SEQSHFT_ALLOW_NEUTRAL "sequential shifter allow neutral"
|
||||
#define HM_ATT_SEQSHFT_ALLOW_REVERSE "sequential shifter allow reverse"
|
||||
|
||||
#define HM_ATT_STEER_SENS "steer sensitivity"
|
||||
#define HM_ATT_STEER_POW "steer power"
|
||||
|
|
|
@ -748,16 +748,20 @@ void ControlPutSettings(void *prefHdle, unsigned index, tGearChangeMode gearChan
|
|||
if (gearChangeMode == GEAR_MODE_NONE)
|
||||
gearChangeMode = GearChangeMode;
|
||||
|
||||
/* Allow neutral gear in sequential mode if nor reverse nor neutral gear command defined */
|
||||
pszReverseCmd = GfctrlGetNameByRef(Cmd[ICmdReverseGear].ref.type, Cmd[ICmdReverseGear].ref.index);
|
||||
/* Allow neutral gear in sequential mode if neutral gear command not defined */
|
||||
pszNeutralCmd = GfctrlGetNameByRef(Cmd[ICmdNeutralGear].ref.type, Cmd[ICmdNeutralGear].ref.index);
|
||||
if (gearChangeMode == GEAR_MODE_SEQ
|
||||
&& (!pszReverseCmd || !strcmp(pszReverseCmd, "-")
|
||||
|| !pszNeutralCmd || !strcmp(pszNeutralCmd, "-")))
|
||||
if (gearChangeMode == GEAR_MODE_SEQ && (!pszNeutralCmd || !strcmp(pszNeutralCmd, "-")))
|
||||
GfParmSetStr(prefHdle, CurrentSection, HM_ATT_SEQSHFT_ALLOW_NEUTRAL, HM_VAL_YES);
|
||||
else
|
||||
GfParmSetStr(prefHdle, CurrentSection, HM_ATT_SEQSHFT_ALLOW_NEUTRAL, HM_VAL_NO);
|
||||
|
||||
/* Allow reverse gear in sequential mode if reverse gear command not defined */
|
||||
pszReverseCmd = GfctrlGetNameByRef(Cmd[ICmdReverseGear].ref.type, Cmd[ICmdReverseGear].ref.index);
|
||||
if (gearChangeMode == GEAR_MODE_SEQ && (!pszReverseCmd || !strcmp(pszReverseCmd, "-")))
|
||||
GfParmSetStr(prefHdle, CurrentSection, HM_ATT_SEQSHFT_ALLOW_REVERSE, HM_VAL_YES);
|
||||
else
|
||||
GfParmSetStr(prefHdle, CurrentSection, HM_ATT_SEQSHFT_ALLOW_REVERSE, HM_VAL_NO);
|
||||
|
||||
/* Release gear lever goes neutral in grid mode if no neutral gear command defined */
|
||||
if (gearChangeMode == GEAR_MODE_GRID
|
||||
&& (!pszNeutralCmd || !strcmp(pszNeutralCmd, "-")))
|
||||
|
|
|
@ -368,14 +368,20 @@ PutPlayerSettings(unsigned index)
|
|||
GfParmSetNum(PrefHdle, drvSectionPath, HM_ATT_NBPITS, (char*)NULL, (tdble)player->nbPitStops());
|
||||
GfParmSetStr(PrefHdle, drvSectionPath, HM_ATT_AUTOREVERSE, Yn[player->autoReverse()]);
|
||||
|
||||
/* Allow neutral gear in sequential mode if nor reverse nor neutral gear command defined */
|
||||
/* Allow neutral gear in sequential mode if neutral gear command not defined */
|
||||
if (player->gearChangeMode() == GEAR_MODE_SEQ
|
||||
&& (!strcmp(GfParmGetStr(PrefHdle, drvSectionPath, HM_ATT_GEAR_R, "-"), "-")
|
||||
|| !strcmp(GfParmGetStr(PrefHdle, drvSectionPath, HM_ATT_GEAR_N, "-"), "-")))
|
||||
&& !strcmp(GfParmGetStr(PrefHdle, drvSectionPath, HM_ATT_GEAR_N, "-"), "-"))
|
||||
GfParmSetStr(PrefHdle, drvSectionPath, HM_ATT_SEQSHFT_ALLOW_NEUTRAL, HM_VAL_YES);
|
||||
else
|
||||
GfParmSetStr(PrefHdle, drvSectionPath, HM_ATT_SEQSHFT_ALLOW_NEUTRAL, HM_VAL_NO);
|
||||
|
||||
/* Allow reverse gear in sequential mode if reverse gear command not defined */
|
||||
if (player->gearChangeMode() == GEAR_MODE_SEQ
|
||||
&& !strcmp(GfParmGetStr(PrefHdle, drvSectionPath, HM_ATT_GEAR_R, "-"), "-"))
|
||||
GfParmSetStr(PrefHdle, drvSectionPath, HM_ATT_SEQSHFT_ALLOW_REVERSE, HM_VAL_YES);
|
||||
else
|
||||
GfParmSetStr(PrefHdle, drvSectionPath, HM_ATT_SEQSHFT_ALLOW_REVERSE, HM_VAL_NO);
|
||||
|
||||
/* Release gear lever goes neutral in grid mode if no neutral gear command defined */
|
||||
if (player->gearChangeMode() == GEAR_MODE_GRID
|
||||
&& !strcmp(GfParmGetStr(PrefHdle, drvSectionPath, HM_ATT_GEAR_N, "-"), "-"))
|
||||
|
|
Loading…
Reference in a new issue