
    b                     8   S SK r S SKrS SKrS SKJrJrJrJr  S SKJ	r	J
r
  S SKJr  S SKJrJrJrJrJrJr  \S:X  aE  S SKr\R,                  " \R.                  S   5        \R,                  " \R.                  S   5         \eS SKr\R>                  " S
5        S SK r S SK!r!S SK"r"S SK#r#S SK$r$/ SQr%Sr&S\S\SS4S jr'S\(4S jr)S\ RT                  4S jr+S\ RT                  4S jr,S\ RT                  4S jr-S\ RT                  4S jr.S%S\\ RT                     S\ RT                  4S jjr/S%S\\ RT                     S\04S jjr1S\0S\04S jr2S\0S\04S jr3S\0S\0S\(4S jr4S\S\0SS4S  jr5S!\0S\(4S" jr6 " S# S$\5      r7\7" 5       r8\S:X  aI  \ HC  r9\9Rt                  \8Rt                  :X  d  M  \Rv                  " \95        \Rx                  " \85          O   \" \85        g! \ a6    \R2                  " 5       S	   R4                  R6                  R8                  r GNf = f)&    N)AnyDictOptionalcast)debugkeys)KeyBinds)EnabledSaveTypeModPrioritiesModsModTypesRegisterModSDKMod__main__zMods.EridiumLib.debugzMods.EridiumLib.keyszMods/EridiumLib/dist)logisClientgetCurrentPlayerControllergetCurrentWorldInfogetCurrentGameInfogetSkillManagergetActionSkillgetVaultHunterClassNamecheckLibraryVersioncheckModVersion
EridiumModr   r   requestssemversocketsslasyncioz0.4.2modargsreturnc                 N    [         R                  " SU R                   S3/UQ76   g )N[])	unrealsdkLogName)r"   r#   s     ^Z:\mnt\Skyabridged\SteamLibrary\steamapps\common\Borderlands 2\sdk_mods\EridiumLib\__init__.pyr   r   ?   s    MMAchhZq/)D)    c                  t    [        [        R                  " 5       R                  5       R                  5      S:H  $ )z<Returns true if the current netmode is configured as client.   )intr(   	GetEngineGetCurrentWorldInfoNetMode r,   r+   r   r   C   s*    y""$88:BBCqHHr,   c                      [        [        R                  [        R                  " 5       R                  S   R
                  5      $ )zReturns the local player.r   )r   r(   UObjectr0   GamePlayersActorr3   r,   r+   r   r   H   s/    	!!9#6#6#8#D#DQ#G#M#MNNr,   c                  x    [        [        R                  [        R                  " 5       R	                  5       5      $ )zReturns the current world info.)r   r(   r5   r0   r1   r3   r,   r+   r   r   M   s'    	!!9#6#6#8#L#L#NOOr,   c                  Z    [        [        R                  [        5       R                  5      $ )zReturns the current game info.)r   r(   r5   r   Gamer3   r,   r+   r   r   R   s    	!!#6#8#=#=>>r,   c                  b    [        [        R                  [        5       R	                  5       5      $ )z4Returns the global skill manager from the game info.)r   r(   r5   r   GetSkillManagerr3   r,   r+   r   r   W   s"    	!!#5#7#G#G#IJJr,   PCc                     U c
  [        5       n [        [        R                  U R                  R                  5       5      $ )zReturns the action skill of a player controller.

A player controller can be passed in.
If no player controller is passed in, the local player will be used.
)r   r   r(   r5   PlayerSkillTreeGetActionSkillr=   s    r+   r   r   \   s3     
z')	!!2#5#5#D#D#FGGr,   c                     U c
  [        5       n [        U R                  R                  R                  R
                  5      $ )zReturns the class name of a Vault Hunter of a player controller.

A player controller can be passed in.
If no player controller is passed in, the local player will be used.
)r   strPlayerClassCharacterNameIdCharacterClassId	ClassNamerA   s    r+   r   r   h   s2     
z')r~~-->>HHIIr,   versionc                 "    U S   S:X  a  U SS  n U $ )Nr   v   r3   )rH   s    r+   validateVersionrL   t   s    qzS!"+Nr,   
repositoryc                      [         R                  " SU  S3SS9nUR                  5         UR                  5       n[        U5      S:  a  [        U  S35      e[        US   S   5      $ ! [         a    e f = f)	z
Gets the latest public release tag name of a passed in repository.
Will raise an exception if the releases couldn't be fetched.
zhttps://api.github.com/repos/z	/releases   )timeoutrK   z has no releases!r   tag_name)r   getraise_for_statusjson	ExceptionlenRuntimeWarningrC   )rM   responsereleasess      r+   getLatestVersionrZ   z   s    
<<"?
|9 U_ab!!#==? 8}q
|+<=>>x{:&''  s   9A) )A5latestVersioncurrentVersionc                 l    [        [        R                  " [        U5      [        U 5      5      5      S:  $ )zQ
Returns True if the current version is equal
or higher than the latest version.
r   )r/   r   comparerL   )r[   r\   s     r+   isLatestReleaser_      s*    
 v~~on=}?]^_cdddr,   c                    [        U SU R                   35         [        U5      n[	        [        U5      [        U R                  5      5      (       a  [        U S5        g[        U SU 35        g! [         a    [        U S5         gf = f)zO
Checks if the mod version is up-to-date.
Will log the results to the console.
z
Version: vz;Latest version couldn't be fetched! Skipping version check.NzMod is up-to-date!zNewer version available: )r   VersionrZ   rU   r_   rL   )r"   rM   r[   s      r+   r   r      s    
 z#++'(-j9
 }5s{{7STTC%&C,]O<=  CNOs   A0 0B	B	requiredVersionc                     SSK n[        [        R                  " [        [        U 5      5      5      S:  a  gUR                  " S5        g)z
Returns True if the version of EridiumLib is compatible.
If not, opens a page which informs that the EridiumLib version is incompatible.
r   NTzRhttps://github.com/DAmNRelentless/bl2-eridiumlib/blob/main/docs/TROUBLESHOOTING.mdF)
webbrowserr/   r   r^   __version__rL   open)rb   rd   s     r+   r   r      s;    
 
6>>+'GHIQNOO\ r,   c                      ^  \ rS rSr% S rSrSr\r\	R                  r\R                  r\R                  r\R$                  R&                  S0r\\\4   \S'   SS jrS	\SS4U 4S
 jjrSrU =r$ )
EridiumLib   zChronophylos, Relentlessz3A library with common functionality of all our modsGitHubSettingsInputsr$   Nc                     SU l         [        U S5        [        U S[        R                   35        [        U SS 35        g )NEnabledzDAmNRelentless/bl2-eridiumlibzPython Version: z__debug__: T)Statusr   r   sysrH   )selfs    r+   __init__EridiumLib.__init__   s;    =>D$S[[M23DK	{+,r,   actionc                 ^   > US:X  a  [         R                  " S5        g [        TU ]  U5        g )Nrj   z0https://github.com/DAmNRelentless/bl2-eridiumlib)rd   rf   superSettingsInputPressed)rp   rs   	__class__s     r+   rv   EridiumLib.SettingsInputPressed   s%    XOONOG(0r,   )rn   )r$   N)__name__
__module____qualname____firstlineno__r*   AuthorDescriptionre   ra   r   LibraryTypesr
   LoadWithSettingsSaveEnabledStater   Priorityr	   Gvaluerk   r   rC   __annotations__rq   rv   __static_attributes____classcell__)rw   s   @r+   rh   rh      s}    D'FGKGE&77$$H 	

(&NDcN -13 14 1 1r,   rh   )N)=r(   ro   rd   typingr   r   r   r   Mods.EridiumLibr   r   Mods.EridiumLib.keysr	   Mods.ModMenur
   r   r   r   r   r   ry   	importlibreloadmodulesNotImplementedErrorexc_infotb_framef_codeco_filename__file__site
addsitedirr!   r   r    r   r   __all__re   r   boolr   r5   r   r   r   r   r   rC   r   rL   rZ   r_   r   r   rh   instancer"   r*   removeappendr3   r,   r+   <module>r      sY    
  , , ' ) \ \zS[[!89:S[[!789B!!  & '   
  * *V *C *D *I$ I
OI$5$5 O
PY.. P
?I-- ?
K** K
	Hx	 1 12 	Hi>O>O 	H	J):): ; 	Js 	JS S ( ( ($e3 e e e> >S >T >&   1 16 <z88x}}$KKKK!	 
 H I  B<<>"%..55AABs    G 8HH