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

Unexpected UI when an active tool with UI is unloaded, runs out of charge, or when the player tries to sleep with the tool on #21093

Open
Qrox opened this issue May 22, 2017 · 2 comments
Labels
<Bug> This needs to be fixed Info / User Interface Game - player communication, menus, etc. (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@Qrox
Copy link
Contributor

Qrox commented May 22, 2017

Related to #18033. There are these lines of code from game::unload( item &it )

    // Turn off any active tools
    if( target->is_tool() && target->active && target->ammo_remaining() == 0 ) {
        target->type->invoke( &u, target, u.pos() );
    }

The code tries to deactivate a tool by activating it. If the tool shows UI when activated, unexpected UI will show when the the tool is active, and is then unloaded, runs out of charge, or if the player tries to sleep with the tool on.

The last scenario is fixable by not showing the UI unless it's the player who is activating the item (see #21014). For the first two, that fix is not applicable. It can be worked around by not showing the UI unless the tool has remaining charge, but it will not work for items that have multiple functions both when charged and not charged (Is there any item of this kind?).

Affected tools:

  • E-ink tablet PC
  • Remote vehicle controller
  • Multi cooker
  • RC car
  • RC control
  • Torch (When running out of charge)
  • Louisville Slaughterer (When running out of charge)
@Night-Pryanik Night-Pryanik added <Bug> This needs to be fixed Info / User Interface Game - player communication, menus, etc. labels May 22, 2017
@Treah
Copy link
Contributor

Treah commented May 25, 2017

Is the E-ink Tablet the only device that has a UI when its activated that has the ability to stay active after you close the UI?

@Qrox
Copy link
Contributor Author

Qrox commented May 26, 2017

A search for uimenu and menu() in iuse.cpp turned out these items: remote vehicle controller, multi cooker, RC car, and RC control. These items are also reproducing the bug in #18033.

The bug also happens when the charge runs out, which also happens to torch and Louisville Slaughterer.

This can be worked around by not showing the UI unless the tool has remaining charge and is activated by the player. But it will not work for items that have multiple functions both when charged and not charged (Is there any item of this kind?).

@Qrox Qrox changed the title Unloading E-ink tablet while playing music with it causes unexpected popup Unexpected UI when an active tool with UI is unloaded, runs out of charge, or when the player tries to sleep May 26, 2017
@Qrox Qrox changed the title Unexpected UI when an active tool with UI is unloaded, runs out of charge, or when the player tries to sleep Unexpected UI when an active tool with UI is unloaded, runs out of charge, or when the player tries to sleep with the tool on May 26, 2017
@Night-Pryanik Night-Pryanik added (S2 - Confirmed) Bug that's been confirmed to exist and removed old issue - still valid? labels Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed Info / User Interface Game - player communication, menus, etc. (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

No branches or pull requests

4 participants