diff --git a/src/StatefulVideo.js b/src/StatefulVideo.js index 2d92519..e7384b2 100644 --- a/src/StatefulVideo.js +++ b/src/StatefulVideo.js @@ -331,7 +331,8 @@ export class StatefulVideo { for (const [index, state] of statefulVideo.flags.states.entries()) { if (!state.icon) continue; - const stateBtn = StatefulVideo.makeHudButton(state.name, state.icon); + const currentState = statefulVideo.flags.currentStateIndex === index; + const stateBtn = StatefulVideo.makeHudButton(state.name, state.icon, currentState ? "background-color: #048d6e;" : ""); stateBtn.on("pointerdown", () => { statefulVideo.changeState({ state: index, fast: true }); }); @@ -406,7 +407,6 @@ export class StatefulVideo { parentContainer.css("visibility", newState); }); - selectContainer.append(selectButtonContainer); selectButtonContainer.append(selectColorButton); selectButtonContainer.append(parentContainer); @@ -414,9 +414,12 @@ export class StatefulVideo { if (internalVariations.length > 1) { const variationContainer = $(`
`); parentContainer.append(variationContainer); + const currentVariation = placeableDocument.texture.src.includes("_%5B") + ? placeableDocument.texture.src.split("%5B")[1].split("%5D")[0] + : "original"; for (const variation of internalVariations) { const name = variation.includes("_%5B") ? variation.split("%5B")[1].split("%5D")[0] : "original"; - const button = $(`${name}`) + const button = $(`${name}`) variationContainer.append(button); button.on("pointerdown", async () => {