seats get hidden without sitting #824

Open
opened 2026-02-20 10:20:51 -05:00 by deekerman · 2 comments
Owner

Originally created by @ArnoldSmith86 on GitHub (Sep 10, 2024).

QuickDownload without assets 2024-09-10 0639 - Intrigue of the Three Kingdoms.vtt.zip

If I click on a seat but then click Cancel, unused seats are hidden anyway. Might be a game bug but feels like an engine bug.

The problem is that it sets playerName = '':

{
  "type": "seat",
  "id": "seat",

  "hideWhenUnused": true,

  "clickRoutine": [
    "var playerName = ''"
  ]
}

Cancelling an INPUT usually stops execution but apparently it only stops the thenRoutine. But setting playerName to nothing should not behave like it does.

Originally created by @ArnoldSmith86 on GitHub (Sep 10, 2024). [QuickDownload without assets 2024-09-10 0639 - Intrigue of the Three Kingdoms.vtt.zip](https://github.com/user-attachments/files/16940550/QuickDownload.without.assets.2024-09-10.0639.-.Intrigue.of.the.Three.Kingdoms.vtt.zip) If I click on a seat but then click Cancel, unused seats are hidden anyway. Might be a game bug but feels like an engine bug. The problem is that it sets `playerName = ''`: ```JSON { "type": "seat", "id": "seat", "hideWhenUnused": true, "clickRoutine": [ "var playerName = ''" ] } ``` Cancelling an `INPUT` usually stops execution but apparently it only stops the `thenRoutine`. But setting `playerName` to nothing should not behave like it does.
Author
Owner

@bjalder26 commented on GitHub (Nov 28, 2024):

foreign is being appended to the class name of those seats whenever the playerName is changed to "" - even when done manually.

I think it is because of this line in seat.js.

if(this.get('hideWhenUnused') && !this.get('player') && widgetFilter(w=>w.get('type') == 'seat' && w.get('player') == playerName).length)
      className += ' foreign';

I'm thinking that this part: w.get('player') == playerName is making it so when the playerName is "", that any seats without an explicit player property will be hidden because the default is player: ''.

Is the solution to this as simple as changing the default for the player property on seats to null?

@bjalder26 commented on GitHub (Nov 28, 2024): `foreign` is being appended to the class name of those seats whenever the playerName is changed to "" - even when done manually. I think it is because of this line in seat.js. ```js if(this.get('hideWhenUnused') && !this.get('player') && widgetFilter(w=>w.get('type') == 'seat' && w.get('player') == playerName).length) className += ' foreign'; ``` I'm thinking that this part: `w.get('player') == playerName` is making it so when the playerName is "", that any seats without an explicit player property will be hidden because the default is `player: ''`. Is the solution to this as simple as changing the default for the `player` property on seats to `null`?
Author
Owner

@96LawDawg commented on GitHub (Nov 28, 2024):

Is the solution to this as simple as changing the default for the player property on seats to null?

Wouldn't that require a fileUpdater? Lots of my seat code relies on the fact that the default is ''.

@96LawDawg commented on GitHub (Nov 28, 2024): > Is the solution to this as simple as changing the default for the `player` property on seats to `null`? Wouldn't that require a fileUpdater? Lots of my seat code relies on the fact that the default is ''.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/virtualtabletop#824
No description provided.