a
    V$c                     @   s:  d dl mZmZmZmZmZ d dlmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZ d dlmZ d dlZd dlZd dlZd dlZejjdddddZi ZG d	d
 d
ejjZdd Ze e!Z"G dd deZ#e#Z$dd Z%G dd dejjZ&d Z'dZ(dZ)dZ*dZ+g dZ,G dd dej-j.j/Z0da1d dkr<ej-j20 a1nda1g Z3dd Z4dd Z5i Z6e e7Z8e9 Z:dHddZ;d d! Z<da=da>g a?i a@g aAd"d# ZBd$d% ZCd&d' ZDd(d) ZEd*d+ ZFd,d- ZGdId.d/ZHd0d1 ZId2d3 ZJd4d5 ZKd6d7 ZLdJd8d9ZMd:d; ZNd<d= ZOdKd>d?ZPePZQdLd@dAZReRZSdBdC ZTdDdE ZUdFdG ZVdS )M    )divisionabsolute_importwith_statementprint_functionunicode_literals)PY2
basestringbchrbordchropenpystrrangeroundstrtobytesunicode)OptionalNprofile_screenTF)	developerappendflushc                   @   s   e Zd ZdZdddZdS )ScreenProfilez?
    :doc: profile_screen
    :name: renpy.profile_screen

    Fc	           	      C   sT   || _ || _|| _|| _|| _|| _|| _|durPt|trPt	|
 }| t|< dS )a  
        Requests screen profiling for the screen named `name`, which
        must be a string.

        Apart from `name`, all arguments must be supplied as keyword
        arguments. This function takes three groups of arguments.


        The first group of arguments determines when profiling occurs.

        `predict`
            If true, profiling occurs when the screen is being predicted.

        `show`
            If true, profiling occurs when the screen is first shown.

        `update`
            If true, profiling occurs when the screen is updated.

        `request`
            If true, profiling occurs when requested by pressing F8.

        The second group of arguments controls what profiling output is
        produced when profiling occurs.

        `time`
            If true, Ren'Py will log the amount of time it takes to evaluate
            the screen.

        `debug`
            If true, Ren'Py will log information as to how screens are
            evaluated, including:

            * Which displayables Ren'Py considers constant.
            * Which arguments, if any, needed to be evaluated.
            * Which displayables were reused.

            Producing and saving this debug information takes a noticeable
            amount of time, and so the `time` output should not be considered
            reliable if `debug` is set.

        The last group of arguments controls what output is produced once
        per Ren'Py run.

        `const`
            Displays the variables in the screen that are marked as const and
            not-const.

        All profiling output will be logged to profile_screen.txt in the game
        directory.
        N)predictshowupdaterequesttimedebugconst
isinstancer   tuplesplitprofile)	selfnamer   r   r   r   r   r   r    r&   renpy/display\screen.py__init__0   s    5
zScreenProfile.__init__N)FFFFFFF__name__
__module____qualname____doc__r(   r&   r&   r&   r'   r   )   s   r   c                 C   s2   t | trt|  } | tv r&t|  S tdS dS )z
    Returns the profile object for the screen with `name`, or a default
    profile object if none exists.

    `name`
        A string or tuple.
    N)r    r   r!   r"   r#   r   r%   r&   r&   r'   get_profileu   s
    	
r/   c                   @   s   e Zd ZdZdd ZdS )ScreenCachezh
    Represents an entry in the screen cache. Upon creation, puts itself into
    the screen cache.
    c                 C   sP   |j d u rd S || _|| _|| _t| }||  t|tjj	krL|
d d S Nr   )astargskwargscachepredict_cacher   lenrenpyconfigscreen_cache_sizepop)r$   screenr3   r4   r5   pcr&   r&   r'   r(      s    

zScreenCache.__init__Nr)   r&   r&   r&   r'   r0      s   r0   c                 C   sZ   | j du ri S t|  }|si S |D ]&}|j|kr"|j|kr"||  qTq"|d}|jS )zZ
    Returns the cache to use when `screen` is accessed with `args` and
    `kwargs`.
    Nr   )r2   r6   r3   r4   remover;   r5   )r<   r3   r4   r=   scr&   r&   r'   	cache_get   s    


r@   c                
   @   s"   e Zd ZdZdZdZd
dd	ZdS )Screenz~
    A screen is a collection of widgets that are displayed together.
    This class stores information about the screen.
    TrueNFalse0Fscreensc                 C   s   t |trt| }|| _|d u s.t |tr4|g}|D ]$}| t|d |f< | t|d  |< q8|| _t |tj	j
jr||| _nd | _|| _|| _|p|d | _|d u rtjj}|| _|| _|	| _|
| _|| _|| _dadad S Nr   F)r    r   r!   r"   r%   rE   screens_by_namefunctionr8   sl2slastSLScreenr2   modalzordertagr9   predict_screensr   
parameterslocationlayer	sensitiveroll_forwardpreparedanalyzed)r$   r%   rH   rL   rM   rN   r   variantrP   rQ   rR   rS   rT   vr&   r&   r'   r(      s2    
zScreen.__init__)
rC   rD   NNNFNrE   rB   N)r*   r+   r,   r-   rS   rT   r(   r&   r&   r&   r'   rA      s             rA               )PREDICTSHOWUPDATEHIDEOLDc                       s   e Zd ZdZg dZdZdZdZdd Zi i df fdd	Z	e
dd	 Zd
d Zdd Zd+ddZdd Z fddZdd Zdd Zdd Zdd Zdd Zdd  Zd!d" Zd#d$ Zd%d& Zd'd( Zd)d* Z  ZS ),ScreenDisplayablez
    A screen is a collection of widgets that are displayed together. This
    class is responsible for managing the display of a screen.
    )r<   childchildren
transformswidgetsbase_widgetsold_widgetshidden_widgetsold_transformsr5   
miss_cacher#   phase	use_cacheFc                 C   sr   t | jd | _d | _g | _i | _i | _i | _d | _d | _	d| _
i | _i | _t| _i | _i | _t| jd | _d S rF   )get_screen_variantscreen_namer<   rc   rd   re   rf   rg   rh   rj   old_transfersri   r5   r_   rl   rm   rk   r#   getr$   r&   r&   r'   after_setstateE  s    z ScreenDisplayable.after_setstatec           	         s@  t t| jf i | || _|| _|j| _| jj| _t	
| jd | _	|| _|| _tj|| _d | _|| _i | _i | _i | _|r|rt||}nd }|d ur|j| _ni | _|d ur|j| _ni | _i | _d | _d | _|o|j| jk| _d | _i | _d| _d| _ || _!tj"j#| jj$| jd| _$tj"j#| jj%| jd| _%t&| _'d S )NFlocals)(superrb   r(   
propertiesr<   r%   ro   rQ   	_locationr#   rq   rN   rR   r8   
revertableRevertableDictscoperc   widget_propertiesrf   rg   r5   
get_screenre   rm   rk   rh   rj   rp   current_transform_eventri   
restartinghiding	transientpythonpy_evalrL   rM   r]   rl   )	r$   r<   rN   rR   r|   r{   r   rw   
old_screen	__class__r&   r'   r(   W  sF    


zScreenDisplayable.__init__c                 C   s   d | jS )N )joinro   rr   r&   r&   r'   r%     s    zScreenDisplayable.namec                 C   s   | j S Nr.   rr   r&   r&   r'   
_repr_info  s    zScreenDisplayable._repr_infoc                 C   s   | j gS r   )rc   rr   r&   r&   r'   visit  s    zScreenDisplayable.visitNc                 C   sB   ||  z,t |  | jd ur,| jj|d d W t  nt  0 d S )N)seen)push_current_screenrc   	visit_allpop_current_screen)r$   callbackr   r&   r&   r'   r     s    
zScreenDisplayable.visit_allc                 C   s   t jj| d |   d S r1   )r8   displayrenderredrawr   rr   r&   r&   r'   per_interact  s    zScreenDisplayable.per_interactc                    s   t t| | || _d S r   )rv   rb   set_transform_eventr~   r$   eventr   r&   r'   r     s    z%ScreenDisplayable.set_transform_eventc                 C   sh   | j tkp| j tk}| jr0t| js0tjj  z*t	|  | j
rR|sR| j
|| W t  nt  0 d S r   )rl   ra   r`   rL   callabler8   r   focus
mark_modalr   rc   find_focusabler   )r$   r   
focus_namer   r&   r&   r'   r     s    
z ScreenDisplayable.find_focusablec                 C   sZ   t | j| j| j| j| jfi | j}| j |_| j	 |_	| j	 |_
d|_| j|_|S )NT)rb   r<   rN   rR   r|   r{   rw   re   copyrf   rg   rp   rc   r$   rvr&   r&   r'   r     s    $zScreenDisplayable.copyc                 C   s(   | j d u r| jrdS |   | j |S )NF)rc   r   r   _handles_eventr   r&   r&   r'   r     s
    
z ScreenDisplayable._handles_eventc           
      C   sn  | j tkr| }n| jd ur*| j|s*d S t|  |   | jd u rJd S | jd u rXd S | j|shd S | jjd ur| jj	| j
di  |  }| jjD ]}|| qt|_ d }|j}t|tjjjsd S tj  tjjdd| j d|_|jg|_tj  |jD ]>}||||}	|	d urtjj|	d |j|	 |}q|d urjtjj|d |S )Nr   _screen__r   )rl   r`   rc   r   updated_screensdiscardr   r<   r2   copy_on_changer5   rq   r   rd   r   r    r8   r   layoutMultiBoxuidetacheddefault_fixedr   ro   close_hider   r   add)
r$   statkindhidir   	old_childdcr&   r&   r'   r     sF    









zScreenDisplayable._hidec                 C   sj   | j d u r| S | jd u r| S tjjs(| S | j jd urL| j j| jdi  | 	 }t
|_| j |_|S r1   )r<   rc   r8   r9   transition_screensr2   r   r5   rq   r   ra   rl   _in_current_storer   r&   r&   r'   r   1  s    

z#ScreenDisplayable._in_current_storec           	   
   C   s  | t v rd S t |  | jd u r6tjjjdd| _i S | jsP| j	t
ksP| j	tkrn| jshtjjjdd| _| jS d}d}| jr | j	tkr| jjrd}n.| j	tkr| jjrd}n| j	tkr| jjrd}tjjjr| jjrd}|r tdt| j	 d| jtj d t }| jj r d}| j| _!| j"| _#i | _i | _$i | _"t%|  tj&j}| tj&_d}| j'(|d }ztj&)  tj&j*d	d
| j d| _| jg| _+| j,| j,d< || j,d< || j,d< | jj-f i | j, tj&.  W | j,/dd  |tj&_t0  n| j,/dd  |tj&_t0  0 d | _!d | _#d| _1| j2r>| j23  | j'(|d |urp| j4d u rp| j	tkrpd| _4| j4r| jj+D ]}|5| j4 qd | _4|rt }| jjrtdd||   | jj rtd | jS )Nfixed)r   FTz%s %s %sr   z%H:%M:%S.%fr   r   r   r   _scope_name_debugr   z	* %.2f msi  
)6r   r   r<   r8   r   r   r   rc   r   rl   r`   ra   rf   r#   r_   r   r^   r   r]   r   	interfaceprofile_oncer   profile_logwrite
phase_namer   ro   datetimenowstrftimer   r   rh   re   rj   rg   r   r   r5   rq   r   r   rd   r{   rH   r   r;   r   rp   rk   clearr~   r   )	r$   r#   r   startold_ui_screenNAME	old_cacher   endr&   r&   r'   r   E  s    








,


zScreenDisplayable.updatec           	      C   s   | j s|   | jtkrt| _z*t|  tjj| j ||||}W t	  nt	  0 tjj
||}| |_| jtkpz| jtk}| jd u rd}ntjj| jj| jd}|j|d|o| | d | jo| |_|S )NFrt   )r   r   )r   main)rc   r   rl   r^   r_   r   r8   r   r   r   Renderfocus_screenra   r`   r<   r   r   rS   r{   blitrL   )	r$   whr   r   rc   r   r   rS   r&   r&   r'   r     s"    

zScreenDisplayable.renderc                 C   s   | j s|   | j  S r   )rc   r   get_placementrr   r&   r&   r'   r     s    zScreenDisplayable.get_placementc                 C   s   | j tks| j tkrd S | js"d S tjj| jj| jdsBtj	j
j}z$t|  | j||||}W t  nt  0 |d ur||S tj	j| j|||d d rtj	j d S )Nrt   )rl   ra   r`   r<   r8   r   r   rS   r{   r   r   
time_eventr   rc   r   r   r   check_modalrL   IgnoreLayers)r$   evxyr   r   r&   r&   r'   r     s    
zScreenDisplayable.eventc                 C   s
   t | j S r   )r   rl   rr   r&   r&   r'   get_phase_name  s    z ScreenDisplayable.get_phase_namec                 C   s<   | j tks| j tkrdS | jr0tjj|  S |  S d S )N )	rl   ra   r`   rL   r8   r   ttsTTSDone_tts_commonrr   r&   r&   r'   _tts  s
    zScreenDisplayable._tts)N)r*   r+   r,   r-   nosaver   r   r   rs   r(   propertyr%   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __classcell__r&   r&   r   r'   rb   +  s2   a




9qrb   c                 C   s   t t | ad S r   )current_screen_stackr   _current_screen)r<   r&   r&   r'   r     s    
r   c                   C   s   t  ad S r   )r   r;   r   r&   r&   r&   r'   r     s    r   c                 C   s>   |du rt jj}|D ]$}t| |fd}|dur|  S qdS )zi
    Get a variant screen object for `name`.

    `candidates`
        A list of candidate variants.
    N)r8   r9   variantsrE   rq   )r%   
candidatesr   r   r&   r&   r'   rn      s    
rn   c                 C   s:   t | trt|  } | d } | tvr*g S tt|   S )z
    Gets all variants of the screen with `name`.

    Returns a list of (`variant`, `screen`) tuples, in no particular
    order.
    r   )r    r   r!   r"   rG   listitemsr.   r&   r&   r'   get_all_screen_variants3  s    
r   c                     s   t tkrtS tt ttdd tD t D ]>\} }| d    |jsVq6 fdd}|j| q6g }dd   D }|r|	 |
  D ]$} | }| |s|| q= qt at  |atta |S )zG
    Produces a list of SL2 screens in topologically sorted order.
    c                 S   s   h | ]}|d  qS )r   r&   ).0r   r&   r&   r'   	<setcomp>f      zsort_screens.<locals>.<setcomp>r   c                    s,   | vrd S    |  |    d S r   )r   )usesdependsr%   namesreverser&   r'   r   r  s    zsort_screens.<locals>.callbackc                 S   s   h | ]\}}t |s|qS r&   )r7   )r   krX   r&   r&   r'   r   ~  r   )screens_at_sortrE   sorted_screenscollectionsdefaultdictsetr   r2   used_screensr;   r   r>   r   r   keys	use_cyclesortdict)r   rX   r   r   worksetr   r   r&   r   r'   sort_screensT  s8    	



r   c                  C   s&   g } t  D ]}| t|   q
| S )zB
    Produces a list of screen variants in topological order.
    )r   extendrG   values)r   r%   r&   r&   r'   sorted_variants  s    
r   c                  C   s2   t rdS t D ]} | jdu rq| j  qda dS )z
    Analyzes all screens.
    NT)rV   r   r2   analyze_screen)sr&   r&   r'   analyze_screens  s    

r  c                  C   s   t rdS t  tjjj} dtjj_zHts0t  t	 D ]$}|j
du rFq6|j
  |j
  q6da W | tjj_n| tjj_0 tjjrtrtddt d dS )z'
    Prepares all screens for use.
    NTz0The following screens use each other in a loop: z, z. This is not allowed.)rU   r6   r   r8   r   r   
predictingrV   r  r   r2   unprepare_screenprepare_screenr9   r   r   	Exceptionr   )old_predictingr  r&   r&   r'   prepare_screens  s"    




r	  c                  O   s   t | i | dS )a  
    :undocumented:
    :args: (name, function, modal="False", zorder="0", tag=None, variant=None)

    Defines a screen with `name`, which should be a string.

    `function`
        The function that is called to display the screen. The
        function is called with the screen scope as keyword
        arguments. It should ignore additional keyword arguments.

        The function should call the ui functions to add things to the
        screen.

    `modal`
        A string that, when evaluated, determines of the created
        screen should be modal. A modal screen prevents screens
        underneath it from receiving input events.

    `zorder`
        A string that, when evaluated, should be an integer. The integer
        controls the order in which screens are displayed. A screen
        with a greater zorder number is displayed above screens with a
        lesser zorder number.

    `tag`
        The tag associated with this screen. When the screen is shown,
        it replaces any other screen with the same tag. The tag
        defaults to the name of the screen.

    `predict`
        If true, this screen can be loaded for image prediction. If false,
        it can't. Defaults to true.

    `variant`
        String. Gives the variant of the screen to use.

    N)rA   )r3   r4   r&   r&   r'   define_screen  s    (r
  c                 C   s0   t | ts| d } t| }|du r&dS |jS dS )zC
    Returns the layer that the screen with `name` is part of.
    r   NrE   )r    r   rn   rR   )r%   r<   r&   r&   r'   get_screen_layer  s    
r  c                 C   s|   |du rt | }t| tr | f} tj }| D ] }|||}|dur.|  S q.| D ]"}|||f}|durT|  S qTdS )a  
    :doc: screens

    Returns the ScreenDisplayable with the given `name` on `layer`. `name`
    is first interpreted as a tag name, and then as a screen name. If the
    screen is not showing, returns None.

    This can also take a list of names, in which case the first screen
    that is showing is returned.

    This function can be used to check if a screen is showing::

        if renpy.get_screen("say"):
            text "The say screen is showing."
        else:
            text "The say screen is hidden."

    The ScreenDisplayable objects returned by this function have the
    following documented fields:

    .. attribute:: ScreenDisplayable.layer

        The layer the screen is being displayed on.

    .. attribute:: ScreenDisplayable.name

        The name of the screen.

    .. attribute:: ScreenDisplayable.zorder

        The zorder the screen is being displayed at.
    N)r  r    r   r8   exportsscene_listsget_displayable_by_tagget_displayable_by_name)r%   rR   slrN   sdr&   r&   r'   r}     s    "



r}   c                 C   s6   t | tst|  } | sdS t| d r.dS dS dS )z>
    Returns true if a screen with the given name exists.
    Fr   TN)r    r!   r"   rn   r.   r&   r&   r'   
has_screenO  s    
r  c                 C   sF   | }t |tst| }t|d }|du r@td|d f |jS )zX
    Given a screeen name, determines if roll forward is enable for the
    screen.
    r   NScreen %s is not known.
)r    r!   r"   rn   r  rT   )ro   r%   r<   r&   r&   r'   get_screen_roll_forward`  s    
r  c              	   O   sT  | dd}| dd}| di }| dd}| dd}| }t|tsVt| }t|d }	|	du r|td	|d f |du rt|}|du r|	j}i }
|	jr||
d
< ||
d< n
|
	| t
|	||||
|d}|du r|j}t||}|r|jr|j|_t|	|||_t|_nt|	|||_t|_tjj }|j|||||d|d dS )aS  
    :doc: screens

    The programmatic equivalent of the show screen statement.

    Shows the named screen. This takes the following keyword arguments:

    `_screen_name`
        The name of the screen to show.
    `_layer`
        The layer to show the screen on.
    `_zorder`
        The zorder to show the screen on. If not specified, defaults to
        the zorder associated with the screen. It that's not specified,
        it is 0 by default.
    `_tag`
        The tag to show the screen with. If not specified, defaults to
        the tag associated with the screen. It that's not specified,
        defaults to the name of the screen.
    `_widget_properties`
        A map from the id of a widget to a property name -> property
        value map. When a widget with that id is shown by the screen,
        the specified properties are added to it.
    `_transient`
        If true, the screen will be automatically hidden at the end of
        the current interaction.

    Non-keyword arguments, and keyword arguments that do not begin with
    an underscore, are passed to the screen.
    _layerN_tag_widget_properties
_transientF_zorderr   r  _kwargs_args)r   T)rM   r   keep_str%   )r;   r    r!   r"   rn   r  r  rN   rP   r   rb   rM   r}   r5   r@   rk   r_   rl   r^   r8   r   corer  r   )_screen_namer  r4   r  r  r  r  r  r%   r<   r{   r   old_dslsr&   r&   r'   show_screens  s@     



r!  c              
   O   sx  | dd}| dd}| di }| dd}| }tjjrLtjjd| t|tsbt|	 }t
|d }|du rzdS |jsdS |du rt|}i }	|	|	d	< |jr||	d
< ||	d< n
|	| zzHt|dd||	}
t||||
_|
  t||||
j tjj|
 W n> tyJ   tjjrFddl}td|  |  t  Y n0 W |	 d	d n|	 d	d 0 tj  dS )a  
    Predicts the displayables that make up the given screen.

    `_screen_name`
        The name of the  screen to show.
    `_widget_properties`
        A map from the id of a widget to a property name -> property
        value map. When a widget with that id is shown by the screen,
        the specified properties are added to it.

    Keyword arguments not beginning with underscore (_) are used to
    initialize the screen's scope.
    r  Nr  r  r  FzPredict screen %sr   r   r  r  zWhile predicting screen)r;   r8   r9   debug_predictionr   ic_logr   r    r!   r"   rn   r   r  rP   r   rb   r@   r5   	cache_putdisplayabler  	tracebackprint	print_excr   reset)r  r  r4   r  r  r  r  r%   r<   r{   r   r&  r&   r&   r'   predict_screen  sH    




r*  c                 C   s:   |du rt | f}t| |}|dur6tjj|j|d dS )z
    :doc: screens

    The programmatic equivalent of the hide screen statement.

    Hides the screen with `tag` on `layer`.
    N)rR   )r  r}   r8   r  hiderN   )rN   rR   r<   r&   r&   r'   hide_screen  s
    	

r,  c           	   
   O   s   | dd}| di }| }t|ts2t| }t|d }|d u rTtd|f tj}dt_|jr|i }||d< ||d< n|	 }|
| ||d< ||f|d< z |jf i | W | dd  n| dd  0 |t_d S )	Nr   r&   r   r   zScreen %r is not known.Tr  r  )r;   r    r!   r"   rn   r  r   rp   rP   r   r   rH   )	r  r  r4   r   r   r%   r<   rp   r{   r&   r&   r'   
use_screen  s,    


r-  c                   C   s   t S )z
    :doc: screens
    :name: renpy.current_screen

    Returns the ScreenDisplayable corresponding to the screen currently being
    updated, rendered, or processed.

    See :func:`get_screen` for documented fields on ScreenDisplayable.
    )r   r&   r&   r&   r'   current_screenC  s    r.  c                 C   s   t | tr| j} | du r t } n|du r0t| }t| |} t | tsHdS | jdu rZ|   |rn| j	|d}n| j
	|d}|S )z
    :doc: screens
    :name: renpy.get_displayable

    From the `screen` on `layer`, returns the displayable with
    `id`. Returns None if the screen doesn't exist, or there is no
    widget with that id on the screen.
    N)r    rb   ro   r.  r  r}   rc   r   rg   rq   rf   )r<   idrR   baser   r&   r&   r'   get_displayableQ  s    




r1  c                 C   sT   |du rt  }n|du r t|}t||}|du r6i S |j| d}|du rPi }|S )a  
    :doc: screens
    :name: renpy.get_displayable_properties

    Returns the properties for the displayable with `id` in the `screen`
    on `layer`. If `screen` is None, returns the properties for the
    current screen. This can be used from Python or property code inside
    a screen.

    Note that this returns a dictionary containing the widget properties,
    and so to get an individual property, the dictionary must be accessed.
    N)r.  r  r}   r|   rq   )r/  r<   rR   r  r   r&   r&   r'   get_displayable_propertiesw  s    
r2  c                  C   sB   t jjj D ].\} }| du r q|jD ]}t|tr&d|_q&qdS )z
    This is called before Ren'Py restarts to put the screens into restart
    mode, which prevents crashes due to variables being used that are no
    longer defined.
    NT)	r8   r   r   	old_scener   rd   r    rb   r   )r   rR   r   r&   r&   r'   before_restart  s    

r4  c                 C   s   |  }t jjdu r|}nt jjdu r*d}nd}|rVt jjD ]}t|du r:t| q:n"t jjD ]}t|dur^t| q^t jjD ]}t|du rt| qdS )zC
    Called from interact to show or hide the overlay screens.
    NTF)	r8   store_overlay_screensr9   overlay_screensr}   r!  r,  always_shown_screens)suppress_overlayr   r   r&   r&   r'   show_overlay_screens  s     
r:  c                  C   sD   t jjD ]6} t| }|du rqt| t jj| |	  qdS )zi
    Called from interact once per frame to invalidate screens we want to
    update once per frame.
    N)
r8   r9   per_frame_screensr}   r   r   r   r   
invalidater   )r   r  r&   r&   r'   	per_frame  s    
r=  )N)N)N)NF)NN)W
__future__r   r   r   r   r   renpy.compatr   r   r	   r
   r   r   r   r   r   r   r   r   typingr   r8   r   r   r   logr   r#   objectObjectr   r/   r   r   r6   r0   r$  r@   rA   r]   r^   r_   r`   ra   r   r   r   	Containerrb   r   r<   r   r   r   rE   r   rG   r   r   rn   r   rV   rU   r   r   r   r   r   r  r	  r
  r  r}   r  r  r!  r*  r,  r-  r.  r1  
get_widgetr2  get_widget_propertiesr4  r:  r=  r&   r&   r&   r'   <module>   s~   8L
V	   X


C$+
9RG
%
#
! 