ó
¶G]c           @  sA  d  d l  m Z d  d l m Z m Z d  d l Z d „  Z d e j j	 j
 f d „  ƒ  YZ d e j j	 j
 f d „  ƒ  YZ d	 „  Z e Z d
 e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d „  Z d e j j f d „  ƒ  YZ e ƒ  Z d e f d „  ƒ  YZ d „  Z d e j j	 j
 f d „  ƒ  YZ i  Z d „  Z e d „ Z  e d „ Z! d „  Z" d „  Z# d e f d  „  ƒ  YZ$ d! „  Z% e% Z& d" e f d# „  ƒ  YZ' d$ e j j	 j
 f d% „  ƒ  YZ( d& e f d' „  ƒ  YZ) d( e f d) „  ƒ  YZ* e* Z+ d* e f d+ „  ƒ  YZ, d, e f d- „  ƒ  YZ- d S(.   iÿÿÿÿ(   t   print_function(   t   rendert   RenderNc         C  s   t  |  t ƒ r |  | S|  Sd S(   sj   
    If num is a float, multiplies it by base and returns that. Otherwise,
    returns num unchanged.
    N(   t
   isinstancet   float(   t   numt   base(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   scale   s    t   Nullc           B  s&   e  Z d  Z d d d „ Z d „  Z RS(   sr  
    :doc: disp_imagelike
    :name: Null

    A displayable that creates an empty box on the screen. The size
    of the box is controlled by `width` and `height`. This can be used
    when a displayable requires a child, but no child is suitable, or
    as a spacer inside a box.

    ::

        image logo spaced = HBox("logo.png", Null(width=100), "logo.png")

    i    c         K  s,   t  t |  ƒ j |   | |  _ | |  _ d  S(   N(   t   superR   t   __init__t   widtht   height(   t   selfR   R   t
   properties(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
   ;   s    	c         C  sJ   t  j j j |  j |  j ƒ } |  j rF | j |  d  d  d  d  d  ƒ n  | S(   N(	   t   renpyt   displayR   R   R   R   t	   focusablet	   add_focust   None(   R   R   R   t   stt   att   rv(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   @   s    	(   t   __name__t
   __module__t   __doc__R
   R   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   +   s   t	   Containerc           B  s’   e  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 d „  Z d „  Z d „  Z d „  Z RS(   s‡  
    This is the base class for containers that can have one or more
    children.

    @ivar children: A list giving the children that have been added to
    this container, in the order that they were added in.

    @ivar child: The last child added to this container. This is also
    used to access the sole child in containers that can only hold
    one child.

    @ivar offsets: A list giving offsets for each of our children.
    It's expected that render will set this up each time it is called.

    @ivar sizes: A list giving sizes for each of our children. It's
    also expected that render will set this each time it is called.

    c         O  s_   |  j  ƒ  |  _ d  |  _ |  j  ƒ  |  _ x | D] } |  j | ƒ q. Wt t |  ƒ j |   d  S(   N(	   t
   _list_typet   childrenR   t   childt   offsetst   addR	   R   R
   (   R   t   argsR   t   i(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
   a   s    	c         C  s+   x$ |  j  D] } | j | ƒ r
 t Sq
 Wt S(   N(   R   t   _handles_eventt   Truet   False(   R   t   eventR!   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR"   l   s    c         C  sA   t  t |  ƒ j | | ƒ x! |  j D] } | j | t ƒ q# Wd  S(   N(   R	   R   t   set_style_prefixR   R$   (   R   t   prefixt   rootR!   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR&   s   s    c         C  s¼   | r | j  r | j ƒ  n  |  j s) |  S|  j | ƒ } g  |  j D] } | j | ƒ ^ qB | _ | j r| | j d | _ n  t | _ x0 | j D]% } | j ƒ  | j r t	 | _ q q W| S(   Niÿÿÿÿ(
   R    t
   extraneoust   _duplicatablet   _copyR   t
   _duplicateR   R$   t   _uniqueR#   (   R   R    R   R!   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR,   y   s    	(		
	c         C  sˆ   g  } t  } x: |  j D]/ } | j ƒ  } | | | k	 O} | j | ƒ q W| sS |  S|  j ƒ  } | | _ | j r„ | j d | _ n  | S(   Niÿÿÿÿ(   R$   R   t   _in_current_storet   appendR+   R   (   R   R   t   changedt   oldt   newR   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR.   ‘   s    		c         C  sS   t  j j | ƒ } |  j j | ƒ | |  _ |  j ƒ  |  _ | j rO t	 |  _ n  d S(   s1   
        Adds a child to this container.
        N(
   R   t   easyt   displayableR   R/   R   R   R   R*   R#   (   R   t   dR   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   §   s    		c         C  sA   d  |  _ |  j ƒ  |  _ |  j ƒ  |  _ t j j j |  d ƒ d  S(   Ni    (	   R   R   R   R   R   R   R   R   t   redraw(   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   _clear¶   s    	c         C  s|   x1 t  |  j ƒ D] \ } } | | k r Pq q Wd S|  j j | ƒ |  j ƒ  |  _ |  j ro |  j d |  _ n	 d |  _ d S(   st   
        Removes the first instance of child from this container. May
        not work with all containers.
        Niÿÿÿÿ(   t	   enumerateR   t   popR   R   R   R   (   R   R5   R!   t   c(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   remove½   s    	c         C  s   t  j j j |  ƒ d S(   sw   
        This should be called if a child is added to this
        displayable outside of the render function.
        N(   R   R   R   t
   invalidate(   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   updateÑ   s    c   	      C  s|   t  | | ƒ } |  j ƒ  |  _ xW |  j D]L } t | | | | | ƒ } | j | d d | | | ƒ } |  j j | ƒ q( W| S(   Ni    (   R   R   R   R   R   t   placeR/   (	   R   R   R   R   R   R   R:   t   crt   offset(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   Ù   s    c         C  s£   |  j  } |  j } t | ƒ t | ƒ k r. d  Sxn t t | ƒ d d d ƒ D]P } | | } | | \ }	 }
 | j | | |	 | |
 | ƒ } | d  k	 rK | SqK Wd  S(   Ni   iÿÿÿÿ(   R   R   t   lenR   t   xrangeR%   (   R   t   evt   xt   yR   R   R   R!   R5   t   xot   yoR   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR%   å   s    		#
 c         C  s   |  j  S(   N(   R   (   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   visitú   s    c         C  s   t  j j |  ƒ |  S(   N(   R   t   uit   context_enter(   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt	   __enter__   s    c         C  s   t  j j |  ƒ t S(   N(   R   RI   t   context_exitR$   (   R   t   exc_typet   exc_valt   exc_tb(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   __exit__  s    (   R   R   R   t   listR   R
   R"   R&   R,   R.   R   R7   R;   R=   R   R%   RH   RK   RP   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   I   s    													c   
      O  sÚ   | j  d d ƒ |  \ } } t d | d | d | d | |  } t | ƒ d d k re t d	 ƒ ‚ n  xn t | d d
 d … | d d
 d … ƒ D]C \ } } | \ } }	 | j t | d | d d d |	 d d ƒƒ q W| S(   sÌ  
    :name: Composite
    :doc: disp_imagelike

    This creates a new displayable of `size`, by compositing other
    displayables. `size` is a (width, height) tuple.

    The remaining positional arguments are used to place images inside
    the LiveComposite. The remaining positional arguments should come
    in groups of two, with the first member of each group an (x, y)
    tuple, and the second member of a group is a displayable that
    is composited at that position.

    Displayables are composited from back to front.

    ::

       image eileen composite = Composite(
           (300, 600),
           (0, 0), "body.png",
           (0, 0), "clothes.png",
           (50, 50), "expression.png")
    t   stylet   image_placementt   xmaximumt   ymaximumt   xminimumt   yminimumi   i    s2   LiveComposite requires an odd number of arguments.Ni   t   xpost   xanchort   ypost   yanchor(   t
   setdefaultt   FixedRA   t	   Exceptiont   zipR   t   Position(
   t   sizeR    R   R   R   R   t   post   widgetRX   RZ   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt	   Composite  s    $6/R`   c           B  s,   e  Z d  Z d d „ Z d „  Z d „  Z RS(   s  
    :undocumented:

    Controls the placement of a displayable on the screen, using
    supplied position properties. This is the non-curried form of
    Position, which should be used when the user has directly created
    the displayable that will be shown on the screen.
    RS   c         K  s-   t  t |  ƒ j d | |  |  j | ƒ d S(   sè   
        @param child: The child that is being laid out.

        @param style: The base style of this position.

        @param properties: Position properties that control where the
        child of this widget is placed.
        RR   N(   R	   R`   R
   R   (   R   R   RR   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
   A  s    
c         C  sY   t  |  j | | | | ƒ } d g |  _ t j j  j | j | j ƒ } | j | d ƒ | S(   Ni    (   i    i    (   i    i    (	   R   R   R   R   R   R   R   R   t   blit(   R   R   R   R   R   t   surfR   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   N  s
    c   	      C  s]  |  j  j ƒ  \ } } } } } } } | d  k r9 d } n  | d  k rN d } n  |  j j } | d  k	 ro | } n  |  j j } | d  k	 r | } n  |  j j } | d  k	 r± | } n  |  j j } | d  k	 rÒ | } n  |  j j } | d  k	 r÷ | | 7} n  |  j j	 } | d  k	 r| | 7} n  |  j j
 } | rD| d  k	 rD| } n  | | | | | | | f S(   Ni    (   R   t   get_placementR   RR   RX   RZ   RY   R[   t   xoffsett   yoffsett   subpixel(	   R   RX   RZ   RY   R[   Rh   Ri   Rj   t   v(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRg   Y  s6    $							(   R   R   R   R
   R   Rg   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR`   7  s   	t   Gridc           B  s)   e  Z d  Z d e d d „ Z d „  Z RS(   sÊ   
    A grid is a widget that evenly allocates space to its children.
    The child widgets should not be greedy, but should instead be
    widgets that only use part of the space available to them.
    t   gridc         K  sr   | d k	 r | j d | ƒ n  t t |  ƒ j d | |  t | ƒ } t | ƒ } | |  _ | |  _ | |  _ d S(   sÁ   
        @param cols: The number of columns in this widget.

        @params rows: The number of rows in this widget.

        @params transpose: True if the grid should be transposed.
        t   spacingRR   N(	   R   R\   R	   Rl   R
   t   intt   colst   rowst	   transpose(   R   Rp   Rq   t   paddingRr   RR   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
   ˆ  s    		c      	   C  su  |  j  j } |  j  j } | d  k r3 |  j  j } n  | d  k rN |  j  j } n  |  j } |  j } t |  j ƒ | | k r° t |  j ƒ | | k  r¡ t	 d ƒ ‚ q° t	 d ƒ ‚ n  |  j
 rg  }	 xS t | ƒ D]9 }
 x0 t | ƒ D]" } |	 j |  j |
 | | ƒ qß WqÌ Wn	 |  j }	 | } | } |  j  j rF| | d | | } n  |  j  j rk| | d | | } n  g  |	 D] } t | | | | | ƒ ^ qr} g  | D] } | j ƒ  ^ q} d } d } x2 | D]* \ } } t | | ƒ } t | | ƒ } qÈW|  j  j r| } n  |  j  j r | } n  | | | | d } | | | | d } t j j j | | ƒ } g  } xœ t d | ƒ D]‹ }
 x‚ t d | ƒ D]q } |	 | |
 | } | | |
 | } | | | } |
 | | } | j | | | | | | ƒ } | j | ƒ qWqzW|  j
 rhg  |  _ xS t | ƒ D]9 } x0 t | ƒ D]" }
 |  j j | |
 | | ƒ q;Wq(Wn	 | |  _ | S(   Ns   Grid not completely full.s   Grid overfull.i   i    (   RR   t   xspacingt   yspacingR   Rn   Rp   Rq   RA   R   R^   Rr   t   rangeR/   t   xfillt   yfillR   t   get_sizet   maxR   R   R   R>   R   (   R   R   R   R   R   Rt   Ru   Rp   Rq   R   RE   RD   t   renwidtht	   renheightR!   t   renderst   sizest   cwidtht   cheightt   wt   hR   R   R   Rf   RX   RZ   R@   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR      sl    			'	+				'	N(   R   R   R   R   R$   R
   R   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRl     s
   t   IgnoreLayersc           B  s   e  Z d  Z RS(   sU   
    Raise this to have the event ignored by layers, but reach the
    underlay.
    (   R   R   R   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRƒ   õ  s   t   MultiBoxc           B  s€   e  Z e Z e Z e Z e Z e e d  d „ Z	 d „  Z
 d „  Z d „  Z e e d „ Z d „  Z d „  Z d „  Z d	 „  Z RS(
   t   defaultc         K  su   | d  k	 r | | d <n  t t |  ƒ j d | |  |  j j |  _ | |  _ g  |  _ g  |  _	 d  |  _
 d  |  _ d  S(   NRn   RR   (   R   R	   R„   R
   RR   t   clippingt	   _clippingt   default_layoutt   start_timest
   anim_timest   layerst
   scene_list(   R   Rn   t   layoutRR   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
     s    				c         C  s;   t  t |  ƒ j ƒ  g  |  _ g  |  _ d  |  _ d  |  _ d  S(   N(   R	   R„   R7   R‰   RŠ   R   R‹   RŒ   (   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR7     s
    			c   
      C  sÊ  |  j  d  k	 rÃ |  j d  k r" |  Sg  } t } xZ |  j D]O } | j ƒ  } | j j ƒ  } | | j k	 rz | | _ t } n  | j | ƒ q8 W| s• |  St	 d |  j
 ƒ } |  j  | _  | j | ƒ n© |  j rYt	 d |  j
 ƒ } i  | _ t } x\ t j j D]N } |  j | } | j ƒ  }	 |	 | k	 r.t } n  | j |	 ƒ |	 | j | <qú W| sl|  Sn t t	 |  ƒ j ƒ  S|  j rŠt |  j ƒ | _ n  |  j r¨t |  j ƒ | _ n  |  j rÆt |  j ƒ | _ n  | S(   NR   (   t
   layer_nameR   RŒ   R$   t   copyR4   R.   R#   R/   R„   Rˆ   t   append_scene_listR‹   R   t   configR   R	   R   RQ   R‰   RŠ   (
   R   RŒ   R0   t   old_slet   new_sleR5   R   t   layert   old_dt   new_d(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR.   $  sL    								c         C  s\   |  j  j } | d  k r$ |  j } n  | d k r4 d S| d k rD d S| d k rT d Sd Sd  S(   Nt   fixedR]   t
   horizontalt   HBoxt   verticalt   VBoxR„   (   RR   t
   box_layoutR   Rˆ   (   R   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   __unicode__`  s    c         C  s:   t  t |  ƒ j | ƒ |  j j | ƒ |  j j | ƒ d  S(   N(   R	   R„   R   R‰   R/   RŠ   (   R   Rc   t
   start_timet	   anim_time(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   o  s    c         C  s\   x* | D]" } |  j  | j | j | j ƒ q W|  j d  k rH g  |  _ n  |  j j | ƒ d  S(   N(   R   R4   t	   show_timet   animation_timeRŒ   R   t   extend(   R   t   lt   sle(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   t  s
     c         C  su   t  j j j } g  |  j D] } | p( | ^ q |  _ g  |  j D] } | pM | ^ q> |  _ | d  k rq t |  _ n  d  S(   N(	   R   t   gamet	   interfacet   interact_timeR‰   RŠ   R   R#   t   first(   R   t   itR!   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   update_times~  s
    %%c   9        s¤	  |  j  s |  j d  k	 r! t } n t } |  j j } | d  k	 rZ t | t | | ƒ ƒ } n  |  j j	 } | d  k	 r t | t | | ƒ ƒ } n  |  j
 rµ t |  _
 | rµ |  j ƒ  qµ n  |  j j } | d  k rÙ |  j } n  | rUt j j j }	 g  |  j D]" }
 |
 d  k rd n |	 |
 ^ qø } g  |  j D]" } | d  k rBd n |	 | ^ q*} n, | g t |  j ƒ } | g t |  j ƒ } g  } | d k r†d  } |  j j rÏt t |  j ƒ t | ƒ t | ƒ ƒ } n t |  j | | ƒ } t j j j | | d |  j  ƒ} |  j j } |  j j } |  j j } | d k rDt } t } n< | d k r_t } t } n! | rtt } t } n t } t } g  } xÉ | D]Á \ } } } t | | | | | ƒ } | j ƒ  } | j  | ƒ | rí| d } | _! t } n  | r| d } | _" t } n  | rA| j# | d d | | | ƒ } | j  | ƒ q| j  d ƒ qW| rÙd } xB t | | ƒ D]1 \ } } t | d | d | ƒ } | rnPqnqnW| | _! | t j$ j% k rÙt& d j' | ƒ ƒ ‚ qÙn  | r`d } xB t | | ƒ D]1 \ } } t | d | d | ƒ } | rõPqõqõW| | _" | t j$ j% k r`t& d j' | ƒ ƒ ‚ q`n  |  j j ry| j( ƒ  n  | |  _) | S|  j j* } |  j j+ }  |  d  k r³| }  n  |  g | g t |  j ƒ d }! |  j j, }" |  j j- }# |  j j. }$ |  j j/ }% |  j j }& |  j j	 }' d ‰ d ‰  t0 |  j ƒ }( |  j j1 rZ|( j( ƒ  |! j( ƒ  n  g  ‰ d ‰ d ‰ d } d } ‡  ‡ ‡ ‡ ‡ f d †  }) d }* d }+ | d	 k r|% rº| } n |' } d ‰  g  }, | }- |$ rá| }. n |& }. xt |( |! | | ƒ D]þ \ }/ }0 } } |" r| }1 n |- }1 t |/ |1 | |+ | | ƒ } | j ƒ  \ }2 }3 |" r·|- |2 |0 d k  r·|, r·|) |, |. |* d ƒ \ ‰ ‰ |+ ˆ  |# 7}+ d }* d ‰  | }- g  }, n  |, j  |/ |* |+ | f ƒ t ˆ  |3 ƒ ‰  |* |2 |0 7}* |- |2 |0 8}- qýW|) |, |. |* d ƒ \ ‰ ‰ n‰| d
 k r—|$ r9| } n |& } d ‰ g  }, | }4 |% r`| }5 n |' }5 xt |( |! | | ƒ D]ø \ }/ }0 } } |" r| }6 n |4 }6 t |/ | |* |6 | | ƒ } | j ƒ  \ }2 }3 |" r0|4 |3 |0 d k  r0|) |, d |5 |+ ƒ \ ‰ ‰ |* ˆ |# 7}* d }+ d ‰ | }4 g  }, n  |, j  |/ |* |+ | f ƒ t ˆ |2 ƒ ‰ |+ |3 |0 7}+ |4 |3 |0 8}4 q|W|) |, d |5 |+ ƒ \ ‰ ‰ n t& d | ƒ ‚ |$ s¿t |& ˆ ƒ } n  |% s×t |' ˆ ƒ } n  t j j j | | ƒ } |  j j1 |  j j Ar	ˆ j( ƒ  n  xi ˆ D]a \ } }* }+ }7 }8 } t | |7 ƒ }7 t | |8 ƒ }8 | j# | |* |+ |7 |8 | ƒ } | j  | ƒ q	W|  j j r—	| j( ƒ  n  | |  _) | S(   Ni    R—   RŽ   R   R   i   s"   Fixed fit width ({}) is too large.c           s7  t  d | ƒ } t  d | ƒ } |  rG | t |  ƒ } | t |  ƒ } n d } d } ˆ } ˆ } xË t |  ƒ D]½ \ } \ } }	 }
 } | j ƒ  \ } } t  ˆ | ƒ } t  ˆ  | ƒ } |	 | | 7}	 |
 | | 7}
 | | 7} | | 7} ˆ j | |	 |
 | | | f ƒ t  | |	 | ƒ } t  | |
 | ƒ } ql W| | f S(   sñ   
            Lays out a single line.

            `line` a list of (child, x, y, surf) tuples.
            `xfill` the amount of space to add in the x direction.
            `yfill` the amount of space to add in the y direction.
            i    (   Rz   RA   R8   Ry   R/   (   t   lineRw   Rx   t	   xperchildt	   yperchildt   maxxoutt   maxyoutR!   R   RD   RE   Rf   t   swt   sh(   t   line_heightt
   line_widtht   maxxt   maxyt
   placements(    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   layout_line1  s*    	%

R˜   Rš   s   Unknown box layout: %r(   i    i    (2   RŽ   R‹   R   R#   R$   RR   RV   Rz   R   RW   R¨   Rª   Rœ   Rˆ   R   R¥   R¦   t
   frame_timeR‰   RŠ   RA   R   t   order_reverseR_   t   reversedR   R   R   t   xfitt   yfitt	   fit_firstRy   R/   R   R   R>   R‘   t   max_fit_sizeR^   t   formatt   reverseR   Rn   t   first_spacingt   box_wrapt   box_wrap_spacingRw   Rx   RQ   t   box_reverse(9   R   R   R   R   R   t   adjust_timest   minxt   minyR   t   tt   startt   cstst   animt   catsR   R   t   iteratorR»   R¼   R½   t   first_fit_widtht   first_fit_heightR~   R   t   cstt   catRf   Ra   R@   t   ot   sRn   RÁ   t   spacingsRÂ   RÃ   Rw   Rx   RV   RW   R   R·   RD   RE   R«   t   remwidtht   target_widthR5   Rs   t   rwR°   R±   t	   remheightt   target_heightt   rhR   R‚   (    (   R²   R³   R´   Rµ   R¶   sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   ˆ  sd   			25*!									!
(		(	 			(			c         C  s=  |  j  r: t |  _  |  j s* |  j d  k	 r: |  j ƒ  q: n  t |  j |  j |  j	 ƒ } |  j
 j sn | j ƒ  n  y| xu | D]m \ } \ } } }	 |	 d  k r¢ | }
 n t j j j |	 }
 | j | | | | | |
 ƒ } | d  k	 rx | Sqx WWnL t k
 r8|  j r2| j t j j j k r.t j j j ƒ  n  d  S‚  n Xd  S(   N(   R¨   R$   RŽ   R‹   R   Rª   R_   R   R   R‰   RR   R¹   RÀ   R   R¥   R¦   t
   event_timeR%   Rƒ   t   typeR   t   coret	   TIMEEVENTt   post_time_event(   R   RC   RD   RE   R   t   children_offsetsR!   RF   RG   RÈ   RÐ   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR%   Î  s,    			 	(   R   R   R   RŽ   R#   R¨   R$   R¹   R   R
   R7   R.   R   R   R   Rª   R   R%   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR„   þ  s   		<		
	
	ÿ Gc          K  s   t  d d |   S(   NR   R—   (   R„   (   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR]   ÷  s    t	   SizeGroupc           B  s   e  Z d  „  Z d „  Z RS(   c         C  s2   t  t |  ƒ j ƒ  g  |  _ d  |  _ t |  _ d  S(   N(   R	   Rá   R
   t   membersR   t   _widthR$   t   computing_width(   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
   ý  s    		c         C  s   |  j  d  k	 r |  j  S|  j r# d St |  _ d } xD |  j D]9 } t j j j | | | | | ƒ } t	 | j
 | ƒ } q< W| |  _  t |  _ | S(   Ni    (   Rã   R   Rä   R#   Râ   R   R   R   t   render_for_sizeRz   R   R$   (   R   R   R   R   R   t   maxwidthR!   t   rend(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR     s    		!		(   R   R   R
   R   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRá   û  s   	t   Windowc           B  sA   e  Z d  Z d d d „ Z d „  Z d „  Z d „  Z d „  Z RS(   sæ   
    A window that has padding and margins, and can place a background
    behind its child. `child` is the child added to this
    displayable. All other properties are as for the :ref:`Window`
    screen language statement.
    t   windowc         K  s<   t  t |  ƒ j d | |  | d  k	 r8 |  j | ƒ n  d  S(   NRR   (   R	   Rè   R
   R   R   (   R   R   RR   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
   %  s    c         C  s$   g  } |  j  j | j ƒ | |  j S(   N(   RR   t   _visit_windowR/   R   (   R   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRH   *  s    c         C  s   |  j  j p |  j S(   N(   RR   R   (   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt	   get_child/  s    c         C  s[   |  j  j } | rW t j | d  ƒ } | d  k rD t ƒ  } t | <n  | j j |  ƒ n  d  S(   N(   RR   t
   size_groupt   size_groupst   getR   Rá   Râ   R/   (   R   Rì   t   group(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   per_interact2  s    c       	   C  s}  |  j  } t | j | ƒ } t | j | ƒ } t | j | ƒ } t | j | ƒ }	 |  j  j }
 |
 r— |
 t k r— t | t |
 j	 | | | | ƒ ƒ } n  t | | ƒ } t | | ƒ } t | j
 | ƒ } t | j | ƒ } t | j | ƒ } t | j | ƒ } t | j | ƒ } t | j | ƒ } t | j | ƒ } t | j | ƒ } | | } | | } | | } | | } |  j ƒ  } t | | | | | | | | | ƒ } | j ƒ  \ } } | j sÖt | | | | ƒ } n  | j sùt | | | | ƒ } n  t j j rD| d  k	 r#t | | ƒ } n  |	 d  k	 rDt | |	 ƒ } qDn  t j j j | | ƒ } | j r¼| | } | | } t | j | | | | ƒ } | j j | | | | | | d t  ƒn  | j | | | | | | | | | | | | ƒ } | j! rR| | } | | } t | j! | | | | ƒ } | j! j | | | | | | d t  ƒn  |  j" rj| g |  _# n  | | f |  _$ | S(   Nt   main(%   RR   R   RV   RW   RT   RU   Rì   Rí   Rz   R   t   left_margint   left_paddingt   right_margint   right_paddingt
   top_margint   top_paddingt   bottom_margint   bottom_paddingRë   R   Ry   Rw   Rx   R   R‘   t   enforce_window_max_sizeR   t   minR   R   t
   backgroundR>   R$   t
   foregroundR   R   t   window_size(    R   R   R   R   R   RR   RV   RW   RT   RU   Rì   Rò   Ró   Rô   Rõ   Rö   R÷   Rø   Rù   t   cxmargint   cymargint	   cxpaddingt	   cypaddingR   Rf   R°   R±   R   t   bwt   bht   backR   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   <  st    	(



			

(			

(	N(	   R   R   R   R   R
   RH   Rë   Rð   R   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRè     s   			
c         C  s   t  j j | ƒ } | d  f S(   N(   R   t   pythont   py_evalR   (   R   R   t   exprR   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   dynamic_displayable_compat   s    t   DynamicDisplayablec           B  sh   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 RS(   sU  
    :doc: disp_dynamic

    A displayable that can change its child based on a Python
    function, over the course of an interaction.

    `function`
        A function that is called with the arguments:

        * The amount of time the displayable has been shown for.
        * The amount of time any displayable with the same tag has been shown for.
        * Any positional or keyword arguments supplied to DynamicDisplayable.

        and should return a (d, redraw) tuple, where:

        * `d` is a displayable to show.
        * `redraw` is the amount of time to wait before calling the
          function again, or None to not call the function again
          before the start of the next interaction.

        `function` is called at the start of every interaction.

    As a special case, `function` may also be a python string that evaluates
    to a displayable. In that case, function is run once per interaction.

    ::

        # Shows a countdown from 5 to 0, updating it every tenth of
        # a second until the time expires.
        init python:

            def show_countdown(st, at):
                if st > 5.0:
                    return Text("0.0"), None
                else:
                    d = Text("{:.1f}".format(5.0 - st))
                    return d, 0.1

        image countdown = DynamicDisplayable(show_countdown)
    R   c         C  s   d  |  _ d  S(   N(   R   R   (   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   after_setstateÑ  s    c         O  sw   t  t |  ƒ j ƒ  d  |  _ t | t ƒ rC | f } i  } t } n  | j d d  ƒ |  _	 | |  _
 | |  _ | |  _ d  S(   Nt   _predict_function(   R	   R
  R
   R   R   R   t
   basestringR	  R9   t   predict_functiont   functionR    t   kwargs(   R   R  R    R  (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
   Ô  s    					c         C  s   g  S(   N(    (   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRH   ã  s    c         C  sx   |  j  | | |  j |  j Ž \ } } t j j | ƒ } | j d „  ƒ | |  _ | d  k	 rt t j	 j
 j |  | ƒ n  d  S(   Nc         S  s
   |  j  ƒ  S(   N(   Rð   (   R:   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   <lambda>é  s    (   R  R    R  R   R3   R4   t	   visit_allR   R   R   R   R6   (   R   R   R   R   R6   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR=   æ  s    $	c         C  s   t  j j j |  d ƒ d  S(   Ni    (   R   R   R   R6   (   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRð   ð  s    c         C  s2   |  j  | | ƒ t j j j |  j | | | | ƒ S(   N(   R=   R   R   R   R   (   R   R   R‚   R   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   ó  s    c         C  s£   y• |  j  r' |  j  |  j |  j Ž  } n$ |  j d d |  j |  j Ž \ } } t | t ƒ r x7 | D] } t j j j	 | ƒ qa Wn t j j j	 | ƒ Wn n Xd  S(   Ni    (
   R  R    R  R  R   RQ   R   R   t   predictR4   (   R   R   t   _R!   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   predict_oneø  s    	$c         C  s)   |  j  s |  j d d ƒ n  |  j  j ƒ  S(   Ni    (   R   R=   Rg   (   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRg   	  s    	c         C  s&   |  j  r" |  j  j | | | | ƒ Sd  S(   N(   R   R%   (   R   RC   RD   RE   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR%     s    	(   R   R   R   t   nosaveR  R
   RH   R=   Rð   R   R  Rg   R%   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
  ¥  s   (					
				c         C  s…   xr |  D]j \ } } | d  k r# | S| t k r< t | } n t j j | d ƒ } | t | <t j j | ƒ r | Sq Wt d ƒ ‚ d  S(   Nt   evals&   Switch could not choose a displayable.(   R   t
   cond_cacheR   R  t
   py_compilet   py_eval_bytecodeR^   (   t   switcht   condR5   t   code(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   condition_switch_pick  s    
c         C  s   t  | ƒ d  f S(   N(   R  R   (   R   R   R  t   predict_all(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   condition_switch_show-  s    c         C  sf   | d  k r t j j } n  t j j s< | rY t j j j rY g  |  D] \ } } | ^ qC St	 |  ƒ g S(   N(
   R   R   R‘   t   conditionswitch_predict_allR¥   t   lintR   R  t
   predictingR  (   R  R  t   _condR5   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   condition_switch_predict1  s
    !c          O  sÿ   | j  d d ƒ } | j d d ƒ g  } t |  ƒ d d k rM t d ƒ ‚ n  xŠ t |  d d d … |  d d d … ƒ D]_ \ } } | t k r± t j j	 | d	 ƒ } | t | <n  t j
 j | ƒ } | j | | f ƒ qw Wt t | | d
 t ƒ} t | |  S(   sÂ  
    :name: ConditionSwitch
    :doc: disp_dynamic
    :args: (*args, predict_all=None, **properties)

    This is a displayable that changes what it is showing based on
    Python conditions. The positional arguments should be given in
    groups of two, where each group consists of:

    * A string containing a Python condition.
    * A displayable to use if the condition is true.

    The first true condition has its displayable shown, at least
    one condition should always be true.

    The conditions uses here should not have externally-visible side-effects.

    `predict_all`
        If True, all of the possible displayables will be predicted when
        the displayable is shown. If False, only the current condition is
        predicted. If None, :var:`config.conditionswitch_predict_all` is
        used.

    ::

        image jill = ConditionSwitch(
            "jill_beers > 4", "jill_drunk.png",
            "True", "jill_sober.png")
    R  RR   R…   i   i    s1   ConditionSwitch takes an even number of argumentsNi   R  R  (   R9   R   R\   RA   R^   R_   R  R   R  R  R3   R4   R/   R
  R   R%  R`   (   R    R  R  R  R  R5   R  R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   ConditionSwitch<  s     6	c          O  sç   | j  d d ƒ } t |  ƒ d d k r7 t d ƒ ‚ n  g  } xš t |  d d d … |  d d d … ƒ D]o \ } } | d k	 r¶ t | t ƒ s£ t | j ƒ  ƒ } n  d | | f } n d } | j | ƒ | j | ƒ qg Wt	 | | Ž  S(	   sª  
    :doc: disp_dynamic
    :args: (*args, predict_all=None, **properties)

    This is a displayable that changes what it is showing based on the
    images are showing on the screen. The positional argument should
    be given in groups of two, where each group consists of:

    * A string giving an image name, or None to indicate the default.
    * A displayable to use if the condition is true.

    A default image should be specified.

    `predict_all`
        If True, all of the possible displayables will be predicted when
        the displayable is shown. If False, only the current condition is
        predicted. If None, :var:`config.conditionswitch_predict_all` is
        used.

    One use of ShowingSwitch is to have side images change depending on
    the current emotion of a character. For example::

       define e = Character("Eileen",
           show_side_image=ShowingSwitch(
               "eileen happy", Image("eileen_happy_side.png", xalign=1.0, yalign=1.0),
               "eileen vhappy", Image("eileen_vhappy_side.png", xalign=1.0, yalign=1.0),
               None, Image("eileen_happy_default.png", xalign=1.0, yalign=1.0),
               )
           )
    R”   t   masteri   i    s:   ShowingSwitch takes an even number of positional argumentsNi   s   renpy.showing(%r, layer=%r)(
   R9   RA   R^   R_   R   R   t   tuplet   splitR/   R&  (   R    R  R”   t   condargst   nameR5   R  (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   ShowingSwitcht  s     6t   IgnoresEventsc           B  s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         K  s'   t  t |  ƒ j |   |  j | ƒ d  S(   N(   R	   R-  R
   R   (   R   R   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
   «  s    c   	      C  sh   t  j j j |  j | | | | ƒ } | j ƒ  \ } } t  j j j | | ƒ } | j | d d t ƒ| S(   Ni    t   focus(   i    i    (   R   R   R   R   Ry   R   Re   R$   (	   R   R   R‚   R   R   R?   t   cwt   chR   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   ¯  s
    $c         C  s   |  j  j ƒ  S(   N(   R   Rg   (   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRg   ·  s    c         C  s   d  S(   N(   R   (   R   RC   RD   RE   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR%   »  s    (   R   R   R
   R   Rg   R%   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR-  ©  s   			c         K  s   t  j j j | d |  | S(   së   
    :doc: disp_imagelike
    :name: Crop

    This creates a displayable by cropping `child` to `rect`, where
    `rect` is an (x, y, width, height) tuple. ::

        image eileen cropped = Crop((0, 0, 300, 300), "eileen happy")
    t   crop(   R   R   t   motiont	   Transform(   t   rectR   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   Crop¿  s    t   Sidec        
   B  sh   e  Z e d  d d d d d d d d g	 ƒ Z d	 „  Z d
 d „ Z d „  Z d „  Z d „  Z d „  Z	 RS(   t   tlRÈ   t   trt   rt   brt   bt   blR£   R:   c         C  s   t  |  _ d  S(   N(   R$   t   sized(   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR  Ô  s    t   sidec         K  sÄ   t  t |  ƒ j d | |  t | t ƒ r: | j ƒ  } n  t ƒ  } xb | D]Z } | t j k ru t d | f ƒ ‚ n  | | k r— t d | f ƒ ‚ n  | j	 | ƒ qJ Wt
 | ƒ |  _ t |  _ d  S(   NRR   s(   Side used with impossible position '%s'.s'   Side used with duplicate position '%s'.(   R	   R6  R
   R   R  R)  t   sett   possible_positionsR^   R   R(  t	   positionsR$   R=  (   R   RA  RR   R   t   seenR!   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
   ×  s    	c         C  sG   t  |  j ƒ t  |  j ƒ k r- t d ƒ ‚ n  t t |  ƒ j | ƒ d  S(   Ns'   Side has been given too many arguments.(   RA   R   RA  R^   R	   R6  R   (   R   R5   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   ì  s    c         C  s    t  t |  ƒ j ƒ  t |  _ d  S(   N(   R	   R6  R7   R$   R=  (   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR7   ò  s    c         C  s   t  |  _ d  S(   N(   R$   R=  (   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRð   ö  s    c   #        sS  t  j j r9 t ˆ j ƒ t ˆ j ƒ k r9 t d ƒ ‚ n  i  ‰ i  ‰ xC t t ˆ j ˆ j ƒ ƒ D]& \ } \ } } | ˆ | <| ˆ | <qa W| } | }	 ˆ j	 s¿t
 ˆ _	 ˆ j j ‰ ‡ ‡ f d †  }
 |
 d d d | ƒ \ ˆ _ } |
 d d d | ƒ \ ˆ _ } |
 d d	 d | ƒ \ ˆ _ } |
 d d
 d | ƒ \ ˆ _ } d } d } d } d } d } d } ‡  ‡ ‡ f d †  } | d | | d d ƒ \ } } | d	 | | | | ƒ \ } } | d
 | | | | ƒ \ } } | d | | | | ƒ \ } } | d | | | | ƒ \ } } | d | | | | ƒ \ } } | d | | | | ƒ \ } } | d | | | | ƒ \ } } | d | | | | ƒ \ } } | ˆ _ | ˆ _ | ˆ _ | ˆ _ | ˆ _ | ˆ _ n6 ˆ j } ˆ j } ˆ j } ˆ j } ˆ j } ˆ j } | } |	 } d  g t ˆ j ƒ ˆ _ ˆ j } ˆ j } ˆ j } ˆ j } ˆ j j rS| } n  ˆ j j rh| } n  t | | | | | | ƒ } t | | | | | | ƒ } t  j j j | | | | | | | | | | ƒ ‰ ‡  ‡ ‡ ‡ ‡ ‡ f d †  } d } | | } | | | | } d } | | } | | | | } d | | | | f d	 | | | | f d | | | | f d
 | | | | f d | | | | f d | | | | f d | | | | f d | | | | f d | | | | f g	 } t  j j r‡ ‡ f d †  } | j  d | ƒ n  x3 | D]+ \ } } }  }! }" | | | |  |! |" ƒ q Wˆ S(   Ns(   A side has the wrong number of children.c           s@   |  ˆ  k s$ | ˆ  k s$ | ˆ  k r2 ˆ | ˆ f Sd | f Sd  S(   Ni    (    (   t   aR;  R:   t   axis(   t   pos_dRn   (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   spacer  s    $R7  R£   R<  R8  R9  R:  RÈ   R;  i    c           s]   |  ˆ k r | | f St  j j j ˆ |  | | ˆ ˆ  ƒ } t | | j ƒ t | | j ƒ f S(   N(   R   R   R   Rå   Rz   R   R   (   Rb   R   R   t   owidtht   oheightRç   (   R   RE  R   (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   sizeit$  s    
%R:   c           si   |  ˆ k r d  Sˆ |  } ˆ |  } t  | | | ˆ ˆ  ƒ } ˆ |  j ˆ | | | | | ƒ ˆ j | <d  S(   N(   R   R>   R   (   Rb   RD   RE   R   R‚   R5   R!   Rç   (   R   RE  t   pos_iR   R   R   (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR>   ^  s    

c           s5   |  \ } } } } } | ˆ  k r% d  Sˆ j  j | ƒ S(   N(   RA  t   index(   t   elemRb   RD   RE   R   R‚   (   RE  R   (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   sort  s    t   key(!   R   R‘   t	   developerRA   RA  R   R^   R8   R_   R=  R#   RR   Rn   t
   left_spacet   right_spacet	   top_spacet   bottom_spaceR   R€   t   topt   bottomt   leftt   rightR   R   Rw   Rx   Rû   R   R   R   t   keep_side_render_orderRM  (#   R   R   R   R   R   R!   Rb   R5   t	   old_widtht
   old_heightRF  RV  RW  RT  RU  R   R€   RI  t   leftst   rightst   topst   bottomsR>   t   col1t   col2t   col3t   row1t   row2t   row3t   place_orderRM  RD   RE   R   R‚   (    (   R   RE  RJ  R   R   Rn   R   sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   ù  s¤    *.
																			


(
   R   R   R?  R@  R  R
   R   R7   Rð   R   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR6  Ð  s   '				t   Alphac           B  s2   e  Z d e e e d d  „ Z d „  Z d „  Z RS(   c	   
      K  se   t  t |  ƒ j |	   | |  _ | |  _ | |  _ t j j | ƒ |  _	 | |  _
 | |  _ | |  _ d  S(   N(   R	   Rf  R
   RÉ   t   endt   timeR   R3   R4   R   t   repeatt   anim_timebaset	   time_warp(
   R   RÉ   Rg  Rh  R   Ri  t   bounceRj  Rk  R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
   “  s    					c         C  s
   |  j  g S(   N(   R   (   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRH      s    c         C  sG  |  j  r | } n | } |  j r: t | |  j d ƒ } n d } t j j rU d } nQ |  j r | d } t j j j	 |  d ƒ n% | d k r¦ t j j j	 |  d ƒ n  |  j
 rÁ |  j
 | ƒ } n  |  j | |  j |  j } t j j j |  j | | | | ƒ } | j ƒ  \ }	 }
 t j j j |	 |
 ƒ } | j | d ƒ | | _ | S(   Ng      ð?i    (   i    i    (   Rj  Rh  Rû   R   R¥   t   less_updatesRi  R   R   R6   Rk  RÉ   Rg  R   Ry   R   Re   t   alpha(   R   R   R   R   R   RÈ   t   doneRn  Rç   R   R‚   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   £  s,    					
	$	N(   R   R   R   R$   R
   RH   R   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRf  ‘  s   		t   AdjustTimesc           B  s5   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         K  s9   t  t |  ƒ j |   | |  _ | |  _ |  j | ƒ d  S(   N(   R	   Rp  R
   Rž   RŸ   R   (   R   R   Rž   RŸ   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
   Ç  s    		c         C  sÃ   t  j j j } |  j d  k r6 | d  k	 r6 | |  _ n  |  j d  k	 r^ t  j j j |  j } n d } |  j d  k r‹ | d  k	 r‹ | |  _ n  |  j d  k	 r³ t  j j j |  j } n d } | | f S(   Ni    (   R   R¥   R¦   R§   Rž   R   R¸   RŸ   (   R   R§   R   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   adjusted_timesÏ  s    c   	      C  s€   |  j  ƒ  \ } } t j j j |  j | | | | ƒ } | j ƒ  \ } } t j j j | | ƒ } | j | d ƒ d g |  _ | S(   Ni    (   i    i    (   i    i    (	   Rq  R   R   R   R   Ry   R   Re   R   (	   R   R   R‚   R   R   R?   R/  R0  R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   å  s    $c         C  s/   |  j  ƒ  \ } } t j |  | | | | ƒ d  S(   N(   Rq  R   R%   (   R   RC   RD   RE   R   R  (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR%   ò  s    c         C  s   |  j  j ƒ  S(   N(   R   Rg   (   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRg   ö  s    (   R   R   R
   Rq  R   R%   Rg   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRp  Å  s
   				t   Tilec           B  s#   e  Z d  Z d d „ Z d „  Z RS(   s©   
    :doc: disp_imagelike
    :name: Tile

    Tiles `child` until it fills the area allocated to this displayable.

    ::

        image bg tile = Tile("bg.png")

    t   tilec         K  s-   t  t |  ƒ j d | |  |  j | ƒ d  S(   NRR   (   R	   t   LiveTileR
   R   (   R   R   RR   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
     s    c         C  s:  t  j j j |  j | | | | ƒ } | j ƒ  \ } } t  j j j | | ƒ } t | ƒ } t | ƒ } t | ƒ } t | ƒ } xµ t d | | ƒ D]¡ }	 x˜ t d | | ƒ D]„ }
 t | | |
 ƒ } t | | |	 ƒ } | | k  sî | | k  r| j	 d d | | f ƒ } n | } | j
 | |
 |	 f d t ƒqª Wq‘ W| S(   Ni    R.  (   R   R   R   R   Ry   R   Ro   Rv   Rû   t
   subsurfaceRe   R$   (   R   R   R   R   R   R?   R/  R0  R   RE   RD   t   ccwt   ccht   ccr(    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR     s     $$(   R   R   R   R
   R   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRr  ú  s   t   Flattenc           B  s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s  
    :doc: disp_imagelike

    This flattens `child`, which may be made up of multiple textures, into
    a single texture.

    Certain operations, like the alpha transform property, apply to every
    texture making up a displayable, which can yield incorrect results
    when the textures overlap on screen. Flatten creates a single texture
    from multiple textures, which can prevent this problem.

    Flatten is a relatively expensive operation, and so should only be used
    when absolutely required.
    c         K  s'   t  t |  ƒ j |   |  j | ƒ d  S(   N(   R	   Ry  R
   R   (   R   R   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
   :  s    c   
      C  s´   t  j j j |  j | | | | ƒ } | j ƒ  \ } } | j t ƒ } t  j j j | | ƒ }	 |	 j | d ƒ |	 j	 | d t ƒt  j j
 j |	 _ t  j j j |	 _ d g |  _ |	 S(   Ni    R.  (   i    i    (   i    i    (   R   R   R   R   Ry   t   render_to_textureR#   R   Re   t
   depends_ont   drawt   draw_to_virtRÀ   t   IDENTITYt   forwardR   (
   R   R   R   R   R   R?   R/  R0  t   texR   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   ?  s    $c         C  s   |  j  j ƒ  S(   N(   R   Rg   (   R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRg   P  s    (   R   R   R   R
   R   Rg   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyRy  *  s   		t	   AlphaMaskc           B  s    e  Z d  Z d „  Z d „  Z RS(   sñ  
    :doc: disp_imagelike

    This displayable takes its colors from `child`, and its alpha channel
    from the multiplication of the alpha channels of `child` and `mask`.
    The result is a displayable that has the same colors as `child`, is
    transparent where either `child` or `mask` is transparent, and is
    opaque where `child` and `mask` are both opaque.

    The `child` and `mask` parameters may be arbitrary displayables. The
    size of the AlphaMask is the size of `child`.
    c         K  sE   t  t |  ƒ j |   |  j | ƒ t j j | ƒ |  _ d  |  _	 d  S(   N(
   R	   R  R
   R   R   R3   R4   t   maskR   t   null(   R   R   R‚  R   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR
   a  s    c         C  sA  t  j j j |  j | | | | ƒ } | j ƒ  \ } } t  j j j | | ƒ } | j |  j d t ƒ|  j	 d  k r‚ t ƒ  |  _	 n  t  j j j |  j	 | | | | ƒ }	 t  j j j | | d t ƒ}
 t  j j j |
 _ d |
 _ d d |
 _ d |
 _ |
 j | d	 d t d t ƒ|
 j |	 d
 d t d t ƒ|
 j | d ƒ |
 S(   NRñ   t   opaqueg      ð?g      p@i   i    R.  g      €@(   i    i    (   i    i    (   i    i    (   R   R   R   R   Ry   R   R>   R‚  R$   Rƒ  R   R]   t   IMAGEDISSOLVEt	   operationt   operation_alphat   operation_completet   operation_parameterRe   (   R   R   R   R   R   R?   R   R‚   t   mrt   nrR   (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR   h  s     $$		(   R   R   R   R
   R   (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyR  S  s   	(.   t
   __future__R    t   renpy.display.renderR   R   t   renpy.displayR   R   R   RÝ   t   DisplayableR   R   Rd   t   LiveCompositeR`   Rl   R^   Rƒ   R„   R]   t   objectt   ObjectRá   t   dictRí   Rè   R	  R
  R  R  R   R   R%  R&  R,  R-  R5  t   LiveCropR6  Rf  Rp  Rr  Rt  Ry  R  (    (    (    sm   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\layout.pyt   <module>   sD   	Â	)Jt	ÿ ú		ƒ	p		8	5	Á45-)