ui

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package ui is WittyPlay's server-driven UI (module API 4): what it adds to every app, as data the server checks, merges and renders (WittyMediaServer docs/SDUI-MODULES.md). sdui.json at the repository's root is written from UI and held equal to it by a test.

The games pages themselves are the server's own (Games, each games library, a game's page), drawn from the library. What WittyPlay adds is the one thing only it knows: which consoles this server plays, and how (a core installed, or a standalone emulator set up). It's a row on the Games page, a page of its own, a section for the page editor, and its settings.

Index

Constants

View Source
const (
	SourceConsoles = Module + ".consoles"
	// SettingShowConsoles, for the server: the row on the Games page is shown.
	SettingShowConsoles = "showConsoles"
	// SettingOnlyPlayable, for each profile: list only the consoles that play here.
	SettingOnlyPlayable = "onlyPlayable"
)

The source and its settings, by the names the helper answers (rpc/sdui.go).

View Source
const (
	SourceRecent      = Module + ".recent"
	SourceCollections = Module + ".collections"
	SourceFriends     = Module + ".friends"
	SourceRooms       = Module + ".rooms"
	SourceRoom        = Module + ".room"
	SourceInvites     = Module + ".invites"
	SourceSaveStates  = Module + ".saveStates"
	SourceMemories    = Module + ".memories"
	SourceControllers = Module + ".controllers"
	// Answered by the server for its Forms: the profile's two choices as switches, and an
	// administrator's choice of a Kids profile's friends (user: the profile's ID).
	SourcePrivacy     = Module + ".privacy"
	SourceKidsFriends = Module + ".kidsFriends"
)

WittyPlay Online's sources (WittyMediaServer docs/plans/DESIGN-2-SDUI-GAPS.md, section 6). Friends and a room's players are people: person cards, round, with a line and a badge. They're about this server's profiles, saves and running games, so the server answers them (its wittyplay_online.go) through each profile's limits; they're declared here so that pages, editors and the checks know them.

View Source
const (
	SourceLibrary       = Module + ".library"
	SourceStoreConsoles = Module + ".storeConsoles"
	SourceStoreEmus     = Module + ".storeEmulators"
	SourceSetup         = Module + ".setup"
	// For administrators: refreshing a games library's or a game's details, and the opt-in to
	// console photos from Wikimedia.
	SourceRefresh       = Module + ".refresh"
	SourceConsolePhotos = Module + ".consolePhotos"
)

The library and the store, for the apps that draw WittyPlay's screens themselves (the Apple TV and Android TV apps, and the phone apps): answered by package api (sdui_store.go).

View Source
const (
	PageOnline      = Module + "-online"
	PageControllers = Module + "-controllers"
	PageQuick       = Module + "-quick"
	PageRoom        = Module + "-room"
	PageMemory      = Module + "-memory"
	PageKeep        = Module + "-keep"
	PagePrivacy     = Module + "-privacy"
	PageKids        = Module + "-kids"
	// The apps' own versions of WittyPlay's web pages (the web app keeps its React pages for these):
	// every games library's page, Settings, and Cores & emulators with each console's rows.
	PageLibrary      = Module + "-library"
	PageSettings     = Module + "-settings"
	PageStore        = Module + "-store"
	PageStoreConsole = Module + "-store-console"
	// The first-run step on every app: the server's "Finish setting up WittyPlay" notice opens it.
	PageSetup = Module + "-setup"
)

WittyPlay Online's pages (Design 2: docs/design-2/canvas/Play.dc.html in WittyMediaServer, and the boards in docs/design-2/images/play and gaps/GB2_7). All of it is the catalogue's own components over the sources above, so every app draws it; what only a device knows (its controllers' batteries, "press any button") the app adds itself.

View Source
const (
	CommandCoreInstall     = Module + ".core.install"
	CommandCoreRemove      = Module + ".core.remove"
	CommandConsoleCore     = Module + ".console.core"
	CommandEmulatorInstall = Module + ".emulator.install"
	CommandEmulatorCancel  = Module + ".emulator.cancel"
	CommandEmulatorRemove  = Module + ".emulator.remove"
	CommandSetupDone       = Module + ".setup.done"
	CommandSetupLater      = Module + ".setup.later"
	// WittyPlay Online's invites (api/invites.go), for every profile with friends.
	CommandFriendInvite  = Module + ".friend.invite"
	CommandInviteAccept  = Module + ".invite.accept"
	CommandInviteDecline = Module + ".invite.decline"
	CommandInviteCancel  = Module + ".invite.cancel"
	// Refresh game details, for a games library (item: its ID) or one game (item: its ID).
	CommandLibraryRefresh = Module + ".library.refresh"
	CommandGameRefresh    = Module + ".game.refresh"
	// The opt-in to console photos from Wikimedia, on and off.
	CommandConsolePhotosOn  = Module + ".consolePhotos.on"
	CommandConsolePhotosOff = Module + ".consolePhotos.off"
)

The commands the store's rows run: WittyPlay's own routes (api/cores.go, rpc/docker.go), which every app runs from the server's catalogue (WittyMediaServer docs/SDUI-MODULES.md, "Commands"). Every one is an administrator's route, and none needs a password.

View Source
const ConsolePhotoNotice = "" /* 359-byte string literal not displayed */

ConsolePhotoNotice is what an administrator is told before opting in to console photos: what is fetched, from where, and under which licences. Every app shows these same words beside the switch: the SDUI pages (Settings and the first-run step), and the web app's, from GET /games/console-photos. At most 400 characters: a Notice's text.

View Source
const Module = "wittyplay"

Module is WittyPlay's ID.

Variables

This section is empty.

Functions

func Commands added in v0.7.0

func Commands() []core.CommandSpec

Commands are WittyPlay's own commands, as sdui.json declares them.

func JSON added in v0.7.0

func JSON() ([]byte, error)

JSON is sdui.json: UI, with Commands. WittyModule's sdui.Module has no field for commands yet (its core has, and the server reads them), so they are added here; once it has, they go into UI.

func UI

func UI() *sdui.Module

UI is WittyPlay's SDUI.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL