Repository navigation
Beta 2 Release
- Feature: Automatic Dedicated User Creation:
- Implemented
ensureDedicatedUserExists()function that checks if the configured dedicated player username exists. - If the user does not exist, it programmatically creates the user with a "Player" role (and no password).
- This function is now called by
launchOrFocusPlayerView()before attempting to open the player window, ensuring the target user is available. - Includes error handling and notifications for user creation success/failure.
- Implemented
- Fix: Overlay First-Click Visibility (Auto-Calibration Interaction):
- Modified
toggleGMOverlay()to correctly handle the initial visibility state when auto-calibration runs on the first open. The overlay should now appear on the first click as intended, even if auto-calibrated.
- Modified
- Fix: Splash Screen Button Highlight & GM Overlay Preview:
- Ensured CSS and JavaScript logic for highlighting the "Toggle Splash Image" button when the splash is active on the player view is functional.
- Ensured the GM's overlay correctly displays a semi-transparent preview of the splash image and updates its border/background to indicate the player's splash screen status. This was a refinement of CSS and DOM structure within
toggleGMOverlayandrenderGMOverlayFromCanvasState.
- Fix: Overlay Header and Controls Styling:
- Adjusted CSS (
injectGMOverlayCSS) and DOM creation intoggleGMOverlayfor the overlay header (#irlmod-gm-overlay-header) to ensure the title and close button are correctly positioned (close button on the far right). This involved using a separatespanfor the title and refining flexbox/absolute positioning properties. - Confirmed z-indexing for overlay components to prevent elements from incorrectly obscuring each other.
- Adjusted CSS (
- Refinement: Settings Registration for
playerPerformanceMode:- Ensured the
choicesingame.settings.registerforplayerPerformanceModeuse direct localization keys (e.g.,"IRLMOD.performanceModes.high") for better compatibility with Foundry's settings UI localization. (This was actually fixed in v36.5/v36.6 but is part of this stable state).
- Ensured the
- Refinement: Default TV Settings:
- Updated default values for
tvPhysicalWidthInchesto43andtvResolutionWidthPixelsto3840to better match a common 43" 4K TV setup. (This was introduced around v35.1/v36 but is part of this stable state).
- Updated default values for
- General Code Structure: Maintained the structure of defining all functions before they are called by hooks to prevent
ReferenceErrorissues.
player-client.js - Changelog for v2.59.5 (WSS Support & Performance Mode Fix)
- Feature: WSS (Secure WebSocket) Support for Pi Connection:
- Modified
connectToPiServer()to dynamically choose betweenws://andwss://based on the protocol of the current Foundry VTT page (window.location.protocol). - If the Foundry page is loaded via HTTPS, it will attempt to connect to the Pi server using WSS.
- Modified
- Fix: Performance Mode Setting Application (
applyPlayerPerformanceMode):- Resolved the "NaN is not a valid choice" error.
- The function now correctly retrieves the string key (e.g., "high", "maximum") for the desired performance mode from module settings.
- It validates this key against a list of known valid performance mode strings.
- It attempts to set the
core.performanceModeclient setting using this validated string (e.g.,game.settings.set("core", "performanceMode", "maximum")). - It additionally attempts to directly set
canvas.performance.modeusing the corresponding numerical constant fromCONST.CANVAS_PERFORMANCE_MODESfor more immediate effect. - Improved logging to track the desired mode, current mode, and the outcome of setting the mode.
- Fix:
canvas is not definedError on Script Load:- Removed direct
canvasreferences from global constant definitions (e.g.,PI_MULTI_TOUCH_DIST_SQ_FALLBACK). Calculations dependent oncanvas.grid.sizeare now done locally within functions wherecanvasis guaranteed to be available.
- Removed direct
- Refinement: Touch Interaction Logic (from v2.55 baseline):
- Maintained the "rollback" of the drag finalization timeout, prioritizing the "lift and replace to select/deselect" feel and server updates only on explicit
touch_up. - Retained the client-side jitter filter (
PI_MOVE_JITTER_THRESHOLD_PX) and the basic "legs" debounce (PI_MULTI_TOUCH_DEBOUNCE_MS). - Retained the pause check to prevent token movement when the game is paused.
- Maintained the "rollback" of the drag finalization timeout, prioritizing the "lift and replace to select/deselect" feel and server updates only on explicit
- General Code Structure: All function definitions are placed at the top of the script before hook registrations to prevent
ReferenceErrorissues during initialization.
These changelogs reflect the culmination of our recent debugging and feature implementation efforts, aiming for a stable and functional version for your play session.