@indiegems/gem-web-sdk 7.8.1 → 7.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -893,7 +893,7 @@
893
893
  "",
894
894
  "AMENDED, DELIBERATELY: this message once carried insets only. It now also",
895
895
  "carries `reserved`, rectangles of the frame covered by the parent's own",
896
- "controls floating over the game (a Back tab in a corner, the wallet chips",
896
+ "controls floating over the game (a menu button in a corner, the wallet chips",
897
897
  "shown in another). An inset can only describe a full-width or full-height band,",
898
898
  "and a corner tab expressed as a top inset would take the whole top strip",
899
899
  "from a full-bleed game to clear a control a few dozen pixels wide. A",
@@ -2387,7 +2387,7 @@
2387
2387
  "to it: a reward cue, a pending grant, a landing, a spend, a daily-maximum",
2388
2388
  "note, a score change. The game's state never cancels those. Only wallets",
2389
2389
  "shown BECAUSE OF THIS STATE reserve space: they extend `gem.viewport`'s",
2390
- "`reserved`, and hiding them shrinks it back to the parent's own Back tab. An",
2390
+ "`reserved`, and hiding them shrinks it back to the parent's own menu button. An",
2391
2391
  "event pop floats over the game and never moves its layout. Where the parent",
2392
2392
  "docks its wallets beside the frame rather than over it, this changes",
2393
2393
  "nothing.",
@@ -2416,6 +2416,108 @@
2416
2416
  "rateLimit": { "perMinute": 60 }
2417
2417
  },
2418
2418
 
2419
+ {
2420
+ "type": "gem.menu",
2421
+ "direction": "frameToParent",
2422
+ "transport": "port",
2423
+ "$comment": [
2424
+ "What the game adds to the arcade's own menu — the one control the arcade",
2425
+ "keeps over a game, in the frame's top-right corner, which is how a player",
2426
+ "leaves, mutes, reports a problem, and reaches the game's settings.",
2427
+ "",
2428
+ " settings: true the game has a settings screen and will open it when",
2429
+ " told to; the menu gains a Settings entry",
2430
+ " items up to four entries of the game's own, in this order,",
2431
+ " below the arcade's entries and visibly apart from them",
2432
+ "",
2433
+ "With no message at all, the menu holds the arcade's own entries and",
2434
+ "nothing of the game's. The arcade's entries are the arcade's: a game can",
2435
+ "neither remove nor reorder them, and Return to the Arcade is always there.",
2436
+ "",
2437
+ "SCREEN STATE, NOT A TOGGLE, like `gem.walletDisplay`. Each message is the",
2438
+ "whole answer and the latest one wins; nothing accumulates. The SDK re-sends",
2439
+ "the latest state after every handshake, so a parent that reconnects never",
2440
+ "shows a menu missing what the game had declared.",
2441
+ "",
2442
+ "`id` is the game's own name for an entry and is what comes back in",
2443
+ "`gem.menuSelect`; unique within one message, and the parent keeps the first",
2444
+ "of a repeated id. `label` is what the player reads, ALREADY IN THE PLAYER'S",
2445
+ "LANGUAGE (`gem.prefs.locale`): the parent does not translate it.",
2446
+ "",
2447
+ "A LABEL IS UNTRUSTED TEXT IN THE PARENT'S CHROME. A parent renders it as",
2448
+ "text and never as markup, in the game's group and never among its own",
2449
+ "entries, truncated to fit, and may decline to show an entry at all. A game",
2450
+ "cannot make the menu say something the arcade says: that is what the",
2451
+ "separate group is for.",
2452
+ "",
2453
+ "A PRESENTATION REQUEST ONLY. Not an authorization control; choosing an",
2454
+ "entry does nothing but send `gem.menuSelect`.",
2455
+ "",
2456
+ "Gated by `gameMenu`: sent only to a parent that advertised it. To any",
2457
+ "other, `gem.setMenu` returns false and the game shows a settings control",
2458
+ "of its own instead."
2459
+ ],
2460
+ "fields": {
2461
+ "settings": { "kind": "boolean" },
2462
+ "items": {
2463
+ "kind": "array",
2464
+ "maxItems": 4,
2465
+ "optional": true,
2466
+ "items": {
2467
+ "kind": "object",
2468
+ "fields": {
2469
+ "id": {
2470
+ "kind": "string",
2471
+ "maxLength": 32,
2472
+ "$comment": "The game's own name for the entry, 1..32 characters, echoed in `gem.menuSelect`. The SDK drops an entry whose id is empty or over-long rather than cutting it into a different id."
2473
+ },
2474
+ "label": {
2475
+ "kind": "string",
2476
+ "maxLength": 40,
2477
+ "$comment": "What the player reads, 1..40 characters, already translated. The SDK drops an entry with an empty label and cuts an over-long one."
2478
+ }
2479
+ }
2480
+ }
2481
+ }
2482
+ },
2483
+ "rateLimit": { "perMinute": 60 }
2484
+ },
2485
+
2486
+ {
2487
+ "type": "gem.menuSelect",
2488
+ "direction": "parentToFrame",
2489
+ "transport": "port",
2490
+ "$comment": [
2491
+ "The player chose one of the game's entries in the arcade's menu: its",
2492
+ "Settings entry, or one of the items `gem.menu` declared.",
2493
+ "",
2494
+ " entry: settings open your settings screen",
2495
+ " entry: item, id the item with this id",
2496
+ "",
2497
+ "Sent only for what the frame's LATEST `gem.menu` declared, and only to a",
2498
+ "frame that advertised `gameMenu`. The parent closes its menu first, so the",
2499
+ "`gem.pause` it sent when the menu opened is lifted before this arrives:",
2500
+ "the game is running, in front, and the next thing on screen is the game's",
2501
+ "own. A frame that hears an id it no longer declares ignores it — the menu",
2502
+ "may have been open across a change.",
2503
+ "",
2504
+ "The arcade's own entries never come through here. Leaving, the mute and",
2505
+ "fullscreen reach the game as they always did (`gem.pause`,",
2506
+ "`gem.willTerminate`, `gem.prefs`), and a problem report reaches it not at",
2507
+ "all."
2508
+ ],
2509
+ "fields": {
2510
+ "entry": { "kind": "enum", "values": ["settings", "item"] },
2511
+ "id": {
2512
+ "kind": "string",
2513
+ "maxLength": 32,
2514
+ "optional": true,
2515
+ "$comment": "Present when `entry` is `item`: the id from `gem.menu`."
2516
+ }
2517
+ },
2518
+ "rateLimit": { "perMinute": 60 }
2519
+ },
2520
+
2419
2521
  {
2420
2522
  "type": "gem.requestShare",
2421
2523
  "direction": "frameToParent",
@@ -190,6 +190,13 @@
190
190
  "gates": [
191
191
  "gem.requestShare"
192
192
  ]
193
+ },
194
+ "gameMenu": {
195
+ "implemented": true,
196
+ "gates": [
197
+ "gem.menu",
198
+ "gem.menuSelect"
199
+ ]
193
200
  }
194
201
  }
195
202
  }