Compare commits
40 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e2e123af7 | |||
| 14aa4c4e3d | |||
| 2c15237b8a | |||
| b4845252c1 | |||
| 2f513235b3 | |||
| c68b3bae89 | |||
| 3825e88883 | |||
| bbe0fdb98f | |||
| 009969dab5 | |||
| 376ac7ad81 | |||
| de8257f459 | |||
| 3b0fbcc55f | |||
| e33abc05fb | |||
| 430ee03d45 | |||
| 03477d1c75 | |||
| ef9ee657f7 | |||
| e31f1ac63f | |||
| 33a6c97446 | |||
| 99e9e6e9ba | |||
| 1d81cede71 | |||
| 54ab9e0f1b | |||
| f0df9a7a05 | |||
| adc3bf820b | |||
| d26ac890a5 | |||
| d0397b2111 | |||
| 0229de3f0d | |||
| 176150be7f | |||
| 04992fa431 | |||
| b26725fd01 | |||
| 601e7b1949 | |||
| 37c1571792 | |||
| 812144bdf0 | |||
| 6e616fda4e | |||
| 3f120ce658 | |||
| 5446da46dc | |||
| 172efcac94 | |||
| c5ce6c0f4b | |||
| 40f8644ac2 | |||
| d45cf0d79a | |||
| 68937a71b9 |
@@ -1,3 +1,82 @@
|
||||
New in Ren'Py 6.10.2
|
||||
--------------------
|
||||
|
||||
Ren'Py now caches the individual words of text that are rendered. This
|
||||
can lead to a speedup in text display when there are many words of
|
||||
text on the screen, and that text is re-displayed, as is the case
|
||||
where the text text speed is not the maximum. This is especially
|
||||
beneficial for eastasian languages, where every character is treated
|
||||
as a word.
|
||||
|
||||
|
||||
The new config.menu_clear_layers variable allows layers to be cleared
|
||||
when entering the game menu. This makes it easier for a layer to have
|
||||
overlay-like things on it when in the game, but not when in the game
|
||||
menu.
|
||||
|
||||
|
||||
The new renpy.cache_pin function pins images into memory, loading them
|
||||
as soon as possible and keeping them loaded. The renpy.cache_unpin function
|
||||
undoes this.
|
||||
|
||||
|
||||
The new config.automatic_images_strip variable can strip out prefixes
|
||||
when automatically defining images.
|
||||
|
||||
|
||||
It's now possible to assign style properties to individual imagemap
|
||||
buttons, by indexing style.imagemap_button. (So for example, one could
|
||||
assign to style.imagemap_button["Start Game"].hover_sound .)
|
||||
|
||||
|
||||
The new voice_replay function replays the voice played on the current
|
||||
interaction. The new voice_can_replay function returns True if a voice
|
||||
can be replayed.
|
||||
|
||||
|
||||
The launcher now accepts a RENPY_DEFAULT_PROJECTS_DIRECTORY, which sets
|
||||
the default for the projects directory, if it has not already been set
|
||||
by the user. It also will report an error when creating a project fails,
|
||||
rather than producing a traceback.
|
||||
|
||||
|
||||
The launcher now links to the new Ren'Py Games List, at
|
||||
http://games.renpy.org/.
|
||||
|
||||
|
||||
Previously, it was impossible to pass an arguments list to a call
|
||||
expression. Now, we allow the pass keyword to be used to distinguish
|
||||
the two, using code like:
|
||||
|
||||
call expression foo pass (bar, baz)
|
||||
|
||||
|
||||
Ren'Py will now not show the click-to-continue indicator when a
|
||||
character is called with interact=False, unless that character is also
|
||||
called with ctc_force=True.
|
||||
|
||||
|
||||
Ren'Py now builds zip files in distributions 64k at a time.
|
||||
|
||||
|
||||
Ren'Py will now ignore music files that do not exist. Previously, it
|
||||
could loop trying to play them. (This would increase CPU usage, rather
|
||||
than causing a crash.)
|
||||
|
||||
|
||||
The following numbered bugs were fixed:
|
||||
|
||||
* lp:501351 - Displaying a Frame() with tile=True crashes
|
||||
* lp:506322 - MoveTransition is not applied to overlay even when explicitly stated
|
||||
|
||||
In addition:
|
||||
|
||||
* Fixed a bug that caused pixellate to crash.
|
||||
* Fixed a bug that caused the overlay to display twice in some cases.
|
||||
* Fix an infinite loop that could rarely occur when rolling back or saving.
|
||||
|
||||
|
||||
|
||||
New in Ren'Py 6.10.1
|
||||
--------------------
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ if __name__ == "__main__":
|
||||
|
||||
files += glob.glob("launcher/*.rpy")
|
||||
files += glob.glob("common/*.rpy")
|
||||
files += glob.glob("common/*.rpym")
|
||||
files += glob.glob("common/_layout/*.rpym")
|
||||
files += glob.glob("common/_compat/*.rpym")
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This file contains warpers that are used by ATL. They need to be defined
|
||||
# early, so Ren'Py knows about them when parsing other files.
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init -1210 python:
|
||||
|
||||
# This is called when script_version is set, to immediately
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This file contains a number of definitions of standard
|
||||
# locations and transitions. We've moved them into the common
|
||||
# directory so that it's easy for an updated version of all of these
|
||||
# definitions.
|
||||
|
||||
init -1110:
|
||||
|
||||
transform reset:
|
||||
alpha 1 rotate None zoom 1 xzoom 1 yzoom 1 align (0, 0) alignaround (0, 0) subpixel False size None crop None
|
||||
|
||||
# These are positions that can be used inside at clauses. We set
|
||||
# them up here so that they can be used throughout the program.
|
||||
transform left:
|
||||
@@ -27,6 +34,13 @@ init -1110:
|
||||
transform offscreenright:
|
||||
xpos 1.0 xanchor 0.0 ypos 1.0 yanchor 1.0
|
||||
|
||||
transform default:
|
||||
reset
|
||||
center
|
||||
|
||||
python:
|
||||
config.default_transform = right
|
||||
|
||||
|
||||
init -1110 python:
|
||||
|
||||
@@ -176,3 +190,7 @@ init 1110 python:
|
||||
|
||||
if not hasattr(store, 'centered'):
|
||||
centered = Character(None, what_style="centered_text", window_style="centered_window")
|
||||
|
||||
# This is necessary to ensure that config.default_transform works.
|
||||
if config.default_transform:
|
||||
config.default_transform.show()
|
||||
|
||||
+2
-4
@@ -1,7 +1,5 @@
|
||||
# Copyright 2004-2007 PyTom
|
||||
#
|
||||
# Please see the LICENSE.txt distributed with Ren'Py for permission to
|
||||
# copy and modify.
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init -1105 python:
|
||||
|
||||
|
||||
+20
-4
@@ -1,7 +1,5 @@
|
||||
# Copyright 2004-2007 PyTom
|
||||
#
|
||||
# Please see the LICENSE.txt distributed with Ren'Py for permission to
|
||||
# copy and modify.
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This file consists of renpy functions that aren't expected to be
|
||||
# touched by the user too much. We reserve the _ prefix for names
|
||||
@@ -52,8 +50,14 @@ init -1180 python:
|
||||
# Should we automatically define images?
|
||||
config.automatic_images = None
|
||||
|
||||
# Prefixes to strip from automatic images.
|
||||
config.automatic_images_strip = [ ]
|
||||
|
||||
# A save to automatically load, if it exists.
|
||||
config.auto_load = None
|
||||
|
||||
# Layers to clear when entering the menus.
|
||||
config.menu_clear_layers = [ ]
|
||||
|
||||
# This is updated to give the user an idea of where a save is
|
||||
# taking place.
|
||||
@@ -528,6 +532,9 @@ label _enter_menu:
|
||||
renpy.movie_stop(only_fullscreen=True)
|
||||
renpy.take_screenshot((config.thumbnail_width, config.thumbnail_height))
|
||||
|
||||
for i in config.menu_clear_layers:
|
||||
renpy.scene(layer=i)
|
||||
|
||||
renpy.context()._menu = True
|
||||
|
||||
# This may be changed, if we are already in the main menu.
|
||||
@@ -783,6 +790,15 @@ init 1180 python hide:
|
||||
name = ( shortfn, )
|
||||
for sep in seps:
|
||||
name = tuple(j for i in name for j in i.split(sep))
|
||||
|
||||
# Strip name components.
|
||||
while name:
|
||||
for i in config.automatic_images_strip:
|
||||
if name[0] == i:
|
||||
name = name[1:]
|
||||
break
|
||||
else:
|
||||
break
|
||||
|
||||
# Only names of 2 components or more.
|
||||
if len(name) < 2:
|
||||
|
||||
+2
-4
@@ -1,7 +1,5 @@
|
||||
# Copyright 2008 PyTom
|
||||
#
|
||||
# Please see the LICENSE.txt distributed with Ren'Py for permission to
|
||||
# copy and modify.
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# Common stuff that's used by the various Ren'Py menus. This includes
|
||||
# the default definitions of config.main_menu and config.game_menu, as
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This file contains code that sets up the various mixers, based on how
|
||||
# the user sets config.has_music, .has_sound, and .has_voice.
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This is an implementation of NVL-mode, which can be used to show
|
||||
# dialogue in a fullscreen way, like NVL-style games. Multiple lines
|
||||
# of dialogue are shown on the screen at once, whenever a line of
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This file contains code that creates a few new statements. We'll
|
||||
# also describe here the API for defining your own statements.
|
||||
#
|
||||
|
||||
+2
-4
@@ -1,7 +1,5 @@
|
||||
# Copyright 2004-2008 PyTom
|
||||
#
|
||||
# Please see the LICENSE.txt distributed with Ren'Py for permission to
|
||||
# copy and modify.
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This file is responsible for creating and defining the default styles
|
||||
# used by the system.
|
||||
|
||||
+2
-4
@@ -1,7 +1,5 @@
|
||||
# Copyright 2004-2008 PyTom
|
||||
#
|
||||
# Please see the LICENSE.txt distributed with Ren'Py for permission to
|
||||
# copy and modify.
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init -1110 python:
|
||||
|
||||
|
||||
+17
-2
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This extra contains a basic implementation of voice support. Right
|
||||
# now, voice is given its own toggle, and can either be turned on or
|
||||
# turned off. In the future, we'll probably provide some way of
|
||||
@@ -27,15 +30,17 @@ init -1120:
|
||||
_voice.play = None
|
||||
_voice.sustain = False
|
||||
_voice.seen_in_lint = False
|
||||
|
||||
|
||||
# Call this to specify the voice file that will be played for
|
||||
# the user.
|
||||
def voice(file, **kwargs):
|
||||
|
||||
if not config.has_voice:
|
||||
return
|
||||
|
||||
_voice.play = file
|
||||
|
||||
_last_voice_play = file
|
||||
|
||||
# Call this to specify that the currently playing voice file
|
||||
# should be sustained through the current interaction.
|
||||
def voice_sustain(ignored="", **kwargs):
|
||||
@@ -44,6 +49,14 @@ init -1120:
|
||||
|
||||
_voice.sustain = True
|
||||
|
||||
# Call this to replay the last bit of voice.
|
||||
def voice_replay():
|
||||
renpy.sound.play(_last_voice_play, channel=2)
|
||||
|
||||
# Returns true if we can replay the voice.
|
||||
def voice_can_replay():
|
||||
return _last_voice_play != None
|
||||
|
||||
python hide:
|
||||
|
||||
# basics: True if the game will have voice.
|
||||
@@ -58,8 +71,10 @@ init -1120:
|
||||
|
||||
if _voice.play and not config.skipping:
|
||||
renpy.sound.play(_voice.play, channel=2)
|
||||
store._last_voice_play = _voice.play
|
||||
elif not _voice.sustain:
|
||||
renpy.sound.stop(channel=2)
|
||||
store._last_voice_play = _voice.play
|
||||
|
||||
_voice.play = None
|
||||
_voice.sustain = False
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2008 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
######################################################################
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2008 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init:
|
||||
python:
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2008 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init -1170 python hide:
|
||||
|
||||
config.old_names['Quit'] = 'Quit Game'
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2008 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# Copyright 2004-2006 PyTom
|
||||
#
|
||||
# Please see the LICENSE.txt distributed with Ren'Py for permission to
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2008 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python hide:
|
||||
|
||||
style.menu_button = Style(style.button, heavy=True, help='Buttons that are part of the main or game menus.')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2008 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# Copyright 2004-2007 PyTom
|
||||
#
|
||||
# Please see the LICENSE.txt distributed with Ren'Py for permission to
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
layout.provides('joystick_preferences')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
layout.provides('load_save')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
layout.provides('main_menu')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
layout.provides('navigation')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
layout.provides('preferences')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
# Styles
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python hide:
|
||||
|
||||
layout.provides('yesno_prompt')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
layout.provides('main_menu')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
layout.provides('navigation')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
class _ImageMapper(object):
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
layout.provides('load_save')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
layout.provides('main_menu')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
layout.provides('navigation')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
layout.provides('preferences')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python hide:
|
||||
|
||||
layout.provides('yesno_prompt')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
layout.provides('preferences')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
layout.provides('load_save')
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
layout.provides('preferences')
|
||||
|
||||
+78
-4
@@ -7,9 +7,12 @@ init python:
|
||||
import tarfile
|
||||
import time
|
||||
import sys
|
||||
import struct
|
||||
import zlib
|
||||
zlib.Z_DEFAULT_COMPRESSION = 9
|
||||
|
||||
import binascii
|
||||
|
||||
import pefile
|
||||
|
||||
# These are files that are ignored wherever they are found in a
|
||||
@@ -147,7 +150,7 @@ init python:
|
||||
|
||||
fn = os.path.join(os.path.dirname(project.path), filename)
|
||||
|
||||
zf = zipfile.ZipFile(fn + ".zip", "w", zipfile.ZIP_DEFLATED)
|
||||
zf = MyZipFile(fn + ".zip", "w", zipfile.ZIP_DEFLATED)
|
||||
|
||||
for i, (fn, an) in enumerate(files):
|
||||
|
||||
@@ -172,10 +175,9 @@ init python:
|
||||
|
||||
if fn in file_data:
|
||||
data = file_data[fn]
|
||||
zf.writestr(zi, data)
|
||||
else:
|
||||
data = file(fn, "rb").read()
|
||||
|
||||
zf.writestr(zi, data)
|
||||
zf.write_file_with_zipinfo(fn, zi)
|
||||
|
||||
zf.close()
|
||||
|
||||
@@ -552,3 +554,75 @@ label distribute:
|
||||
interact()
|
||||
|
||||
|
||||
init python:
|
||||
|
||||
class MyZipFile(zipfile.ZipFile):
|
||||
"""
|
||||
Modified ZipFile class that can insert a file into the archive,
|
||||
using a supplied ZipInfo object. Code comes from the writestr
|
||||
and write methods of ZipFile.
|
||||
"""
|
||||
|
||||
|
||||
def write_file_with_zipinfo(self, filename, zinfo, compress_type=None):
|
||||
"""Put the bytes from filename into the archive under the name
|
||||
arcname."""
|
||||
st = os.stat(filename)
|
||||
|
||||
if compress_type is None:
|
||||
zinfo.compress_type = self.compression
|
||||
else:
|
||||
zinfo.compress_type = compress_type
|
||||
|
||||
zinfo.file_size = st.st_size
|
||||
zinfo.flag_bits = 0x00
|
||||
zinfo.header_offset = self.fp.tell() # Start of header bytes
|
||||
|
||||
self._writecheck(zinfo)
|
||||
self._didModify = True
|
||||
|
||||
fp = open(filename, "rb")
|
||||
|
||||
# Must overwrite CRC and sizes with correct data later
|
||||
zinfo.CRC = CRC = 0
|
||||
zinfo.compress_size = compress_size = 0
|
||||
zinfo.file_size = file_size = 0
|
||||
|
||||
self.fp.write(zinfo.FileHeader())
|
||||
|
||||
if zinfo.compress_type == zipfile.ZIP_DEFLATED:
|
||||
cmpr = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION,
|
||||
zlib.DEFLATED, -15)
|
||||
else:
|
||||
cmpr = None
|
||||
while 1:
|
||||
buf = fp.read(1024 * 64)
|
||||
if not buf:
|
||||
break
|
||||
file_size = file_size + len(buf)
|
||||
CRC = binascii.crc32(buf, CRC)
|
||||
if cmpr:
|
||||
buf = cmpr.compress(buf)
|
||||
compress_size = compress_size + len(buf)
|
||||
self.fp.write(buf)
|
||||
fp.close()
|
||||
if cmpr:
|
||||
buf = cmpr.flush()
|
||||
compress_size = compress_size + len(buf)
|
||||
self.fp.write(buf)
|
||||
zinfo.compress_size = compress_size
|
||||
else:
|
||||
zinfo.compress_size = file_size
|
||||
|
||||
zinfo.CRC = CRC
|
||||
zinfo.file_size = file_size
|
||||
|
||||
# Seek backwards and write CRC and file sizes
|
||||
position = self.fp.tell() # Preserve current position in file
|
||||
self.fp.seek(zinfo.header_offset + 14, 0)
|
||||
self.fp.write(struct.pack("<lLL", zinfo.CRC, zinfo.compress_size,
|
||||
zinfo.file_size))
|
||||
|
||||
self.fp.seek(position, 0)
|
||||
self.filelist.append(zinfo)
|
||||
self.NameToInfo[zinfo.filename] = zinfo
|
||||
|
||||
+5
-2
@@ -29,9 +29,12 @@ label new_project:
|
||||
_(u"Please wait while we create the project."))
|
||||
|
||||
template = os.path.join(config.renpy_base, "template")
|
||||
|
||||
shutil.copytree(template, path)
|
||||
|
||||
try:
|
||||
shutil.copytree(template, path)
|
||||
except OSError, e:
|
||||
error(_(u"Could not create the project directory. The error was: %s") % unicode(e))
|
||||
|
||||
launcherinfo = os.path.join(path, "launcherinfo.py")
|
||||
if os.path.exists(launcherinfo):
|
||||
os.unlink(launcherinfo)
|
||||
|
||||
@@ -26,7 +26,8 @@ label choose_projects_directory:
|
||||
|
||||
if path is None:
|
||||
path = os.path.dirname(config.renpy_base)
|
||||
|
||||
path = os.environ.get("RENPY_DEFAULT_PROJECTS_DIRECTORY", path)
|
||||
|
||||
|
||||
if EasyDialogs:
|
||||
|
||||
|
||||
+15
-2
@@ -68,7 +68,7 @@ label top:
|
||||
|
||||
title(_(u"Ren'Py"))
|
||||
|
||||
ui.grid(2, 3, transpose=True)
|
||||
ui.grid(2, 4, transpose=True)
|
||||
|
||||
button(_(u"Select Project"),
|
||||
ui.jumps("select_project"),
|
||||
@@ -78,6 +78,10 @@ label top:
|
||||
ui.jumps("new_project"),
|
||||
_(u"Create a new project."))
|
||||
|
||||
button(_(u"Ren'Py Games List"),
|
||||
ui.jumps("renpy_games_list"),
|
||||
_(u"Visit the Ren'Py games list, at http://games.renpy.org."))
|
||||
|
||||
button(_(u"Quit"),
|
||||
renpy.quit,
|
||||
_(u"Causes the launcher to exit."))
|
||||
@@ -99,7 +103,8 @@ label top:
|
||||
else:
|
||||
|
||||
ui.null()
|
||||
|
||||
|
||||
ui.null()
|
||||
|
||||
|
||||
ui.close()
|
||||
@@ -121,6 +126,14 @@ label documentation:
|
||||
jump top
|
||||
|
||||
|
||||
label renpy_games_list:
|
||||
python hide:
|
||||
import webbrowser
|
||||
webbrowser.open_new("http://games.renpy.org")
|
||||
set_tooltip(_(u"Now showing the Ren'Py Games List in your web browser."))
|
||||
|
||||
jump top
|
||||
|
||||
label confirm_quit:
|
||||
$ renpy.quit()
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
init -999:
|
||||
$ config.script_version = (6, 10, 1)
|
||||
$ config.script_version = (6, 10, 2)
|
||||
|
||||
|
||||
+16
-4
@@ -33,14 +33,14 @@ init python:
|
||||
u"Test",
|
||||
u"Left",
|
||||
u"Right",
|
||||
u"Not Assigned",
|
||||
u"Up",
|
||||
u"Down",
|
||||
u"Not Assigned",
|
||||
u"Select/Dismiss",
|
||||
u"Rollback",
|
||||
u"Hold to Skip",
|
||||
u"Joystick Mapping",
|
||||
u"Move the joystick or press a joystick button to create the mapping. Click the mouse to remove the mapping.",
|
||||
u"Rollback",
|
||||
u"Hold to Skip",
|
||||
u"Toggle Skip",
|
||||
u"Hide Text",
|
||||
u"Menu",
|
||||
@@ -64,6 +64,15 @@ init python:
|
||||
u"Joystick...",
|
||||
u"Joystick Configuration",
|
||||
u"Voice Volume",
|
||||
u"Developer Menu",
|
||||
u"Return to the developer menu",
|
||||
u"Reload Game (Shift+R)",
|
||||
u"Variable Viewer",
|
||||
u"Theme Test",
|
||||
u"Style Hierarchy",
|
||||
u"FPS Meter",
|
||||
u"Image Location Picker",
|
||||
u"Done",
|
||||
u"Auto",
|
||||
u"Quick",
|
||||
u"The patterns did not match any files, so no archive was created.",
|
||||
@@ -168,7 +177,9 @@ init python:
|
||||
u"Choose Projects Directory",
|
||||
u"Please choose the directory containing your projects.",
|
||||
u"Could not run zenity. The projects directory has been set to the directory immediately above the directory containing Ren'Py.",
|
||||
u"Launches the Ren'Py tutorial game.",
|
||||
u"Now showing the Ren'Py documentation in your web browser.",
|
||||
u"Now showing the Ren'Py Games List in your web browser.",
|
||||
u"Launch",
|
||||
u"Launches the project.",
|
||||
u"Edit Script",
|
||||
@@ -186,12 +197,13 @@ init python:
|
||||
u"Ren'Py",
|
||||
u"Select a project to work with.",
|
||||
u"Create a new project.",
|
||||
u"Ren'Py Games List",
|
||||
u"Visit the Ren'Py games list, at http://games.renpy.org.",
|
||||
u"Causes the launcher to exit.",
|
||||
u"Options",
|
||||
u"Change Ren'Py launcher options.",
|
||||
u"Ren'Py Help",
|
||||
u"Open the Ren'Py documentation in a web browser.",
|
||||
u"Tutorial Game",
|
||||
u"Launches the Ren'Py tutorial game.",
|
||||
]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Copyright 2004-2007 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -27,7 +27,7 @@
|
||||
# ***** ***** ***** ***** ***** ***** **** ***** ***** ***** *****
|
||||
# Be sure to change script_version in launcher/script_version.rpy, too!
|
||||
# Also check to see if we have to update renpy.py.
|
||||
version = "Ren'Py 6.10.1b"
|
||||
version = "Ren'Py 6.10.2d"
|
||||
script_version = 5003000
|
||||
savegame_suffix = "-LT1.save"
|
||||
|
||||
|
||||
+8
-7
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -92,7 +92,7 @@ class PyExpr(unicode):
|
||||
return self
|
||||
|
||||
def __getnewargs__(self):
|
||||
return (unicode(self), self.filename, self.linenumber)
|
||||
return (unicode(self), self.filename, self.linenumber) # E1101
|
||||
|
||||
|
||||
class PyCode(object):
|
||||
@@ -186,6 +186,7 @@ class Node(object):
|
||||
|
||||
self.filename, self.linenumber = loc
|
||||
self.name = None
|
||||
self.next = None
|
||||
|
||||
def diff_info(self):
|
||||
"""
|
||||
@@ -266,7 +267,7 @@ class Node(object):
|
||||
"""
|
||||
|
||||
rv = Scry()
|
||||
rv._next = self.next
|
||||
rv._next = self.next # W0201
|
||||
return rv
|
||||
|
||||
def say_menu_with(expression, callback):
|
||||
@@ -334,7 +335,7 @@ class Say(Node):
|
||||
|
||||
what = self.what
|
||||
if renpy.config.say_menu_text_filter:
|
||||
what = renpy.config.say_menu_text_filter(what)
|
||||
what = renpy.config.say_menu_text_filter(what) # E1102
|
||||
|
||||
say_menu_with(self.with_, renpy.game.interface.set_transition)
|
||||
renpy.exports.say(who, what, interact=getattr(self, 'interact', True))
|
||||
@@ -372,11 +373,11 @@ class Say(Node):
|
||||
|
||||
def scry(self):
|
||||
rv = Node.scry(self)
|
||||
rv.interacts = True
|
||||
rv.interacts = True # W0201
|
||||
return rv
|
||||
|
||||
# Copy the descriptor.
|
||||
setattr(Say, "with", Say.with_)
|
||||
setattr(Say, "with", Say.with_) # E1101
|
||||
|
||||
class Init(Node):
|
||||
|
||||
@@ -1154,7 +1155,7 @@ class Menu(Node):
|
||||
rv.interacts = True
|
||||
return rv
|
||||
|
||||
setattr(Menu, "with", Menu.with_)
|
||||
setattr(Menu, "with", Menu.with_) # E1101
|
||||
|
||||
|
||||
# Goto is considered harmful. So we decided to name it "jump"
|
||||
|
||||
+56
-24
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -175,6 +175,8 @@ class ATLTransformBase(renpy.object.Object):
|
||||
parameters = renpy.ast.ParameterInfo([ ], [ ], None, None)
|
||||
|
||||
def __init__(self, atl, context, parameters):
|
||||
|
||||
super(ATLTransformBase, self).__init__()
|
||||
|
||||
if parameters is None:
|
||||
parameters = ATLTransformBase.parameters
|
||||
@@ -366,6 +368,10 @@ class ATLTransformBase(renpy.object.Object):
|
||||
# The base class for raw ATL statements.
|
||||
class RawStatement(renpy.object.Object):
|
||||
|
||||
def __init__(self, loc):
|
||||
super(RawStatement, self).__init__()
|
||||
self.loc = loc
|
||||
|
||||
# Compiles this RawStatement into a Statement, by using ctx to
|
||||
# evaluate expressions as necessary.
|
||||
def compile(self, ctx):
|
||||
@@ -379,6 +385,10 @@ class RawStatement(renpy.object.Object):
|
||||
# The base class for compiled ATL Statements.
|
||||
class Statement(renpy.object.Object):
|
||||
|
||||
def __init__(self, loc):
|
||||
super(Statement, self).__init__()
|
||||
self.loc = loc
|
||||
|
||||
# trans is the transform we're working on.
|
||||
# st is the time since this statement started executing.
|
||||
# state is the state stored by this statement, or None if
|
||||
@@ -419,7 +429,7 @@ class RawBlock(RawStatement):
|
||||
|
||||
def __init__(self, loc, statements, animation):
|
||||
|
||||
self.loc = loc
|
||||
super(RawBlock, self).__init__(loc)
|
||||
|
||||
# A list of RawStatements in this block.
|
||||
self.statements = statements
|
||||
@@ -442,7 +452,7 @@ class RawBlock(RawStatement):
|
||||
class Block(Statement):
|
||||
def __init__(self, loc, statements):
|
||||
|
||||
self.loc = loc
|
||||
super(Block, self).__init__(loc)
|
||||
|
||||
# A list of statements in the block.
|
||||
self.statements = statements
|
||||
@@ -577,7 +587,7 @@ class RawMultipurpose(RawStatement):
|
||||
|
||||
def __init__(self, loc):
|
||||
|
||||
self.loc = loc
|
||||
super(RawMultipurpose, self).__init__(loc)
|
||||
|
||||
self.warper = None
|
||||
self.duration = None
|
||||
@@ -716,7 +726,9 @@ class RawMultipurpose(RawStatement):
|
||||
class RawContainsExpr(RawStatement):
|
||||
|
||||
def __init__(self, loc, expr):
|
||||
self.loc = loc
|
||||
|
||||
super(RawContainsExpr, self).__init__(loc)
|
||||
|
||||
self.expression = expr
|
||||
|
||||
def compile(self, ctx):
|
||||
@@ -729,7 +741,9 @@ class RawContainsExpr(RawStatement):
|
||||
class RawChild(RawStatement):
|
||||
|
||||
def __init__(self, loc, child):
|
||||
self.loc = loc
|
||||
|
||||
super(RawChild, self).__init__(loc)
|
||||
|
||||
self.children = [ child ]
|
||||
|
||||
def compile(self, ctx):
|
||||
@@ -745,8 +759,9 @@ class RawChild(RawStatement):
|
||||
class Child(Statement):
|
||||
|
||||
def __init__(self, loc, child, transition):
|
||||
self.loc = loc
|
||||
|
||||
super(Child, self).__init__(loc)
|
||||
|
||||
self.child = renpy.easy.displayable(child)
|
||||
self.transition = transition
|
||||
|
||||
@@ -775,7 +790,9 @@ class Child(Statement):
|
||||
class Interpolation(Statement):
|
||||
|
||||
def __init__(self, loc, warper, duration, properties, revolution, circles, splines):
|
||||
self.loc = loc
|
||||
|
||||
super(Interpolation, self).__init__(loc)
|
||||
|
||||
self.warper = warper
|
||||
self.duration = duration
|
||||
self.properties = properties
|
||||
@@ -899,7 +916,9 @@ class Interpolation(Statement):
|
||||
class RawRepeat(RawStatement):
|
||||
|
||||
def __init__(self, loc, repeats):
|
||||
self.loc = loc
|
||||
|
||||
super(RawRepeat, self).__init__(loc)
|
||||
|
||||
self.repeats = repeats
|
||||
|
||||
def compile(self, ctx):
|
||||
@@ -916,7 +935,9 @@ class RawRepeat(RawStatement):
|
||||
class Repeat(Statement):
|
||||
|
||||
def __init__(self, loc, repeats):
|
||||
self.loc = loc
|
||||
|
||||
super(Repeat, self).__init__(loc)
|
||||
|
||||
self.repeats = repeats
|
||||
|
||||
def execute(self, trans, st, state, event):
|
||||
@@ -928,7 +949,8 @@ class Repeat(Statement):
|
||||
class RawParallel(RawStatement):
|
||||
|
||||
def __init__(self, loc, block):
|
||||
self.loc = loc
|
||||
|
||||
super(RawParallel, self).__init__(loc)
|
||||
self.blocks = [ block ]
|
||||
|
||||
def compile(self, ctx):
|
||||
@@ -940,9 +962,9 @@ class RawParallel(RawStatement):
|
||||
|
||||
|
||||
class Parallel(Statement):
|
||||
|
||||
|
||||
def __init__(self, loc, blocks):
|
||||
self.loc = loc
|
||||
super(Parallel, self).__init__(loc)
|
||||
self.blocks = blocks
|
||||
|
||||
def execute(self, trans, st, state, event):
|
||||
@@ -989,7 +1011,8 @@ class Parallel(Statement):
|
||||
class RawChoice(RawStatement):
|
||||
|
||||
def __init__(self, loc, chance, block):
|
||||
self.loc = loc
|
||||
super(RawChoice, self).__init__(loc)
|
||||
|
||||
self.choices = [ (chance, block) ]
|
||||
|
||||
def compile(self, ctx):
|
||||
@@ -1003,7 +1026,9 @@ class RawChoice(RawStatement):
|
||||
class Choice(Statement):
|
||||
|
||||
def __init__(self, loc, choices):
|
||||
self.loc = loc
|
||||
|
||||
super(Choice, self).__init__(loc)
|
||||
|
||||
self.choices = choices
|
||||
|
||||
def execute(self, trans, st, state, event):
|
||||
@@ -1044,7 +1069,8 @@ class Choice(Statement):
|
||||
class RawTime(RawStatement):
|
||||
|
||||
def __init__(self, loc, time):
|
||||
self.loc = loc
|
||||
|
||||
super(RawTime, self).__init__(loc)
|
||||
self.time = time
|
||||
|
||||
def compile(self, ctx):
|
||||
@@ -1054,7 +1080,8 @@ class RawTime(RawStatement):
|
||||
class Time(Statement):
|
||||
|
||||
def __init__(self, loc, time):
|
||||
self.loc = loc
|
||||
super(Time, self).__init__(loc)
|
||||
|
||||
self.time = time
|
||||
|
||||
def execute(self, trans, st, state, event):
|
||||
@@ -1066,7 +1093,8 @@ class Time(Statement):
|
||||
class RawOn(RawStatement):
|
||||
|
||||
def __init__(self, loc, name, block):
|
||||
self.loc = loc
|
||||
super(RawOn, self).__init__(loc)
|
||||
|
||||
self.handlers = { name : block }
|
||||
|
||||
def compile(self, ctx):
|
||||
@@ -1087,13 +1115,13 @@ class RawOn(RawStatement):
|
||||
class On(Statement):
|
||||
|
||||
def __init__(self, loc, handlers):
|
||||
self.loc = loc
|
||||
super(On, self).__init__(loc)
|
||||
|
||||
self.handlers = handlers
|
||||
|
||||
def execute(self, trans, st, state, event):
|
||||
|
||||
executing(self.loc)
|
||||
|
||||
|
||||
# If it's our first time through, start in the start state.
|
||||
if state is None:
|
||||
@@ -1166,7 +1194,8 @@ class On(Statement):
|
||||
class RawEvent(RawStatement):
|
||||
|
||||
def __init__(self, loc, name):
|
||||
self.loc = loc
|
||||
super(RawEvent, self).__init__(loc)
|
||||
|
||||
self.name = name
|
||||
|
||||
def compile(self, ctx):
|
||||
@@ -1176,7 +1205,8 @@ class RawEvent(RawStatement):
|
||||
class Event(Statement):
|
||||
|
||||
def __init__(self, loc, name):
|
||||
self.loc = loc
|
||||
super(Event, self).__init__(loc)
|
||||
|
||||
self.name = name
|
||||
|
||||
def execute(self, trans, st, state, event):
|
||||
@@ -1186,7 +1216,8 @@ class Event(Statement):
|
||||
class RawFunction(RawStatement):
|
||||
|
||||
def __init__(self, loc, expr):
|
||||
self.loc = loc
|
||||
super(RawFunction, self).__init__(loc)
|
||||
|
||||
self.expr = expr
|
||||
|
||||
def compile(self, ctx):
|
||||
@@ -1196,7 +1227,8 @@ class RawFunction(RawStatement):
|
||||
class Function(Statement):
|
||||
|
||||
def __init__(self, loc, function):
|
||||
self.loc = loc
|
||||
super(Function, self).__init__(loc)
|
||||
|
||||
self.function = function
|
||||
|
||||
def execute(self, trans, st, state, event):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
+13
-8
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -142,6 +142,8 @@ class MusicContext(renpy.python.RevertableObject):
|
||||
|
||||
def __init__(self):
|
||||
|
||||
super(MusicContext, self).__init__()
|
||||
|
||||
# The time this channel was last ordered panned.
|
||||
self.pan_time = None
|
||||
|
||||
@@ -286,7 +288,7 @@ class Channel(object):
|
||||
|
||||
rv = mcd.get(self.name)
|
||||
if rv is None:
|
||||
rv = mcd[self.name] = MusicContext();
|
||||
rv = mcd[self.name] = MusicContext()
|
||||
|
||||
return rv
|
||||
|
||||
@@ -371,6 +373,12 @@ class Channel(object):
|
||||
self.playing = True
|
||||
|
||||
except:
|
||||
|
||||
# If playing failed, remove topq.filename from self.loop
|
||||
# so we don't keep trying.
|
||||
while topq.filename in self.loop:
|
||||
self.loop.remove(topq.filename)
|
||||
|
||||
if renpy.config.debug_sound:
|
||||
raise
|
||||
else:
|
||||
@@ -387,7 +395,7 @@ class Channel(object):
|
||||
|
||||
# Queue empty callback.
|
||||
if do_callback and self.callback:
|
||||
self.callback()
|
||||
self.callback() # E1102
|
||||
|
||||
def dequeue(self, even_tight=False):
|
||||
"""
|
||||
@@ -427,11 +435,9 @@ class Channel(object):
|
||||
pss.set_secondary_volume(self.number,
|
||||
self.context.secondary_volume,
|
||||
0)
|
||||
|
||||
self.pan_delay = 0
|
||||
|
||||
if not self.queue and self.callback:
|
||||
self.callback()
|
||||
self.callback() # E1102
|
||||
|
||||
|
||||
def fadeout(self, secs):
|
||||
@@ -594,7 +600,6 @@ def init():
|
||||
def quit():
|
||||
|
||||
global pcm_ok
|
||||
global midi_ok
|
||||
global mix_ok
|
||||
|
||||
if not pcm_ok:
|
||||
@@ -782,7 +787,7 @@ def event(ev):
|
||||
if ev.type == REFRESH_EVENT:
|
||||
if renpy.audio.music.get_playing("movie"):
|
||||
pss.refresh_event()
|
||||
|
||||
|
||||
# Return False, as a Movie should get this to know when to
|
||||
# redraw itself.
|
||||
return False
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
+8
-8
@@ -54,7 +54,7 @@ def extra_imports():
|
||||
import pygame.locals
|
||||
import pygame.color
|
||||
import pygame.colordict; pygame.colordict
|
||||
import posixpath; posixpath
|
||||
import posixpath; posixpath # W0403
|
||||
import ctypes
|
||||
import ctypes.wintypes; ctypes.wintypes
|
||||
import EasyDialogs; EasyDialogs
|
||||
@@ -90,15 +90,15 @@ def popen_del(self, _deadstate=sys.maxint):
|
||||
self.poll(_deadstate=_deadstate)
|
||||
|
||||
try:
|
||||
import subprocess
|
||||
if self.returncode is None and subprocess._active is not None:
|
||||
subprocess._active.append(self)
|
||||
import subprocess # W0403
|
||||
if self.returncode is None and subprocess._active is not None: # E1101
|
||||
subprocess._active.append(self) # E1101
|
||||
except:
|
||||
pass
|
||||
|
||||
def bootstrap(renpy_base):
|
||||
|
||||
global renpy
|
||||
global renpy # W0602
|
||||
|
||||
os.environ["RENPY_BASE"] = os.path.abspath(renpy_base)
|
||||
|
||||
@@ -226,12 +226,12 @@ def bootstrap(renpy_base):
|
||||
|
||||
# Show the presplash.
|
||||
if not options.lint and not options.compile and not options.version and not options.rmpersistent:
|
||||
import renpy.display.presplash
|
||||
import renpy.display.presplash # W0404
|
||||
renpy.display.presplash.start(gamedir)
|
||||
|
||||
# Fix an exception thrown by garbage collection.
|
||||
import subprocess
|
||||
subprocess.Popen.__del__ = popen_del
|
||||
import subprocess # W0403
|
||||
subprocess.Popen.__del__ = popen_del # E1101
|
||||
|
||||
# If we're on a mac, install our own os.start.
|
||||
if sys.platform == "darwin":
|
||||
|
||||
+9
-7
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -42,7 +42,8 @@ def predict_show_display_say(who, what, who_args, what_args, window_args, image=
|
||||
rv.append(renpy.game.style.say_who_window.background)
|
||||
|
||||
if image:
|
||||
rv.append(renpy.display.im.image(who, True))
|
||||
if image != "<Dynamic>":
|
||||
rv.append(renpy.display.im.image(who, True))
|
||||
|
||||
if side_image:
|
||||
rv.append(renpy.display.im.image(side_image, True))
|
||||
@@ -214,7 +215,8 @@ def display_say(show_function,
|
||||
callback,
|
||||
type,
|
||||
checkpoint=True,
|
||||
ctc_timedpause=None):
|
||||
ctc_timedpause=None,
|
||||
ctc_force=False):
|
||||
|
||||
|
||||
# If we're in fast skipping mode, don't bother with say
|
||||
@@ -295,6 +297,9 @@ def display_say(show_function,
|
||||
what_ctc = ctc_pause
|
||||
else:
|
||||
what_ctc = ctc
|
||||
|
||||
if not (interact or ctc_force):
|
||||
what_ctc = None
|
||||
|
||||
what_ctc = renpy.easy.displayable_or_none(what_ctc)
|
||||
|
||||
@@ -326,7 +331,7 @@ def display_say(show_function,
|
||||
c("show_done", interact=interact, type=type, **cb_args)
|
||||
|
||||
if behavior and afm:
|
||||
behavior.set_afm_length(what_text.get_simple_length() - slow_start)
|
||||
behavior.set_afm_length(what_text.get_simple_length() - slow_start) # E1103
|
||||
|
||||
if interact:
|
||||
|
||||
@@ -571,9 +576,6 @@ class ADVCharacter(object):
|
||||
|
||||
def predict(self, what):
|
||||
|
||||
if self.dynamic and self.image:
|
||||
return [ ]
|
||||
|
||||
if self.dynamic:
|
||||
who = "<Dynamic>"
|
||||
else:
|
||||
|
||||
+18
-2
@@ -1,4 +1,5 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -401,9 +402,24 @@ rtl = False
|
||||
# A callback for file opening.
|
||||
file_open_callback = None
|
||||
|
||||
# The size of screenshot thumbnails. (Redefined in common/)
|
||||
thumbnail_width = None
|
||||
thumbnail_height = None
|
||||
|
||||
# The end game transition.
|
||||
end_game_transition = None
|
||||
|
||||
# The default transform.
|
||||
default_transform = None
|
||||
|
||||
# Various directories.
|
||||
gamedir = None
|
||||
basedir = None
|
||||
renpy_base = None
|
||||
|
||||
del renpy
|
||||
|
||||
def init():
|
||||
import renpy
|
||||
import renpy # W0404
|
||||
global style_properties
|
||||
style_properties = renpy.style.style_properties
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -76,7 +76,7 @@ class State(object):
|
||||
def motion_copy(self, child):
|
||||
|
||||
if self.image is not None:
|
||||
child = self.mage
|
||||
child = self.image
|
||||
|
||||
return State(self.name, child, *self.atlist)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -556,7 +556,7 @@ class Input(renpy.display.text.Text):
|
||||
self.content = content
|
||||
|
||||
if self.changed:
|
||||
self.change(content)
|
||||
self.changed(content)
|
||||
|
||||
self.editable = editable
|
||||
|
||||
@@ -616,6 +616,8 @@ adj_registered = { }
|
||||
class Adjustment(renpy.object.Object):
|
||||
|
||||
def __init__(self, range=1, value=0, step=None, page=0, changed=None, adjustable=True, ranged=None):
|
||||
super(Adjustment, self).__init__()
|
||||
|
||||
self._value = value
|
||||
self._range = range
|
||||
self._page = page
|
||||
@@ -701,11 +703,11 @@ class Bar(renpy.display.core.Displayable):
|
||||
def after_upgrade(self, version):
|
||||
|
||||
if version < 1:
|
||||
self.adjustment = Adjustment(self.range, self.value, changed=self.changed)
|
||||
self.adjustment = Adjustment(self.range, self.value, changed=self.changed) # E1101
|
||||
self.adjustment.register(self)
|
||||
del self.range
|
||||
del self.value
|
||||
del self.changed
|
||||
del self.range # E1101
|
||||
del self.value # E1101
|
||||
del self.changed # E1101
|
||||
|
||||
def __init__(self,
|
||||
range=None,
|
||||
@@ -733,6 +735,12 @@ class Bar(renpy.display.core.Displayable):
|
||||
|
||||
self.adjustment = adjustment
|
||||
self.focusable = adjustment.adjustable
|
||||
|
||||
# These are set when we are first rendered.
|
||||
self.thumb_dim = 0
|
||||
self.height = 0
|
||||
self.width = 0
|
||||
self.hidden = False
|
||||
|
||||
def visit(self):
|
||||
return [ self.style.fore_bar, self.style.aft_bar, self.style.thumb, self.style.thumb_shadow ]
|
||||
|
||||
+21
-7
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -100,7 +100,7 @@ class Displayable(renpy.object.Object):
|
||||
# Can we change our look in response to transform_events?
|
||||
transform_event_responder = False
|
||||
|
||||
def __init__(self, focus=None, default=False, style='default', **properties):
|
||||
def __init__(self, focus=None, default=False, style='default', **properties): # W0231
|
||||
self.style = renpy.style.Style(style, properties, heavy=True)
|
||||
self.focus_name = focus
|
||||
self.default = default
|
||||
@@ -393,6 +393,8 @@ class ImagePredictInfo(renpy.object.Object):
|
||||
|
||||
def __init__(self, ipi=None):
|
||||
|
||||
super(ImagePredictInfo, self).__init__()
|
||||
|
||||
# layer -> (tag -> image name)
|
||||
self.images = { }
|
||||
|
||||
@@ -458,9 +460,10 @@ class SceneLists(renpy.object.Object):
|
||||
|
||||
def __init__(self, oldsl, ipi):
|
||||
|
||||
super(SceneLists, self).__init__()
|
||||
|
||||
# Has a window been shown as part of these scene lists?
|
||||
self.shown_window = False
|
||||
|
||||
|
||||
# A map from layer name -> list of
|
||||
# (key, zorder, show time, animation time, displayable)
|
||||
@@ -528,6 +531,9 @@ class SceneLists(renpy.object.Object):
|
||||
to the new thing.
|
||||
"""
|
||||
|
||||
if old_thing is None:
|
||||
return new_thing
|
||||
|
||||
old_transform = old_thing.get_parameterized()
|
||||
if not isinstance(old_transform, renpy.display.motion.Transform):
|
||||
return new_thing
|
||||
@@ -540,7 +546,7 @@ class SceneLists(renpy.object.Object):
|
||||
return new_thing
|
||||
|
||||
|
||||
def add(self, layer, thing, key=None, zorder=0, behind=[ ], at_list=[ ], name=None, atl=None):
|
||||
def add(self, layer, thing, key=None, zorder=0, behind=[ ], at_list=[ ], name=None, atl=None, default_transform=None):
|
||||
"""
|
||||
This is called to add something to a layer. Layer is
|
||||
the name of the layer that we need to add the thing to,
|
||||
@@ -609,12 +615,11 @@ class SceneLists(renpy.object.Object):
|
||||
# is a transform, and then take the transform state.
|
||||
|
||||
thing = self.transform_state(old_thing, thing)
|
||||
|
||||
|
||||
thing.set_transform_event("replace")
|
||||
thing.show()
|
||||
|
||||
if zorder == zo:
|
||||
if zorder == zo: # W0631
|
||||
l[index] = (key, zorder, st, at, thing)
|
||||
return
|
||||
else:
|
||||
@@ -630,6 +635,8 @@ class SceneLists(renpy.object.Object):
|
||||
else:
|
||||
index = len(l)
|
||||
|
||||
thing = self.transform_state(default_transform, thing)
|
||||
|
||||
thing.set_transform_event("show")
|
||||
thing.show()
|
||||
l.insert(index, (key, zorder, st, at, thing))
|
||||
@@ -1335,7 +1342,10 @@ class Interface(object):
|
||||
# for contexts outside the current one. This is used to restore those
|
||||
# in the case where nothing has changed in the new context.
|
||||
self.transition_info_stack = [ ]
|
||||
|
||||
|
||||
# The time when the event was dispatched.
|
||||
self.event_time = 0
|
||||
|
||||
|
||||
def take_screenshot(self, scale):
|
||||
"""
|
||||
@@ -1411,6 +1421,10 @@ class Interface(object):
|
||||
self.old_scene = self.compute_scene(scene_lists)
|
||||
|
||||
# Get rid of transient things.
|
||||
|
||||
for i in renpy.config.overlay_layers:
|
||||
scene_lists.clear(i)
|
||||
|
||||
scene_lists.replace_transient()
|
||||
scene_lists.shown_window = False
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -40,7 +40,7 @@ class ReportError(object):
|
||||
# In the report method, Ren'Py may be in an ill-defined state.
|
||||
def report(self, error_type):
|
||||
import os.path
|
||||
import pygame
|
||||
import pygame # W0404
|
||||
pygame.display.init()
|
||||
|
||||
msg = "Ren'Py has experienced " + error_type + ".\n"
|
||||
@@ -56,7 +56,7 @@ class ReportError(object):
|
||||
|
||||
y += self.font.get_linesize()
|
||||
|
||||
pygame.display.flip()
|
||||
pygame.display.flip() # E1120
|
||||
|
||||
pygame.time.set_timer(pygame.USEREVENT + 1, 50)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -176,9 +176,6 @@ def before_interact(roots):
|
||||
# This changes the focus to be the widget contained inside the new
|
||||
# focus object.
|
||||
def change_focus(newfocus, default=False):
|
||||
|
||||
global argument
|
||||
|
||||
rv = None
|
||||
|
||||
if grab:
|
||||
|
||||
+27
-21
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -123,6 +123,8 @@ class SFont(ImageFont):
|
||||
kerns,
|
||||
charset):
|
||||
|
||||
super(SFont, self).__init__()
|
||||
|
||||
self.filename = filename
|
||||
self.spacewidth = spacewidth
|
||||
self.default_kern = default_kern
|
||||
@@ -131,18 +133,18 @@ class SFont(ImageFont):
|
||||
|
||||
def load(self):
|
||||
|
||||
self.chars = { }
|
||||
self.width = { }
|
||||
self.advance = { }
|
||||
self.offsets = { }
|
||||
self.chars = { } # W0201
|
||||
self.width = { } # W0201
|
||||
self.advance = { } # W0201
|
||||
self.offsets = { } # W0201
|
||||
|
||||
# Load in the image.
|
||||
surf = renpy.display.im.Image(self.filename).load(unscaled=True)
|
||||
|
||||
sw, sh = surf.get_size()
|
||||
height = sh
|
||||
self.height = height
|
||||
self.baseline = height
|
||||
self.height = height # W0201
|
||||
self.baseline = height # W0201
|
||||
|
||||
# Create space characters.
|
||||
self.chars[u' '] = renpy.display.pgrender.surface((self.spacewidth, height), True)
|
||||
@@ -201,6 +203,8 @@ class MudgeFont(ImageFont):
|
||||
default_kern,
|
||||
kerns):
|
||||
|
||||
super(MudgeFont, self).__init__()
|
||||
|
||||
self.filename = filename
|
||||
self.xml = xml
|
||||
self.spacewidth = spacewidth
|
||||
@@ -209,10 +213,10 @@ class MudgeFont(ImageFont):
|
||||
|
||||
def load(self):
|
||||
|
||||
self.chars = { }
|
||||
self.width = { }
|
||||
self.advance = { }
|
||||
self.offsets = { }
|
||||
self.chars = { } # W0201
|
||||
self.width = { } # W0201
|
||||
self.advance = { } # W0201
|
||||
self.offsets = { } # W0201
|
||||
|
||||
# Load in the image.
|
||||
surf = renpy.display.im.Image(self.filename).load(unscaled=True)
|
||||
@@ -245,8 +249,8 @@ class MudgeFont(ImageFont):
|
||||
|
||||
height = max(height, h)
|
||||
|
||||
self.height = height
|
||||
self.baseline = height
|
||||
self.height = height # W0201
|
||||
self.baseline = height # W0201
|
||||
|
||||
# Create space characters.
|
||||
if u' ' not in self.chars:
|
||||
@@ -293,16 +297,18 @@ def parse_bmfont_line(l):
|
||||
class BMFont(ImageFont):
|
||||
|
||||
def __init__(self, filename):
|
||||
super(BMFont, self).__init__()
|
||||
|
||||
self.filename = filename
|
||||
|
||||
def load(self):
|
||||
|
||||
self.chars = { }
|
||||
self.width = { }
|
||||
self.advance = { }
|
||||
self.offsets = { }
|
||||
self.kerns = { }
|
||||
self.default_kern = 0
|
||||
self.chars = { } # W0201
|
||||
self.width = { } # W0201
|
||||
self.advance = { } # W0201
|
||||
self.offsets = { } # W0201
|
||||
self.kerns = { } # W0201
|
||||
self.default_kern = 0 # W0201
|
||||
|
||||
pages = { }
|
||||
|
||||
@@ -312,8 +318,8 @@ class BMFont(ImageFont):
|
||||
kind, args = parse_bmfont_line(l)
|
||||
|
||||
if kind == "common":
|
||||
self.height = int(args["lineHeight"])
|
||||
self.baseline = int(args["base"])
|
||||
self.height = int(args["lineHeight"]) # W0201
|
||||
self.baseline = int(args["base"]) # W0201
|
||||
elif kind == "page":
|
||||
pages[int(args["id"])] = renpy.display.im.Image(args["file"]).load(unscaled=True)
|
||||
elif kind == "char":
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
+105
-24
@@ -1,4 +1,5 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -80,6 +81,10 @@ class Cache(object):
|
||||
# Is the preload_thread alive?
|
||||
self.keep_preloading = True
|
||||
|
||||
# A map from image object to surface, only for objects that have
|
||||
# been pinned into memory.
|
||||
self.pin_cache = { }
|
||||
|
||||
# The preload thread.
|
||||
self.preload_thread = threading.Thread(target=self.preload_thread_main, name="preloader")
|
||||
self.preload_thread.setDaemon(True)
|
||||
@@ -106,6 +111,7 @@ class Cache(object):
|
||||
def clear(self):
|
||||
self.lock.acquire()
|
||||
|
||||
self.pin_cache = { }
|
||||
self.cache = { }
|
||||
self.preloads = [ ]
|
||||
self.first_preload_in_tick = True
|
||||
@@ -147,9 +153,7 @@ class Cache(object):
|
||||
else:
|
||||
return
|
||||
|
||||
self.lock.acquire()
|
||||
self.preloads.append(image)
|
||||
self.lock.release()
|
||||
|
||||
# This returns the pygame surface corresponding to the provided
|
||||
# image. It also takes care of updating the age of images in the
|
||||
@@ -179,13 +183,17 @@ class Cache(object):
|
||||
ce = self.cache.get(image, None)
|
||||
|
||||
if ce is not None:
|
||||
self.cache.release()
|
||||
self.lock.release()
|
||||
|
||||
# Otherwise, we keep the lock, and load the image ourselves.
|
||||
if ce is None:
|
||||
|
||||
|
||||
try:
|
||||
surf = image.load()
|
||||
if image in self.pin_cache:
|
||||
surf = self.pin_cache[image]
|
||||
else:
|
||||
surf = image.load()
|
||||
|
||||
except:
|
||||
self.lock.release()
|
||||
raise
|
||||
@@ -203,23 +211,29 @@ class Cache(object):
|
||||
# RLE detection. (ce.size is used to check that we're not
|
||||
# 0 pixels big.)
|
||||
if id(ce.surf) not in rle_cache and ce.size:
|
||||
|
||||
rle = not renpy.game.less_memory
|
||||
# rle = image.rle
|
||||
surf = ce.surf
|
||||
|
||||
if rle:
|
||||
|
||||
# We must copy the surface, so we have a RLE-specific version.
|
||||
rle_surf = renpy.display.pgrender.copy_surface(ce.surf)
|
||||
rle_surf.set_alpha(255, pygame.RLEACCEL)
|
||||
|
||||
idsurf = id(ce.surf)
|
||||
|
||||
if idsurf in pin_rle_cache:
|
||||
rle_surf = pin_rle_cache[idsurf]
|
||||
else:
|
||||
rle_surf = renpy.display.pgrender.copy_surface(ce.surf)
|
||||
rle_surf.set_alpha(255, pygame.RLEACCEL)
|
||||
|
||||
renpy.display.render.mutated_surface(rle_surf)
|
||||
|
||||
rle_cache[id(ce.surf)] = rle_surf
|
||||
rle_cache[idsurf] = rle_surf
|
||||
|
||||
if renpy.config.debug_image_cache:
|
||||
print "Added to rle cache:", image
|
||||
|
||||
|
||||
self.lock.release()
|
||||
|
||||
|
||||
# Move it into the current generation. This isn't protected by
|
||||
# a lock, so in certain circumstances we could have an
|
||||
@@ -230,10 +244,11 @@ class Cache(object):
|
||||
if ce.time != self.time:
|
||||
ce.time = self.time
|
||||
self.size_of_current_generation += ce.size
|
||||
|
||||
|
||||
# Done... return the surface.
|
||||
return ce.surf
|
||||
|
||||
|
||||
# This kills off a given cache entry.
|
||||
def kill(self, ce):
|
||||
|
||||
@@ -317,7 +332,7 @@ class Cache(object):
|
||||
def preload_thread_main(self):
|
||||
|
||||
while self.keep_preloading:
|
||||
|
||||
|
||||
self.lock.acquire()
|
||||
self.lock.wait()
|
||||
self.lock.release()
|
||||
@@ -340,7 +355,14 @@ class Cache(object):
|
||||
|
||||
try:
|
||||
image = self.preloads.pop(0)
|
||||
self.get(image)
|
||||
|
||||
if image not in preload_blacklist:
|
||||
|
||||
try:
|
||||
self.get(image)
|
||||
except:
|
||||
preload_blacklist.add(image)
|
||||
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -348,12 +370,70 @@ class Cache(object):
|
||||
self.cleanout()
|
||||
self.lock.release()
|
||||
|
||||
|
||||
cache = Cache()
|
||||
# If we have time, preload pinned images.
|
||||
if self.keep_preloading and not renpy.game.less_memory:
|
||||
|
||||
workset = set(renpy.store._cache_pin_set)
|
||||
|
||||
# Remove things that are not in the workset from the pin cache,
|
||||
# and remove things that are in the workset from pin cache.
|
||||
for i in self.pin_cache.keys():
|
||||
|
||||
if i in workset:
|
||||
workset.remove(i)
|
||||
else:
|
||||
if renpy.config.debug_image_cache:
|
||||
print "IC Pin Clear", image
|
||||
|
||||
|
||||
idsurf = id(self.pin_cache[i])
|
||||
|
||||
if idsurf in pin_rle_cache:
|
||||
del pin_rle_cache[idsurf]
|
||||
|
||||
del self.pin_cache[i]
|
||||
|
||||
|
||||
# For each image in the worklist...
|
||||
for image in workset:
|
||||
|
||||
if image in preload_blacklist:
|
||||
continue
|
||||
|
||||
# If we have normal preloads, break out.
|
||||
if self.preloads:
|
||||
break
|
||||
|
||||
# Otherwise, pin preload the image.
|
||||
if renpy.config.debug_image_cache:
|
||||
print "IC Pin Preload", image
|
||||
|
||||
try:
|
||||
surf = image.load()
|
||||
|
||||
self.pin_cache[image] = surf
|
||||
|
||||
rle_surf = renpy.display.pgrender.copy_surface(surf)
|
||||
rle_surf.set_alpha(255, pygame.RLEACCEL)
|
||||
|
||||
pin_rle_cache[id(surf)] = rle_surf
|
||||
|
||||
except:
|
||||
preload_blacklist.add(image)
|
||||
|
||||
|
||||
# A map from id(cached surface) to rle version of cached surface.
|
||||
rle_cache = { }
|
||||
|
||||
# Same thing, for pinned surfaces.
|
||||
pin_rle_cache = { }
|
||||
|
||||
# Images that we tried, and failed, to preload.
|
||||
preload_blacklist = set()
|
||||
|
||||
|
||||
cache = Cache()
|
||||
|
||||
def free_memory():
|
||||
"""
|
||||
Frees some memory.
|
||||
@@ -361,7 +441,8 @@ def free_memory():
|
||||
|
||||
cache.clear()
|
||||
rle_cache.clear()
|
||||
|
||||
pin_rle_cache.clear()
|
||||
|
||||
|
||||
class ImageBase(renpy.display.core.Displayable):
|
||||
"""
|
||||
@@ -440,7 +521,7 @@ class Image(ImageBase):
|
||||
super(Image, self).__init__(filename, **properties)
|
||||
self.filename = filename
|
||||
|
||||
def load(self, unscaled=False):
|
||||
def load(self, unscaled=False): # W0221
|
||||
try:
|
||||
|
||||
if unscaled:
|
||||
@@ -675,7 +756,7 @@ class FrameImage(ImageBase):
|
||||
tilew, tileh = srcsize
|
||||
dstw, dsth = dstsize
|
||||
|
||||
surf2 = renpy.display.pgrender.surface_unscaled(dstsize)
|
||||
surf2 = renpy.display.pgrender.surface_unscaled(dstsize, surf)
|
||||
|
||||
for y in range(0, dsth, tileh):
|
||||
for x in range(0, dstw, tilew):
|
||||
@@ -1251,9 +1332,9 @@ im.matrix(%f, %f, %f, %f, %f.
|
||||
h = h * math.pi / 180
|
||||
cosVal = math.cos(h)
|
||||
sinVal = math.sin(h)
|
||||
lumR = 0.213;
|
||||
lumG = 0.715;
|
||||
lumB = 0.072;
|
||||
lumR = 0.213
|
||||
lumG = 0.715
|
||||
lumB = 0.072
|
||||
return matrix(
|
||||
lumR+cosVal*(1-lumR)+sinVal*(-lumR),lumG+cosVal*(-lumG)+sinVal*(-lumG),lumB+cosVal*(-lumB)+sinVal*(1-lumB),0,0,
|
||||
lumR+cosVal*(-lumR)+sinVal*(0.143),lumG+cosVal*(1-lumG)+sinVal*(0.140),lumB+cosVal*(-lumB)+sinVal*(-0.283),0,0,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -46,7 +46,7 @@ class UncachedImage(renpy.display.core.Displayable):
|
||||
|
||||
super(UncachedImage, self).__init__(style=style, **properties)
|
||||
|
||||
self.surf = renpy.display.pgrender.image_load(file, hint)
|
||||
self.surf = renpy.display.pgrender.load_image(file, hint)
|
||||
|
||||
if scale:
|
||||
renpy.display.render.blit_lock.acquire()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
+19
-16
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -122,7 +122,7 @@ class Container(renpy.display.core.Displayable):
|
||||
else:
|
||||
return
|
||||
|
||||
self.children.pop(i)
|
||||
self.children.pop(i) # W0631
|
||||
self.offsets = self._list_type()
|
||||
|
||||
if self.children:
|
||||
@@ -430,7 +430,7 @@ class MultiBox(Container):
|
||||
# The scene list for this widget.
|
||||
self.scene_list = None
|
||||
|
||||
def add(self, widget, start_time=None, anim_time=None):
|
||||
def add(self, widget, start_time=None, anim_time=None): # W0221
|
||||
super(MultiBox, self).add(widget)
|
||||
self.start_times.append(start_time)
|
||||
self.anim_times.append(anim_time)
|
||||
@@ -476,7 +476,7 @@ class MultiBox(Container):
|
||||
if layout is None:
|
||||
layout = self.default_layout
|
||||
|
||||
self.layout = layout
|
||||
self.layout = layout # W0201
|
||||
|
||||
else:
|
||||
layout = self.layout
|
||||
@@ -656,6 +656,9 @@ def Fixed(**properties):
|
||||
class SizeGroup(renpy.object.Object):
|
||||
|
||||
def __init__(self):
|
||||
|
||||
super(SizeGroup, self).__init__()
|
||||
|
||||
self.members = [ ]
|
||||
self._width = None
|
||||
self.computing_width = False
|
||||
@@ -803,7 +806,7 @@ class Window(Container):
|
||||
|
||||
self.offsets = [ offsets ]
|
||||
|
||||
self.window_size = width, height
|
||||
self.window_size = width, height # W0201
|
||||
|
||||
return rv
|
||||
|
||||
@@ -1076,7 +1079,7 @@ class Viewport(Container):
|
||||
self.xadjustment.change(self.xadjustment.value - dx)
|
||||
self.yadjustment.change(self.yadjustment.value - dy)
|
||||
|
||||
self.drag_position = (x, y)
|
||||
self.drag_position = (x, y) # W0201
|
||||
|
||||
if renpy.display.behavior.map_event(ev, 'viewport_drag_end'):
|
||||
renpy.display.focus.set_grab(None)
|
||||
@@ -1168,10 +1171,10 @@ class Side(Container):
|
||||
else:
|
||||
return 0, axis
|
||||
|
||||
self.left_space, width = spacer('tl', 'l', 'bl', width)
|
||||
self.right_space, width = spacer('tr', 'r', 'br', width)
|
||||
self.top_space, height = spacer('tl', 't', 'tr', height)
|
||||
self.bottom_space, height = spacer('bl', 'b', 'br', height)
|
||||
self.left_space, width = spacer('tl', 'l', 'bl', width) # W0201
|
||||
self.right_space, width = spacer('tr', 'r', 'br', width) # W0201
|
||||
self.top_space, height = spacer('tl', 't', 'tr', height) # W0201
|
||||
self.bottom_space, height = spacer('bl', 'b', 'br', height) # W0201
|
||||
|
||||
# The sizes of the various borders.
|
||||
left = 0
|
||||
@@ -1201,13 +1204,13 @@ class Side(Container):
|
||||
right, top = sizeit('tr', right, top, right, top)
|
||||
right, bottom = sizeit('br', right, bottom, right, bottom)
|
||||
|
||||
self.cwidth = cwidth
|
||||
self.cheight = cheight
|
||||
self.cwidth = cwidth # W0201
|
||||
self.cheight = cheight # W0201
|
||||
|
||||
self.top = top
|
||||
self.bottom = bottom
|
||||
self.left = left
|
||||
self.right = right
|
||||
self.top = top # W0201
|
||||
self.bottom = bottom # W0201
|
||||
self.left = left # W0201
|
||||
self.right = right # W0201
|
||||
|
||||
else:
|
||||
cwidth = self.cwidth
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -73,7 +73,7 @@ class Minigame(renpy.display.core.Displayable):
|
||||
|
||||
if rv is None:
|
||||
|
||||
font = renpy.display.text.get_font(font, size, bold=bold, italics=italics, underline=underline)
|
||||
font = renpy.display.text.get_font(font, size, bold, italics, underline)
|
||||
rv = font.render(text, antialias, color)
|
||||
self.mutated_surface(rv)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -56,7 +56,7 @@ def polar_to_cartesian(angle, radius, xaround, yaround):
|
||||
|
||||
class TransformState(renpy.object.Object):
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self): # W0231
|
||||
self.alpha = 1
|
||||
self.rotate = None
|
||||
self.zoom = 1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -124,7 +124,7 @@ class SnowBlossomFactory(object):
|
||||
self.init()
|
||||
|
||||
def init(self):
|
||||
self.starts = [ random.uniform(0, self.start) for i in range(0, self.count) ]
|
||||
self.starts = [ random.uniform(0, self.start) for i in range(0, self.count) ] # W0201
|
||||
self.starts.append(self.start)
|
||||
self.starts.sort()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -32,9 +32,9 @@ class ModuleProxy(object):
|
||||
self.__dict__.update(module.__dict__)
|
||||
|
||||
opygame = ModuleProxy(pygame)
|
||||
opygame.display = ModuleProxy(pygame.display)
|
||||
opygame.transform = ModuleProxy(pygame.transform)
|
||||
opygame.image = ModuleProxy(pygame.image)
|
||||
opygame.display = ModuleProxy(pygame.display) # W0201
|
||||
opygame.transform = ModuleProxy(pygame.transform) # W0201
|
||||
opygame.image = ModuleProxy(pygame.image) # W0201
|
||||
|
||||
|
||||
# Sample surfaces, with and without alpha.
|
||||
@@ -98,7 +98,7 @@ def surface((width, height), alpha):
|
||||
sample = opygame.Surface((2, 2), opygame.SRCALPHA, 32)
|
||||
|
||||
surf = Surface((width + 2, height + 2), 0, sample)
|
||||
return surf.subsurface((1, 1, width, height))
|
||||
return surf.subsurface((1, 1, width, height)) # E1101
|
||||
|
||||
surface_unscaled = surface
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -53,9 +53,9 @@ def start(gamedir):
|
||||
import sys
|
||||
|
||||
if sys.argv[0].lower().endswith(".exe"):
|
||||
proc = subprocess.Popen([sys.argv[0], "--presplash", fn], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||
proc = subprocess.Popen([sys.argv[0], "--presplash", fn], stdin=subprocess.PIPE, stdout=subprocess.PIPE) # W0631
|
||||
else:
|
||||
proc = subprocess.Popen([sys.executable, sys.argv[0], "--presplash", fn], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||
proc = subprocess.Popen([sys.executable, sys.argv[0], "--presplash", fn], stdin=subprocess.PIPE, stdout=subprocess.PIPE) # W0631
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -92,7 +92,7 @@ def show(fn):
|
||||
|
||||
pygame.display.init()
|
||||
|
||||
img = pygame.image.load(fn)
|
||||
img = pygame.image.load(fn, fn)
|
||||
screen = pygame.display.set_mode(img.get_size(), pygame.constants.NOFRAME)
|
||||
screen.blit(img, (0, 0))
|
||||
pygame.display.update()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -292,6 +292,9 @@ def load_scaling():
|
||||
|
||||
w = int(w * factor)
|
||||
h = int(h * factor)
|
||||
|
||||
if isinstance(alpha, ScaledSurface):
|
||||
alpha = alpha.surface # E1103
|
||||
|
||||
self.surface = pgrender.surface_unscaled((w, h), alpha)
|
||||
|
||||
@@ -381,7 +384,6 @@ def load_scaling():
|
||||
|
||||
set_colorkey = proxy("set_colorkey")
|
||||
get_alpha = proxy("get_alpha")
|
||||
get_locked = proxy("get_locked")
|
||||
get_locks = proxy("get_locks")
|
||||
map_rgb = proxy("map_rgb")
|
||||
unmap_rgb = proxy("unmap_rgb")
|
||||
|
||||
+56
-24
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -99,9 +99,25 @@ class TextStyle(object):
|
||||
def __init__(self, source=None):
|
||||
if source is not None:
|
||||
vars(self).update(vars(source))
|
||||
else:
|
||||
self.font = ""
|
||||
self.size = 0
|
||||
self.bold = False
|
||||
self.italic = False
|
||||
self.underline = False
|
||||
self.strikethrough = False
|
||||
self.color = None
|
||||
self.black_color = None
|
||||
self.hyperlink = None
|
||||
|
||||
# The cached font.
|
||||
self.f = None
|
||||
|
||||
# Width cache.
|
||||
self.wcache = { }
|
||||
|
||||
# Surface cache.
|
||||
self.scache = { }
|
||||
|
||||
def update(self):
|
||||
self.f = get_font(self.font, self.size, self.bold, self.italic, self.underline, 0)
|
||||
@@ -124,12 +140,17 @@ class TextStyle(object):
|
||||
|
||||
return self.get_width(text), self.f.get_ascent() - self.f.get_descent()
|
||||
|
||||
def render(self, text, antialias, color, black_color, use_colors, time, at, expand):
|
||||
|
||||
def render(self, text, antialias, color, black_color, use_colors, time, at, expand, use_cache):
|
||||
|
||||
if use_colors:
|
||||
color = self.color or color
|
||||
black_color = self.black_color or black_color
|
||||
|
||||
key = (text, antialias, color, black_color, expand)
|
||||
|
||||
if use_cache and key in self.scache:
|
||||
return self.scache[key]
|
||||
|
||||
if expand:
|
||||
font = get_font(self.font, self.size, self.bold, self.italic, self.underline, expand)
|
||||
else:
|
||||
@@ -159,7 +180,10 @@ class TextStyle(object):
|
||||
renpy.display.module.linmap(rv, rv, 256, 256, 256, a + 1)
|
||||
|
||||
renpy.display.render.mutated_surface(rv)
|
||||
|
||||
|
||||
if use_cache and not renpy.game.less_memory:
|
||||
self.scache[key] = (rv, rv.get_size())
|
||||
|
||||
return rv, rv.get_size()
|
||||
|
||||
def length(self, text):
|
||||
@@ -196,7 +220,7 @@ class WidgetStyle(object):
|
||||
def sizes(self, widget):
|
||||
return self.width, self.height
|
||||
|
||||
def render(self, widget, antialias, color, black_color, foreground, st, at, expand):
|
||||
def render(self, widget, antialias, color, black_color, foreground, st, at, expand, use_cache):
|
||||
|
||||
# If in the foreground
|
||||
if foreground:
|
||||
@@ -659,6 +683,9 @@ class Text(renpy.display.core.Displayable):
|
||||
# The duration of each pause, or None if the pause is infinite.
|
||||
self.pause_lengths = [ ]
|
||||
|
||||
# The width we've been laid out for.
|
||||
self.width = -1
|
||||
|
||||
self.update(redraw=False)
|
||||
|
||||
|
||||
@@ -706,12 +733,12 @@ class Text(renpy.display.core.Displayable):
|
||||
|
||||
new_tokens = [ ]
|
||||
fasts = 0
|
||||
self.no_wait = False
|
||||
self.no_wait_once = False
|
||||
self.no_wait_done = False
|
||||
|
||||
self.pauses = 0
|
||||
self.pause_lengths = [ ]
|
||||
self.no_wait = False # W0201
|
||||
self.no_wait_once = False # W0201
|
||||
self.no_wait_done = False # W0201
|
||||
self.pauses = 0 # W0201
|
||||
self.pause_lengths = [ ] # W0201
|
||||
|
||||
for i in self.tokens[0]:
|
||||
type, text = i
|
||||
@@ -802,7 +829,7 @@ class Text(renpy.display.core.Displayable):
|
||||
|
||||
# Postprocess the tokens list to create widgets, as necessary.
|
||||
|
||||
self.children = [ ]
|
||||
self.children = [ ] # W0201
|
||||
newtokens = [ ]
|
||||
|
||||
for tl in self.tokens:
|
||||
@@ -878,10 +905,10 @@ class Text(renpy.display.core.Displayable):
|
||||
|
||||
|
||||
def visit(self):
|
||||
if self.tokens is None:
|
||||
if self.tokens is None:
|
||||
self.update()
|
||||
|
||||
return self.children
|
||||
return self.children
|
||||
|
||||
|
||||
def layout(self, width, time):
|
||||
@@ -919,7 +946,7 @@ class Text(renpy.display.core.Displayable):
|
||||
tsl[-1].hyperlink = None
|
||||
tsl[-1].update()
|
||||
|
||||
self.laidout_hyperlinks = [ ]
|
||||
self.laidout_hyperlinks = [ ] # W0201
|
||||
|
||||
# if not self.text:
|
||||
# text = " "
|
||||
@@ -1131,14 +1158,14 @@ class Text(renpy.display.core.Displayable):
|
||||
# Now, we need to go through these lines, to generate the data
|
||||
# we need to render text.
|
||||
|
||||
self.laidout = [ ]
|
||||
self.laidout_lineheights = [ ]
|
||||
self.laidout_linewidths = [ ]
|
||||
self.laidout_length = 0
|
||||
self.laidout_start = 0
|
||||
self.laidout_width = self.style.min_width
|
||||
self.laidout_height = 0
|
||||
self.laidout_lines_last = lines_last
|
||||
self.laidout = [ ] # W0201
|
||||
self.laidout_lineheights = [ ] # W0201
|
||||
self.laidout_linewidths = [ ] # W0201
|
||||
self.laidout_length = 0 # W0201
|
||||
self.laidout_start = 0 # W0201
|
||||
self.laidout_width = self.style.min_width # W0201
|
||||
self.laidout_height = 0 # W0201
|
||||
self.laidout_lines_last = lines_last # W0201
|
||||
|
||||
# Add something to empty lines.
|
||||
for l in linetriples:
|
||||
@@ -1314,13 +1341,18 @@ class Text(renpy.display.core.Displayable):
|
||||
|
||||
length -= ts.length(text)
|
||||
|
||||
# Should we cache the rendered text?
|
||||
use_cache = True
|
||||
|
||||
if length < 0:
|
||||
use_cache = False
|
||||
|
||||
if isinstance(text, (str, unicode)):
|
||||
text = text[:length]
|
||||
else:
|
||||
return False
|
||||
|
||||
surf, (sw, sh) = ts.render(text, antialias, color, black_color, user_colors, time, at, expand)
|
||||
surf, (sw, sh) = ts.render(text, antialias, color, black_color, user_colors, time, at, expand, use_cache)
|
||||
|
||||
if expand:
|
||||
(sw, sh) = ts.sizes(text)
|
||||
@@ -1423,7 +1455,7 @@ class Text(renpy.display.core.Displayable):
|
||||
else:
|
||||
length = sys.maxint
|
||||
self.call_slow_done(st)
|
||||
|
||||
|
||||
rv = renpy.display.render.Render(self.laidout_width - mindsx + maxdsx, self.laidout_height - mindsy + maxdsy)
|
||||
|
||||
for dsxo, dsyo in dslist:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -53,12 +53,12 @@ class Transition(renpy.display.core.Displayable):
|
||||
def event(self, ev, x, y, st):
|
||||
|
||||
if self.events or ev.type == renpy.display.core.TIMEEVENT:
|
||||
return self.new_widget.event(ev, x, y, st)
|
||||
return self.new_widget.event(ev, x, y, st) # E1101
|
||||
else:
|
||||
return None
|
||||
|
||||
def visit(self):
|
||||
return [ self.new_widget, self.old_widget ]
|
||||
return [ self.new_widget, self.old_widget ] # E1101
|
||||
|
||||
def null_render(d, width, height, st, at):
|
||||
|
||||
@@ -279,7 +279,7 @@ class Pixellate(Transition):
|
||||
surf = rdr.pygame_surface(False)
|
||||
size = surf.get_size()
|
||||
|
||||
newsurf = renpy.display.pgrender.surface(size, False)
|
||||
newsurf = renpy.display.pgrender.surface(size, surf)
|
||||
|
||||
px = 2 ** step
|
||||
|
||||
@@ -491,17 +491,6 @@ class ImageDissolve(Transition):
|
||||
|
||||
ramp += '\xff' * 256
|
||||
|
||||
old = 0
|
||||
for i in ramp:
|
||||
i = ord(i)
|
||||
if i < old:
|
||||
self.can_fast = False
|
||||
break
|
||||
|
||||
old = i
|
||||
else:
|
||||
self.can_fast = True
|
||||
|
||||
if reverse:
|
||||
ramp = list(ramp)
|
||||
ramp.reverse()
|
||||
@@ -972,9 +961,8 @@ def MoveTransition(delay, old_widget=None, new_widget=None, factory=None, enter
|
||||
|
||||
if (isinstance(f, renpy.display.layout.MultiBox)
|
||||
and layer in layers
|
||||
and f.scene_list is not None
|
||||
and layer not in renpy.config.overlay_layers):
|
||||
|
||||
and f.scene_list is not None):
|
||||
|
||||
f = merge_slide(old.layers[layer], new.layers[layer])
|
||||
|
||||
rv.layers[layer] = f
|
||||
@@ -1090,7 +1078,7 @@ def MoveTransition(delay, old_widget=None, new_widget=None, factory=None, enter
|
||||
# This calls merge_slide to actually do the merging.
|
||||
|
||||
rv = merge_slide(old_widget, new_widget)
|
||||
rv.delay = delay
|
||||
rv.delay = delay # W0201
|
||||
|
||||
return rv
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
+7
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -36,6 +36,8 @@ class PredictInfo(renpy.object.Object):
|
||||
|
||||
def __init__(self, pi=None):
|
||||
|
||||
super(PredictInfo, self).__init__()
|
||||
|
||||
if pi:
|
||||
self.images = renpy.display.core.ImagePredictInfo(pi.images)
|
||||
else:
|
||||
@@ -82,6 +84,8 @@ class Context(renpy.object.Object):
|
||||
|
||||
def __init__(self, rollback, context=None):
|
||||
|
||||
super(Context, self).__init__()
|
||||
|
||||
self.current = None
|
||||
self.call_location_stack = [ ]
|
||||
self.return_stack = [ ]
|
||||
@@ -253,7 +257,7 @@ class Context(renpy.object.Object):
|
||||
"""
|
||||
|
||||
if not self.current:
|
||||
raise "Context not capable of executing Ren'Py code."
|
||||
raise Exception("Context not capable of executing Ren'Py code.")
|
||||
|
||||
if return_site is None:
|
||||
return_site = self.current
|
||||
@@ -345,8 +349,7 @@ class Context(renpy.object.Object):
|
||||
print "While predicting images."
|
||||
|
||||
# We accept that sometimes prediction won't work.
|
||||
pass
|
||||
|
||||
|
||||
self.predict_info = old_predict_info
|
||||
|
||||
|
||||
|
||||
+56
-16
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -46,6 +46,8 @@ from renpy.character import show_display_say, predict_show_display_say, display_
|
||||
import renpy.audio.sound as sound
|
||||
import renpy.audio.music as music
|
||||
|
||||
import time
|
||||
|
||||
|
||||
def public_api():
|
||||
"""
|
||||
@@ -66,7 +68,8 @@ def public_api():
|
||||
show_display_say, predict_show_display_say, display_say
|
||||
sound
|
||||
music
|
||||
|
||||
time
|
||||
|
||||
del public_api
|
||||
|
||||
|
||||
@@ -232,7 +235,7 @@ def show(name, at_list=[ ], layer='master', what=None, zorder=0, tag=None, behin
|
||||
if renpy.config.missing_hide:
|
||||
renpy.config.missing_hide(name, layer)
|
||||
|
||||
sls.add(layer, img, key, zorder, behind, at_list=at_list, name=name, atl=atl)
|
||||
sls.add(layer, img, key, zorder, behind, at_list=at_list, name=name, atl=atl, default_transform=renpy.config.default_transform)
|
||||
|
||||
|
||||
def hide(name, layer='master'):
|
||||
@@ -505,7 +508,7 @@ def predict_say(who, what):
|
||||
"""
|
||||
|
||||
if who is None:
|
||||
who = renpy.store.narrator
|
||||
who = renpy.store.narrator # E1101
|
||||
|
||||
if isinstance(who, (str, unicode)):
|
||||
return renpy.store.predict_say(who, what)
|
||||
@@ -528,7 +531,7 @@ def say(who, what, interact=True):
|
||||
what = what % tag_quoting_dict
|
||||
|
||||
if who is None:
|
||||
who = renpy.store.narrator
|
||||
who = renpy.store.narrator # E1101
|
||||
|
||||
if isinstance(who, (str, unicode)):
|
||||
renpy.store.say(who, what, interact=interact)
|
||||
@@ -1030,7 +1033,7 @@ def launch_editor(filenames, line=1, transient=0):
|
||||
cmd = cmd.replace('""', '')
|
||||
|
||||
try:
|
||||
subprocess.Popen(split_args(cmd))
|
||||
subprocess.Popen(split_args(cmd)) # E1101
|
||||
return True
|
||||
except:
|
||||
if renpy.config.debug:
|
||||
@@ -1241,19 +1244,22 @@ def game_menu(screen=None):
|
||||
def shown_window():
|
||||
renpy.game.context().scene_lists.shown_window = True
|
||||
|
||||
class placement(renpy.python.RevertableObject):
|
||||
def __init__(self, p):
|
||||
super(placement, self).__init__()
|
||||
|
||||
self.xpos = p[0]
|
||||
self.ypos = p[1]
|
||||
self.xanchor = p[2]
|
||||
self.yanchor = p[3]
|
||||
self.xoffset = p[4]
|
||||
self.yoffset = p[5]
|
||||
self.subpixel = p[6]
|
||||
|
||||
def get_placement(d):
|
||||
o = renpy.store.object()
|
||||
p = d.get_placement()
|
||||
|
||||
o.xpos = p[0]
|
||||
o.ypos = p[1]
|
||||
o.xanchor = p[2]
|
||||
o.yanchor = p[3]
|
||||
o.xoffset = p[4]
|
||||
o.yoffset = p[5]
|
||||
o.subpixel = p[6]
|
||||
|
||||
return o
|
||||
return placement(p)
|
||||
|
||||
# User-Defined Displayable stuff.
|
||||
|
||||
@@ -1271,6 +1277,40 @@ class Container(renpy.display.core.Displayable, renpy.python.RevertableObject):
|
||||
def get_roll_forward():
|
||||
return renpy.game.interface.shown_window
|
||||
|
||||
def cache_pin(*args):
|
||||
|
||||
new_pins = renpy.python.RevertableSet()
|
||||
|
||||
for i in args:
|
||||
|
||||
im = renpy.easy.displayable(i)
|
||||
|
||||
if not isinstance(im, renpy.display.im.ImageBase):
|
||||
raise Exception("Cannot pin non-image-manipulator %r" % im)
|
||||
|
||||
new_pins.add(im)
|
||||
|
||||
renpy.store._cache_pin_set = new_pins | renpy.store._cache_pin_set
|
||||
|
||||
|
||||
def cache_unpin(*args):
|
||||
|
||||
new_pins = renpy.python.RevertableSet()
|
||||
|
||||
for i in args:
|
||||
|
||||
im = renpy.easy.displayable(i)
|
||||
|
||||
if not isinstance(im, renpy.display.im.ImageBase):
|
||||
raise Exception("Cannot unpin non-image-manipulator %r" % im)
|
||||
|
||||
new_pins.add(im)
|
||||
|
||||
renpy.store._cache_pin_set = renpy.store._cache_pin_set - new_pins
|
||||
|
||||
|
||||
|
||||
|
||||
# This is a map from a definition to the place where it was
|
||||
# defined.
|
||||
definitions = collections.defaultdict(list)
|
||||
|
||||
+18
-15
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -42,6 +42,9 @@ searchpath = [ ]
|
||||
# The options that were read off the command line.
|
||||
options = None
|
||||
|
||||
# The game's script.
|
||||
script = None
|
||||
|
||||
# A shallow copy of the store dictionary made at the end of the init
|
||||
# phase. If a key in here points to the same value here as it does in
|
||||
# the store, it is not saved.
|
||||
@@ -113,31 +116,31 @@ class Preferences(object):
|
||||
Stores preferences that will one day be persisted.
|
||||
"""
|
||||
def reinit(self):
|
||||
self.fullscreen = False
|
||||
self.skip_unseen = False
|
||||
self.text_cps = 0
|
||||
self.afm_time = 0
|
||||
self.afm_enable = True
|
||||
self.fullscreen = False # W0201
|
||||
self.skip_unseen = False # W0201
|
||||
self.text_cps = 0 # W0201
|
||||
self.afm_time = 0 # W0201
|
||||
self.afm_enable = True # W0201
|
||||
|
||||
|
||||
# These will be going away soon.
|
||||
self.sound = True
|
||||
self.music = True
|
||||
self.sound = True # W0201
|
||||
self.music = True # W0201
|
||||
|
||||
|
||||
# 2 - All transitions.
|
||||
# 1 - Only non-default transitions.
|
||||
# 0 - No transitions.
|
||||
self.transitions = 2
|
||||
self.transitions = 2 # W0201
|
||||
|
||||
self.skip_after_choices = False
|
||||
self.skip_after_choices = False # W0201
|
||||
|
||||
# Mixer channel info.
|
||||
self.volumes = { }
|
||||
self.mute = { }
|
||||
self.volumes = { } # W0201
|
||||
self.mute = { } # W0201
|
||||
|
||||
# Joystick mappings.
|
||||
self.joymap = dict(
|
||||
self.joymap = dict( # W0201
|
||||
joy_left="Axis 0.0 Negative",
|
||||
joy_right="Axis 0.0 Positive",
|
||||
joy_up="Axis 0.1 Negative",
|
||||
@@ -171,7 +174,7 @@ class RestartException(Exception):
|
||||
been changed, and therefore execution needs to be restarted.
|
||||
"""
|
||||
|
||||
def __init__(self, contexts, label):
|
||||
def __init__(self, contexts, label): # W0231
|
||||
self.contexts = contexts
|
||||
self.label = label
|
||||
|
||||
@@ -181,7 +184,7 @@ class FullRestartException(Exception):
|
||||
destroying the store and config and so on.
|
||||
"""
|
||||
|
||||
def __init__(self, reason="end_game"):
|
||||
def __init__(self, reason="end_game"): # W0231
|
||||
self.reason = reason
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -126,7 +126,7 @@ def check_file(what, fn):
|
||||
check_file_cache[fn] = True
|
||||
|
||||
try:
|
||||
renpy.loader.transfn(fn)
|
||||
renpy.loader.transfn(fn)
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
+4
-2
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -407,6 +407,8 @@ def MultiPersistent(name):
|
||||
except:
|
||||
pass
|
||||
|
||||
fn = "" # prevent a warning from happening.
|
||||
|
||||
# Find the first file that actually exists. Otherwise, use the last
|
||||
# file.
|
||||
for fn in files:
|
||||
@@ -419,7 +421,7 @@ def MultiPersistent(name):
|
||||
except:
|
||||
rv = _MultiPersistent()
|
||||
|
||||
rv._filename = fn
|
||||
rv._filename = fn # W0201
|
||||
return rv
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -131,7 +131,7 @@ def main():
|
||||
renpy.config.searchpath = [ renpy.config.gamedir ]
|
||||
|
||||
# Find the common directory.
|
||||
commondir = __main__.path_to_common(renpy.config.renpy_base)
|
||||
commondir = __main__.path_to_common(renpy.config.renpy_base) # E1101
|
||||
|
||||
if os.path.isdir(commondir):
|
||||
renpy.config.searchpath.append(commondir)
|
||||
@@ -179,7 +179,7 @@ def main():
|
||||
|
||||
# Find the save directory.
|
||||
if renpy.config.savedir is None:
|
||||
renpy.config.savedir = __main__.path_to_saves(renpy.config.gamedir)
|
||||
renpy.config.savedir = __main__.path_to_saves(renpy.config.gamedir) # E1101
|
||||
|
||||
if renpy.game.options.savedir:
|
||||
renpy.config.savedir = renpy.game.options.savedir
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -51,10 +51,10 @@ class Object(object):
|
||||
self.__dict__.update(new_dict)
|
||||
|
||||
if version != self.__version__:
|
||||
self.after_upgrade(version)
|
||||
self.after_upgrade(version) # E1101
|
||||
|
||||
if self.after_setstate:
|
||||
self.after_setstate()
|
||||
self.after_setstate() # E1102
|
||||
|
||||
# We don't handle slots with this mechanism, since the call to vars should
|
||||
# throw an error.
|
||||
|
||||
+32
-12
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -81,6 +81,15 @@ class ParseError(Exception):
|
||||
def __unicode__(self):
|
||||
return self.message
|
||||
|
||||
# Something to hold the expected line number.
|
||||
class LineNumberHolder(object):
|
||||
"""
|
||||
Holds the expected line number.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.line = 0
|
||||
|
||||
def unicode_filename(fn):
|
||||
"""
|
||||
Converts the supplied filename to unicode.
|
||||
@@ -377,7 +386,16 @@ class Lexer(object):
|
||||
self.eob = False
|
||||
|
||||
self.line = -1
|
||||
|
||||
|
||||
# These are set by advance.
|
||||
self.filename = ""
|
||||
self.text = ""
|
||||
self.number = 0
|
||||
self.subblock = [ ]
|
||||
self.pos = 0
|
||||
self.word_cache_pos = -1
|
||||
self.word_cache_newpos = -1
|
||||
self.word_cache = ""
|
||||
|
||||
def advance(self):
|
||||
"""
|
||||
@@ -716,12 +734,12 @@ class Lexer(object):
|
||||
extending to a colon.
|
||||
"""
|
||||
|
||||
rv = self.delimited_python(':')
|
||||
pe = self.delimited_python(':')
|
||||
|
||||
if not rv:
|
||||
if not pe:
|
||||
self.error("expected python_expression")
|
||||
|
||||
rv = renpy.ast.PyExpr(rv.strip(), rv.filename, rv.linenumber)
|
||||
rv = renpy.ast.PyExpr(pe.strip(), pe.filename, pe.linenumber) # E1101
|
||||
|
||||
return rv
|
||||
|
||||
@@ -867,10 +885,7 @@ class Lexer(object):
|
||||
|
||||
rv = [ ]
|
||||
|
||||
# Something to hold the expected line number.
|
||||
class Object(object):
|
||||
pass
|
||||
o = Object()
|
||||
o = LineNumberHolder()
|
||||
o.line = self.number
|
||||
|
||||
def process(block, indent):
|
||||
@@ -1211,7 +1226,7 @@ def parse_parameters(l):
|
||||
parameters.append((name, default))
|
||||
|
||||
if add_positional:
|
||||
positional.append(name)
|
||||
positional.append(name)
|
||||
|
||||
if l.match(r'\)'):
|
||||
break
|
||||
@@ -1410,10 +1425,15 @@ def parse_statement(l):
|
||||
if l.keyword('expression'):
|
||||
expression = True
|
||||
target = l.require(l.simple_expression)
|
||||
|
||||
else:
|
||||
expression = False
|
||||
target = l.require(l.name)
|
||||
|
||||
# Optional pass, to let someone write:
|
||||
# call expression foo pass (bar, baz)
|
||||
l.keyword('pass')
|
||||
|
||||
arguments = parse_arguments(l)
|
||||
|
||||
rv = [ ast.Call(loc, target, expression, arguments) ]
|
||||
@@ -1534,7 +1554,7 @@ def parse_statement(l):
|
||||
rv = ast.Define(loc, name, expr)
|
||||
|
||||
if not l.init:
|
||||
rv = ast.Init(loc, [ rv ], priority)
|
||||
rv = ast.Init(loc, [ rv ], priority)
|
||||
|
||||
l.advance()
|
||||
|
||||
@@ -1810,7 +1830,7 @@ def report_parse_errors():
|
||||
if renpy.config.editor:
|
||||
renpy.exports.launch_editor([ 'errors.txt' ], 1, transient=1)
|
||||
else:
|
||||
os.startfile('errors.txt')
|
||||
os.startfile('errors.txt') # E1101
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
+24
-15
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -72,9 +72,9 @@ def reached(obj, reachable, wait):
|
||||
pass
|
||||
|
||||
try:
|
||||
# Treat as iterable
|
||||
# Treat as iterable
|
||||
if not isinstance(obj, basestring):
|
||||
for v in obj:
|
||||
for v in obj.__iter__():
|
||||
reached(v, reachable, wait)
|
||||
except:
|
||||
pass
|
||||
@@ -299,9 +299,9 @@ class RevertableList(list):
|
||||
reverse = mutator(list.reverse)
|
||||
sort = mutator(list.sort)
|
||||
|
||||
def wrapper(method):
|
||||
def newmethod(*args, **kwargs):
|
||||
return RevertableList(method(*args, **kwargs))
|
||||
def wrapper(method): # E0213
|
||||
def newmethod(*args, **kwargs):
|
||||
return RevertableList(method(*args, **kwargs)) # E1102
|
||||
|
||||
return newmethod
|
||||
|
||||
@@ -309,6 +309,8 @@ class RevertableList(list):
|
||||
__getslice__ = wrapper(list.__getslice__)
|
||||
__mul__ = wrapper(list.__mul__)
|
||||
|
||||
del wrapper
|
||||
|
||||
def get_rollback(self):
|
||||
return self[:]
|
||||
|
||||
@@ -330,9 +332,9 @@ class RevertableDict(dict):
|
||||
popitem = mutator(dict.popitem)
|
||||
setdefault = mutator(dict.setdefault)
|
||||
|
||||
def list_wrapper(method):
|
||||
def list_wrapper(method): # E0213
|
||||
def newmethod(*args, **kwargs):
|
||||
return RevertableList(method(*args, **kwargs))
|
||||
return RevertableList(method(*args, **kwargs)) # E1102
|
||||
|
||||
return newmethod
|
||||
|
||||
@@ -340,6 +342,8 @@ class RevertableDict(dict):
|
||||
values = list_wrapper(dict.values)
|
||||
items = list_wrapper(dict.items)
|
||||
|
||||
del list_wrapper
|
||||
|
||||
def copy(self):
|
||||
rv = RevertableDict()
|
||||
rv.update(self)
|
||||
@@ -371,11 +375,9 @@ class RevertableSet(sets.Set):
|
||||
union_update = mutator(sets.Set.union_update)
|
||||
update = mutator(sets.Set.update)
|
||||
|
||||
# TODO: Wrap all of the methods that can return normal sets.
|
||||
|
||||
def wrapper(method):
|
||||
def wrapper(method): # E0213
|
||||
def newmethod(*args, **kwargs):
|
||||
rv = method(*args, **kwargs)
|
||||
rv = method(*args, **kwargs) # E1102
|
||||
if isinstance(rv, sets.Set):
|
||||
return RevertableSet(rv)
|
||||
else:
|
||||
@@ -494,6 +496,9 @@ class Rollback(renpy.object.Object):
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
|
||||
super(Rollback, self).__init__()
|
||||
|
||||
self.context = renpy.game.contexts[0].rollback_copy()
|
||||
self.objects = [ ]
|
||||
self.store = [ ]
|
||||
@@ -542,7 +547,8 @@ class Rollback(renpy.object.Object):
|
||||
else:
|
||||
if renpy.config.debug:
|
||||
print "Removing unreachable:", o
|
||||
pass
|
||||
|
||||
pass
|
||||
|
||||
self.objects = new_objects
|
||||
|
||||
@@ -598,16 +604,19 @@ class RollbackLog(renpy.object.Object):
|
||||
nosave = [ 'old_store', 'mutated' ]
|
||||
|
||||
def __init__(self):
|
||||
|
||||
super(RollbackLog, self).__init__()
|
||||
|
||||
self.log = [ ]
|
||||
self.current = None
|
||||
self.mutated = { }
|
||||
self.ever_been_changed = { }
|
||||
self.rollback_limit = 0
|
||||
self.forward = [ ]
|
||||
|
||||
self.old_store = { }
|
||||
|
||||
# Did we just do a roll forward?
|
||||
self.rolled_forward = False
|
||||
|
||||
|
||||
# Reset the RNG on the creation of a new game.
|
||||
rng.reset()
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -106,6 +106,11 @@ class Script(object):
|
||||
self.all_stmts = [ ]
|
||||
self.all_pycode = [ ]
|
||||
|
||||
# Bytecode caches.
|
||||
self.bytecode_oldcache = { }
|
||||
self.bytecode_newcache = { }
|
||||
self.bytecode_dirty = False
|
||||
|
||||
# Init the bytecode compiler.
|
||||
self.init_bytecode()
|
||||
|
||||
@@ -261,8 +266,7 @@ class Script(object):
|
||||
data, stmts = loads(f.read().decode('zlib'))
|
||||
except:
|
||||
raise
|
||||
return None, None
|
||||
|
||||
|
||||
if not isinstance(data, dict):
|
||||
return None, None
|
||||
|
||||
@@ -388,10 +392,6 @@ class Script(object):
|
||||
Init/Loads the bytecode cache.
|
||||
"""
|
||||
|
||||
self.bytecode_oldcache = { }
|
||||
self.bytecode_newcache = { }
|
||||
self.bytecode_dirty = False
|
||||
|
||||
# Load the oldcache.
|
||||
try:
|
||||
version, cache = loads(renpy.loader.load("bytecode.rpyb").read().decode("zlib"))
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
+12
-3
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -74,7 +74,7 @@ class _Config(object):
|
||||
raise Exception('config.%s is not a known configuration variable.' % (name))
|
||||
|
||||
if name == "script_version":
|
||||
renpy.store._set_script_version(value)
|
||||
renpy.store._set_script_version(value) # E1101
|
||||
|
||||
cvars[name] = value
|
||||
|
||||
@@ -83,7 +83,10 @@ class _Config(object):
|
||||
raise Exception('Deleting configuration variables is not supported.')
|
||||
else:
|
||||
delattr(renpy.config, name)
|
||||
|
||||
|
||||
# The styles object.
|
||||
style = None
|
||||
|
||||
config = _Config()
|
||||
library = config
|
||||
|
||||
@@ -291,7 +294,13 @@ def say(who, what, interact=True):
|
||||
who = Character(who, kind=name_only)
|
||||
who(what, interact=interact)
|
||||
|
||||
# Used by renpy.reshow_say.
|
||||
_last_say_who = None
|
||||
_last_say_what = None
|
||||
|
||||
# Used to store the things pinned into the cache.
|
||||
_cache_pin_set = set()
|
||||
|
||||
__name__ = 'store'
|
||||
|
||||
import sys
|
||||
|
||||
+3
-2
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -629,7 +629,7 @@ class Style(object):
|
||||
if isinstance(parent, basestring):
|
||||
parent = ( parent, )
|
||||
if isinstance(parent, Style):
|
||||
parent = parent.name
|
||||
parent = parent.name # E1103
|
||||
|
||||
if parent is None:
|
||||
raise Exception("The parent of a style must be a named style.")
|
||||
@@ -647,6 +647,7 @@ class Style(object):
|
||||
else:
|
||||
self.name = ( name, )
|
||||
|
||||
self.parent = None
|
||||
self.set_parent(parent)
|
||||
|
||||
self.indexed = None
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -26,7 +26,7 @@
|
||||
# but are probably better than nothing.
|
||||
|
||||
import sys
|
||||
import encodings.zlib_codec; encodings.zlib_codec
|
||||
import encodings.zlib_codec; encodings.zlib_codec # E0601
|
||||
import random
|
||||
import glob
|
||||
|
||||
@@ -60,7 +60,7 @@ def archive(prefix, files):
|
||||
|
||||
key = random.randint(0, 0x7ffffffe)
|
||||
|
||||
padding = "RPA-3.0 XXXXXXXXXXXXXXXX XXXXXXXX\n"
|
||||
padding = "RPA-3.0 XXXXXXXXXXXXXXXX XXXXXXXX\n" # W0511
|
||||
|
||||
archivef.write(padding)
|
||||
offset = len(padding)
|
||||
|
||||
+7
-3
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -62,6 +62,7 @@ def interact(type='misc', **kwargs):
|
||||
if current_stack:
|
||||
raise Exception("ui.interact called with non-empty widget/layer stack. Did you forget a ui.close() somewhere?")
|
||||
|
||||
|
||||
if at_stack:
|
||||
raise Exception("ui.interact called with non-empty at stack.")
|
||||
|
||||
@@ -102,7 +103,7 @@ def add(w, make_current=False, once=False):
|
||||
elif current is None:
|
||||
pass
|
||||
else:
|
||||
current.add(atw)
|
||||
current.add(atw) # E1103
|
||||
|
||||
add_tag = None
|
||||
|
||||
@@ -326,6 +327,9 @@ def imagemap(ground,
|
||||
button_style='imagemap_button',
|
||||
**properties):
|
||||
|
||||
if isinstance(button_style, basestring):
|
||||
button_style = getattr(renpy.game.style, button_style)
|
||||
|
||||
rv = fixed(style=style, **properties)
|
||||
|
||||
if unselected is None:
|
||||
@@ -341,7 +345,7 @@ def imagemap(ground,
|
||||
imagebutton(renpy.display.layout.LiveCrop((x0, y0, x1 - x0, y1 - y0), unselected),
|
||||
renpy.display.layout.LiveCrop((x0, y0, x1 - x0, y1 - y0), selected),
|
||||
clicked=returns(result),
|
||||
style=button_style,
|
||||
style=button_style[result],
|
||||
xpos=x0,
|
||||
xanchor=0,
|
||||
ypos=y0,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2009 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user