Pull current speed provider from game settings for non GM users (fixes #34)

This commit is contained in:
Manuel Vögele
2021-03-03 09:41:43 +01:00
parent 404e978377
commit 544740b697
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -1,3 +1,8 @@
## In development
### Bugfixes
- Speed Provider Settings are now being saved for non GM players
## 1.3.2
### Translation
- Updated japanese translation (thanks to togue)
+2 -1
View File
@@ -111,6 +111,7 @@ class SpeedProviderSettings extends FormApplication {
}
async _updateObject(event, formData) {
const selectedSpeedProvider = game.user.isGM ? formData.speedProvider : game.settings.get(settingsKey, "speedProvider")
for (let [key, value] of Object.entries(formData)) {
// Check if this is color, convert the value to an integer
const splitKey = key.split(".", 3)
@@ -121,7 +122,7 @@ class SpeedProviderSettings extends FormApplication {
}
// Don't change settings for speed providers that aren't currently active
if (key !== "speedProvider" && !key.startsWith(formData.speedProvider))
if (key !== "speedProvider" && !key.startsWith(selectedSpeedProvider))
continue
// Get the key for the current setting