Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seats get hidden without sitting #2301

Open
ArnoldSmith86 opened this issue Sep 10, 2024 · 2 comments
Open

seats get hidden without sitting #2301

ArnoldSmith86 opened this issue Sep 10, 2024 · 2 comments
Labels
bug Something isn't working widget properties changes to widget properties

Comments

@ArnoldSmith86
Copy link
Owner

ArnoldSmith86 commented 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.

@ArnoldSmith86 ArnoldSmith86 added bug Something isn't working widget properties changes to widget properties labels Sep 10, 2024
@bjalder26
Copy link
Collaborator

bjalder26 commented Nov 29, 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?

@96LawDawg
Copy link
Collaborator

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working widget properties changes to widget properties
Projects
None yet
Development

No branches or pull requests

3 participants