@utsp/core 0.14.0-nightly.20251219144833.1c27cfe → 0.14.0

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.
@@ -1467,7 +1467,13 @@ declare enum PostProcessOrderType {
1467
1467
  *
1468
1468
  * Parameters: slotId (0-255)
1469
1469
  */
1470
- SwitchPalette = 6
1470
+ SwitchPalette = 6,
1471
+ /**
1472
+ * 0x07 - SetCellSize: Set cell dimensions in pixels
1473
+ *
1474
+ * Parameters: cellWidth (1-255), cellHeight (1-255)
1475
+ */
1476
+ SetCellSize = 7
1471
1477
  }
1472
1478
 
1473
1479
  /**
@@ -1487,18 +1493,25 @@ declare enum ScanlinesPatternType {
1487
1493
  }
1488
1494
  /**
1489
1495
  * Base interface for all post-process orders
1496
+ *
1497
+ * All post-process orders are scoped to a specific display.
1498
+ * The displayId identifies which display the order applies to.
1490
1499
  */
1491
1500
  interface PostProcessOrderBase {
1501
+ /** Order type identifier */
1492
1502
  type: PostProcessOrderType;
1503
+ /** Display ID this order applies to (0-255) */
1504
+ displayId: number;
1493
1505
  }
1494
1506
  /**
1495
1507
  * SetConfig Order (0x01)
1496
1508
  *
1497
- * Sets the full post-process configuration.
1509
+ * Sets the full post-process configuration for a specific display.
1498
1510
  * Flags indicate which optional sections are present.
1499
1511
  *
1500
1512
  * Binary format:
1501
1513
  * - type: 1 byte (0x01)
1514
+ * - displayId: 1 byte (0-255)
1502
1515
  * - flags: 1 byte (PostProcessConfigFlags)
1503
1516
  * - [if HasScanlines]:
1504
1517
  * - enabled: 1 byte (0 or 1)
@@ -1536,10 +1549,11 @@ interface SetConfigOrder extends PostProcessOrderBase {
1536
1549
  /**
1537
1550
  * SetScanlines Order (0x02)
1538
1551
  *
1539
- * Sets only the scanlines configuration.
1552
+ * Sets only the scanlines configuration for a specific display.
1540
1553
  *
1541
1554
  * Binary format:
1542
1555
  * - type: 1 byte (0x02)
1556
+ * - displayId: 1 byte (0-255)
1543
1557
  * - enabled: 1 byte (0 or 1)
1544
1558
  * - opacity: 1 byte (0-255, scaled from 0.0-1.0)
1545
1559
  * - pattern: 1 byte (ScanlinesPatternType)
@@ -1559,10 +1573,11 @@ interface SetScanlinesOrder extends PostProcessOrderBase {
1559
1573
  /**
1560
1574
  * SetAmbientEffect Order (0x03)
1561
1575
  *
1562
- * Sets only the ambient effect configuration.
1576
+ * Sets only the ambient effect configuration for a specific display.
1563
1577
  *
1564
1578
  * Binary format:
1565
1579
  * - type: 1 byte (0x03)
1580
+ * - displayId: 1 byte (0-255)
1566
1581
  * - enabled: 1 byte (0 or 1)
1567
1582
  * - blur: 1 byte (0-255 pixels)
1568
1583
  * - scale: 1 byte (100-255, scaled from 1.0-2.55)
@@ -1578,10 +1593,11 @@ interface SetAmbientEffectOrder extends PostProcessOrderBase {
1578
1593
  /**
1579
1594
  * SetScalingMode Order (0x04)
1580
1595
  *
1581
- * Sets the pixel-perfect scaling mode.
1596
+ * Sets the pixel-perfect scaling mode for a specific display.
1582
1597
  *
1583
1598
  * Binary format:
1584
1599
  * - type: 1 byte (0x04)
1600
+ * - displayId: 1 byte (0-255)
1585
1601
  * - mode: 1 byte (ScalingModeValue)
1586
1602
  */
1587
1603
  interface SetScalingModeOrder extends PostProcessOrderBase {
@@ -1591,10 +1607,11 @@ interface SetScalingModeOrder extends PostProcessOrderBase {
1591
1607
  /**
1592
1608
  * SetGrid Order (0x05)
1593
1609
  *
1594
- * Sets the debug grid overlay configuration.
1610
+ * Sets the debug grid overlay configuration for a specific display.
1595
1611
  *
1596
1612
  * Binary format:
1597
1613
  * - type: 1 byte (0x05)
1614
+ * - displayId: 1 byte (0-255)
1598
1615
  * - enabled: 1 byte (0 or 1)
1599
1616
  * - colorR: 1 byte (0-255)
1600
1617
  * - colorG: 1 byte (0-255)
@@ -1614,21 +1631,39 @@ interface SetGridOrder extends PostProcessOrderBase {
1614
1631
  /**
1615
1632
  * SwitchPalette Order (0x06)
1616
1633
  *
1617
- * Switches to a pre-loaded palette slot.
1634
+ * Switches to a pre-loaded palette slot for a specific display.
1618
1635
  * The palette must have been loaded to the Core via loadPaletteToSlot() first.
1619
1636
  *
1620
1637
  * Binary format:
1621
1638
  * - type: 1 byte (0x06)
1639
+ * - displayId: 1 byte (0-255)
1622
1640
  * - slotId: 1 byte (0-255)
1623
1641
  */
1624
1642
  interface SwitchPaletteOrder extends PostProcessOrderBase {
1625
1643
  type: PostProcessOrderType.SwitchPalette;
1626
1644
  slotId: number;
1627
1645
  }
1646
+ /**
1647
+ * SetCellSize Order (0x07)
1648
+ *
1649
+ * Sets the cell dimensions in pixels for a specific display.
1650
+ * Used to configure the renderer's native cell size.
1651
+ *
1652
+ * Binary format:
1653
+ * - type: 1 byte (0x07)
1654
+ * - displayId: 1 byte (0-255)
1655
+ * - cellWidth: 1 byte (1-255 pixels)
1656
+ * - cellHeight: 1 byte (1-255 pixels)
1657
+ */
1658
+ interface SetCellSizeOrder extends PostProcessOrderBase {
1659
+ type: PostProcessOrderType.SetCellSize;
1660
+ cellWidth: number;
1661
+ cellHeight: number;
1662
+ }
1628
1663
  /**
1629
1664
  * Union type for all post-process orders
1630
1665
  */
1631
- type AnyPostProcessOrder = SetConfigOrder | SetScanlinesOrder | SetAmbientEffectOrder | SetScalingModeOrder | SetGridOrder | SwitchPaletteOrder;
1666
+ type AnyPostProcessOrder = SetConfigOrder | SetScanlinesOrder | SetAmbientEffectOrder | SetScalingModeOrder | SetGridOrder | SwitchPaletteOrder | SetCellSizeOrder;
1632
1667
 
1633
1668
  /**
1634
1669
  * Update packet according to the new UTSP protocol
@@ -4281,6 +4316,7 @@ declare class User<TData = Record<string, any>> {
4281
4316
  private bytesTickRate;
4282
4317
  private currentTickBytesSent;
4283
4318
  private currentTickBytesReceived;
4319
+ private availableViewports;
4284
4320
  /**
4285
4321
  * Application-specific data storage
4286
4322
  * Use this to store game state, player data, or any custom information
@@ -4310,6 +4346,78 @@ declare class User<TData = Record<string, any>> {
4310
4346
  * Removes all displays from the user
4311
4347
  */
4312
4348
  clearDisplays(): void;
4349
+ /**
4350
+ * Sets the available viewport size (in pixels) for a display
4351
+ *
4352
+ * Called by the server when receiving viewport information from the client.
4353
+ * The application can use this to adapt display resolution.
4354
+ *
4355
+ * @param displayId - Display ID (0-255)
4356
+ * @param pixelWidth - Available width in pixels (0-65535)
4357
+ * @param pixelHeight - Available height in pixels (0-65535)
4358
+ *
4359
+ * @example
4360
+ * ```typescript
4361
+ * // Called automatically by decodeAndApplyCompressedInput()
4362
+ * user.setDisplayViewport(0, 800, 600);
4363
+ * ```
4364
+ */
4365
+ setDisplayViewport(displayId: number, pixelWidth: number, pixelHeight: number): void;
4366
+ /**
4367
+ * Gets the available viewport size (in pixels) for a display
4368
+ *
4369
+ * @param displayId - Display ID (0-255)
4370
+ * @returns Viewport size in pixels, or null if not set
4371
+ *
4372
+ * @example
4373
+ * ```typescript
4374
+ * const viewport = user.getDisplayViewport(0);
4375
+ * if (viewport) {
4376
+ * console.log(`Available: ${viewport.pixelWidth}x${viewport.pixelHeight}px`);
4377
+ * }
4378
+ * ```
4379
+ */
4380
+ getDisplayViewport(displayId: number): {
4381
+ pixelWidth: number;
4382
+ pixelHeight: number;
4383
+ } | null;
4384
+ /**
4385
+ * Gets all available viewports (in pixels)
4386
+ *
4387
+ * @returns Map of displayId → viewport size
4388
+ */
4389
+ getAllDisplayViewports(): Map<number, {
4390
+ pixelWidth: number;
4391
+ pixelHeight: number;
4392
+ }>;
4393
+ /**
4394
+ * Calculates the maximum number of cells that fit in a display's available viewport
4395
+ *
4396
+ * Helper method that divides pixel dimensions by cell size to get max cells.
4397
+ * The application can use this to decide the optimal display resolution.
4398
+ *
4399
+ * @param displayId - Display ID (0-255)
4400
+ * @param cellWidth - Width of a cell in pixels (e.g., 8 for 8px font)
4401
+ * @param cellHeight - Height of a cell in pixels (e.g., 16 for 16px font)
4402
+ * @returns Max cells { cols, rows }, or null if viewport not set
4403
+ *
4404
+ * @example
4405
+ * ```typescript
4406
+ * // With 8x16 font, calculate how many cells fit in available space
4407
+ * const maxCells = user.calculateMaxCells(0, 8, 16);
4408
+ * if (maxCells) {
4409
+ * const display = user.getDisplays()[0];
4410
+ * display.setSize(new Vector2(
4411
+ * Math.min(maxCells.cols, 120), // Cap at 120 columns
4412
+ * Math.min(maxCells.rows, 40) // Cap at 40 rows
4413
+ * ));
4414
+ * }
4415
+ * ```
4416
+ */
4417
+ calculateMaxCells(displayId: number, cellWidth: number, cellHeight: number): {
4418
+ cols: number;
4419
+ rows: number;
4420
+ } | null;
4313
4421
  getLayers(): Layer[];
4314
4422
  /**
4315
4423
  * Gets a layer by its ID
@@ -4968,6 +5076,12 @@ declare class User<TData = Record<string, any>> {
4968
5076
  * // Values are now available
4969
5077
  * const move = user.getAxis("MoveHorizontal");
4970
5078
  * if (user.getButton("Jump")) { ... }
5079
+ *
5080
+ * // Viewport info is available via:
5081
+ * const viewport = user.getDisplayViewport(0);
5082
+ * if (viewport) {
5083
+ * console.log(`Available: ${viewport.pixelWidth}x${viewport.pixelHeight}px`);
5084
+ * }
4971
5085
  * });
4972
5086
  * ```
4973
5087
  */
@@ -5819,17 +5933,18 @@ declare class User<TData = Record<string, any>> {
5819
5933
  */
5820
5934
  macroActivateFocused(): void;
5821
5935
  /**
5822
- * Set post-processing configuration
5936
+ * Set post-processing configuration for a specific display
5823
5937
  *
5824
5938
  * The post-process overlay is rendered ONCE when this is called.
5825
5939
  * No per-frame cost - only updates when you call this method.
5826
5940
  *
5941
+ * @param displayId - Display ID (0-255) this setting applies to
5827
5942
  * @param config - Post-processing configuration (or null to disable)
5828
5943
  *
5829
5944
  * @example
5830
5945
  * ```typescript
5831
- * // Enable scanlines effect
5832
- * user.setPostProcess({
5946
+ * // Enable scanlines effect on display 0
5947
+ * user.setPostProcess(0, {
5833
5948
  * scanlines: {
5834
5949
  * enabled: true,
5835
5950
  * opacity: 0.15,
@@ -5837,105 +5952,112 @@ declare class User<TData = Record<string, any>> {
5837
5952
  * }
5838
5953
  * });
5839
5954
  *
5840
- * // Disable all post-processing
5841
- * user.setPostProcess(null);
5955
+ * // Disable all post-processing on display 0
5956
+ * user.setPostProcess(0, null);
5842
5957
  * ```
5843
5958
  */
5844
- setPostProcess(config: PostProcessConfig | null): void;
5959
+ setPostProcess(displayId: number, config: PostProcessConfig | null): void;
5845
5960
  /**
5846
- * Enable or disable scanlines effect with default/current settings
5961
+ * Enable or disable scanlines effect with default/current settings for a specific display
5847
5962
  *
5963
+ * @param displayId - Display ID (0-255)
5848
5964
  * @param enabled - Whether to enable scanlines
5849
5965
  *
5850
5966
  * @example
5851
5967
  * ```typescript
5852
- * user.setScanlinesEnabled(true); // Enable with defaults
5853
- * user.setScanlinesEnabled(false); // Disable
5968
+ * user.setScanlinesEnabled(0, true); // Enable with defaults on display 0
5969
+ * user.setScanlinesEnabled(0, false); // Disable on display 0
5854
5970
  * ```
5855
5971
  */
5856
- setScanlinesEnabled(enabled: boolean): void;
5972
+ setScanlinesEnabled(displayId: number, enabled: boolean): void;
5857
5973
  /**
5858
- * Set scanlines opacity (0-1)
5974
+ * Set scanlines opacity (0-1) for a specific display
5859
5975
  *
5860
5976
  * Also enables scanlines if not already enabled.
5861
5977
  *
5978
+ * @param displayId - Display ID (0-255)
5862
5979
  * @param opacity - Opacity of dark lines (0 = invisible, 1 = fully opaque)
5863
5980
  *
5864
5981
  * @example
5865
5982
  * ```typescript
5866
- * user.setScanlinesOpacity(0.2); // Subtle effect
5867
- * user.setScanlinesOpacity(0.5); // Strong effect
5983
+ * user.setScanlinesOpacity(0, 0.2); // Subtle effect on display 0
5984
+ * user.setScanlinesOpacity(0, 0.5); // Strong effect on display 0
5868
5985
  * ```
5869
5986
  */
5870
- setScanlinesOpacity(opacity: number): void;
5987
+ setScanlinesOpacity(displayId: number, opacity: number): void;
5871
5988
  /**
5872
- * Set scanlines pattern
5989
+ * Set scanlines pattern for a specific display
5873
5990
  *
5991
+ * @param displayId - Display ID (0-255)
5874
5992
  * @param pattern - Pattern type: 'horizontal', 'vertical', or 'grid'
5875
5993
  */
5876
- setScanlinesPattern(pattern: 'horizontal' | 'vertical' | 'grid'): void;
5994
+ setScanlinesPattern(displayId: number, pattern: 'horizontal' | 'vertical' | 'grid'): void;
5877
5995
  /**
5878
- * Enable or configure ambient effect
5996
+ * Enable or configure ambient effect for a specific display
5879
5997
  *
5880
5998
  * Ambient effect creates a blurred glow around the terminal canvas,
5881
5999
  * filling the unused space with colors from the terminal content.
5882
6000
  * This effect is GPU-accelerated (CSS blur) and has zero CPU cost.
5883
6001
  *
6002
+ * @param displayId - Display ID (0-255)
5884
6003
  * @param config - true to enable with defaults, false to disable,
5885
6004
  * or object with blur and scale settings
5886
6005
  *
5887
6006
  * @example
5888
6007
  * ```typescript
5889
- * // Enable with defaults (blur: 30px, scale: 1.3)
5890
- * user.setAmbientEffect(true);
6008
+ * // Enable with defaults (blur: 30px, scale: 1.3) on display 0
6009
+ * user.setAmbientEffect(0, true);
5891
6010
  *
5892
- * // Disable
5893
- * user.setAmbientEffect(false);
6011
+ * // Disable on display 0
6012
+ * user.setAmbientEffect(0, false);
5894
6013
  *
5895
- * // Custom settings
5896
- * user.setAmbientEffect({ blur: 50, scale: 1.5 });
6014
+ * // Custom settings on display 1
6015
+ * user.setAmbientEffect(1, { blur: 50, scale: 1.5 });
5897
6016
  * ```
5898
6017
  */
5899
- setAmbientEffect(config: boolean | {
6018
+ setAmbientEffect(displayId: number, config: boolean | {
5900
6019
  blur?: number;
5901
6020
  scale?: number;
5902
6021
  }): void;
5903
6022
  /**
5904
- * Enable or disable ambient effect
6023
+ * Enable or disable ambient effect for a specific display
5905
6024
  *
6025
+ * @param displayId - Display ID (0-255)
5906
6026
  * @param enabled - Whether to enable ambient effect
5907
6027
  *
5908
6028
  * @example
5909
6029
  * ```typescript
5910
- * user.setAmbientEffectEnabled(true); // Enable with defaults
5911
- * user.setAmbientEffectEnabled(false); // Disable
6030
+ * user.setAmbientEffectEnabled(0, true); // Enable with defaults on display 0
6031
+ * user.setAmbientEffectEnabled(0, false); // Disable on display 0
5912
6032
  * ```
5913
6033
  */
5914
- setAmbientEffectEnabled(enabled: boolean): void;
6034
+ setAmbientEffectEnabled(displayId: number, enabled: boolean): void;
5915
6035
  /**
5916
- * Set ambient effect blur intensity
6036
+ * Set ambient effect blur intensity for a specific display
5917
6037
  *
6038
+ * @param displayId - Display ID (0-255)
5918
6039
  * @param blur - Blur intensity in pixels (default: 30)
5919
6040
  *
5920
6041
  * @example
5921
6042
  * ```typescript
5922
- * user.setAmbientEffectBlur(50); // More blur
5923
- * user.setAmbientEffectBlur(15); // Less blur
6043
+ * user.setAmbientEffectBlur(0, 50); // More blur on display 0
6044
+ * user.setAmbientEffectBlur(0, 15); // Less blur on display 0
5924
6045
  * ```
5925
6046
  */
5926
- setAmbientEffectBlur(blur: number): void;
6047
+ setAmbientEffectBlur(displayId: number, blur: number): void;
5927
6048
  /**
5928
- * Set ambient effect scale factor
6049
+ * Set ambient effect scale factor for a specific display
5929
6050
  *
6051
+ * @param displayId - Display ID (0-255)
5930
6052
  * @param scale - Scale factor for the glow (default: 1.3)
5931
6053
  *
5932
6054
  * @example
5933
6055
  * ```typescript
5934
- * user.setAmbientEffectScale(1.5); // Larger glow area
5935
- * user.setAmbientEffectScale(1.1); // Smaller glow area
6056
+ * user.setAmbientEffectScale(0, 1.5); // Larger glow area on display 0
6057
+ * user.setAmbientEffectScale(0, 1.1); // Smaller glow area on display 0
5936
6058
  * ```
5937
6059
  */
5938
- setAmbientEffectScale(scale: number): void;
6060
+ setAmbientEffectScale(displayId: number, scale: number): void;
5939
6061
  /**
5940
6062
  * Check if ambient effect is currently enabled
5941
6063
  */
@@ -5962,16 +6084,18 @@ declare class User<TData = Record<string, any>> {
5962
6084
  * @internal
5963
6085
  */
5964
6086
  flushPostProcessCommands(): PostProcessCommand[];
5965
- /** Current scaling mode */
5966
- private currentScalingMode;
6087
+ /** Current scaling mode per display (Map<displayId, mode>) */
6088
+ private currentScalingModes;
5967
6089
  /**
5968
- * Set the pixel-perfect scaling mode
6090
+ * Set the pixel-perfect scaling mode for a specific display
5969
6091
  *
5970
6092
  * Controls how the terminal canvas is scaled to fit the available space.
5971
6093
  * Stricter modes produce crisper pixels but may leave empty space.
5972
6094
  *
6095
+ * @param displayId - Display ID (0-255) this setting applies to
5973
6096
  * @param mode - Scaling mode:
5974
6097
  * - `'none'`: Fill space, may have sub-pixel artifacts (default)
6098
+ * - `'responsive'`: Fixed cell size, cols/rows adapt to fill space
5975
6099
  * - `'eighth'`: Snap to 0.125 increments (1.0, 1.125, 1.25...)
5976
6100
  * - `'quarter'`: Snap to 0.25 increments (1.0, 1.25, 1.5...)
5977
6101
  * - `'half'`: Snap to 0.5 increments (1.0, 1.5, 2.0...)
@@ -5979,74 +6103,120 @@ declare class User<TData = Record<string, any>> {
5979
6103
  *
5980
6104
  * @example
5981
6105
  * ```typescript
5982
- * // For crisp retro-style pixels
5983
- * user.setScalingMode('integer');
6106
+ * // For crisp retro-style pixels on display 0
6107
+ * user.setScalingMode(0, 'integer');
5984
6108
  *
5985
- * // For balanced quality
5986
- * user.setScalingMode('quarter');
6109
+ * // For balanced quality on display 1
6110
+ * user.setScalingMode(1, 'quarter');
5987
6111
  *
5988
- * // Fill all available space
5989
- * user.setScalingMode('none');
6112
+ * // Fill all available space on display 0
6113
+ * user.setScalingMode(0, 'none');
5990
6114
  * ```
5991
6115
  */
5992
- setScalingMode(mode: ScalingMode): void;
6116
+ setScalingMode(displayId: number, mode: ScalingMode): void;
5993
6117
  /**
5994
- * Get current scaling mode
6118
+ * Get current scaling mode for a display
5995
6119
  *
6120
+ * @param displayId - Display ID (0-255)
6121
+ * @param displayId - Display ID (0-255)
5996
6122
  * @returns Current scaling mode or null if not set
5997
6123
  */
5998
- getScalingMode(): ScalingMode | null;
5999
- /** Current grid configuration */
6000
- private currentGridConfig;
6124
+ getScalingMode(displayId: number): ScalingMode | null;
6125
+ /** Current cell size configuration per display (Map<displayId, {width, height}>) */
6126
+ private currentCellSizes;
6001
6127
  /**
6002
- * Enable or configure the debug grid overlay
6128
+ * Set the cell dimensions in pixels for a specific display (for Responsive mode)
6129
+ *
6130
+ * This is only relevant when using `setScalingMode(displayId, 'responsive')`.
6131
+ * In responsive mode, the cell size is fixed and the number of cols/rows
6132
+ * adapts to fill the available space.
6133
+ *
6134
+ * In other scaling modes (integer, quarter, half, none), the cell size
6135
+ * comes from the font/atlas and CSS scaling is applied to fill space.
6136
+ *
6137
+ * @param displayId - Display ID (0-255) this setting applies to
6138
+ * @param width - Cell width in pixels (1-255, default: 8)
6139
+ * @param height - Cell height in pixels (1-255, default: 8)
6140
+ *
6141
+ * @example
6142
+ * ```typescript
6143
+ * // Responsive mode with 8x8 cells on display 0
6144
+ * user.setScalingMode(0, 'responsive');
6145
+ * user.setCellSize(0, 8, 8);
6146
+ *
6147
+ * // Responsive mode with larger 16x16 tiles on display 1
6148
+ * user.setScalingMode(1, 'responsive');
6149
+ * user.setCellSize(1, 16, 16);
6150
+ * ```
6151
+ */
6152
+ setCellSize(displayId: number, width: number, height: number): void;
6153
+ /**
6154
+ * Get current cell size for a display
6155
+ *
6156
+ * @param displayId - Display ID (0-255)
6157
+ * @returns Object with cellWidth and cellHeight in pixels, or default 8x8 if not set
6158
+ */
6159
+ getCellSize(displayId: number): {
6160
+ cellWidth: number;
6161
+ cellHeight: number;
6162
+ };
6163
+ /** Current grid configuration per display (Map<displayId, GridConfig>) */
6164
+ private currentGridConfigs;
6165
+ /**
6166
+ * Enable or configure the debug grid overlay for a specific display
6003
6167
  *
6004
6168
  * The grid shows cell boundaries aligned with the terminal grid.
6005
6169
  * Useful for debugging layout and alignment issues.
6006
6170
  *
6171
+ * @param displayId - Display ID (0-255) this setting applies to
6007
6172
  * @param config - true to enable with defaults, false to disable,
6008
6173
  * or object with color and lineWidth settings
6009
6174
  *
6010
6175
  * @example
6011
6176
  * ```typescript
6012
- * // Enable with default red grid
6013
- * user.setGrid(true);
6177
+ * // Enable with default red grid on display 0
6178
+ * user.setGrid(0, true);
6014
6179
  *
6015
- * // Disable
6016
- * user.setGrid(false);
6180
+ * // Disable on display 0
6181
+ * user.setGrid(0, false);
6017
6182
  *
6018
- * // Custom green grid
6019
- * user.setGrid({ enabled: true, color: 'rgba(0, 255, 0, 0.5)' });
6183
+ * // Custom green grid on display 1
6184
+ * user.setGrid(1, { enabled: true, color: 'rgba(0, 255, 0, 0.5)' });
6020
6185
  *
6021
- * // Custom with thicker lines
6022
- * user.setGrid({ enabled: true, color: '#ff0000', lineWidth: 2 });
6186
+ * // Custom with thicker lines on display 0
6187
+ * user.setGrid(0, { enabled: true, color: '#ff0000', lineWidth: 2 });
6023
6188
  * ```
6024
6189
  */
6025
- setGrid(config: boolean | GridConfig): void;
6190
+ setGrid(displayId: number, config: boolean | GridConfig): void;
6026
6191
  /**
6027
- * Enable or disable the grid
6192
+ * Enable or disable the grid for a specific display
6028
6193
  *
6194
+ * @param displayId - Display ID (0-255)
6029
6195
  * @param enabled - Whether to show the grid
6030
6196
  *
6031
6197
  * @example
6032
6198
  * ```typescript
6033
- * user.setGridEnabled(true); // Show grid
6034
- * user.setGridEnabled(false); // Hide grid
6199
+ * user.setGridEnabled(0, true); // Show grid on display 0
6200
+ * user.setGridEnabled(0, false); // Hide grid on display 0
6035
6201
  * ```
6036
6202
  */
6037
- setGridEnabled(enabled: boolean): void;
6203
+ setGridEnabled(displayId: number, enabled: boolean): void;
6038
6204
  /**
6039
- * Check if grid is currently enabled
6205
+ * Check if grid is currently enabled for a display
6206
+ *
6207
+ * @param displayId - Display ID (0-255)
6040
6208
  */
6041
- isGridEnabled(): boolean;
6209
+ isGridEnabled(displayId: number): boolean;
6042
6210
  /**
6043
- * Get current grid configuration
6211
+ * Get current grid configuration for a display
6212
+ *
6213
+ * @param displayId - Display ID (0-255)
6044
6214
  */
6045
- getGridConfig(): GridConfig | null;
6046
- /** Currently active palette slot ID */
6047
- private currentPaletteSlotId;
6215
+ getGridConfig(displayId: number): GridConfig | null;
6216
+ /** Currently active palette slot ID per display (Map<displayId, slotId>) */
6217
+ private currentPaletteSlotIds;
6048
6218
  /**
6049
- * Switch to a pre-loaded palette slot
6219
+ * Switch to a pre-loaded palette slot for a specific display
6050
6220
  *
6051
6221
  * The palette must have been loaded to the Core via `core.loadPaletteToSlot()` first.
6052
6222
  * This allows instant palette switching without re-sending palette data over the network.
@@ -6057,6 +6227,7 @@ declare class User<TData = Record<string, any>> {
6057
6227
  * - Accessibility options (high contrast)
6058
6228
  * - Visual effects (damage flash, power-up)
6059
6229
  *
6230
+ * @param displayId - Display ID (0-255) this setting applies to
6060
6231
  * @param slotId - Palette slot ID (0-255)
6061
6232
  *
6062
6233
  * @example
@@ -6068,24 +6239,24 @@ declare class User<TData = Record<string, any>> {
6068
6239
  *
6069
6240
  * // In IApplication.updateUser() - switch based on game state
6070
6241
  * if (gameState.isNight) {
6071
- * user.switchPalette(1);
6242
+ * user.switchPalette(0, 1); // display 0, night palette
6072
6243
  * } else {
6073
- * user.switchPalette(0);
6244
+ * user.switchPalette(0, 0); // display 0, day palette
6074
6245
  * }
6075
6246
  *
6076
- * // Zone-based switching
6077
- * if (player.enteredDungeon) {
6078
- * user.switchPalette(2);
6079
- * }
6247
+ * // Different palettes for different displays (split-screen)
6248
+ * user.switchPalette(0, dayPalette); // Player 1 display
6249
+ * user.switchPalette(1, nightPalette); // Player 2 display
6080
6250
  * ```
6081
6251
  */
6082
- switchPalette(slotId: number): void;
6252
+ switchPalette(displayId: number, slotId: number): void;
6083
6253
  /**
6084
- * Get the currently active palette slot ID
6254
+ * Get the currently active palette slot ID for a display
6085
6255
  *
6256
+ * @param displayId - Display ID (0-255)
6086
6257
  * @returns The active slot ID, or null if no palette has been switched yet
6087
6258
  */
6088
- getCurrentPaletteSlotId(): number | null;
6259
+ getCurrentPaletteSlotId(displayId: number): number | null;
6089
6260
  /**
6090
6261
  * Send data through the bridge channel to the client application
6091
6262
  *