` markup. */ function openstation_alphabet_soup_icon_svg() { return '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . ''; } /** * Register Alphabet Soup with the games registry on `init`. * * Priority 20 — alongside the Games window registration. */ function openstation_alphabet_soup_register() { if ( ! function_exists( 'openstation_games_user_can_use' ) || ! openstation_games_user_can_use() ) { return; } openstation_register_game( 'alphabet-soup', array( 'title' => __( 'Alphabet Soup', 'desktop-mode' ), 'description' => __( 'The daily word search: a seeded letter soup that is the same for every player worldwide — the seed is today’s date. Pick a pot (8×8, 12×12, or 16×16 with more words), drag across the letters to fish them out, chain streaks, and clear waves; Time Attack stirs a different pot against the clock. Your first run of each puzzle earns the shareable score card.', 'desktop-mode' ), 'icon_svg' => openstation_alphabet_soup_icon_svg(), 'script' => 'os-game-alphabet-soup', // Mirrors the `window` block in // `src/games/alphabet-soup/index.ts`. Declared here as well // so the window opens at the right size on the very first // play, before the bundle that carries the def has been // fetched. Keep the two in step. 'window' => array( 'width' => 860, 'height' => 660, 'minWidth' => 600, 'minHeight' => 500, ), 'score_columns' => array( array( 'key' => 'score', 'label' => __( 'Score', 'desktop-mode' ), 'type' => 'number', ), array( 'key' => 'mode', 'label' => __( 'Mode', 'desktop-mode' ), 'type' => 'text', ), array( 'key' => 'size', 'label' => __( 'Size', 'desktop-mode' ), 'type' => 'text', ), array( 'key' => 'words', 'label' => __( 'Words', 'desktop-mode' ), 'type' => 'number', ), array( 'key' => 'wpm', 'label' => __( 'WPM', 'desktop-mode' ), 'type' => 'number', ), array( 'key' => 'accuracy', 'label' => __( 'Accuracy', 'desktop-mode' ), 'type' => 'number', ), array( 'key' => 'streak', 'label' => __( 'Streak', 'desktop-mode' ), 'type' => 'number', ), array( 'key' => 'wave', 'label' => __( 'Wave', 'desktop-mode' ), 'type' => 'number', ), array( 'key' => 'time', 'label' => __( 'Time', 'desktop-mode' ), 'type' => 'time', ), ), // The dictionary URL arrives via the framework-injected // `wordsUrl` config key (see includes/games/config.php). ) ); } add_action( 'init', 'openstation_alphabet_soup_register', 20 ); /** * Ride the Alphabet Soup window styles on the Games window as a * companion — same shape as Inkfall; see * `openstation_inkfall_window_styles()` for the reasoning. * * @param array $window_args Args passed to `openstation_register_window()`. * @return array */ function openstation_alphabet_soup_window_styles( $window_args ) { if ( ! is_array( $window_args ) ) { return $window_args; } $window_args['styles'] = isset( $window_args['styles'] ) ? (array) $window_args['styles'] : array(); $window_args['styles'][] = 'os-game-alphabet-soup'; return $window_args; } add_filter( 'openstation_games_window_args', 'openstation_alphabet_soup_window_styles' );