` markup. */ function openstation_inkfall_icon_svg() { return '' . '' . '' . '' . '' . '' . '' . ''; } /** * Register Inkfall with the games registry on `init`. * * Priority 20 — alongside the Games window registration. */ function openstation_inkfall_register() { if ( ! function_exists( 'openstation_games_user_can_use' ) || ! openstation_games_user_can_use() ) { return; } openstation_register_game( 'inkfall', array( 'title' => __( 'Inkfall', 'desktop-mode' ), 'description' => __( 'Words fall down a notebook page — type them before they reach the bottom. Finishing a word sends up a musical note that tears it into scattering letters.', 'desktop-mode' ), 'icon_svg' => openstation_inkfall_icon_svg(), 'script' => 'os-game-inkfall', 'score_columns' => array( array( 'key' => 'score', 'label' => __( 'Score', 'desktop-mode' ), 'type' => 'number', ), array( 'key' => 'mode', 'label' => __( 'Difficulty', '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' => 'time', 'label' => __( 'Time', 'desktop-mode' ), 'type' => 'time', ), array( 'key' => 'level', 'label' => __( 'Level', 'desktop-mode' ), 'type' => 'number', ), ), // The dictionary URL arrives via the framework-injected // `wordsUrl` config key (see includes/games/config.php). ) ); } add_action( 'init', 'openstation_inkfall_register', 20 ); /** * Enqueue the Inkfall window styles. The game's script is lazily * loaded by the framework on first launch, but its CSS is tiny and * must already be present when the window opens. */ function openstation_inkfall_enqueue_styles() { if ( ! function_exists( 'openstation_games_user_can_use' ) || ! openstation_games_user_can_use() ) { return; } wp_enqueue_style( 'os-game-inkfall' ); } add_action( 'admin_enqueue_scripts', 'openstation_inkfall_enqueue_styles', 30 );