
    Ii
                         S r SSKJrJr  SSKJrJr  SSKJr  \(       a  SSK	J
r
Jr   " S S\5      r " S S	\5      r\ " S
 S5      5       rg)z,Keybind definitions for game input handling.    )	dataclassfield)Enumauto)TYPE_CHECKING)GamePlayerc                   4    \ rS rSrSr\" 5       r\" 5       rSrg)KeybindScope   z*Scope in which a keybind can be performed. N)	__name__
__module____qualname____firstlineno____doc__r   GLOBALTABLE__static_attributes__r       6c:\Users\dbart\PlayPalace11\server\core\ui\keybinds.pyr   r      s    4VFFEr   r   c                   P    \ rS rSrSr\" 5       r\" 5       r\" 5       r\" 5       r	Sr
g)KeybindState   z!When a keybind should be enabled.r   N)r   r   r   r   r   r   NEVERIDLEACTIVEALWAYSr   r   r   r   r   r      s!    +FE6DVFVFr   r   c            	           \ rS rSr% Sr\\S'   \\S'   \\   \S'   Sr\	\S'   \
R                  r\
\S'   \R                  r\\S	'   \" \S
9r\\   \S'   Sr\	\S'   SSS\	4S jrSSSSSS\	S\	4S jjrSrg)Keybind   a  
A keybind definition for triggering game actions.

Keybinds act as hotkeys to trigger actions that can typically
be accessed from a menu. A keybind references one or more actions
by their IDs.

Attributes:
    name: Human-readable name for the keybind (e.g., "Roll dice")
    default_key: The default key combination (e.g., "space", "shift+b")
    actions: List of action IDs this keybind triggers
    requires_focus: If True, must be focused on a valid action menu item
    state: When this keybind is enabled (NEVER, IDLE, ACTIVE, ALWAYS)
    scope: Where the keybind applies (GLOBAL or TABLE)
    players: List of player names who can use (empty = all players)
    include_spectators: Whether spectators can use this keybind
namedefault_keyactionsFrequires_focusstatescope)default_factoryplayersinclude_spectatorsgamer   returnc                 4   U R                   [        R                  :X  a  gU R                   [        R                  :X  a  gU R                   [        R                  :X  a  UR
                  S:g  $ U R                   [        R                  :X  a  UR
                  S:H  $ g)z>Check if keybind state allows activation based on game status.FTplaying)r&   r   r   r   r   statusr   )selfr+   s     r   is_state_activeKeybind.is_state_active8   sq    ::+++::,,,::***;;)++::,,,;;)++r   playerr	   is_spectatorc                     U R                  U5      (       d  gU(       a  U R                  (       d  gU R                  (       a  UR                  U R                  ;  a  gg)z0Check if a specific player can use this keybind.FT)r1   r*   r)   r"   )r0   r+   r3   r4   s       r   can_player_useKeybind.can_player_useD   sF     ##D))  7 7 <<FKKt||;r   r   N)F)r   r   r   r   r   str__annotations__listr%   boolr   r   r&   r   r   r'   r   r)   r*   r1   r6   r   r   r   r   r    r       s    $ I#Y ND &--E<-&,,E<,t4GT#Y4$$
F 
t 
6 8 4 \`  r   r    N)r   dataclassesr   r   enumr   r   typingr   server.games.baser   r	   r   r   r    r   r   r   <module>r@      sH    2 (   .4 4  6 6 6r   