a
    6i
                     @   s  U d Z ddlZddlZddlZddlmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZmZmZmZ dd	lmZ ejdejeje d
 ejeje dZeed< ejeje dZeed< ejeje dZeed< ejeje dZeed< dejd< edddZ edddZ!e"eeee"eeegdf ddddZ#ddddZ$g dZ%dS ) zBStarts the protonfix module and runs fixes after pre-flight-checks    N)Callable   )fix)log)setup_upscalers)setup_frame_ratesetup_local_shader_cachesetup_mount_drives
winetricks)ZenityWaitDialogz/_vendorz
/files/binbin_dirz/files/lib/i386-linux-gnui386_lib_dirz/files/lib/x86_64-linux-gnux86_64_lib_dirz/files/lib/aarch64-linux-gnuaarch64_lib_dir*PROTON_DLL_COPY)returnc                   C   s0   t tjdko.dtjv o.dtjvo.dtjd v S )zDetermine, if the actual game was executed and protonfixes isn't deactivated.

    Returns:
        bool: True, if the fix should be executed.

    r   STEAM_COMPAT_DATA_PATHZPROTONFIXES_DISABLEwaitforexitandrun)lensysargvosenviron r   r   a/home/james-whalen/.local/share/Steam/compatibilitytools.d/GE-Proton10-32/protonfixes/__init__.pycheck_conditions(   s    r   c                   C   s   t tjdkodtjd v S )zDetermine, if we were invoked while running "iscriptevaluator.exe".

    Returns:
        bool: True, if we were invoked while running "iscriptevaluator.exe".

       ziscriptevaluator.exe   )r   r   r   r   r   r   r   check_iscriptevaluator7   s    r   )envbin_path_varlib_path_varfuncr   c                 C   s0   || |t d || |t dt dt d dS )zPSetup PATH and LD_LIBRARY_PATH to include protonfixes's binary and library paths:N)r   r   r   r   )r    r!   r"   r#   r   r   r   setupA   s    r%   c                  C   s   t  rtd nxt s$td nftd} zRz|   t  W n0 t	yr   t
jdt   t
j  Y n0 W |   n
|   0 dS )zExecute protonfixesz>Skipping fix execution. We are running "iscriptevaluator.exe".z<Skipping fix execution. We are probably running a unit test.z.Installing Game-Specific fixes, please wait...zProtonFixes N)r   r   debugr   warnr   startr   main	Exceptionr   stderrwrite	traceback
format_excflushstop)Zdialogr   r   r   executeL   s    r1   )r%   r1   r   r   r	   r   r
   )&__doc__r   r   r-   typingr    r   loggerr   Z	upscalersr   Z	utilitiesr   r   r	   r
   Zzenityr   pathinsertdirnamerealpath__file__r   str__annotations__r   r   r   r   boolr   r   dictr%   r1   __all__r   r   r   r   <module>   s>   "



