diff --git a/src/main/kotlin/de/moritzruth/lampenfieber/act/Fourth.kt b/src/main/kotlin/de/moritzruth/lampenfieber/act/Fourth.kt index be5db12..3440343 100644 --- a/src/main/kotlin/de/moritzruth/lampenfieber/act/Fourth.kt +++ b/src/main/kotlin/de/moritzruth/lampenfieber/act/Fourth.kt @@ -261,7 +261,7 @@ fun ShowBuilderContext.fourthAct() = act("Vierter Akt") { +"Adrian / von links" } - leftSpotTarget = "Kai & Adrian (rechtzeitig positionieren!)" + leftSpotTarget = "Kai & Adrian" onRun { Washs.left.colorWheelMode.static(CoemarProWash.ColorWheelMode.Rotate(5.percent, true)) diff --git a/src/main/kotlin/de/moritzruth/lampenfieber/act/Second.kt b/src/main/kotlin/de/moritzruth/lampenfieber/act/Second.kt index 1d04dfc..ac2d8b7 100644 --- a/src/main/kotlin/de/moritzruth/lampenfieber/act/Second.kt +++ b/src/main/kotlin/de/moritzruth/lampenfieber/act/Second.kt @@ -62,7 +62,7 @@ fun ShowBuilderContext.secondAct() = act("Zweiter Akt") { +"Astronaut / liegt in der Mitte der Bühne" } - rightSpotTarget = "Paula (rechtzeitig positionieren!)" + rightSpotTarget = "Paula" onRun { FrontLights.center.forEach { it.brightness.off() } diff --git a/src/main/kotlin/de/moritzruth/theaterdsl/show/Dsl.kt b/src/main/kotlin/de/moritzruth/theaterdsl/show/Dsl.kt index 2d81c1f..6c047bd 100644 --- a/src/main/kotlin/de/moritzruth/theaterdsl/show/Dsl.kt +++ b/src/main/kotlin/de/moritzruth/theaterdsl/show/Dsl.kt @@ -86,8 +86,8 @@ private fun buildAct(actIndex: Int, actName: String, build: ActBuilderContext.() val actorsOnStage = mutableListOf() val props = PropPosition.values().associateWith { null }.toMutableMap() - var leftSpotTarget: String? - var rightSpotTarget: String? + var leftSpotTarget_: String? = null + var rightSpotTarget_: String? = null var curtainState_ = CurtainState.CLOSED object : ActBuilderContext { @@ -107,10 +107,21 @@ private fun buildAct(actIndex: Int, actName: String, build: ActBuilderContext.() val actorExits = mutableSetOf() var runner: StepRunner? = null - val builderContext = object : StepDataBuilderContext { + object : StepDataBuilderContext { override val props = PropsBuilderMap(changedProps) - override var rightSpotTarget: String? = null - override var leftSpotTarget: String? = null + + override var rightSpotTarget: String? + get() = rightSpotTarget_ + set(value) { + rightSpotTarget_ = value + } + + override var leftSpotTarget: String? + get() = leftSpotTarget_ + set(value) { + leftSpotTarget_ = value + } + override var curtainState: CurtainState get() = curtainState_ set(value) { @@ -124,11 +135,7 @@ private fun buildAct(actIndex: Int, actName: String, build: ActBuilderContext.() override fun onRun(block: StepRunner) { runner = block } - } - - builderContext.also(build) - leftSpotTarget = builderContext.leftSpotTarget - rightSpotTarget = builderContext.rightSpotTarget + }.build() val logger = KotlinLogging.logger("createAct / $actName / $sceneName / #${steps.size + 1} ${cue.format()}") @@ -173,8 +180,8 @@ private fun buildAct(actIndex: Int, actName: String, build: ActBuilderContext.() actorsOnStage.toImmutableList(), props.toImmutableMap(), changedProps.isNotEmpty(), - leftSpotTarget, - rightSpotTarget, + leftSpotTarget_, + rightSpotTarget_, curtainState_, runner ) diff --git a/ui/src/components/ChangeBlinkingBox.vue b/ui/src/components/ChangeBlinkingBox.vue new file mode 100644 index 0000000..9924fd8 --- /dev/null +++ b/ui/src/components/ChangeBlinkingBox.vue @@ -0,0 +1,43 @@ + + + + + \ No newline at end of file diff --git a/ui/src/components/PropBox.vue b/ui/src/components/PropBox.vue index 49b918b..a07e1f1 100755 --- a/ui/src/components/PropBox.vue +++ b/ui/src/components/PropBox.vue @@ -1,9 +1,5 @@ - - + + \ No newline at end of file diff --git a/ui/src/state.ts b/ui/src/state.ts index 3b8574c..e5dde55 100755 --- a/ui/src/state.ts +++ b/ui/src/state.ts @@ -19,6 +19,8 @@ export interface Step { actorsOnStage: string[] props: PropMap hasChangedProps: boolean + leftSpotTarget: string | null + rightSpotTarget: string | null } export type StepCue = { @@ -95,7 +97,9 @@ export const START_STEP: Step = { }, hasChangedProps: false, actorEntrances: [], - actorExits: [] + actorExits: [], + leftSpotTarget: null, + rightSpotTarget: null } const START_SCENE: Scene = { @@ -129,6 +133,16 @@ export function getAct(position: ShowPosition) { return show.value.acts[position.act] } +export function getSceneIndex(position: ShowPosition) { + let index = position.scene + + for (let actIndex = 0; actIndex < position.act; actIndex++) { + index += show.value.acts[actIndex]!.scenes.length + } + + return index +} + export function getActiveMusicAt(position: ShowPosition): ShowMusic | null { let activeMusic: ShowMusic | null = null @@ -162,13 +176,17 @@ export function getActiveMusicAt(position: ShowPosition): ShowMusic | null { export const current = reactiveComputed<{ act: Act | null scene: Scene + sceneIndex: number step: Step activeMusic: ShowMusic | null + allScenes: Scene[] }>(() => ({ act: getAct(state.position), scene: getScene(state.position), + sceneIndex: getSceneIndex(state.position), step: getStep(state.position), - activeMusic: state.activeMusic + activeMusic: state.activeMusic, + allScenes: show.value.acts.flatMap(act => act.scenes) })) export function parseStringWithDetails(string: string) {