@@ -4,8 +4,6 @@ import { buildLightTrailsControllerModel } from "./light-trails/LightTrailsContr
44import { buildArenaSurvivorControllerModel } from "./arena-survivor/ArenaSurvivorController.js" ;
55import { buildChaosKommandoControllerModel } from "./chaos-kommando/ChaosKommandoController.js" ;
66import { buildMinionsTdControllerModel } from "./minions-td/MinionsTdController.js" ;
7- import { buildImposterControllerModel } from "./imposter/ImposterController.js" ;
8- import { createTabuCorrectInput } from "./tabu/tabuBindings.js" ;
97import {
108 createDrawingClearInput ,
119 createDrawingEndInput ,
@@ -15,16 +13,12 @@ import {
1513 createGuessSubmitInput
1614} from "./zeichnen-und-erraten/zeichnenUndErratenBindings.js" ;
1715import { buildDriftRacerControllerModel } from "./drift-racer/DriftRacerController.js" ;
18- import { buildSchaetzoramaControllerModel } from "./schaetzorama/SchaetzoramaController.js" ;
1916import { buildWordTilesControllerModel } from "./word-tiles/WordTilesController.js" ;
2017import type {
2118 ControllerLayoutModel ,
22- ChoiceLayoutModel ,
2319 DrawingGuessLayoutModel ,
24- ReadyLayoutModel ,
25- SingleButtonLayoutModel
20+ ReadyLayoutModel
2621} from "../layouts/models.js" ;
27- import type { TabuControllerState } from "@open-party-lab/protocol" ;
2822import { getControllerText } from "../../i18n/controllerText.js" ;
2923import { externalControllerGameRegistrations } from "./.generated/externalGames.js" ;
3024
@@ -139,115 +133,6 @@ const internalControllerGameRegistry: Record<string, ControllerGameRegistration>
139133 return buildLightTrailsControllerModel ( context ) ;
140134 }
141135 } ,
142- tabu : {
143- id : "tabu" ,
144- layoutKey : "choice" ,
145- buildLayout ( context ) {
146- const { state, onInput } = context ;
147- const text = getControllerText ( state . room ?. language ?? state . preferredLanguage ) ;
148- const en = state . room ?. language === "en" ;
149- const playerId = state . player ?. id ?? "" ;
150- const tabuState = ( state . game ?. state ?? { } ) as TabuControllerState ;
151- const playerNames = new Map ( ( state . room ?. players ?? [ ] ) . map ( ( player ) => [ player . id , player . name ] ) ) ;
152- const currentTurnPlayerId = tabuState . currentTurnPlayerId ;
153- const currentTurnPlayerName = currentTurnPlayerId
154- ? playerNames . get ( currentTurnPlayerId ) ?? currentTurnPlayerId
155- : undefined ;
156- const currentTurnTeamId =
157- tabuState . currentTurnTeamId ?? ( currentTurnPlayerId ? tabuState . teamByPlayerId [ currentTurnPlayerId ] : undefined ) ;
158- const currentTurnTeamLabel =
159- currentTurnTeamId === "team1" ? "Team 1" : currentTurnTeamId === "team2" ? "Team 2" : undefined ;
160- const solved = tabuState . solvedTerms ?? 0 ;
161- const target = tabuState . targetTerms ?? 10 ;
162- const isExplainer = tabuState . currentTurnPlayerId === playerId ;
163- const currentTerm = isExplainer ? tabuState . currentCardTerm ?? ( en ? "Waiting for the first term" : "Warte auf den Startbegriff" ) : undefined ;
164- const remainingSeconds =
165- tabuState . turnRemainingMs !== null ? Math . max ( 0 , Math . ceil ( tabuState . turnRemainingMs / 1000 ) ) : null ;
166- const choices : ChoiceLayoutModel [ "choices" ] = [ ] ;
167-
168- if ( isExplainer && tabuState . mode === "duel" ) {
169- for ( const otherPlayer of state . room ?. players ?? [ ] ) {
170- if ( otherPlayer . id === playerId ) {
171- continue ;
172- }
173-
174- choices . push ( {
175- id : `tabu:duel:${ otherPlayer . id } ` ,
176- label : otherPlayer . name ,
177- description : en ? "Guessed the word" : "Hat das Wort erraten" ,
178- disabled : state . game ?. phase !== "playing" ,
179- onSelect : ( ) => onInput ( createTabuCorrectInput ( playerId , otherPlayer . id ) )
180- } ) ;
181- }
182- }
183-
184- if ( isExplainer && tabuState . mode === "team" ) {
185- choices . push ( {
186- id : "tabu:team:solved" ,
187- label : en ? "Solved" : "Geloest" ,
188- description : en ? "Your team guessed the word" : "Euer Team hat das Wort geschafft" ,
189- disabled : state . game ?. phase !== "playing" ,
190- onSelect : ( ) => onInput ( createTabuCorrectInput ( playerId ) )
191- } ) ;
192- }
193-
194- const model : ChoiceLayoutModel = {
195- kind : "choice" ,
196- title : "Tabu" ,
197- subtitle :
198- tabuState . mode === "team"
199- ? `${ tabuState . currentModeLabel } | ${ currentTurnTeamLabel ?? "Team" } : ${ currentTurnPlayerName ?? text . unknown } `
200- : `${ tabuState . currentModeLabel } | ${ en ? "Explainer" : "Erklaerer" } : ${ currentTurnPlayerName ?? text . unknown } ` ,
201- helperText : isExplainer
202- ? tabuState . mode === "team"
203- ? currentTerm
204- ? `${ currentTerm } \n${ en ? "Tap Solved once your team guessed the word." : "Tippe auf Geloest, wenn euer Team das Wort geschafft hat." } `
205- : en ? "Tap Solved once your team guessed the word." : "Tippe auf Geloest, wenn euer Team das Wort geschafft hat."
206- : currentTerm
207- ? `${ en ? "Word" : "Wort" } : ${ currentTerm } \n${ en ? "Choose the player who guessed the word." : "Waehle den Spieler, der das Wort erraten hat." } `
208- : en ? "Choose the player who guessed the word." : "Waehle den Spieler, der das Wort erraten hat."
209- : currentTurnPlayerName
210- ? `${ en ? "Waiting for" : "Warte auf" } ${ currentTurnPlayerName } .`
211- : en ? "Waiting for the explaining player." : "Warte auf die erklaerende Person." ,
212- disabled : state . game ?. phase !== "playing" || ! isExplainer ,
213- choices,
214- stats : [
215- {
216- label : en ? "Progress" : "Fortschritt" ,
217- value : `${ solved } /${ target } `
218- } ,
219- {
220- label : en ? "Cards left" : "Karten uebrig" ,
221- value : `${ tabuState . remainingCards ?? 0 } `
222- } ,
223- {
224- label : en ? "Mode" : "Modus" ,
225- value : tabuState . currentModeLabel
226- } ,
227- {
228- label : en ? "Time" : "Zeit" ,
229- value : remainingSeconds !== null ? `${ remainingSeconds } s` : "-"
230- } ,
231- {
232- label : en ? "Role" : "Rolle" ,
233- value : isExplainer ? ( en ? "Explainer" : "Erklaerer" ) : ( en ? "Viewer" : "Zuschauer" )
234- } ,
235- {
236- label : "Team" ,
237- value : currentTurnTeamLabel ?? "-"
238- }
239- ] ,
240- } ;
241- return withAutoReady ( model , context ) ;
242- }
243- } ,
244- imposter : {
245- id : "imposter" ,
246- layoutKey : "choice" ,
247- buildLayout ( context ) {
248- return withAutoReady ( buildImposterControllerModel ( context ) , context ) ;
249- }
250- } ,
251136 "zeichnen-und-erraten" : {
252137 id : "zeichnen-und-erraten" ,
253138 layoutKey : "drawing_guess" ,
@@ -296,13 +181,6 @@ const internalControllerGameRegistry: Record<string, ControllerGameRegistration>
296181 return withAutoReady ( model , context ) ;
297182 }
298183 } ,
299- schaetzorama : {
300- id : "schaetzorama" ,
301- layoutKey : "schaetzorama" ,
302- buildLayout ( context ) {
303- return withAutoReady ( buildSchaetzoramaControllerModel ( context ) , context ) ;
304- }
305- } ,
306184 "word-tiles" : {
307185 id : "word-tiles" ,
308186 layoutKey : "word_tiles_board" ,
0 commit comments