
     _-#                     :    S SK Jr  SSKJrJrJr   " S S\5      rg)    )MutableSequence   )	OptionBoxOptionBoxButtonOptionScrollTypec                     ^  \ rS rSr% Sr\   S%S\S\S\S\4S jj5       r\\	   \
S'   S	S
SS.S\S\S\S\\	   S\SS4U 4S jjjr\\
S'   S\4S jrS\	4S jrS&S jrS\	SS4S jrS\	SS4S jrS\	SS4S jrS\S\SS4S jrS\	SS4S jr\S\4S j5       r\R0                  S \SS4S! j5       r\S\4S" j5       r\R0                  S \SS4S# j5       rS$rU =r$ )'
ReorderBox   aC  
Class representing a dialog box with multiple buttons that may be reordered. Based off of the
 same component as an `OptionBox`, with heavy modification.

Attributes:
    Title: The title text to display at the top of the option box.
    Caption: The text to display in the main body of the option box.
    Tooltip: The text to display in the footer of the option box.
    Buttons:
        A mutable sequence of `OptionBoxButton`s that the user should reorder. This may contain
         duplicates. This will be modified in place.
    Priority:
        A byte representing the priority of the option box in reference to the game's other
         `GfxMovie`s. Higher values display above lower ones.
Inherited, unused attributes:
    PreventCanceling: Forced to False.
    ScrollType: Forced to `OptionScrollType.BIDIRECTIONAL_HOVER`.
EnterMessage
EscMessageReorderMessagereturnc                     SU  SU SU 3$ )a  
Creates a tooltip string in a similar format as the game, with your own prompts.

Args:
    EnterMessage: The message to display after the enter prompt. Defaults to "Select".
    EscMessage: The message to display after the escape prompt. Defaults to "Cancel".
    ReorderMessage: The message to display after the up/down prompt. Defaults to "Move".
Returns:
    A string in in a similar format as the game's tooltips, but with your own prompts.
z<StringAliasMap:GFx_Accept> z     [Up / Down] z!     <StringAliasMap:GFx_Cancel>  )r   r   r   s      bZ:\mnt\Skyabridged\SteamLibrary\steamapps\common\Borderlands 2\sdk_mods\UserFeedback\ReorderBox.pyCreateTooltipStringReorderBox.CreateTooltipString   s*    " +<.)*++5,	8	
    Buttons z[<StringAliasMap:GFx_Accept> Select    [Up / Down] Move     <StringAliasMap:GFx_Cancel> Exit   )CaptionTooltipPriorityTitler   r   r   Nc          	      8   > [         TU ]  UUUUSUS9  SU l        g)aN  
Creates a Reorder Box.

Args:
    Title: The title text to display at the top of the option box.
    Caption:
        The text to display in the main body of the option box. Defaults to the empty
         string.
    Tooltip:
        The text to display in the footer of the option box. Defaults to the game's default
         tooltip, which explains the keybinds.
    Buttons:
        A mutable sequence of buttons that the user should reorder. This may contain
         duplicates.
    Priority:
        A byte representing the priority of the option box in reference to the game's other
         `GfxMovie`s. Higher values display above lower ones. Defaults to 254, the same as
         the game's default.
    Raises:
        TypeError: If not passed a sequence of `OptionBoxButton`s.
        ValueError: If not passed at least two buttons.
F)r   r   r   r   PreventCancelingr   N)super__init___IsCurrentlyMoving)selfr   r   r   r   r   	__class__s         r   r   ReorderBox.__init__4   s3    < 	" 	 	
 #(r   r    c                     U R                   $ )a
  
Gets if the user is currently moving a button.

Note that if this is the case, the button being moved has it's `Name` field modified,
 prefixing it with "-- " and suffixing it with " --"

Returns:
    True if the user is currently moving a button, false otherwise.
r    r!   s    r   IsCurrentlyMovingReorderBox.IsCurrentlyMoving_   s     &&&r   c                 P    U R                   U R                     R                  5       $ )af  
Gets the button the user has current got selected.

Note that if a button is currently being moved (and thus this function would return it) then
 it's `Name` field will be modified - prefixed with "-- " and suffixed with " --"

Returns:
    The button the user has currently got selected
Raises:
    RuntimeError: If the option box is not currently showing
)_Pages_CurrentPageIndexGetSelectedButtonr&   s    r   r,   ReorderBox.GetSelectedButtonl   s"     {{4112DDFFr   c                     g)z
Callback function intended to be overwritten. Called when the user "cancels" out of the
 option box menu - i.e. when they exit it.
Nr   r&   s    r   OnCancelReorderBox.OnCancelz   s    
 	r   buttonc                     g)z
Callback function intended to be overwritten. Called when the user starts moving a button,
 though before the `Name` field is modified.

Args:
    button: The button that was selected.
Nr   r!   r1   s     r   OnSelectReorderBox.OnSelect        	r   c                     g)z
Callback function intended to be overwritten. Called when the user places a button into
 it's new stop, after the `Name` field is restored.

Args:
    button: The button that was selected.
Nr   r3   s     r   OnPlaceReorderBox.OnPlace   r6   r   c                    U R                   (       a&  UR                  SS Ul        U R                  U5        O&U R                  U5        SUR                   S3Ul        U R                   (       + U l         U R	                  U5        g )N   z-- z --)r    Namer8   r4   Showr3   s     r   _InternalOnPressReorderBox._InternalOnPress   sf    "" ++a+FKLL MM&!}C0FK&*&=&="=		&r   keyeventc                    US:X  Gao  U R                   R                  U R                  5       5      nUnXR                  ;   a  [	        US-
  S5      nGOpXR
                  ;   a'  [        US-   [        U R                   5      S-
  5      nGO:US:X  a=  [        U R                  5      S::  d  U R                  S:X  a  SnGOU R                  S-  nOUS:X  an  [        U R                  5      S::  d&  U R                  [        U R                  5      S-
  :X  a  [        U R                   5      S-
  nOSU R                  S-   -  S-   nOUS:X  a&  U R                  S:X  a  SnOjU R                  S-  S-   nOWUS:X  aQ  U R                  [        U R                  5      S-
  :X  a  [        U R                   5      S-
  nOSU R                  S-   -  nXC:w  a  U R                  5         U R                  (       aD  U R                   R                  X@R                   R                  U5      5        U R                  5         U R                  nU R                  U R                   U   5        U R                  U:w  a  U R!                  5         U R#                  X5        g )Nr   r   PageUpr;   PageDownHomeEnd)r   indexr,   _UP_KEYSmax
_DOWN_KEYSminlenr*   r+   Hider    insertpopUpdater>   OnPageChangeOnInput)r!   rA   rB   current_index	new_indexold_pages         r   _InternalOnInputReorderBox._InternalOnInput   s   A: LL..t/E/E/GHM%Imm# 115	' 13t||3Dq3HI	t{{#q(D,B,Ba,G !I
 !% 6 6 :I
"t{{#q(D,B,Bc$++FVYZFZ,Z #DLL 1A 5I !"T%;%;a%? @1 DI))Q. !I $ 6 6 :Q >I))S-=-AA #DLL 1A 5I !T%;%;a%? @I)		**LL''	<<3C3CM3RSKKM11		$,,y12))X5%%'S r   c                     [         e)zq
This callback is inherited from `OptionsBox`, but ***is not*** used.
Overwrite `OnSelect` or `OnPlace` instead.
)NotImplementedErrorr3   s     r   OnPressReorderBox.OnPress   s
    
 "!r   c                     g)NFr   r&   s    r   r   ReorderBox.PreventCanceling   s    r   valc                     g Nr   r!   r_   s     r   r   r^          r   c                 "    [         R                  $ ra   )r   BIDIRECTIONAL_HOVERr&   s    r   
ScrollTypeReorderBox.ScrollType   s    333r   c                     g ra   r   rb   s     r   rf   rg      rc   r   r%   )SelectExitMove)r   N)__name__
__module____qualname____firstlineno____doc__staticmethodstrr   r   r   __annotations__intr   boolr'   r,   r/   r4   r8   r?   rW   r[   propertyr   setterr   rf   __static_attributes____classcell__)r"   s   @r   r	   r	      s   & $ $


 
 
	
 
. _--
 t'('( '( 	'(
 !1'( '( 
'( '(R 
'4 
'G? G 4 o $ 	 	4 	.!C .! .! .!b"o "$ " $   D T   4, 4 4 . 4  r   r	   N)typingr   r   r   r   r	   r   r   r   <module>r{      s    " C C` `r   