Skip to content

Commit

Permalink
Merge pull request #9 from jonathonhillnz/fix/fix-game-resolution-cha…
Browse files Browse the repository at this point in the history
…nger

Fix: Pass changeresolution boolean to Patch method
  • Loading branch information
Bluscream authored Nov 4, 2024
2 parents 7997bc3 + 0ffe95d commit 815d401
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Classes/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public bool Patch(HmdConfig config, Resolution resolution, bool changeresolution
continue;
}
var attributes = new AttributesFile(attributesFile);
if (!attributes.Patch(config, resolution)) {
if (!attributes.Patch(config, resolution, changeresolution)) {
Logger.Error($"Failed to patch {attributesFile.Quote()}!");
continue;
}
Expand Down
5 changes: 3 additions & 2 deletions Classes/Xml/AttributesFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,16 @@ public bool Patch(HmdConfig config, Resolution resolution, bool changeresolution
Logger.Info($"Set attribute: {item.Key} to {item.Value}");
}
if (config.Fov is not null) changed |= AddOrUpdate("FOV", config.Fov);
// TODO: Add a way to change resolution based on if user checks a checkbox, see below
// I'm not able to figure out how to get the 'isChecked' to work here....

if (changeresolution) {
Logger.Info("Changing resolution to match HMD");
if (resolution.Height is not null) changed |= AddOrUpdate("Height", resolution.Height);
if (resolution.Width is not null) changed |= AddOrUpdate("Width", resolution.Width);
Logger.Info($"Changed resolution to {resolution.Width}x{resolution.Height}");
}
else {
Logger.Info("Not changing game resolution to match headset as requested");
}
if (changed) {
Save();
Logger.Info($"Patched {File.FullName}");
Expand Down

0 comments on commit 815d401

Please sign in to comment.