1# Copyright 2004-2021 Tom Rothamel <pytom@bishoujo.us>
2#
3# Permission is hereby granted, free of charge, to any person
4# obtaining a copy of this software and associated documentation files
5# (the "Software"), to deal in the Software without restriction,
6# including without limitation the rights to use, copy, modify, merge,
7# publish, distribute, sublicense, and/or sell copies of the Software,
8# and to permit persons to whom the Software is furnished to do so,
9# subject to the following conditions:
10#
11# The above copyright notice and this permission notice shall be
12# included in all copies or substantial portions of the Software.
13#
14# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22# This is the config module, where game configuration settings are stored.
23# This includes both simple settings (like the screen dimensions) and
24# methods that perform standard tasks, like the say and menu methods.
25
26from __future__ import division, absolute_import, with_statement, print_function, unicode_literals
27from renpy.compat import *
28
29import collections
30import os
31import renpy
32
33# Can we add more config variables?
34locked = False
35
36# Contains help for config variables.
37help = [ ] # @ReservedAssignment
38
39# The title of the game window.
40window_title = None
41
42# An image file containing the window icon image.
43window_icon = None
44
45# The same, but only used on MS windows.
46windows_icon = None
47
48# The width and height of the drawable area of the screen.
49screen_width = 800
50screen_height = 600
51
52# Should sound be enabled?
53sound = True
54
55# Turns recoverable errors into fatal ones, so that the user can know
56# about and fix them.
57debug = False
58
59# Ditto, but for sound operations
60debug_sound = None
61
62# Is rollback enabled? (This only controls if the user-invoked
63# rollback command does anything)
64rollback_enabled = True
65
66# If the rollback is longer than this, we may trim it.
67rollback_length = 128
68
69# If set to True, clicking while in rollback will keep the roll forward
70# buffer if the data has not changed.
71keep_rollback_data = False
72
73# If set to true, menus in fixed rollback will not have clickable
74# options and a click anywhere or mouse wheel will roll forward.
75fix_rollback_without_choice = False
76
77# The maximum number of steps the user can rollback the game,
78# interactively.
79hard_rollback_limit = 100
80
81# A list of functions returning lists of displayables that will be
82# added to the end of the display list.
83overlay_functions = [ ]
84
85# A list of Displayables that should always be added to the start
86# of the scene list. (Mostly used for keymaps and the like.)
87underlay = [ ]
88
89# True to enable profiling.
90profile = False
91
92# The directory save files will be saved to.
93savedir = None
94
95# The number of screens worth of images that are allowed to
96# live in the image cache at once.
97image_cache_size = None
98
99# The size of the image cache, in megabytes.
100image_cache_size_mb = 300
101
102# The number of statements we will analyze when doing predictive
103# loading. Please note that this is a total number of statements in a
104# BFS along all paths, rather than the depth along any particular
105# path. The current node is counted in this number.
106predict_statements = 32
107
108# Causes the contents of the image cache to be printed to stdout when
109# it changes.
110debug_image_cache = ("RENPY_DEBUG_IMAGE_CACHE" in os.environ)
111
112# Should we allow skipping at all?
113allow_skipping = True
114
115# Should we allow fast skipping?
116fast_skipping = False
117
118# Are we currently skipping? If so, how fast?
119# May be "slow", "fast", or None.
120skipping = None
121
122# The delay while we are skipping say statements.
123skip_delay = 5
124
125# basic: Archive files that are searched for images.
126archives = [ ]
127
128# Searchpath.
129searchpath = [ ]
130
131# If True, we will only try loading from archives.
132# Only useful for debugging Ren'Py, don't document.
133force_archives = False
134
135# Used to control the software mouse cursor.
136mouse = None
137
138# The default sound playback sample rate.
139sound_sample_rate = 48000
140
141# The amount of time music is faded out between tracks.
142fade_music = 0.0
143
144# Should the at list be sticky?
145sticky_positions = False
146
147# A list of all of the layers that we know about.
148layers = [ 'master', 'transient', 'screens', 'overlay' ]
149
150# A list of layers that should be cleared when we replace
151# transients.
152transient_layers = [ 'transient' ]
153
154# A list of layers that should be cleared when we recompute
155# overlays.
156overlay_layers = [ 'overlay' ]
157
158# A list of layers that should be cleared when we enter a
159# new context.
160context_clear_layers = [ 'screens' ]
161
162# A list of layers that are displayed atop all other layers, and do
163# not participate in transitions.
164top_layers = [ ]
165
166# True if we want to show overlays during wait statements, or
167# false otherwise.
168overlay_during_with = True
169
170# True if we want to allow the fast dissolve.
171enable_fast_dissolve = True
172
173# When using the keyboard to navigate, how much we penalize
174# distance out of the preferred direction.
175focus_crossrange_penalty = 1024
176
177# If True, then we force all loading to occur before transitions
178# start.
179load_before_transition = True
180
181# The keymap that is used to change keypresses and mouse events.
182keymap = { }
183
184# The default keymap, used when a binding isn't found in keymap.
185default_keymap = { }
186
187# Should we try to support joysticks?
188joystick = True
189
190# A list of functions that are called when an interaction is
191# started or restarted.
192interact_callbacks = [ ]
193
194# A list of functions that are called when an interaction is started.
195start_interact_callbacks = [ ]
196
197# A list of functions that are called when a say statement
198# is sustained.
199say_sustain_callbacks = [ ]
200
201# A function that is called to see if say should allow
202# itself to be dismissed.
203say_allow_dismiss = None
204
205# A function that is called to tokenize text.
206text_tokenizer = None
207
208# The number of characters per AFM time period.
209afm_characters = 250
210
211# The number of bonus characters to add to a string for afm.
212afm_bonus = 25
213
214# A function that must return True for afm mode to forward.
215afm_callback = None
216
217# The amount of time we delay before making an automatic
218# choice from a menu. This can be used for making a demo version of a
219# game. It should be set to None in a deployed game.
220auto_choice_delay = None
221
222# A map from font, bold, italic to font, bold, italic. This is used
223# to replace (say) the italic version of a regular font with the regular
224# version of an italic font.
225font_replacement_map = { }
226
227# A callback that is called when a with statement (but not
228# the with clause of a say or menu statement) executes. If not None,
229# it's called with a single argument, the transition supplied to the
230# with clause.
231with_callback = None
232
233# The framerate limit, in frames per second.
234framerate = 100
235
236# The number of frames that Ren'Py has shown.
237frames = 0
238
239# NOT USED: A text editor that is launched at the location of the current
240# statement.
241editor = None # os.environ.get('RENPY_EDITOR', None)
242
243# NOT USED: Text editor, with arguments to reload or clobber the file - used,
244# for example, to display traceback.txt.
245editor_transient = None # os.environ.get('RENPY_EDITOR_TRANSIENT', editor)
246
247# NOT USED: The separator used between files in the text editor.
248editor_file_separator = None # os.environ.get('RENPY_EDITOR_FILE_SEPARATOR', '" "')
249
250# Enable developer mode?
251developer = False # Changed to True or False in the init code.
252
253# The value of developer requested by the creator (True, False, or "auto")
254original_developer = False
255
256# The default value of developer that's used when it's set to auto.
257default_developer = False
258
259# A logfile that logging messages are sent to.
260log = None
261
262# Lint hooks.
263lint_hooks = [ ]
264
265# Hyperlink styler.
266hyperlink_styler = None
267
268# Hyperlink callback.
269hyperlink_callback = None
270
271# Hyperlink focus.
272hyperlink_focus = None
273
274# Should SFonts be recolored? internal.
275recolor_sfonts = True
276
277# Function that is called to layout text.
278text_layout = None
279
280# A callback that is called 20 times a second.
281periodic_callback = None
282periodic_callbacks = [ ]
283
284# Should we check that all style properties are in style_properties? (Internal)
285check_properties = True
286
287# If True, then we implicily do a with None after every interaction.
288implicit_with_none = True
289
290# A map from a layer to (x, y, w, h) tuples that the layer is clipped to.
291layer_clipping = { }
292
293# Should we disable the fullscreen optimization?
294disable_fullscreen_opt = False
295
296# Should we reject midi files?
297reject_midi = True
298
299# Default character callback.
300character_callback = None
301
302# Character callback list.
303all_character_callbacks = [ ]
304
305# The number of autosave slots we have.
306autosave_slots = 10
307
308# How often do we autosave. (Number of interactions, sort of.)
309autosave_frequency = int(os.environ.get("RENPY_AUTOSAVE_FREQUENCY", "200"))
310
311# The callback that is used by the scene statement.
312scene = None
313
314# The callback that is used by the show statement.
315show = None
316
317# The callback that is used by the hide statement.
318hide = None
319
320# Python 2.x only: Should we use cPickle or pickle for load/save?
321use_cpickle = True
322
323# The function to call as the inspector.
324inspector = None
325
326# Should we reject backslashes in filenames?
327reject_backslash = True
328
329# Hide the mouse.
330mouse_hide_time = 30
331
332# Called when we can't load an image.
333missing_image_callback = None
334
335# Called to filter text in the say and menu statements.
336say_menu_text_filter = None
337
338# Used to replace one label with another.
339label_overrides = { }
340
341# Called to get the extra_info for an auto_save.
342auto_save_extra_info = None
343
344# The directory (underneath ~/RenPy, ~/Library/RenPy, or ~/.renpy) where the
345# game-specific data is saved.
346save_directory = None
347
348# These are used to deal with the case where a picture is missing.
349missing_scene = None
350missing_show = None
351missing_hide = None
352
353# This is called when control is transferred to a label.
354label_callback = None
355
356# A function that is called when the window needs to be shown.
357empty_window = None
358
359# A list of functions that are called when the window is shown.
360window_overlay_functions = [ ]
361
362# Do we support right-to-left languages?
363rtl = False
364
365# A callback for file opening.
366file_open_callback = None
367
368# The size of screenshot thumbnails. (Redefined in common/)
369thumbnail_width = 256
370thumbnail_height = 144
371
372# The end game transition.
373end_game_transition = None
374
375# The default transform.
376default_transform = None
377
378# Should we use the child position?
379transform_uses_child_position = True
380
381# The action to use when it's time to quit.
382quit_action = None
383
384# If not None, a rectangle giving the area of the screen to crop the
385# screenshots to.
386screenshot_crop = None
387
388# Various directories.
389gamedir = None
390basedir = None
391renpy_base = None
392commondir = None
393logdir = None # Where log and error files go.
394
395# Should we enable OpenGL mode?
396gl_enable = True
397
398# A list of callbacks that are called by renpy.mode.
399mode_callbacks = [ ]
400
401# Should MoveTransition take offsets into account?
402movetransition_respects_offsets = True
403
404# Do we care about the pos and anchor attributes of an ImageReference's
405# style?
406imagereference_respects_position = False
407
408# Do we want to try to pretend to be android?
409simulate_android = False
410
411# Do we want to enable imagemap caching?
412imagemap_cache = True
413
414# Callbacks that are called in order to predict images.
415predict_callbacks = [ ]
416
417# Callbacks that are called on expensive idle_frame one per tick
418# to predict screens or other hard stuff.
419expensive_predict_callbacks = [ ]
420
421# Should screens be predicted?
422predict_screens = True
423
424# Should we use the new choice screen format?
425choice_screen_chosen = True
426
427# Should the narrator speak menu labels?
428narrator_menu = False
429
430# A list of screen variants to use.
431variants = [ None ]
432
433# A function from (auto_parameter, variant) -> displayable.
434imagemap_auto_function = None
435
436# Should we keep the running transform when we merely change the image?
437keep_running_transform = True
438
439# Should we use image attributes?
440image_attributes = True
441
442# Should we use the new version of the character image argument?
443new_character_image_argument = True
444
445# A transition that is performed when a say statement has an image attribute
446# corresponding to a shown image.
447say_attribute_transition = None
448
449# The layer the say_attribute_transition runs on.
450say_attribute_transition_layer = None
451
452# What is the name and version of this game?
453name = ""
454version = ""
455
456# Should we log?
457log_enable = True
458
459# Should we log text overflows?
460debug_text_overflow = False
461
462# Should underfull grids raise an exception?
463allow_underfull_grids = False
464
465# Should we save the window size in the preferences?
466save_physical_size = True
467
468# Do we use new text substitutions?
469new_substitutions = True
470
471# Do we use old text substitutions?
472old_substitutions = True
473
474# The graphics renderer we use. (Ren'Py sets this.)
475renderer = "auto"
476
477# The translator to use, if any. (Not used anymore.)
478translator = None
479
480# Should we use the old, broken line spacing code?
481broken_line_spacing = False
482
483# A list of callbacks that are called after each non-init-phase python
484# block.
485python_callbacks = [ ]
486
487# If true, we dump information about a save upon save.
488save_dump = False
489
490# Can we resize a gl window?
491gl_resize = True
492
493# Called when we change the translation.
494change_language_callbacks = [ ]
495
496# The translation directory.
497tl_directory = "tl"
498
499# Key repeat timings. A tuple giving the initial delay and the delay between
500# repeats, in seconds.
501key_repeat = (.3, .03)
502
503# A callback that is called with the character's voice_tag.
504voice_tag_callback = None
505
506# A list of callbacks that can be used to add JSON to save files.
507save_json_callbacks = [ ]
508
509# The duration of a longpress, in seconds.
510longpress_duration = .5
511
512# The radius the longpress has to remain within, in pixels.
513longpress_radius = 15
514
515# How long we vibrate the device upon a longpress.
516longpress_vibrate = .1
517
518# A list of callbacks that are called before each statement, with the name
519# of the statement.
520statement_callbacks = [ ]
521
522# A list of file extensions that are blacklisted by autoreload.
523autoreload_blacklist = [ ".rpyc", ".rpymc", ".rpyb", ".pyc", ".pyo" ]
524
525# A list of python modules that should be reloaded when appropriate.
526reload_modules = [ ]
527
528# The layer dialogue is shown on.
529say_layer = "screens"
530
531# The layer the choice screen is shown on.
532choice_layer = "screens"
533
534# If true, we will not use the .report_traceback method to produced
535# prettier tracebacks.
536raw_tracebacks = ("RENPY_RAW_TRACEBACKS" in os.environ)
537
538# A function to process texts which should be spoken
539tts_function = None
540
541# Channels that stop voice playback.
542tts_voice_channels = [ "voice" ]
543
544# The number of copies of each screen to keep in the screen cache.
545screen_cache_size = 4
546
547# A callback that adjusts the physical size of the screen.
548adjust_view_size = None
549
550# True if we should autosave when a choice occurs.
551autosave_on_choice = True
552
553# True if we should autosave when the player has input something.
554autosave_on_input = True
555
556# A list of channels we should emphasize the audio on.
557emphasize_audio_channels = [ 'voice' ]
558
559# What we should lower the volume of non-emphasized channels to.
560emphasize_audio_volume = 0.5
561
562# How long we should take to raise and lower the volume when emphasizing
563# audio.
564emphasize_audio_time = 0.5
565
566# Should we transition screens, or always use their new states.
567transition_screens = True
568
569# A function that given the current statement identifier, returns a list
570# of statement identifiers that should be predicted.
571predict_statements_callback = None
572
573# Should we use hardware video on platforms that support it?
574hw_video = False
575
576# A function to use to dispatch gestures.
577dispatch_gesture = None
578
579# The table mapping gestures to events used by the default function.
580gestures = {
581    "n_s_w_e_w_e" : "progress_screen",
582    }
583
584# Sizes of gesture components and strokes, as a fraction of screen_width.
585gesture_component_size = .05
586gesture_stroke_size = .2
587
588# Should we log to stdout rather than files?
589log_to_stdout = bool(int(os.environ.get("RENPY_LOG_TO_STDOUT", "0")))
590
591# new-style custom text tags.
592custom_text_tags = { }
593
594# Same, but for ones that are empty.
595self_closing_custom_text_tags = { }
596
597# A function that given the text from a TEXT token, returns a replacement text.
598replace_text = None
599
600# A function that is called when a label is missing.
601missing_label_callback = None
602
603# Should show preserve zorder when not explicitly set?
604preserve_zorder = True
605
606# The set of names to ignore.
607lint_ignore_replaces = [ 'help', 'quit', "_confirm_quit" ]
608
609# How long should the presplash be kept up for?
610minimum_presplash_time = 0.0
611
612# Should Ren'Py use nearest-neighbor filtering by default.
613nearest_neighbor = False
614
615# Should Ren'Py use the drawable resolution at all? (For RTT, Text, etc?)
616use_drawable_resolution = bool(int(os.environ.get("RENPY_USE_DRAWABLE_RESOLUTION", "1")))
617
618# Should text layout occur at drawable resolution?
619drawable_resolution_text = bool(int(os.environ.get("RENPY_DRAWABLE_RESOLUTION_TEXT", "1")))
620
621# Should we fill the virtual-resolution text box?
622draw_virtual_text_box = bool(int(os.environ.get("RENPY_DRAW_VIRTUAL_TEXT_BOX", "0")))
623
624# Bindings of gamepad buttons.
625pad_bindings = { }
626
627# A list of pygame events that should be enabled in addition to the standard
628# events.
629pygame_events = [ ]
630
631# A function that is used to map a gamepad event into a list of Ren'Py
632# events.
633map_pad_event = None
634
635# This is called when a replay finishes.
636after_replay_callback = None
637
638# Should Ren'Py wrap shown transforms in an ImageReference?
639wrap_shown_transforms = True
640
641# A list of prefixes Ren'Py will search for assets.
642search_prefixes = [ "", "images/" ]
643
644# Should Ren'Py clear the database of code lines?
645clear_lines = True
646
647# Special namespaces for define and default.
648special_namespaces = { }
649
650# Should Ren'Py log lines?
651line_log = False
652
653# Should Ren'Py process dynamic images?
654dynamic_images = True
655
656# Should Ren'Py save when the mobile app may terminate?
657save_on_mobile_background = True
658
659# Should Ren'Py quit on mobile background?
660quit_on_mobile_background = False
661
662# Should Ren'Py pass the raw joystick (not controller) events.?
663pass_joystick_events = False
664
665# A list of screens that should be shown when the overlay is enabled.
666overlay_screens = [ ]
667
668# A map from tag to the default layer that tag should be displayed on.
669tag_layer = { }
670
671# The default layer for tags not in in tag_layer.
672default_tag_layer = 'master'
673
674# A map from tag to the default transform that's used for that tag.
675tag_transform = { }
676
677# A map from the tag to the default zorder that's used for that tag.
678tag_zorder = { }
679
680# The width of lines logged with renpy.log.
681log_width = 78
682
683# The size of the rollback side, as a fraction of the screen.
684rollback_side_size = .2
685
686# If dpi_scale is less than this, make it 1.0.
687de_minimus_dpi_scale = 1.0
688
689# Not used.
690windows_dpi_scale_head = 1.0
691
692# Should rollback_side be enabled?
693enable_rollback_side = True
694
695# The default contents of the replay scope.
696replay_scope = { "_game_menu_screen" : "preferences" }
697
698# The mixer to use for auto-defined movie channels.
699movie_mixer = "music"
700
701# Auto audio channels. A map from base name to:
702# * mixer
703# * file prefix
704# * file suffix
705auto_channels = { "audio" : ("sfx", "", "") }
706
707# The channel used by renpy.play.
708play_channel = "audio"
709
710# An image attribute that is added when the character is speaking, and
711# removed when the character is not.
712speaking_attribute = None
713
714# How many elements need to be in a list before we compress it for rollback.
715list_compression_length = 25
716
717# How many elements of history are kept. None to disable history.
718history_length = None
719
720# History callbacks that annotate additional information onto the History
721# object.
722history_callbacks = [ ]
723
724# Should we use the new order for translate blocks?
725new_translate_order = True
726
727# Should we defer style execution until translate block time?
728defer_styles = False
729
730# A list of stores that should be cleaned on translate.
731translate_clean_stores = [ ]
732
733# A list of additional script files that should be translated.
734translate_files = [ ]
735
736# A list of files for which ##<space> comment sequences should also be
737# translated.
738translate_comments = [ ]
739
740# Should we trying detect user locale on first launch?
741enable_language_autodetect = False
742
743# A function from (locale, region) -> existing language.
744locale_to_language_function = None
745
746# Should we pass the full argument list to the say screen?
747old_say_args = False
748
749# The text-to-speech voice.
750tts_voice = None
751
752# The maximum size of xfit, yfit, first_fit, etc.
753max_fit_size = 8192
754
755# Should the window max size be enforced?
756enforce_window_max_size = True
757
758# The max priority to translate to.
759translate_launcher = False
760
761# A map from language to a list of callbacks that are used to help set it
762# up.
763language_callbacks = collections.defaultdict(list)
764
765# A function that is called to init system styles.
766init_system_styles = None
767
768# Callbacks that are called just before rebuilding styles.
769build_styles_callbacks = [ ]
770
771# Should movie displayables be given their own channels?
772auto_movie_channel = True
773
774# Should we ignore duplicate labels?
775ignore_duplicate_labels = False
776
777# A list of callbacks when creating a line log entry.
778line_log_callbacks = [ ]
779
780# A list of screens for which screen profiling should be enabled.
781profile_screens = [ ]
782
783# Should Ren'Py search for system fonts.
784allow_sysfonts = False
785
786# Should Ren'Py tightly loop during fadeouts? (That is, not stop the fadeout
787# if it reaches the end of a trac.)
788tight_loop_default = True
789
790# Should Ren'Py apply style_prefix to viewport scrollbar styles?
791prefix_viewport_scrollbar_styles = True
792
793# These functions are called to determine if Ren'Py needs to redraw the screen.
794needs_redraw_callbacks = [ ]
795
796# Should a hyperlink inherit the size of the text its in?
797hyperlink_inherit_size = True
798
799# A list of callbacks that are called when a line is printed to stdout or
800# stderr.
801stdout_callbacks = [ ]
802stderr_callbacks = [ ]
803
804# Should ATL automatically cause polar motion when angle changes.
805automatic_polar_motion = True
806
807# Functions that are called to generate lint stats.
808lint_stats_callbacks = [ ]
809
810# Should we apply position properties to the side of a viewport?
811position_viewport_side = True
812
813# Things that be given properties via Character.
814character_id_prefixes = [ ]
815
816# Should {nw} wait for voice.
817nw_voice = True
818
819# If not None, a function that's used to process say arguments.
820say_arguments_callback = None
821
822# Should we show an atl interpolation for one frame?
823atl_one_frame = True
824
825# Should we keep the show layer state?
826keep_show_layer_state = True
827
828# A list of callbacks that are called when fast skipping happens.
829fast_skipping_callbacks = [ ]
830
831# Should the audio periodic callback run in its own thread.
832audio_periodic_thread = True
833if renpy.emscripten:
834    audio_periodic_thread = False
835
836# A list of fonts to preload on Ren'Py startup.
837preload_fonts = [ ]
838
839# Should Ren'Py process multiple ATL events in a single update?
840atl_multiple_events = True
841
842# A callback that's called when checking to see if a file is loadable.
843loadable_callback = None
844
845# How many frames should be drawn fast each time the screen needs to be
846# updated?
847fast_redraw_frames = 4
848
849# The color passed to glClearColor when clearing the screen.
850gl_clear_color = "#000"
851
852# Screens that are updated once per frame rather than once per interaction.
853per_frame_screens = [ ]
854
855# How long we store performance data for.
856performance_window = 5.0
857
858# How long does a frame have to take (to the event) to trigger profiling.
859profile_time = 1.0 / 50.0
860
861# What event do we check to see if the profile needs to be printed?
862profile_to_event = "flip"
863
864# Should we instantly zap transient displayables, or properly hide them?
865fast_unhandled_event = True
866
867# Should a fast path be used when displaying empty windows.
868fast_empty_window = True
869
870# Should all nodes participate in rollback?
871all_nodes_rollback = False
872
873# Should Ren'Py manage GC itself?
874manage_gc = True
875
876# Default thresholds that apply to garbage collection.
877gc_thresholds = (25000, 10, 10)
878
879# The threshold for a level 0 gc when we have the time.
880idle_gc_count = 2500
881
882# Should we print unreachable.
883gc_print_unreachable = "RENPY_GC_PRINT_UNREACHABLE" in os.environ
884
885# The first frame that we consider to be "idle", so we can do gc and
886# prediction.
887idle_frame = 4
888
889# Does taking the transform state go through image reference targets?
890take_state_from_target = False
891
892# Does ui.viewport set the child_size if not set?
893scrollbar_child_size = True
894
895# Should surfaces be cached?
896cache_surfaces = False
897
898# Should we optimize textures by taking the bounding rect?
899optimize_texture_bounds = True
900
901# Should we predict everything in a ConditionSwitch?
902conditionswitch_predict_all = False
903
904# Transform events to deliver each time one happens.
905repeat_transform_events = [ "show", "replace", "update" ]
906
907# How many statements should we warp through?
908warp_limit = 1000
909
910# Should dissolve statments force the use of alpha.
911dissolve_force_alpha = True
912
913# A map from a displayable prefix to a function that returns a displayable
914# corresponding to the argument.
915displayable_prefix = { }
916
917# Should we re-play a movie when it's shown again.
918replay_movie_sprites = True
919
920# A callback that is called when entering a new context.
921context_callback = None
922
923# Should we reject . and .. in filenames?
924reject_relative = True
925
926# The prefix to use on the side image.
927side_image_prefix_tag = 'side'
928
929# Do the say attributes of a hidden side image use the side image tag?
930say_attributes_use_side_image = True
931
932# Does the menu statement show a window by itself, when there is no caption?
933menu_showed_window = False
934
935# Should the menu statement produce actions instead of values?
936menu_actions = True
937
938# Should disabled menu items be included?
939menu_include_disabled = False
940
941# Should we report extraneous attributes?
942report_extraneous_attributes = True
943
944# Should we play non-loooped music when skipping?
945skip_sounds = False
946
947# Should we lint screens without parameters?
948lint_screens_without_parameters = True
949
950# If not None, a function that's used to process and modify menu arguments.
951menu_arguments_callback = None
952
953# Should Ren'PY automatically clear the screenshot?
954auto_clear_screenshot = True
955
956# Should Ren'Py allow duplicate labels.
957allow_duplicate_labels = False
958
959# A map of font transform name to font transform function.
960font_transforms = { }
961
962# A scaling factor that is applied to a truetype font.
963ftfont_scale = { }
964
965# This is used to scale the ascent and descent of a font.
966ftfont_vertical_extent_scale = { }
967
968# The default shader.
969default_shader = "renpy.geometry"
970
971
972def say_attribute_transition_callback(*args):
973    """
974    :args: (tag, attrs, mode)
975
976    Returns the say attribute transition to use, and the layer the transition
977    should be applied to (with None being a valid layer.
978
979    Attrs is the list of tags/attributes of the incoming image.
980
981    Mode is one of "permanent", "temporary", or "restore".
982    """
983
984    return renpy.config.say_attribute_transition, renpy.config.say_attribute_transition_layer
985
986
987# Should say_attribute_transition_callback take attrs?
988say_attribute_transition_callback_attrs = True
989
990# The function used by renpy.notify
991notify = None
992
993# Should Ren'Py support a SL2 keyword after a Python statement?
994keyword_after_python = False
995
996# A label Ren'Py should jump to if a load fails.
997load_failed_label = None
998
999# If true, Ren'Py distributes mono to both stereo channels. If false,
1000# it splits it 50/50.
1001equal_mono = True
1002
1003# If True, renpy.input will always return the default.
1004disable_input = False
1005
1006# If True, the order of substrings in the Side positions will
1007# also determine the order of their render.
1008keep_side_render_order = True
1009
1010# Should this game enable and require gl2?
1011gl2 = True
1012
1013# Does this game use the depth buffer? If so, how many bits of depth should
1014# it use?
1015depth_size = 24
1016
1017# A list of screens to remove when the context is copied.
1018context_copy_remove_screens = [ "notify" ]
1019
1020# An exception handling callback.
1021exception_handler = None
1022
1023# A label that is jumped to if return fails.
1024return_not_found_label = None
1025
1026# A list of (regex, autoreload function) tuples.
1027autoreload_functions = [ ]
1028
1029# A list of voice mixers (that should not be dropped when self voicing is
1030# enabled).
1031voice_mixers = [ "voice" ]
1032
1033# Should the text alignment pattern be drawn?
1034debug_text_alignment = False
1035
1036# Init blocks taking longer than this amount of time to run are
1037# reported to log.txt.
1038profile_init = 0.25
1039
1040# Should live2d interpolate movements?
1041live2d_interpolate = False
1042
1043# A list of text tags with contents that should be filtered by the TTS system.
1044tts_filter_tags = [ "noalt", "rt", "art" ]
1045
1046# A function that merges uniforms together. This is a map from uniform name
1047# to a function that takes the two values and merges them.
1048merge_uniforms = { }
1049
1050# Does the side image required an attribute to be defined?
1051side_image_requires_attributes = True
1052
1053# What is the max mipmap level?
1054max_mipmap_level = 1000
1055
1056# Should we show the touch keyboard outside of emscripten/touch.
1057touch_keyboard = os.environ.get("RENPY_TOUCH_KEYBOARD", False)
1058
1059# The size of the framebuffer Ren'Py creates, which doubles as the
1060# largest texture size.
1061fbo_size = (4096, 4096)
1062
1063# Names to ignore the redefinition of.
1064lint_ignore_redefine = [ "gui.about" ]
1065
1066# A list of functions that are called when Ren'Py terminates.
1067quit_callbacks = [ ]
1068
1069# The steam_appid, if known. This needs to be set here since it is loaded
1070# very early.
1071steam_appid = None
1072
1073# How long between when the controller is pressed and the first repeat?
1074controller_first_repeat = .25
1075
1076# How long between repeats?
1077controller_repeat = .05
1078
1079# The states that repeat.
1080controller_repeat_states = { "pos", "neg", "press" }
1081
1082# If True, the side image will only be shown if an image with the same tag
1083# is not shown.
1084side_image_only_not_showing = False
1085
1086# How much should the texture bounds be expanded by? This allows the mipmaps
1087# to properly include
1088expand_texture_bounds = 8
1089
1090# Should time events be modal?
1091modal_timeevent = False
1092
1093# This exists for debugging Ren'Py.
1094gl_set_attributes = None
1095
1096# The blacklist of controllers with known problems.
1097controller_blocklist = [
1098    "030000007e0500000920", # Nintendo Pro Controller (needs init to work.)
1099]
1100
1101# Should dissolve transitions be mipmapped by default?
1102mipmap_dissolves = False
1103
1104# Should movies be mipmapped by default?
1105mipmap_movies = False
1106
1107# Should text be mipmapped by default?
1108mipmap_text = False
1109
1110# Should the screensaver be allowed?
1111allow_screensaver = True
1112
1113# The amount of time to spend fading in and out music when the context changes.
1114context_fadein_music = 0
1115context_fadeout_music = 0
1116
1117# Shout it be possible to dismiss blocking transitions that are not part of
1118# a with statement?
1119dismiss_blocking_transitions = True
1120
1121# Should GL extensions be logged to log.txt
1122log_gl_extensions = False
1123
1124# Should GL shaders be logged to log.txt
1125log_gl_shaders = False
1126
1127# OpenGL Blend Funcs
1128gl_blend_func = { }
1129
1130# Should we pause immediately after a rollback?
1131pause_after_rollback = False
1132
1133# The default perspective.
1134perspective = (100.0, 1000.0, 100000.0)
1135
1136# Does the scene clear the layer at list?
1137scene_clears_layer_at_list = True
1138
1139# The mouse displayable, if any. Can be a displayable, or a callable that
1140# return a displayable.
1141mouse_displayable = None
1142
1143# The default bias for the GL level of detail.
1144gl_lod_bias = -.5
1145
1146# A dictionary from a tag (or None) to a function that adjusts the attributes
1147# of that tag.
1148adjust_attributes = { }
1149
1150# The compatibility mode for who/what substitutions.
1151# 0: ver < 7.4
1152# 1: 7.4 <= ver <= 7.4.4
1153# 2: ver >= 7.4.5
1154who_what_sub_compat = 2
1155
1156# Compat for {,x,y}minimum when applied to side.
1157compat_viewport_minimum = False
1158
1159# Should webaudio be used on the web platform?
1160webaudio = True
1161
1162# If not None, a callback that can be used to alter audio filenames.
1163audio_filename_callback = None
1164
1165# Should minimums be adjusted when x/yminimum and x/ymaximum are both floats?
1166adjust_minimums = True
1167
1168# Should ATL start on show?
1169atl_start_on_show = True
1170
1171# Should the default input caret blink ?
1172input_caret_blink = 1.
1173
1174# The channel movies with play defined play on.
1175single_movie_channel = None
1176
1177# Should Ren'Py raise exceptions when finding an image?
1178raise_image_exceptions = True
1179
1180# Should the size transform property only accept numbers of pixels ?
1181relative_transform_size = True
1182
1183# Should tts of layers be from front to back?
1184tts_front_to_back = True
1185
1186# Should live2d loading be logged to log.txt
1187log_live2d_loading = False
1188
1189# Should Ren'Py debug prediction?
1190debug_prediction = False
1191
1192# Should mouse events that cause a window to gain focus be passed through.
1193mouse_focus_clickthrough = False
1194
1195# Should the current displayable always run its unfocus handler, even when
1196# focus is taken away by default.
1197always_unfocus = True
1198
1199del os
1200del collections
1201
1202
1203def init():
1204    import renpy.display
1205
1206    global scene
1207    scene = renpy.exports.scene
1208
1209    global show
1210    show = renpy.exports.show
1211
1212    global hide
1213    hide = renpy.exports.hide
1214
1215    global tts_function
1216    tts_function = renpy.display.tts.default_tts_function
1217
1218    global notify
1219    notify = renpy.exports.display_notify
1220
1221    global autoreload_functions
1222    autoreload_functions = [
1223        (r'\.(png|jpg|jpeg|webp|gif|tif|tiff|bmp)$', renpy.exports.flush_cache_file),
1224        (r'\.(mp2|mp3|ogg|opus|wav)$', renpy.audio.audio.autoreload),
1225        ]
1226
1227    from renpy.uguu import GL_FUNC_ADD, GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ZERO, GL_DST_COLOR, GL_MIN, GL_MAX
1228
1229    gl_blend_func["normal"] = (GL_FUNC_ADD, GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_FUNC_ADD, GL_ONE, GL_ONE_MINUS_SRC_ALPHA)
1230    gl_blend_func["add"] = (GL_FUNC_ADD, GL_ONE, GL_ONE, GL_FUNC_ADD, GL_ZERO, GL_ONE)
1231    gl_blend_func["multiply"] = (GL_FUNC_ADD, GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA, GL_FUNC_ADD, GL_ZERO, GL_ONE)
1232    gl_blend_func["min"] = (GL_MIN, GL_ONE, GL_ONE, GL_MIN, GL_ONE, GL_ONE)
1233    gl_blend_func["max"] = (GL_MAX, GL_ONE, GL_ONE, GL_MAX, GL_ONE, GL_ONE)
1234