+
    Ki"  c                   s    R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt  ! R R]4      tR# )z%Runner for the PICO-8 fantasy consoleN)gettext)sleep)settings)get_game_by_field)MissingGameExecutableError)Runner)system)
Downloader)logger)split_argumentsc                   s  a a ] tR t^t o]! R4      tRt]! R4      t]! R4      .tRRRRR]! R	4      R
]! R4      /.t	RRRRR]! R4      R]! R4      RRR
]! R4      /RRR]! R4      R]! R4      RRRRR
]! R4      /RRRRR]! R4      RR/RRRRR]! R4      RRR
]! R4      RR/RR RRR]! R!4      RR"R
]! R#4      /.t
RR$RR/.tR%tR1V 3R& llt]R' 4       t]R( 4       t]R) 4       t]R* 4       tR+ tR2V3R, lR- lltR. tR/ tR0tVtV ;t# )3pico8z&Runs PICO-8 fantasy console cartridgesFzPICO-8Zoption	main_fileZtypeZfileZlabelzCartridge file/URL/IDZhelpz?You can put a .p8.png file path, URL, or BBS cartridge ID here.
fullscreenboolZsectionZGraphicsZ
FullscreenZdefaultTzLaunch in fullscreen.window_sizezWindow sizeZstringZ640x512z$The initial size of the game window.splorezStart in splore modeargszExtra arguments z!Extra arguments to the executableZadvancedenginezEngine (web only)Zpico8_0111g_4z6Name of engine (will be downloaded) or local file pathZdisable_runtimezpico8/web.pyc                s&   < \         SV `  V4       R # N)Zsuper__init__)selfconfig	__class__s   &&9/usr/lib/python3.14/site-packages/lutris/runners/pico8.pyr   Zpico8.__init__N   s         c                s@    V P                   P                  R R4      R8g  # )runner_executabler   )runner_configgetr      &r   	is_nativeZpico8.is_nativeQ   s!    !!%%&92>"DDr   c                sn   V P                   P                  R 4      pVP                  4       P                  R4      '       gu   \        P
                  P                  V4      '       gP   \        P
                  P                  \        P                  RV P                   P                  R 4      R,           4      pV# )r   .jspico8/web/engines)
r   r   ZlowerZendswithospathexistsjoinr   
RUNNER_DIR)r   r      & r   engine_pathZpico8.engine_pathU   s    ##''1||~&&u--bggnnV6L6LWW\\###""&&x058F
 r   c                s   V P                   P                  R 4      pV P                  '       dG   VP                  R4      '       d0   \        P
                  P                  \        P                  RR4      # \        P
                  P                  V4      '       gM   VP                  4       '       d7   \        P
                  P                  \        P                  RVR,           4      # V# )r   httppico8/cartridges
tmp.p8.png.p8.png)game_configr   r   
startswithr"   r#   r%   r   r&   r$   isdigit)r   r   r'   r   	cart_pathZpico8.cart_path`   s    $$((5	>>>i226::77<< 3 35GVVww~~i((Y->->-@-@77<< 3 35GU^I^__r   c                s   V P                   '       EdU   V P                  4       pVP                  R 4       TP                  V P                  P	                  R4      '       d   RMR4       V P                  P	                  R4      '       d   VP                  R4       V P                  P	                  R4      P                  R4      p\        V4      ^8X  dS   VP                  R4       VP                  V^ ,          4       VP                  R	4       VP                  V^,          4       V P                  P	                  R
R4      p\        V4       F  pVP                  V4       K  	  V# V P                  4       \        P                  P                  \        P                  R4      RV P                  P	                  R4      .,           pV# )z	-windowedr   Z0Z1r   z-splorer   Zxz-widthz-heightr   r   pico8/web/player.htmlz--window-size)r   Zget_commandappendr   r   ZsplitZlenr	   r"   r#   r%   r   r&   )r   r   ZsizeZ
extra_argsZargs   &    r   launch_argsZpico8.launch_argsi   s[   >>>##%DKK$KKt1155lCCM!!%%h//I&%%))-8>>sCD4yA~H%DG$I&DG$++//;J&z2C  3  ##%X002IJ""&&}5) D
 r   c                sB    R V P                   RV P                  RR7      /# )commandenvFZos_env)r3   get_envr   r   r   get_run_dataZpico8.get_run_data   s"    4++UDLLL4NOOr   c                s&   < V ^8  d   QhRS[ RS[ /# )i   flatpak_allowedZreturn)r   )Zformat__classdict__s   "r   Z__annotate__Zpico8.__annotate__   s     ^ ^D ^D ^r   c                s   V P                   '       d8   \        P                  ! V P                  P	                  R4      4      '       d   R# \        P                  ! \
        P                  P                  \        P                  R4      4      # )zJChecks if pico8 runner is installed and if the pico8 executable available.r   Tr1   )
r   r   Zpath_existsr   r   r"   r#   r%   r   r&   )r   r9   s   &&r   is_installedZpico8.is_installed   sW    >>>f001C1C1G1GH[1\]]!!"'',,x/B/BD["\]]r   c                sP	  aaa V P                   P                  R 4      '       g   V P                  4       '       d   R# \        P                  P                  \        P                  P                  \        P                  RR4      4      '       dD   \        P                  ! \        P                  P                  \        P                  RR4      4       V P                  '       g2   V P                   P                  R 4      P                  R4      '       Eg>   \        P                  P                  V P                   P                  R 4      4      '       Eg   V P                   P                  R 4      P                  4       '       g2   V P                   P                  R 4      P                  R4      '       Ed   V P                   P                  R 4      P                  R4      '       gs   \        V P                   P                  R 4      4      p\        P                  ! VR,          4      pR\!        V4      ,           R,           \!        V4      ,           R,           pMV P                   P                  R 4      pV P"                  o\$        P&                  ! \        P                  P)                  S4      4       R	oVVV3R
 lp\+        VSR,           RVR7      oSP-                  4        \        P                  P                  S4      '       gN   S'       g    SP.                  \*        P0                  8X  d   \2        P4                  ! RV4       R	# \7        R4       Kr  V P                  '       EgB   \        P                  P                  V P8                  P                  R4      4      '       Eg   \        P                  P                  \        P                  RV P8                  P                  R4      R,           4      p\        P                  P                  V4      '       g   RV P8                  P                  R4      ,           R,           p\$        P&                  ! \        P                  P)                  V4      4       \+        W5R4      oSP-                  4        SP                  4        R# R# R# R# )r   Tr*   r+   r)   i'  z&https://www.lexaloffle.com/bbs/cposts/Z/r,   Fc                  s   < SP                   '       d#   \        P                  ! S R ,           S 4       RoR# \        P                  ! S R ,           4       RoR# )	.downloadTN)Zdownloaded_sizeshutilZmover"   remove)cartPathdldownloadCompleteds   r   on_downloaded_cartZ+pico8.prelaunch.<locals>.on_downloaded_cart   sE     )))H{$:HE )-% 		(["89(,%r   r<   )Zcallbackz$Could not download cartridge from %sg?r   r!   r    zhttps://www.lexaloffle.com/bbs/N)r-   r   r;   r"   r#   r$   r%   r   r&   r>   r   r.   r/   ZintmathZfloorZstrr0   r   Zcreate_folderZdirnamer   ZstartZstateZERRORr   Zerrorr   r   )	r   ZpidZnumZdownloadUrlrB   Z
enginePathr?   r@   rA   s	   &     @@@r   	prelaunchZpico8.prelaunch   s   ##K00T5F5F5H5H77>>"'',,x':':<NP\]^^IIbggll8#6#68JLYZ >>>!1!1!5!5k!B!M!Mf!U!U77>>$"2"2"6"6{"CDD  $$[199;;t?O?O?S?ST_?`?k?klr?s?s''++K8CCFKKd..22;?@C**S5[1C"JSQTX"UX["[^abe^f"fir"rK"&"2"2"6"6{"CK>>$$RWW__X%>?$)!-  {*/	 
 ''..22(BHH
8H8H,H%K[Y$#J ~~~bggnnT5G5G5K5KH5U&V&V###""&&x058J
 77>>*--?$BTBTBXBXYaBbbejj$$RWW__Z%@A>
	 . 'W~r   c                s    / pV P                  R R7      VR&   \        V P                  P                  R4      pV P                  pV P
                  '       d   V P                  P                  R4      '       g   VP                  R4       V P                  p\        P                  P                  V4      '       g   \        VR7      hVP                  V4       MVP                  R4       VP                  VP                  R4      R	,           4       R
V P                  RV P                  RV P                  P                  R4      RJ /pVP                  R4       VP                  R\        P                   ! V4      ,           R,           4       W1R&   V# )Fr6   r5   Z
configpathr   z-run)Zfilenamez--nameZnamez	 - PICO-8Z	cartridger   r   Tz--execjszload_config(Z)r4   )r7   r   r   Zgame_config_idr3   r   r   r   r2   r0   r"   r#   r$   r   r(   jsonZdumps)r   Zlaunch_infoZ	game_datar4   r?   Zwebargss   &     r   playZ
pico8.play   s7   !\\\7E%dkk&@&@,O	"">>>%%))(33v&~~H77>>(++0(CCNN8$ NN8$NN9==0;>? T^^$**d0044\BdJG
 NN:&NN>DJJw,??#EF!(Ir    r   )T)Z__name__Z
__module__Z__qualname__Z__firstlineno___ZdescriptionZmultiple_versionsZ
human_nameZ	platformsZgame_optionsZrunner_optionsZsystem_options_overrider   r   Zpropertyr   r(   r0   r3   r8   r;   rD   rF   Z__static_attributes__Z__classdictcell__Z__classcell__)r   r:   s   @@r   r
   r
      s    <=K8J8I kFQ./AWX		
L lFq}Q|_tA-.	
 mq}Q}%HyA<=	
 hFQ-.u		
 fHQ()rA9:	
 hHQ*+ANO	
?&NP !)*;YMN&! E E      2P^ ^:x" "r   r
   )Z__doc__rE   rC   r"   r=   r    rH   Ztimer   Zlutrisr   Zlutris.database.gamesr   Zlutris.exceptionsr   Zlutris.runners.runnerr   Zlutris.utilr   Zlutris.util.downloaderr   Zlutris.util.logr   Zlutris.util.stringsr	   r
   rG   r   r   <module>rI      s@    +   	      3 8 (  - " /VF Vr   