ó
ôöŒ\c           @  st  d  d l  m Z d  d l Z d  d l Z d  d l m Z m Z d  d l Z i  Z	 e j
 e ƒ Z g  Z d „  Z d „  Z d d „ Z d „  Z d „  Z d d d	 „ Z d
 „  Z e d „ Z d „  Z d „  Z d e j j j f d „  ƒ  YZ d e j j j f d „  ƒ  YZ d e j j  f d „  ƒ  YZ! e! e j j _" e j j# j$ Z% e j j& j' Z' e j j& j( Z( e j j) j* Z* d S(   iÿÿÿÿ(   t   print_functionN(   t   rendert   Renderc           C  s   t  S(   sš   
    :doc: image_func

    Returns a list of images that have been added to Ren'Py, as a list of
    strings with spaces between the name components.
    (   t   image_names(    (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   list_images.   s    c          C  s)   g  t  j ƒ  D] \ }  } | r |  ^ q S(   sT   
    :doc: image_func

    Returns a list of image tags that have been defined.
    (   t   image_attributest   items(   t   kt   v(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   get_available_image_tags9   s    c         C  s]   g  } |  t  k r | Sx@ t  |  D]4 } x+ | D] } | | k r. Pq. q. W| j | ƒ q! W| S(   s  
    :undocumented:

    Returns a list of tuples, with each tuple representing a possible
    combination of image attributes that can be associated with `tag`.
    If `attributes` is given, only images that contain all the attributes
    in that iterable are returned.
    (   R   t   append(   t   tagt
   attributest   rvt   att   a(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   get_available_image_attributesC   s    
c         C  s5   t  j |  f d ƒ } | d k r% d St | | d ƒ S(   sµ   
    This looks for an image named `tag`, then tries to grab the given method
    from it. If it can do that, returns a reference to the method. Otherwise,
    it returns None.
    N(   t   imagest   gett   Nonet   getattr(   R   t   methodt   ti(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   get_tag_method\   s    c   	      C  s  g  } x¸ t  |  j ƒ  D]¦ \ } } g  | D] } | | k r* | ^ q* } t | d d ƒ } | d k	 r§ | |  | d ƒ } | d k	 r½ | j t | ƒ t | ƒ ƒ q½ q | s | j | ƒ q q Wx0 | D]( } t | ƒ t | ƒ k rÈ t | ƒ SqÈ Wt | ƒ d k r
d St | d ƒ S(   sº   
    :doc: image_func

    Checks to see if there is a unique image with the given tag and
    attributes. If there is, returns the attributes in order.
    Otherwise, returns None.
    t   _choose_attributesi   i    N(   R   R   R   R   R
   t   listt   lent   tuple(	   R   R   t   lt   attrst   dt   it	   remaindert   cat   chosen(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   check_image_attributesk   s     	%#c           s
  g  } t  j t ƒ } t  j t ƒ } xt t |  j ƒ  ƒ D]ó \ ‰  } t | d d ƒ } | d k	 rÏ t	 ˆ  ƒ | |  g  | D] } | ˆ  k r{ | ^ q{ ƒ ‰ t
 ‡ f d †  | Dƒ ƒ s¿ q; n  | j ˆ ƒ q; t
 ‡  f d †  | Dƒ ƒ sñ q; n  x: t ˆ  ƒ D], \ } }	 | |	 c d 7<| |	 c | 7<qþ Wq; Wˆ d k rht	 t | j ƒ  ƒ t d „  | Dƒ ƒ Bƒ Sg  }
 t  j t ƒ } xT | D]L } xC | rÏ| j d ƒ } | | x | D] } | | j | ƒ q±WqWq„Wxµ | r‹t d „  | j ƒ  Dƒ ƒ ‰ t ‡ f d †  | j ƒ  Dƒ ƒ } x | D] } | | =q"Wx  | D] } | | | | | <q:Wt	 | ƒ } | j d	 ‡ f d
 †  ƒ |
 j | ƒ q×Wg  } xE | D]= }	 |	 |
 k r™| j | |	 | |	 ˆ |	 ƒ |	 f ƒ q™q™W| j ƒ  x | D] } |
 j | d ƒ qëW|
 S(   sÞ  
    :doc: image_func

    Returns a list of image tags, ordered in a way that makes sense to
    present to the user.

    `attributes`
        If present, only attributes that are compatible with the given
        attributes are considered. (Compatible means that the attributes
        can be in a single image at the same time.)

    `sort`
        If not None, the returned list of attributes is sorted. This is a function
        that should be used as a tiebreaker.

    t   _list_attributesc         3  s   |  ] } | ˆ  k Vq d  S(   N(    (   t   .0R   (   t   sequence(    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pys	   <genexpr>°   s    c         3  s   |  ] } | ˆ  k Vq d  S(   N(    (   R%   R   (   R   (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pys	   <genexpr>·   s    i   c         s  s"   |  ] } | D] } | Vq q d  S(   N(    (   R%   R   t   j(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pys	   <genexpr>¿   s    i    c         s  s   |  ] } t  | ƒ Vq d  S(   N(   R   (   R%   R   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pys	   <genexpr>Ö   s    c         3  s-   |  ]# \ } } t  | ƒ ˆ  k r | Vq d  S(   N(   R   (   R%   R   R   (   t   mincount(    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pys	   <genexpr>×   s    t   keyc           s   ˆ  |  ƒ |  f S(   N(    (   R   (   t   sort(    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   <lambda>à   s    i   N(   t   collectionst   defaultdictt   intt   floatt   sortedR   R   R   R   R   t   allR
   t	   enumeratet   sett   keyst   popt   addt   mint   valuesR*   t   extend(   R   R   R*   t	   sequencest	   attrcountt   attrtotalposR   t   laR   t   attrR   t   afterR'   R   t   readyR   (    (   R   R(   R&   R*   sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   get_ordered_image_attributes’   sV    #8*		"/
c         C  sF   |  d } |  d } | t  |  <| t | | <t j d j |  ƒ ƒ d S(   s   
    Registers the existence of an image with `name`, and that the image
    used displayable d.

    `name`
        A tuple of strings.
    i    i   t    N(   R   R   R   R
   t   join(   t   nameR   R   t   rest(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   register_imageñ   s
    	


c         C  sY   t  |  t ƒ s$ t |  j ƒ  ƒ }  n  x. |  rT |  t k r= t S| rG t S|  d  }  q' Wt S(   sˆ  
    :doc: image_func
    :name: renpy.has_image

    Return true if an image with `name` exists, and false if no such image
    exists.

    `name`
        Either a string giving an image name, or a tuple of strings giving
        the name components.

    `exact`
        Returns true if and only if an image with the exact name exists -
        parameterized matches are not included.
    iÿÿÿÿ(   t
   isinstanceR   t   splitR   t   Truet   False(   RD   t   exact(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   image_exists  s    	c         C  s1   t  |  t ƒ s$ t |  j ƒ  ƒ }  n  t j |  ƒ S(   s–   
    :doc: image_func

    If an image with the same name has been registered with renpy.register_image,
    returns it. Otherwise, returns None.
    (   RG   R   RH   R   R   (   RD   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   get_registered_image#  s    c         C  sA   t  |  | | | | ƒ } t | j | j ƒ } | j | d ƒ | S(   Ni    (   i    i    (   R   R   t   widtht   heightt   blit(   t   childt   wt   ht   stR   t   rendR   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   wrap_render1  s    t   ImageReferencec           B  sÎ   e  Z d  Z d g Z d Z d Z d Z d Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d „  Z d	 „  Z e Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s¹   
    ImageReference objects are used to reference images by their name,
    which is a tuple of strings corresponding to the name used to define
    the image in an image statment.
    t   targeti   c         C  s=   | d k  r9 t  |  j t j j j ƒ r9 |  j |  _ q9 n  d  S(   Ni   (   RG   t   param_targett   renpyt   displayt	   transformt	   Transformt   old_transform(   t   selft   version(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   after_upgradeG  s    c         K  s#   t  t |  ƒ j |   | |  _ d S(   s‡   
        @param name: A tuple of strings, the name of the image. Or else
        a displayable, containing the image directly.
        N(   t   superRW   t   __init__RD   (   R_   RD   t
   properties(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRc   L  s    c         C  s   d j  |  j ƒ S(   Nu   <ImageReference {!r}>(   t   formatRD   (   R_   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   __unicode__V  s    c         C  s   t  |  j ƒ S(   N(   t   hashRD   (   R_   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   __hash__Y  s    c         C  s=   |  | k r t  S|  j | ƒ s# t S|  j | j k r9 t St  S(   N(   RI   t   _equalsRJ   RD   (   R_   t   o(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   __eq__\  s    c         C  s)   |  j  d  k r |  j ƒ  n  |  j  j ƒ  S(   N(   RX   R   t   find_targett   _target(   R_   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRm   h  s    c           së  ˆ  j  } t | t j j j ƒ r. | ˆ  _ t St | t ƒ sR t | j	 ƒ  ƒ } n  ‡  f d †  } g  } xJ | r³ t
 j | d  ƒ } | d  k	 r’ Pn  | j d | d ƒ | d  } qj W| sØ | d d j ˆ  j  ƒ ƒ t S| rˆ  j j  | k r| d j d j | ƒ ƒ ƒ t S| ˆ  j j 7} y1 ˆ  j j d | d | ƒ } | j | ƒ ˆ  _ Wn5 t k
 rˆ} t j j ru‚  n  | t | ƒ ƒ n Xˆ  j j ƒ  } t | t j j j ƒ rÞˆ  j d  k	 rÒ| j ˆ  j ƒ n  | ˆ  _ n	 d  ˆ  _ t S(	   Nc           sU   t  j j j |  d d d d d d d d d d ƒˆ  _ t  j j rQ t |  ƒ ‚ n  d  S(	   Nt   coloriÿ   i    t   xanchort   xpost   yanchort   ypos(   iÿ   i    i    iÿ   (   RZ   t   textt   TextRX   t   configt   debugt	   Exception(   t   msg(   R_   (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   errorz  s    6i    iÿÿÿÿs   Image '%s' not found.RB   s   Image '{}' refers to itself.RD   t   args(   RD   RG   RZ   R[   t   coret   DisplayableRX   RI   R   RH   R   R   R   t   insertRC   RJ   t   _argsRe   Rz   t   copyt
   _duplicateRw   Ru   Rv   t   strRm   R\   R]   R^   t
   take_state(   R_   RD   Ry   Rz   RX   R   t   et   new_transform(    (   R_   sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRl   o  sF    				c         C  s“   | r | j  r | j ƒ  n  |  j | ƒ } d  | _ t | j t j j	 j
 ƒ rv | j j rv | j j | ƒ | _ qv n  | j ƒ  | j j | _ | S(   N(   Rz   t
   extraneoust   _copyR   RX   RG   RD   RZ   R[   R{   R|   t   _duplicatableR€   Rl   (   R_   Rz   R   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyR€   ²  s    	
c         C  s/   |  j  d  k r |  j ƒ  n  |  j  j |  _ d  S(   N(   RX   R   Rl   R‡   (   R_   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   _uniqueÃ  s    c         C  sW   |  j  d  k r |  j ƒ  n  |  j  j ƒ  } | |  j  k r> |  S|  j ƒ  } | | _  | S(   N(   RX   R   Rl   t   _in_current_storeR†   (   R_   RX   R   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyR‰   Ê  s    	c         C  s#   |  j  d  k r t S|  j  j | ƒ S(   N(   RX   R   RJ   t   _handles_event(   R_   t   event(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRŠ   Ø  s    c         C  s2   |  j  d  k r |  j ƒ  n  |  j  j | | | ƒ S(   N(   RX   R   Rl   t   _hide(   R_   RT   R   t   kind(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRŒ   Þ  s    c         C  s,   |  j  d  k r |  j ƒ  n  |  j  j | ƒ S(   N(   RX   R   Rl   t   set_transform_event(   R_   R‹   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRŽ   ä  s    c         C  s5   |  j  d  k r |  j ƒ  n  |  j  j | | | | ƒ S(   N(   RX   R   Rl   R‹   (   R_   t   evt   xt   yRT   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyR‹   ê  s    c         C  s5   |  j  d  k r |  j ƒ  n  t |  j  | | | | ƒ S(   N(   RX   R   Rl   RV   (   R_   RN   RO   RT   R   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyR   ð  s    c         C  sÞ   |  j  d  k r |  j ƒ  n  t j j s5 |  j  j ƒ  S|  j  j ƒ  \ } } } } } } } | d  k rt |  j j } n  | d  k r |  j j	 } n  | d  k rª |  j j
 } n  | d  k rÅ |  j j } n  | | | | | | | f S(   N(   RX   R   Rl   RZ   Ru   t    imagereference_respects_positiont   get_placementt   styleRp   Rr   Ro   Rq   (   R_   Rp   Rr   Ro   Rq   t   xoffsett   yoffsett   subpixel(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyR“   ö  s    $c         C  s&   |  j  d  k r |  j ƒ  n  |  j  g S(   N(   RX   R   Rl   (   R_   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   visit  s    N(   t   __name__t
   __module__t   __doc__t   nosaveR   RX   R^   RY   t   __version__Ra   Rc   Rf   Rh   Rk   Rm   Rl   RI   R‡   R€   Rˆ   R‰   RŠ   RŒ   RŽ   R‹   R   R“   R˜   (    (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRW   8  s0   			
					A									t   DynamicImagec           B  sÑ   e  Z d  Z d g Z d Z d Z e Z d Z	 d d „ Z
 d „  Z d „  Z d „  Z d „  Z d „  Z d e d „ Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s÷   
    :doc: disp_imagelike
    :args: (name)

    A DynamicImage is a displayable that has text interpolation performed
    on it to yield a string giving a new displayable. Such interpolation is
    performed at the start of each interaction.
    t
   raw_targetc         K  s³   t  t |  ƒ j |   | |  _ | d  k	 rD |  j | ƒ t |  _ n	 t |  _ t	 | t
 ƒ rt d | k rt t |  _ n  t	 | t ƒ r¯ x) | D] } d | k rŠ t |  _ qŠ qŠ Wn  d  S(   Ns   [prefix_(   Rb   Rž   Rc   RD   R   Rl   RI   t   _uses_scopeRJ   RG   t
   basestringR‡   R   (   R_   RD   t   scopeRd   R   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRc   ,  s    		c         C  s   |  j  | | ƒ S(   N(   Rl   (   R_   R¢   t   update(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   _scope?  s    c         C  s   d j  |  j ƒ S(   Nu   DynamicImage {!r}(   Re   RD   (   R_   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRf   B  s    c         C  sR   |  j  d  k rE t |  j t ƒ r6 t |  j ƒ |  _  qE |  j |  _  n  t |  j  ƒ S(   N(   t	   hash_nameR   RG   RD   R   R   Rg   (   R_   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRh   E  s
    c         C  s\   |  | k r t  S|  j | ƒ s# t S|  j | j k r9 t S|  j rX |  j | j k rX t St  S(   N(   RI   Ri   RJ   RD   R    RX   (   R_   Rj   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRk   O  s    c         C  s   |  j  r |  j  j ƒ  S|  Sd  S(   N(   RX   Rm   (   R_   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRm   ^  s    	c   
      C  sy  |  j  r |  j d  k	 r d  S|  j j d  k r7 d } n |  j j } y. g  } t j j |  j | d | d | ƒ} Wnd t	 k
 r¬ } t
 d |  j t | j d ƒ f ƒ ‚ n, t
 k
 r× } t
 d |  j | f ƒ ‚ n X| d  k rœd |  j f } t | ƒ d k r| d	 | d f 7} no t | ƒ d
 k rO| d | d | d f 7} n> t | ƒ d
 k r| d | d | d t | ƒ d
 f 7} n  t
 | ƒ ‚ n  |  j | k r¯t S| s¹t S| |  _ |  j }	 | j ré| j |  j ƒ } n  | |  _ t j j j |  d ƒ |	 st St |	 t j j j ƒ s.t St | t j j j ƒ sht j j j d | ƒ |  _ } n  | j |	 ƒ t S(   Nt    t   prefixt   searchs5   In DynamicImage %r: Could not find substitution '%s'.i    s   In DynamicImage %r: %rs&   DynamicImage %r: could not find image.i   s    (%r)i   s	    (%r, %r)s    (%r, %r, and %d more.)RQ   (   t   lockedRX   R   R~   R§   RZ   t   easyt   dynamic_imageRD   t   KeyErrorRw   t   unicodeRz   R   RŸ   RJ   RI   R‡   R€   R[   R   t   redrawRG   t   motionR]   R‚   (
   R_   R¢   R£   R§   R¨   RX   t   keRƒ   Ry   t
   old_target(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRl   d  sN    	(),				"c         C  s8   | r | j  r | j ƒ  n  |  j | ƒ } d  | _ | S(   N(   Rz   R…   R†   R   RX   (   R_   Rz   R   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyR€   Ÿ  s
    	c         C  s7   |  j  ƒ  } | j r* | j j ƒ  | _ n  t | _ | S(   N(   R†   RX   R‰   RI   R©   (   R_   R   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyR‰   ª  s
    		c         C  s#   |  j  d  k r t S|  j  j | ƒ S(   N(   RX   R   RJ   RŠ   (   R_   R‹   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRŠ   ³  s    c         C  s2   |  j  d  k r |  j ƒ  n  |  j  j | | | ƒ S(   N(   RX   R   Rl   RŒ   (   R_   RT   R   R   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRŒ   ¹  s    c         C  s,   |  j  d  k r |  j ƒ  n  |  j  j | ƒ S(   N(   RX   R   Rl   RŽ   (   R_   R‹   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRŽ   ¿  s    c         C  s5   |  j  d  k r |  j ƒ  n  |  j  j | | | | ƒ S(   N(   RX   R   Rl   R‹   (   R_   R   R   R‘   RT   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyR‹   Å  s    c         C  s5   |  j  d  k r |  j ƒ  n  t |  j  | | | | ƒ S(   N(   RX   R   Rl   RV   (   R_   RN   RO   RT   R   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyR   Ë  s    c         C  s)   |  j  d  k r |  j ƒ  n  |  j  j ƒ  S(   N(   RX   R   Rl   R“   (   R_   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyR“   Ñ  s    c         C  s&   |  j  d  k r |  j ƒ  n  |  j  g S(   N(   RX   R   Rl   (   R_   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyR˜   ×  s    c         C  sH   |  j  } |  j s |  j ƒ  n  | |  j  k	 rD |  j  j d „  ƒ n  d  S(   Nc         S  s
   |  j  ƒ  S(   N(   t   per_interact(   R   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyR+   å  s    (   RX   R    Rl   t	   visit_all(   R_   R±   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyR²   Þ  s
    		N(   R™   Rš   R›   Rœ   R   RX   RŸ   RJ   R©   R¥   Rc   R¤   Rf   Rh   Rk   Rm   RI   Rl   R€   R‰   RŠ   RŒ   RŽ   R‹   R   R“   R˜   R²   (    (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRž     s.   				
		;										t   ShownImageInfoc           B  s‰   e  Z d  Z d Z d d „ Z d „  Z d d „ Z e d „ Z	 d „  Z
 d „  Z d „  Z e d	 „ Z d
 „  Z g  g  d „ Z d „  Z RS(   sØ   
    This class keeps track of which images are being shown right now,
    and what the attributes of those images are. (It's used for a similar
    purpose during prediction, regarding the state in the future.)
    i   c         C  sL   | d k r$ i  |  _ t ƒ  |  _ n$ | j j ƒ  |  _ | j j ƒ  |  _ d S(   sš   
        Creates a new object. If `old` is given, copies the default state
        from old, otherwise initializes the object to a default state.
        N(   R   R   R3   t   shownR   (   R_   t   old(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRc   ñ  s
    	c         C  sŒ   | d k  rˆ i  |  _  t ƒ  |  _ xd |  j D]V } xM |  j | D]> } |  j | | d |  j  | | f <|  j j | | f ƒ q? Wq+ Wn  d  S(   Ni   i   (   R   R3   Rµ   R   R6   (   R_   R`   t   layerR   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRa     s    	"c         C  s@   | d k r' t j j j | d ƒ } n  |  j j | | f | ƒ S(   s^   
        Get the attributes associated the image with tag on the given
        layer.
        t   masterN(   R   RZ   Ru   t	   tag_layerR   R   (   R_   R·   R   t   default(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   get_attributes  s    c   	      C  sÙ   | d } | d } | d k r; t j j j | d ƒ } n  | | f |  j k rT d S|  j | | f } t | ƒ t | ƒ k  rƒ t S| r¥ t | ƒ t | ƒ k r¥ t Sx- t	 | | ƒ D] \ } } | | k rµ t Sqµ Wt
 S(   sv   
        Returns true if name is the prefix of an image that is showing
        on layer, or false otherwise.
        i    i   R¸   N(   R   RZ   Ru   R¹   R   Rµ   R   R   RJ   t   zipRI   (	   R_   R·   RD   RK   R   RE   Rµ   R   t   b(    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   showing  s    

c           s   ‡  f d †  |  j  Dƒ S(   sA   
        Returns the set of tags being shown on `layer`.
        c           s(   h  |  ] \ } } | ˆ  k r | ’ q S(    (    (   R%   R   t   t(   R·   (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pys	   <setcomp>?  s   	 (   Rµ   (   R_   R·   (    (   R·   sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   get_showing_tags:  s    c           s   ‡  ‡ f d †  ˆ j  Dƒ S(   sh   
        Returns the set of tags on layer that have attributes,
        but aren't being shown.
        c           s=   h  |  ]3 \ } } | ˆ  k r | | f ˆ j  k r | ’ q S(    (   Rµ   (   R%   R   R¿   (   R·   R_   (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pys	   <setcomp>G  s   	 (   R   (   R_   R·   (    (   R·   R_   sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   get_hidden_tagsA  s    c           sz   ˆ  d k r d ‰  n  x< |  j j ƒ  D]+ \ } } | ˆ  k r% |  j | | f =q% q% Wt ‡  f d †  |  j Dƒ ƒ |  _ d S(   sE   
        Predicts the scene statement being called on layer.
        R¸   c         3  s-   |  ]# \ } } | ˆ  k r | | f Vq d  S(   N(    (   R%   R   R¿   (   R·   (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pys	   <genexpr>U  s    N(   R   R   R4   R3   Rµ   (   R_   R·   R   R¿   (    (   R·   sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   predict_sceneI  s    	c         C  sq   | d } | d } | d k r; t j j j | d ƒ } n  | |  j | | f <| rm |  j j | | f ƒ n  d S(   sË   
        Predicts name being shown on layer.

        `show`
            If True, the image will be flagged as being shown to the user. If
            False, only the attributes will be updated.
        i    i   R¸   N(   R   RZ   Ru   R¹   R   R   Rµ   R6   (   R_   R·   RD   t   showR   RE   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   predict_showW  s    	

c         C  ss   | d } | d  k r1 t j j j | d ƒ } n  | | f |  j k rY |  j | | f =n  |  j j | | f ƒ d  S(   Ni    R¸   (   R   RZ   Ru   R¹   R   R   Rµ   t   discard(   R_   R·   RD   R   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   predict_hidek  s    
c         C  s2  | d k r' t j j j | d ƒ } n  | t k ri | p< | ri t t | d d ƒ } | d k ri | Sn  | d } t | ƒ t |  j j | | f g  ƒ ƒ B} t ƒ  }	 xT | d D]H }
 |
 d d k rí | j	 |
 d ƒ |	 j	 |
 d ƒ q² |	 j
 |
 ƒ q² Wx | D] }
 | j	 |
 ƒ qW|  j | |	 | | ƒ S(   s   
        Given a layer, tag, and an image name (with attributes),
        returns the canonical name of an image, if one exists. Raises
        an exception if it's ambiguious, and returns None if an image
        with that name couldn't be found.
        R¸   R   i    i   t   -N(   R   RZ   Ru   R¹   R   R   R   R3   R   RÅ   R6   t   choose_image(   R_   R·   R   RD   t   wantedt   removeR!   t   nametagt   optionalt   requiredR   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   apply_attributesv  s"    
+	c           s¿  d } d  } xAt | j ƒ  D]/\ ‰  } t | d d  ƒ } | rž ‡  f d †  | Dƒ }	 ‡  f d †  | Dƒ }
 | | |	 |
 ƒ } | d  k r‘ q n  ˆ  | ‰  n  d } x¥ ˆ  D]2 } | | k rÍ | d 7} q« q« | | k r« Pq« q« W| t | ƒ k rù q n  t t ˆ  ƒ ƒ } | | k  rq n  | | k r8| } g  } n  | j | f ˆ  ƒ q W| d  k r`d  St | ƒ d k rz| d S| r·t d d j | ƒ d	 d
 j d „  | Dƒ ƒ ƒ ‚ n d  Sd  S(   NiÿÿÿÿR   c           s"   h  |  ] } | ˆ  k r | ’ q S(    (    (   R%   R   (   R   (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pys	   <setcomp>©  s   	 c           s"   h  |  ] } | ˆ  k r | ’ q S(    (    (   R%   R   (   R   (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pys	   <setcomp>ª  s   	 i    i   s	   Showing 'RB   s)   ' is ambiguous, possible images include: s   , c         s  s   |  ] } d  j  | ƒ Vq d S(   RB   N(   RC   (   R%   R   (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pys	   <genexpr>Ö  s    (	   R   R   R   R   R   R3   R
   Rw   RC   (   R_   R   RÍ   RÌ   t   exception_namet   max_lent   matchesR   R!   t   ca_requiredt   ca_optionalt   newattrst   num_requiredR   t	   len_attrs(    (   R   sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyRÈ   œ  sD    
	7N(    (   R™   Rš   R›   R   R   Rc   Ra   R»   RJ   R¾   RÀ   RÁ   RÂ   RI   RÄ   RÆ   RÎ   RÈ   (    (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyR´   è  s   					&(    (    (+   t
   __future__R    t   renpy.displayRZ   t
   renpy.textt   renpy.display.renderR   R   R,   R   R-   t   dictR   R   R   R	   R   R   R#   R   RA   RF   RJ   RL   RM   RV   R[   R{   R|   RW   Rž   t   objectt   ObjectR´   t   ImagePredictInfot   imt   imaget   Imaget	   imageliket   Solidt   Framet   behaviort   ImageButton(    (    (    sl   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\image.pyt   <module>   s2   		
		'_	 		ÜÔó