Skip to content

Commit

Permalink
update layout select list on custom skin change
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinir committed Jun 1, 2020
1 parent 738f6b0 commit 7057c0b
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions index.html
Expand Up @@ -339,21 +339,23 @@
}, customCallback: customSkinConfig => {
if (!customSkinConfig) {
Renderer.unloadSkin(customSkinLocalStorageKey)
return
} else {
Renderer.unloadSkin(customSkinLocalStorageKey, false)
Renderer.loadSkin(customSkinLocalStorageKey)

for (let i = 0; i < Renderer.skinSlot.length; i++) {
const skinSlot = Renderer.skinSlot[i]
if (
!skinSlot ||
!skinSlot.hasOwnProperty('dirname') ||
skinSlot.dirname !== customSkinLocalStorageKey
) { continue }
Renderer.changeSkinOfSlot(i, skinSlot.gamepadId)
}
}

Renderer.unloadSkin(customSkinLocalStorageKey, false)
Renderer.loadSkin(customSkinLocalStorageKey)

for (let i = 0; i < Renderer.skinSlot.length; i++) {
const skinSlot = Renderer.skinSlot[i]
if (
!skinSlot ||
!skinSlot.hasOwnProperty('dirname') ||
skinSlot.dirname !== customSkinLocalStorageKey
) { continue }
Renderer.changeSkinOfSlot(i, skinSlot.gamepadId)
}
// update the layout select list
cpPanel.layout.updateItems(cpPanel.layout.list)
}
}
)
Expand Down

0 comments on commit 7057c0b

Please sign in to comment.