Change check for remapping execution. Take some Gyro mode settings into account

This commit is contained in:
Travis Nickles 2020-03-28 15:49:32 -05:00
parent fc679bf807
commit 24f030aba5
3 changed files with 23 additions and 3 deletions

View File

@ -1319,8 +1319,7 @@ namespace DS4Windows
if (!recordingMacro && (useTempProfile[ind] || if (!recordingMacro && (useTempProfile[ind] ||
containsCustomAction(ind) || containsCustomExtras(ind) || containsCustomAction(ind) || containsCustomExtras(ind) ||
getProfileActionCount(ind) > 0 || getProfileActionCount(ind) > 0))
GetSASteeringWheelEmulationAxis(ind) >= SASteeringWheelEmulationAxisType.VJoy1X))
{ {
Mapping.MapCustom(ind, cState, MappedState[ind], ExposedState[ind], touchPad[ind], this); Mapping.MapCustom(ind, cState, MappedState[ind], ExposedState[ind], touchPad[ind], this);
cState = MappedState[ind]; cState = MappedState[ind];

View File

@ -1690,8 +1690,16 @@ namespace DS4Windows
public static void cacheProfileCustomsFlags(int device) public static void cacheProfileCustomsFlags(int device)
{ {
m_Config.containsCustomAction[device] = HasCustomActions(device); bool customAct = false;
m_Config.containsCustomAction[device] = customAct = HasCustomActions(device);
m_Config.containsCustomExtras[device] = HasCustomExtras(device); m_Config.containsCustomExtras[device] = HasCustomExtras(device);
if (!customAct)
{
customAct = m_Config.gyroOutMode[device] == GyroOutMode.MouseJoystick;
customAct = customAct || m_Config.sASteeringWheelEmulationAxis[device] >= SASteeringWheelEmulationAxisType.VJoy1X;
m_Config.containsCustomAction[device] = customAct;
}
} }
public static void CacheExtraProfileInfo(int device) public static void CacheExtraProfileInfo(int device)

View File

@ -651,9 +651,13 @@ namespace DS4WinWPF.DS4Forms.ViewModels
default: break; default: break;
} }
GyroOutMode current = Global.GyroOutputMode[device];
if (temp == current) return;
Global.GyroOutputMode[device] = temp; Global.GyroOutputMode[device] = temp;
GyroOutModeIndexChanged?.Invoke(this, EventArgs.Empty);
} }
} }
public event EventHandler GyroOutModeIndexChanged;
public OutContType ContType public OutContType ContType
{ {
@ -665,6 +669,7 @@ namespace DS4WinWPF.DS4Forms.ViewModels
get => (int)Global.SASteeringWheelEmulationAxis[device]; get => (int)Global.SASteeringWheelEmulationAxis[device];
set => Global.SASteeringWheelEmulationAxis[device] = (SASteeringWheelEmulationAxisType)value; set => Global.SASteeringWheelEmulationAxis[device] = (SASteeringWheelEmulationAxisType)value;
} }
public event EventHandler SASteeringWheelEmulationAxisIndexChanged;
private int[] saSteeringRangeValues = private int[] saSteeringRangeValues =
new int[9] { 90, 180, 270, 360, 450, 720, 900, 1080, 1440 }; new int[9] { 90, 180, 270, 360, 450, 720, 900, 1080, 1440 };
@ -1561,6 +1566,14 @@ namespace DS4WinWPF.DS4Forms.ViewModels
{ {
DS4WinLightVisibleChanged?.Invoke(this, EventArgs.Empty); DS4WinLightVisibleChanged?.Invoke(this, EventArgs.Empty);
}; };
GyroOutModeIndexChanged += CalcProfileFlags;
SASteeringWheelEmulationAxisIndexChanged += CalcProfileFlags;
}
private void CalcProfileFlags(object sender, EventArgs e)
{
Global.cacheProfileCustomsFlags(device);
} }
private void ProfileSettingsViewModel_MainColorChanged(object sender, EventArgs e) private void ProfileSettingsViewModel_MainColorChanged(object sender, EventArgs e)