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

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
emmauss committed Jan 4, 2022
1 parent aa562fb commit 68208ee
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Ryujinx.Ava/Assets/Locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -493,5 +493,6 @@
"SettingsTabSystemEnableInternetAccess": "Enable Guest Internet Access",
"EnableInternetAccessTooltip": "Enables guest Internet access. If enabled, the application will behave as if the emulated Switch console was connected to the Internet. Note that in some cases, applications may still access the Internet even with this option disabled",
"GameListContextMenuManageCheatToolTip" : "Manage Cheats",
"GameListContextMenuManageCheat" : "Manage Cheats"
"GameListContextMenuManageCheat" : "Manage Cheats",
"ControllerSettingsStickRange" : "Range"
}
2 changes: 1 addition & 1 deletion Ryujinx.Ava/Configuration/ConfigurationFileFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ConfigurationFileFormat
/// <summary>
/// The current version of the file format
/// </summary>
public const int CurrentVersion = 35;
public const int CurrentVersion = 36;

/// <summary>
/// Version of the configuration file format
Expand Down
18 changes: 17 additions & 1 deletion Ryujinx.Ava/Configuration/ConfigurationState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -981,11 +981,27 @@ public void Load(ConfigurationFileFormat configurationFileFormat, string configu

configurationFileUpdated = true;
}

if (configurationFileFormat.Version < 35)
{
Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 35.");

foreach (InputConfig config in configurationFileFormat.InputConfig)
{
if (config is StandardControllerInputConfig controllerConfig)
{
controllerConfig.RangeLeft = 1.0f;
controllerConfig.RangeRight = 1.0f;
}
}

configurationFileUpdated = true;
}

if (configurationFileFormat.Version < 36)
{
Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 36.");

configurationFileFormat.BaseStyle = "Dark";

configurationFileUpdated = true;
Expand Down
28 changes: 28 additions & 0 deletions Ryujinx.Ava/Ui/Models/InputConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public class InputConfiguration<Key, Stick> : BaseModel
private bool enableMotion;
private float weakRumble;
private float strongRumble;
private float _rangeLeft;
private float _rangeRight;

public InputBackendType Backend { get; set; }

Expand Down Expand Up @@ -56,6 +58,17 @@ public float DeadzoneLeft
}
}

public float RangeLeft
{
get => _rangeLeft;
set
{
_rangeLeft = MathF.Round(value, 3);

OnPropertyChanged();
}
}

public float DeadzoneRight
{
get => _deadzoneRight;
Expand All @@ -67,6 +80,17 @@ public float DeadzoneRight
}
}

public float RangeRight
{
get => _rangeRight;
set
{
_rangeRight = MathF.Round(value, 3);

OnPropertyChanged();
}
}

public float TriggerThreshold
{
get => _triggerThreshold;
Expand Down Expand Up @@ -249,6 +273,8 @@ public InputConfiguration(InputConfig config)

DeadzoneLeft = controllerConfig.DeadzoneLeft;
DeadzoneRight = controllerConfig.DeadzoneRight;
RangeLeft = controllerConfig.RangeLeft;
RangeRight = controllerConfig.RangeRight;
TriggerThreshold = controllerConfig.TriggerThreshold;

if (controllerConfig.Motion != null)
Expand Down Expand Up @@ -392,6 +418,8 @@ public InputConfig GetConfig()
Version = InputConfig.CurrentVersion,
DeadzoneLeft = DeadzoneLeft,
DeadzoneRight = DeadzoneRight,
RangeLeft = RangeLeft,
RangeRight = RangeRight,
TriggerThreshold = TriggerThreshold,
Motion = EnableCemuHookMotion
? new CemuHookMotionConfigController()
Expand Down
2 changes: 2 additions & 0 deletions Ryujinx.Ava/Ui/ViewModels/ControllerSettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,8 @@ public InputConfig LoadDefaultConfiguration()
ControllerType = ControllerType.ProController,
DeadzoneLeft = 0.1f,
DeadzoneRight = 0.1f,
RangeLeft = 1.0f,
RangeRight = 1.0f,
TriggerThreshold = 0.5f,
LeftJoycon =
new LeftJoyconCommonConfig<ConfigGamepadInputId>
Expand Down
2 changes: 1 addition & 1 deletion Ryujinx.Ava/Ui/Windows/CheatWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public CheatWindow(VirtualFileSystem virtualFileSystem, string titleId, string t
currentCheatFile = cheat.Path.FullName;
parentPath = currentCheatFile.Replace(titleModsPath, "");

buildId = Path.GetFileNameWithoutExtension(currentCheatFile);
buildId = Path.GetFileNameWithoutExtension(currentCheatFile).ToUpper();
currentGroup = new CheatsList(buildId, parentPath);

LoadedCheats.Add(currentGroup);
Expand Down
32 changes: 32 additions & 0 deletions Ryujinx.Ava/Ui/Windows/ControllerSettingsWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,22 @@
Margin="5, 0"
Text="{Binding Configuration.DeadzoneLeft, StringFormat=\{0:0.000\}}" />
</StackPanel>
<TextBlock Margin="2" Text="{locale:Locale ControllerSettingsStickRange}" />
<StackPanel
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">
<Slider
Margin="0,-10,0,-5"
Width="200"
Maximum="1"
Minimum="0"
Value="{Binding Configuration.RangeLeft, Mode=TwoWay}" />
<TextBlock
VerticalAlignment="Center"
Margin="5, 0"
Text="{Binding Configuration.RangeLeft, StringFormat=\{0:0.000\}}" />
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
Expand Down Expand Up @@ -1330,6 +1346,22 @@
Margin="5, 0"
Text="{Binding Configuration.DeadzoneRight, StringFormat=\{0:0.000\}}" />
</StackPanel>
<TextBlock Margin="2" Text="{locale:Locale ControllerSettingsStickRange}" />
<StackPanel
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">
<Slider
Margin="0,-10,0,-5"
Width="200"
Maximum="1"
Minimum="0"
Value="{Binding Configuration.RangeRight, Mode=TwoWay}" />
<TextBlock
VerticalAlignment="Center"
Margin="5, 0"
Text="{Binding Configuration.RangeRight, StringFormat=\{0:0.000\}}" />
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
Expand Down

0 comments on commit 68208ee

Please sign in to comment.