Pull current speed provider from game settings for non GM users (fixes #34)
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
## In development
|
||||||
|
### Bugfixes
|
||||||
|
- Speed Provider Settings are now being saved for non GM players
|
||||||
|
|
||||||
|
|
||||||
## 1.3.2
|
## 1.3.2
|
||||||
### Translation
|
### Translation
|
||||||
- Updated japanese translation (thanks to togue)
|
- Updated japanese translation (thanks to togue)
|
||||||
|
|||||||
+2
-1
@@ -111,6 +111,7 @@ class SpeedProviderSettings extends FormApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _updateObject(event, formData) {
|
async _updateObject(event, formData) {
|
||||||
|
const selectedSpeedProvider = game.user.isGM ? formData.speedProvider : game.settings.get(settingsKey, "speedProvider")
|
||||||
for (let [key, value] of Object.entries(formData)) {
|
for (let [key, value] of Object.entries(formData)) {
|
||||||
// Check if this is color, convert the value to an integer
|
// Check if this is color, convert the value to an integer
|
||||||
const splitKey = key.split(".", 3)
|
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
|
// 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
|
continue
|
||||||
|
|
||||||
// Get the key for the current setting
|
// Get the key for the current setting
|
||||||
|
|||||||
Reference in New Issue
Block a user