Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
Make sure to enforce more defaults in ProfileDTO class
Browse files Browse the repository at this point in the history
Needed especially for retro profile migration
  • Loading branch information
Ryochan7 committed Dec 21, 2023
1 parent af6a412 commit 59d8e49
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 48 deletions.
46 changes: 23 additions & 23 deletions DS4Windows/DS4Control/DTOXml/ProfileDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public bool ShouldSerializeConfigVersion()
public bool TouchToggle
{
get; private set;
}
} = BackingStore.DEFAULT_TOUCH_TOGGLE;

[XmlElement("touchToggle")]
public string TouchToggleString
Expand All @@ -85,7 +85,7 @@ public int IdleDisconnect
public bool OutputDataToDS4
{
get; private set;
}
} = BackingStore.DEFAULT_OUTPUT_TO_DS4;

[XmlElement("outputDataToDS4")]
public string OutputDataToDS4String
Expand Down Expand Up @@ -256,7 +256,7 @@ public string FlashColorString
public bool TouchpadJitterCompensation
{
get; private set;
}
} = BackingStore.DEFAULT_TOUCHPAD_JITTER_COMP;

[XmlElement("touchpadJitterCompensation")]
public string TouchpadJitterCompensationString
Expand All @@ -282,7 +282,7 @@ public string LowerRCOnString
public byte TapSensitivity
{
get; set;
}
} = BackingStore.DEFAULT_TOUCHPAD_SENS;

[XmlIgnore]
public bool DoubleTap
Expand Down Expand Up @@ -769,7 +769,7 @@ public TouchpadOutMode TouchpadOutputMode
public string SATriggers
{
get; set;
}
} = BackingStore.DEFAULT_SA_TRIGGERS;

private bool _sATriggerCond = true;
[XmlElement("SATriggerCond")]
Expand Down Expand Up @@ -918,7 +918,7 @@ public GyroOutMode GyroOutputMode
}


private string _gyroMouseStickTriggers = "-1";
private string _gyroMouseStickTriggers = BackingStore.DEFAULT_GYRO_MSTICK_TRIGGERS;
[XmlElement("GyroMouseStickTriggers")]
public string GyroMouseStickTriggers
{
Expand Down Expand Up @@ -1055,7 +1055,7 @@ public GyroSwipeSettings GyroSwipeSettings
get; set;
}

private int _bTPollRate = 4;
private int _bTPollRate = BackingStore.DEFAULT_DS4_BT_POLL_RATE;
[XmlElement("BTPollRate")]
public int BTPollRateString
{
Expand All @@ -1067,7 +1067,7 @@ public int BTPollRateString
public string LSOutputCurveMode
{
get; set;
}
} = BackingStore.DEFAULT_STICK_OUTPUT_CURVE;

[XmlElement("LSOutputCurveCustom")]
public string LSOutputCurveCustom
Expand All @@ -1079,7 +1079,7 @@ public string LSOutputCurveCustom
public string RSOutputCurveMode
{
get; set;
}
} = BackingStore.DEFAULT_STICK_OUTPUT_CURVE;

[XmlElement("RSOutputCurveCustom")]
public string RSOutputCurveCustom
Expand Down Expand Up @@ -1171,13 +1171,13 @@ public int RSAntiSnapbackTimeout
public StickMode LSOutputMode
{
get; set;
}
} = StickMode.Controls;

[XmlElement("RSOutputMode")]
public StickMode RSOutputMode
{
get; set;
}
} = StickMode.Controls;

[XmlElement("LSOutputSettings")]
public StickModeOutputSettings LSOutputSettings
Expand Down Expand Up @@ -1354,7 +1354,7 @@ public AbsMouseRegionSettingsSerializer AbsMouseRegionSettings
public OutContType OutputContDevice
{
get; set;
}
} = BackingStore.DEFAULT_OUT_CONT_TYPE;

[XmlElement("DS4OutputTriggerMode")]
public DS4TriggerOutputMode OutputDS4TriggerMode
Expand Down Expand Up @@ -2778,9 +2778,9 @@ public class GyroControlsSettings
public string Triggers
{
get; set;
}
} = GyroControlsInfo.DEFAULT_TRIGGERS;

private bool _triggerCond;
private bool _triggerCond = GyroControlsInfo.DEFAULT_TRIGGER_COND;
[XmlIgnore]
public bool TriggerCond
{
Expand All @@ -2795,7 +2795,7 @@ public string TriggerCondString
set => _triggerCond = BackingStore.SaTriggerCondValue(value);
}

private bool _triggerTurns;
private bool _triggerTurns = GyroControlsInfo.DEFAULT_TRIGGER_TURNS;
[XmlIgnore]
public bool TriggerTurns
{
Expand All @@ -2809,7 +2809,7 @@ public string TriggerTurnsString
set => _triggerTurns = XmlDataUtilities.StrToBool(value);
}

private bool _toggle;
private bool _toggle = GyroControlsInfo.DEFAULT_TRIGGER_TOGGLE;
[XmlIgnore]
public bool Toggle
{
Expand Down Expand Up @@ -2892,21 +2892,21 @@ public class GyroSwipeSettings
public int DeadZoneX
{
get; set;
}
} = GyroDirectionalSwipeInfo.DEFAULT_GYRO_DIR_SPEED;

[XmlElement("DeadZoneY")]
public int DeadZoneY
{
get; set;
}
} = GyroDirectionalSwipeInfo.DEFAULT_GYRO_DIR_SPEED;

[XmlElement("Triggers")]
public string Triggers
{
get; set;
}
} = GyroDirectionalSwipeInfo.DEFAULT_TRIGGERS;

private bool _triggerCond;
private bool _triggerCond = GyroDirectionalSwipeInfo.DEFAULT_TRIGGER_COND;
[XmlIgnore]
public bool TriggerCond
{
Expand All @@ -2921,7 +2921,7 @@ public string TriggerCondString
set => _triggerCond = BackingStore.SaTriggerCondValue(value);
}

private bool _triggerTurns;
private bool _triggerTurns = GyroDirectionalSwipeInfo.DEFAULT_TRIGGER_TURNS;
[XmlIgnore]
public bool TriggerTurns
{
Expand All @@ -2939,13 +2939,13 @@ public string TriggerTurnsString
public GyroDirectionalSwipeInfo.XAxisSwipe XAxis
{
get; set;
}
} = GyroDirectionalSwipeInfo.DEFAULT_X_AXIS;

[XmlElement("DelayTime")]
public int DelayTime
{
get; set;
}
} = GyroDirectionalSwipeInfo.DEFAULT_DELAY_TIME;
}

public class StickModeOutputSettings
Expand Down
Loading

0 comments on commit 59d8e49

Please sign in to comment.