
    ~f+                     \   S SK r S SKJrJrJrJrJrJrJrJ	r	  SSK
JrJrJrJrJrJrJr  S\	S\S\4S jrS\	S\S\S	\4S
 jrS	\4S jrS\	S\S\S	\4S jrS\	S\S\S	\4S jr " S S\5      r\" 5       r\S:X  a  \" S\R8                   S35        \ H  r\R8                  \R8                  :X  d  M  \R<                  (       a  \R?                  5         \R@                  " \5        \" S\R8                   S35        \RB                  RD                  \RB                  l"          O   \" \5        g)    N)
FindObjectFStruct	GetEngineLog
RemoveHookRunHook	UFunctionUObject   )EnabledSaveTypeGameModsModTypesOptionsRegisterModSDKModcallerfunctionparamsc                    [         R                  R                  (       GaC  UR                  S:X  Ga2  UR                  S:X  a#  [         R
                  =R                  S-  sl        UR                  S:X  a#  [         R
                  =R                  S-  sl        UR                  S:X  a#  [         R                  =R                  S-  sl        UR                  S:X  a#  [         R                  =R                  S-  sl        UR                  S:X  a#  [         R                  =R                  S-  sl        UR                  S:X  a#  [         R                  =R                  S-  sl        g	)
Nr   Up   DownLeftRightMouseScrollUpMouseScrollDownT)instanceEnableMovementCurrentValueEventKey
yPosSlider
xPosSlider
SizeSliderr   r   r   s      gZ:\mnt\Skyabridged\SteamLibrary\steamapps\common\Borderlands 2\sdk_mods\ShieldRechargeTimer\__init__.pyRechargeTimerMoveKeysr(      s    +++0A::,,1,::,,1,::,,1,:: ,,1,::(,,1,::**,,1,    returnc                    [         R                  R                  (       a1  [         R                  R	                  U R
                  5      S   S:X  a  gU R                  R                  [         l        [         R                  R                  (       aD  UR                  [         R                  R	                  U 5      S   :  aA  [         R                  S::  a-  S[         l        [        SS[        5        [        SS[        5        g)	Nr           Tr   .WillowGame.WillowGameViewportClient.PostRenderPostRenderRechargeTimer,WillowGame.WillowPlayerController.PlayerTickRechargeTimerPlayerTicks)r   OnlyWithRoidShieldr    ShieldRoidValueGetValue
Controller	WorldInfoTimeSecondsLastDamageTakenTimeOnlyWhenDepletedDamageShieldCurValueTimeRemainingr   onPostRenderRechargeTimerr0   r&   s      r'   RechargeTimerPlayerDamagedr=      s    ""//##,,V->->?BbH#)#3#3#?#?H %%22I`I`IiIijpIqrsIt8t''1,!"@B[]vw>@Z\tur)   c                      U R                   R                  R                  [        R                  -
  nUS:  a  g [        [        R                  R                  U 5      S   U-
  S5      $ ! [
         a     gf = f)Nr   r,   r   )	MyWillowPawnr5   r6   r   r7   AttributeErrorroundShieldRegenDelayr3   )PCelapsedTimes     r'   GetTimeUntilShieldRechargerE   *   st    oo//;;h>Z>ZZ? 
 **33B7:[H!LL  s   7A* *
A76A7c                 l    [        U 5      nU[        l        US::  a  [        SS5        [        SS5        g)Nr   r/   r0   r-   r.   T)rE   r   r;   r   )r   r   r   rechargeTimes       r'   r0   r0   6   s7    -f5L)HqAC]^CE^_r)   c                 .    [         R                  U5        g)NT)r   displayFeedbackr&   s      r'   r<   r<   ?   s    V$r)   c                   n  ^  \ rS rSr% Sr\\S'   Sr\\S'   Sr\\S'   Sr	\\S	'   \
R                  \
R                  -  r\
\S
'   \R                  r\\S'   \R$                  r\\S'   \R*                  R-                  5       rS\S'   S\SS4U 4S jjrSr\\S'   Sr\\S'   SS jrSS jrS rS rS rSr U =r!$ )ShieldRechargeTimerD   zShield Recharge TimerName
LaryIslandAuthorz<font size='26' color='#de5b00'>     Shield Recharge Timer</font>

Displays a configurable timer on your HUD that counts the seconds before your shield starts to recharge.

Descriptionz1.0VersionSupportedGamesTypesSaveEnabledStateGitHubGactionr*   Nc                 ^   > US:X  a  [         R                  " S5        g [        TU ]  U5        g )NrU   zGhttps://github.com/LaryIsland/bl-sdk-mods/tree/main/ShieldRechargeTimer)
webbrowseropensuperSettingsInputPressed)selfrW   	__class__s     r'   r\   (ShieldRechargeTimer.SettingsInputPressedT   s%    XOOefG(0r)   r,   r;   r7   c           
         / U l         [         R                  " SSSSSSSS9U l        [         R                  " SS	S
SSSSS9U l        [         R                  " SSSSSSSS9U l        [         R                  " SSSSSSSS9U l        [         R                  " SSU R                  U R                  U R                  U R
                  /SS9U l        [         R                  " SSSSSSSS9U l        [         R                  " SSSSSSSS9U l	        [         R                  " SSSSSSSS9U l
        [         R                  " SSU R                  U R                  /SS9U l        [         R                  " S S!S"/ S#QS$9U l        [         R                  " S%S&SS'9U l        [         R                  " S(S)SS'9U l        [         R                  " S*S+SS'9U l        [         R                  " S,S-SS'9U l        U R                  U R                  U R                  U R                  U R                   U R                  U R"                  U R$                  /U l         g ).NRedzRed value for the text colour.r      r   F)CaptionrP   StartingValueMinValueMaxValue	IncrementIsHiddenGreenz Green value for the text colour.   BluezBlue value for the text colour.Alphaz Alpha value for the text colour.zText Colourz#Text colour for the recharge timer.)rc   rP   Childrenrh   z
Timer SizezTimer scaling as a percentage.x   2   i  z
X Positionz=X position for the timer as a percentage of the total screen.p     z
Y Positionz=Y position for the timer as a percentage of the total screen.i  zTimer Positionz%Text position for the recharge timer.FontzUse this to pick your font.
WillowBody)rs   
WillowHeadHUDzEngine 1zEngine 2)rc   rP   rd   ChoiceszShow in Pause Menuz:When enabled, the timer will still show in the pause menu.)rc   rP   rd   zEnable Movement KeyszZWhen enabled, the arrow keys will move the timer and the scrollwheel will change its size.zOnly when DepletedzIWhen enabled, the timer will only show when the shield is fully depleted.zOnly with Roid ShieldzLWhen enabled, the timer will only show when you have a roid shield equipped.)r   Slider	RedSliderGreenSlider
BlueSliderAlphaSliderNested
TextColourr%   r$   r#   TimerPosSpinner
FontChoiceBoolean
ShowInMenur   r8   r1   r]   s    r'   __init__ShieldRechargeTimer.__init__]   sX    8
 #>>:
 "..9
 #>>:
 "..!=nnd&6&6IYIYZ	
 ".. 8
 ".. W
 ".. W
  $?oot7	
 "//5&!		
 "//(T

 &oo*t

 !((c!

 #*//+f#
 OOMMOOOOOO!!##	
r)   c                    U R                   R                  R                  U R                   R                  5      n[	        SU R
                  U   5      Ul        UR                  U-  n	UR                  U-  n
UR                  XS5         UR                  U5        UR                  [        U5      SXg5        g ! [         a     N)f = f)Nrr   r   T)r   rv   indexr    r   Fontsrr   SizeXSetPosSetDrawColorStruct	ExceptionDrawTextstr)r]   canvastextxycolorscalexscaley	fontindextrueXtrueYs              r'   DisplayTextShieldRechargeTimer.DisplayText   s    OO++11$//2N2NO	 I)>?q q eA&	%%e, 	D	48  		s   	B7 7
CCc           
      b   [        5       R                  S   R                  nUR                  (       d  gUR	                  5       b  UR
                  (       aF  UR                  R                  UR                  5      (       a  U R                  R                  (       d  gUR                  R                  5       (       d  UR                  R                  b  gUR                  nU R                  UU R                  U R                   R                  S-  U R"                  R                  S-  U R$                  R                  U R&                  R                  U R(                  R                  U R*                  R                  4U R,                  R                  S-  U R,                  R                  S-  5        g)Nr   Trq   d   )r   GamePlayersActorCanvasGetHUDMoviebViewingThirdPersonMenuGFxUIManagerIsMoviePlayingPauseMenuDefinitionr   r    r?   	IsInjuredDrivenVehicler   r;   r$   r#   rz   ry   rx   r{   r%   )r]   r   rC   r   s       r'   rI   #ShieldRechargeTimer.displayFeedback   s:   [$$Q'--}}>>#r'A'A??11"2H2HIIQUQ`Q`QmQm??$$&&"//*G*G*SOO((4/OO((4/,,  --++  --	 OO((3.OO((3.	
 r)   c                     [        SS[        5        [        SS[        5        [        SS5      U l        [        SS5      U l        [        SS	5      U l        / S
QU l        g )N&WillowGame.WillowPlayerPawn.TakeDamager=   z'WillowGame.WillowUIInteraction.InputKeyr(   ResourcePoolAttributeDefinitionz=D_Attributes.ShieldResourcePool.ShieldOnIdleRegenerationDelayz2D_Attributes.ShieldResourcePool.ShieldCurrentValueAttributeDefinitionz#D_Attributes.Shield.RoidMeleeDamage)zUI_Fonts.Font_Willowbody_18ptzUI_Fonts.Font_Willowhead_8ptzUI_Fonts.Font_Hud_MediumzEngineFonts.SmallFontzEngineFonts.TinyFont)r   r=   r(   r   rB   r:   r2   r   r   s    r'   EnableShieldRechargeTimer.Enable   sf    8:VXrs9;RTij *-K!
 )-@
  *!1 


r)   c                 4    [        SS5        [        SS5        g )Nr-   r.   r   r=   )r   r   s    r'   DisableShieldRechargeTimer.Disable  s    CE^_;=YZr)   )r{   rz   r   r   r   ry   r8   r1   r   rx   r:   rB   r2   r   r%   r}   r~   r$   r#   )r*   N)"__name__
__module____qualname____firstlineno__rM   r   __annotations__rO   rP   rQ   r   BL2TPSrR   r   UtilityrS   r   LoadOnMainMenurT   r   SettingsInputscopyr\   r;   floatr7   r   r   rI   r   r   __static_attributes____classcell__)r^   s   @r'   rK   rK   D   s    'D#'FC	w   GS88dhh.ND.&&E8&(7(F(FoF**//1N"N313 14 1 M5!##t
l9 :
.[ [r)   rK   __main__[z] Manually loadedz] Removed last instance)#rY   	unrealsdkr   r   r   r   r   r   r	   r
   ModMenur   r   r   r   r   r   r   r(   boolr=   r   rE   r0   r<   rK   r   r   rM   mod	IsEnabledr   remover^   r    r)   r'   <module>r      sc   @ @ @, , ,
' Y  "w ) W Y] 	Me 	MW 	 7 W[ g  G X\ 
U[& U[p  z!HMM?+,-88x}}$}}KK!HMM?"9:; -0MM,D,DH)  H r)   