/renpy/config.py

https://github.com/renoa/renpy · Python · 509 lines · 157 code · 146 blank · 206 comment · 0 complexity · 08e12844ceb8f268fb45694c2ea40736 MD5 · raw file

  1. # Copyright 2004-2014 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. # This is the config module, where game configuration settings are stored.
  22. # This includes both simple settings (like the screen dimensions) and
  23. # methods that perform standard tasks, like the say and menu methods.
  24. # This will be deleted by the end of this file.
  25. import renpy.display #@UnusedImport
  26. import os
  27. # Can we add more config variables?
  28. locked = False
  29. # Contains help for config variables.
  30. help = [ ] #@ReservedAssignment
  31. # The title of the game window.
  32. window_title = "A Ren'Py Game"
  33. # An image file containing the window icon image.
  34. window_icon = None
  35. # The same, but only used on MS windows.
  36. windows_icon = None
  37. # The width and height of the drawable area of the screen.
  38. screen_width = 800
  39. screen_height = 600
  40. # Should sound be enabled?
  41. sound = True
  42. # Turns recoverable errors into fatal ones, so that the user can know
  43. # about and fix them.
  44. debug = False
  45. # Ditto, but for sound operations
  46. debug_sound = None
  47. # Is rollback enabled? (This only controls if the user-invoked
  48. # rollback command does anything)
  49. rollback_enabled = True
  50. # If the rollback is longer than this, we may trim it.
  51. rollback_length = 128
  52. # If set to True, clicking while in rollback will keep the roll forward
  53. # buffer if the data has not changed.
  54. keep_rollback_data = False
  55. # If set to true, menus in fixed rollback will not have clickable
  56. # options and a click anywhere or mouse wheel will roll forward.
  57. fix_rollback_without_choice = False
  58. # The maximum number of steps the user can rollback the game,
  59. # interactively.
  60. hard_rollback_limit = 100
  61. # A list of functions returning lists of displayables that will be
  62. # added to the end of the display list.
  63. overlay_functions = [ ]
  64. # A list of Displayables that should always be added to the start
  65. # of the scene list. (Mostly used for keymaps and the like.)
  66. underlay = [ ]
  67. # True to enable profiling.
  68. profile = False
  69. # The directory save files will be saved to.
  70. savedir = None
  71. # The number of screens worth of images that are allowed to
  72. # live in the image cache at once.
  73. image_cache_size = 8
  74. # The number of statements we will analyze when doing predictive
  75. # loading. Please note that this is a total number of statements in a
  76. # BFS along all paths, rather than the depth along any particular
  77. # path. The current node is counted in this number.
  78. predict_statements = 16
  79. # Causes the contents of the image cache to be printed to stdout when
  80. # it changes.
  81. debug_image_cache = False
  82. # Should we allow skipping at all?
  83. allow_skipping = True
  84. # Should we allow fast skipping?
  85. fast_skipping = False
  86. # Are we currently skipping? If so, how fast?
  87. # May be "slow", "fast", or None.
  88. skipping = None
  89. # The delay while we are skipping say statements.
  90. skip_delay = 25
  91. # basic: Archive files that are searched for images.
  92. archives = [ ]
  93. # Searchpath.
  94. searchpath = [ ]
  95. # If True, we will only try loading from archives.
  96. # Only useful for debugging Ren'Py, don't document.
  97. force_archives = False
  98. # Used to control the software mouse cursor.
  99. mouse = None
  100. # The default sound playback sample rate.
  101. sound_sample_rate = 44100
  102. # The amount of time music is faded out between tracks.
  103. fade_music = 0.0
  104. # Should the at list be sticky?
  105. sticky_positions = False
  106. # A list of all of the layers that we know about.
  107. layers = [ 'master', 'transient', 'screens', 'overlay' ]
  108. # A list of layers that should be cleared when we replace
  109. # transients.
  110. transient_layers = [ 'transient' ]
  111. # A list of layers that should be cleared when we recompute
  112. # overlays.
  113. overlay_layers = [ 'overlay' ]
  114. # A list of layers that should be cleared whe we enter a
  115. # new context.
  116. context_clear_layers = [ 'screens' ]
  117. # A list of layers that are displayed atop all other layers, and do
  118. # not participate in transitions.
  119. top_layers = [ ]
  120. # True if we want to show overlays during wait statements, or
  121. # false otherwise.
  122. overlay_during_with = True
  123. # True if we want to allow the fast dissolve.
  124. enable_fast_dissolve = True
  125. # When using the keyboard to navigate, how much we penalize
  126. # distance out of the preferred direction.
  127. focus_crossrange_penalty = 1024
  128. # If True, then we force all loading to occur before transitions
  129. # start.
  130. load_before_transition = True
  131. # The keymap that is used to change keypresses and mouse events.
  132. keymap = { }
  133. # Should we try to support joysticks?
  134. joystick = True
  135. # A list of functions that are called when an interaction is
  136. # started or restarted.
  137. interact_callbacks = [ ]
  138. # A list of functions that are called when an interaction is started.
  139. start_interact_callbacks = [ ]
  140. # A list of functions that are called when a say statement
  141. # is sustained.
  142. say_sustain_callbacks = [ ]
  143. # A function that is called to see if say should allow
  144. # itself to be dismissed.
  145. say_allow_dismiss = None
  146. # A function that is called to tokenize text.
  147. text_tokenizer = None
  148. # The number of characters per AFM time period.
  149. afm_characters = 250
  150. # The number of bonus characters to add to a string for afm.
  151. afm_bonus = 25
  152. # A function that must return True for afm mode to forward.
  153. afm_callback = None
  154. # The amount of time we delay before making an automatic
  155. # choice from a menu. This can be used for making a demo version of a
  156. # game. It should be set to None in a deployed game.
  157. auto_choice_delay = None
  158. # A map from font, bold, italic to font, bold, italic. This is used
  159. # to replace (say) the italic version of a regular font with the regular
  160. # version of an italic font.
  161. font_replacement_map = { }
  162. # A callback that is called when a with statement (but not
  163. # the with clause of a say or menu statement) executes. If not None,
  164. # it's called with a single argument, the transition supplied to the
  165. # with clause.
  166. with_callback = None
  167. # The framerate limit, in frames per second.
  168. framerate = 100
  169. # The number of frames that Ren'Py has shown.
  170. frames = 0
  171. # NOT USED: A text editor that is launched at the location of the current
  172. # statement.
  173. editor = None # os.environ.get('RENPY_EDITOR', None)
  174. # NOT USED: Text editor, with arguments to reload or clobber the file - used,
  175. # for example, to display traceback.txt.
  176. editor_transient = None # os.environ.get('RENPY_EDITOR_TRANSIENT', editor)
  177. # NOT USED: The separator used between files in the text editor.
  178. editor_file_separator = None # os.environ.get('RENPY_EDITOR_FILE_SEPARATOR', '" "')
  179. # Enable developer mode?
  180. developer = False
  181. # A logfile that logging messages are sent to.
  182. log = None
  183. # Lint hooks.
  184. lint_hooks = [ ]
  185. # Hyperlink styler.
  186. hyperlink_styler = None
  187. # Hyperlink callback.
  188. hyperlink_callback = None
  189. # Hyperlink focus.
  190. hyperlink_focus = None
  191. # Should SFonts be recolored? internal.
  192. recolor_sfonts = True
  193. # Function that is called to layout text.
  194. text_layout = None
  195. # A callback that is called 20 times a second.
  196. periodic_callback = None
  197. # Should we check that all style properties are in style_properties? (Internal)
  198. check_properties = True
  199. # If True, then we implicily do a with None after every interaction.
  200. implicit_with_none = True
  201. # A map from a layer to (x, y, w, h) tuples that the layer is clipped to.
  202. layer_clipping = { }
  203. # Should we disable the fullscreen optimization?
  204. disable_fullscreen_opt = False
  205. # Should we reject midi files?
  206. reject_midi = True
  207. # Default character callback.
  208. character_callback = None
  209. # Character callback list.
  210. all_character_callbacks = [ ]
  211. # The number of autosave slots we have.
  212. autosave_slots = 10
  213. # How often do we autosave. (Number of interactions, sort of.)
  214. autosave_frequency = int(os.environ.get("RENPY_AUTOSAVE_FREQUENCY", "200"))
  215. # The callback that is used by the scene statement.
  216. scene = renpy.exports.scene
  217. # The callback that is used by the show statement.
  218. show = renpy.exports.show
  219. # The callback that is used by the hide statement.
  220. hide = renpy.exports.hide
  221. # Should we use cPickle or pickle for load/save?
  222. use_cpickle = True
  223. # The function to call as the inspector.
  224. inspector = None
  225. # Should we reject backslashes in filenames?
  226. reject_backslash = True
  227. # Hide the mouse.
  228. mouse_hide_time = 30
  229. # Called when we can't load an image.
  230. missing_image_callback = None
  231. # Called to filter text in the say and menu statements.
  232. say_menu_text_filter = None
  233. # Used to replace one label with another.
  234. label_overrides = { }
  235. # Called to get the extra_info for an auto_save.
  236. auto_save_extra_info = None
  237. # The directory (underneath ~/RenPy, ~/Library/RenPy, or ~/.renpy) where the
  238. # game-specific data is saved.
  239. save_directory = None
  240. # These are used to deal with the case where a picture is missing.
  241. missing_scene = None
  242. missing_show = None
  243. missing_hide = None
  244. # This is called when control is transferred to a label.
  245. label_callback = None
  246. # A function that is called when the window needs to be shown.
  247. empty_window = None
  248. # A list of functions that are called when the window is shown.
  249. window_overlay_functions = [ ]
  250. # Do we support right-to-left languages?
  251. rtl = False
  252. # A callback for file opening.
  253. file_open_callback = None
  254. # The size of screenshot thumbnails. (Redefined in common/)
  255. thumbnail_width = None
  256. thumbnail_height = None
  257. # The end game transition.
  258. end_game_transition = None
  259. # The default transform.
  260. default_transform = None
  261. # Should we use the child position?
  262. transform_uses_child_position = True
  263. # The action to use when it's time to quit.
  264. quit_action = None
  265. # If not None, a rectangle giving the area of the screen to crop the
  266. # screenshots to.
  267. screenshot_crop = None
  268. # Various directories.
  269. gamedir = None
  270. basedir = None
  271. renpy_base = None
  272. commondir = None
  273. logdir = None # Where log and error files go.
  274. # Should we enable OpenGL mode?
  275. gl_enable = True
  276. # A list of callbacks that are called by renpy.mode.
  277. mode_callbacks = [ ]
  278. # Should MoveTransition take offsets into account?
  279. movetransition_respects_offsets = True
  280. # Do we care about the pos and anchor attributes of an ImageReference's
  281. # style?
  282. imagereference_respects_position = False
  283. # Do we want to try to pretend to be android?
  284. simulate_android = False
  285. # Do we want to enable imagemap caching?
  286. imagemap_cache = True
  287. # Callbacks that are called in order to predict images.
  288. predict_callbacks = [ ]
  289. # Should screens be predicted?
  290. predict_screens = True
  291. # Should we use the new choice screen format?
  292. choice_screen_chosen = True
  293. # Should the narrator speak menu labels?
  294. narrator_menu = False
  295. # A list of screen variants to use.
  296. variants = [ None ]
  297. # A function from (auto_parameter, variant) -> displayable.
  298. imagemap_auto_function = None
  299. # Should we keep the running transform when we merely change the image?
  300. keep_running_transform = True
  301. # Should we use image attributes?
  302. image_attributes = True
  303. # Should we use the new version of the character image argument?
  304. new_character_image_argument = True
  305. # A transition that is performed when a say statement has an image attribute
  306. # corresponding to a shown image.
  307. say_attribute_transition = None
  308. # What is the name and version of this game?
  309. name = ""
  310. version = ""
  311. # Should we log?
  312. log_enable = True
  313. # Should we log text overflows?
  314. debug_text_overflow = False
  315. # Should we save the window size in the preferences?
  316. save_physical_size = True
  317. # Do we use new text substitutions?
  318. new_substitutions = True
  319. # Do we use old text substitutions?
  320. old_substitutions = True
  321. # The graphics renderer we use. (Ren'Py sets this.)
  322. renderer = "auto"
  323. # The translator to use, if any. (Not used anymore.)
  324. translator = None
  325. # Should we use the old, broken line spacing code?
  326. broken_line_spacing = False
  327. # A list of callbacks that are called after each non-init-phase python
  328. # block.
  329. python_callbacks = [ ]
  330. # If true, we dump information about a save upon save.
  331. save_dump = False
  332. # Can we resize a gl window?
  333. gl_resize = True
  334. # Called when we change the translation.
  335. change_language_callbacks = [ ]
  336. # The translation directory.
  337. tl_directory = "tl"
  338. # Key repeat timings. A tuple giving the initial delay and the delay between
  339. # repeats, in seconds.
  340. key_repeat = (.3, .03)
  341. # A callback that is called with the character's voice_tag.
  342. voice_tag_callback = None
  343. # A list of callbacks that can be used to add JSON to save files.
  344. save_json_callbacks = [ ]
  345. # The duration of a longpress, in seconds.
  346. longpress_duration = .5
  347. # The radius the longpress has to remain within, in pixels.
  348. longpress_radius = 15
  349. # How long we vibrate the device upon a longpress.
  350. longpress_vibrate = .1
  351. # A list of callbacks that are called before each statement, with the name
  352. # of the statement.
  353. statement_callbacks = [ ]
  354. # A list of file extensions that are blacklisted by autoreload.
  355. autoreload_blacklist = [ ".rpyc", ".rpymc", ".rpyb", ".pyc", ".pyo" ]
  356. # The layer dialogue is shown on.
  357. say_layer = "screens"
  358. # The layer the choice screen is shown on.
  359. choice_layer = "screens"
  360. del renpy
  361. del os
  362. def init():
  363. pass