Skip to content

Dynamic menus and translates TypedServerCommand. #330

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

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added a comment about instance deletion.
  • Loading branch information
CookStar committed May 11, 2020
commit 436b0fa64f39f91bdb604bc99315eb106bed7cb2
6 changes: 4 additions & 2 deletions addons/source-python/packages/source-python/menus/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ def __init__(self, data=None, select_callback=None, build_callback=None, close_c
def _unload_instance(self):
"""Close this menu object for every player."""
# Just close all open menus, which will remove all instances from the
# queues
# queues.
self.close()

# Also remove the instance from the _instances dict
# Also remove the instance from the _instances dict.
# This process is necessary because there is no guarantee that
# the instance will be destroyed when the plugin is unloaded.
del self._instances[id(self)]

def _unload_player(self, player_index):
Expand Down