Compare commits

...

221 Commits

Author SHA1 Message Date
Tom Rothamel 4c7bdede29 Bump version. 2009-07-30 21:24:55 -04:00
Tom Rothamel 4208836d77 The various layouts now change the mouse to the gamemenu or mainmenu
mouse, as appropriate.
2009-07-30 21:13:34 -04:00
Tom Rothamel 592341f5b1 Editor selection tweaks. (Respects RENPY_EDITOR) 2009-07-30 21:04:06 -04:00
Tom Rothamel bc41ebadce Hide console on lint. 2009-07-29 23:36:02 -04:00
Tom Rothamel 0deadb41ee Reset LD_LIBRARY_PATH before running zenity. 2009-07-29 23:33:06 -04:00
Tom Rothamel 076624c4c2 Normalize filenames when building distributions. This prevents
duplicates and ensures that we can properly replace file data. For
example, on Windows, this was preventing Info.plist from being
replaced.
2009-07-28 22:23:33 -04:00
Tom Rothamel 943b421779 Bump version to 6.9.3a. 2009-07-14 09:59:00 -04:00
Tom Rothamel c21acfb108 Fix missed launcher internationalization. Thanks go to Cato. 2009-07-14 02:47:05 -04:00
Tom Rothamel 8ae58964d8 NVL-mode tutorial. 2009-07-14 01:59:03 -04:00
Tom Rothamel 0cf0135a00 Fix imagemap_preferences to properly highlight button. 2009-07-13 01:47:55 -04:00
Tom Rothamel 11d8a8a249 The save location for screenshots has now been standardized. It is now
the directory containing the executable used to start Ren'Py, be it a
.exe, .py, .sh, or .app. (The latter is handled specially.)
2009-07-12 16:49:45 -04:00
Tom Rothamel 8edacbf9f1 Fixed launchpad bug #392322. 2009-07-12 15:48:23 -04:00
Tom Rothamel e6f49527b6 Ren'Py will now search for a directory named "Ren'Py Data" in the
directories above your Ren'Py installation. If found, save data will
be placed in that directory, rather than the system-specific default
location. This should help make it easier to develop Ren'Py games when
using a USB drive.
2009-07-12 15:39:15 -04:00
Tom Rothamel 9b897f7ffc l2: Automatically update a translations file, if it exists. 2009-07-12 13:38:07 -04:00
Tom Rothamel bc06c75cf2 l2: translations framework 2009-07-12 12:16:09 -04:00
Tom Rothamel ef324e2f9f Remove debug print. 2009-07-11 15:43:17 -04:00
Tom Rothamel 002ed104de Allow config.layer_clipping to specify layers that are larger than the
screen.
2009-07-11 15:27:51 -04:00
Tom Rothamel 211fd59d66 The window show and window hide statements now work with NVL-mode,
and are probably preferred over nvl show and nvl hide.
2009-07-09 01:48:36 -04:00
Tom Rothamel 3827198240 Fixed a 5-year-old bug in rollback that prevented an object from being
rollback if it was not being referred to by an object in the current 
state. For example, if we did:

$ o.foo = [ ]

"point a"

$ o.foo.append(1)

"point b"

$ o.foo = None

"point c"

and then rolled back from point c to point a, o.foo would improperly remain
[1]. (And would become bigger each time we rolled back and forth.)
2009-07-06 23:51:40 -04:00
Tom Rothamel 760d975d5b L2 initial release. 2009-07-05 18:23:59 -04:00
Tom Rothamel ad25bd6597 l2 is now the default launcher. 2009-07-05 14:24:36 -04:00
Tom Rothamel 9edc9aa741 l2: text editing support. 2009-07-05 14:23:09 -04:00
Tom Rothamel 061f481d10 l2: new 2009-06-30 01:47:36 -04:00
Tom Rothamel f33839212d Add header to pot file. 2009-06-27 23:10:19 -04:00
Tom Rothamel ac46d25470 Switch to using pot files to store translations. 2009-06-27 22:41:25 -04:00
Tom Rothamel efdf7d4e30 l2: archiver. 2009-06-27 22:05:21 -04:00
Tom Rothamel 76d942ebb3 l2: progress bars and success screen 2009-06-27 20:50:16 -04:00
Tom Rothamel 24881174ce l2: Now building distributions on win, mac, linux, all. 2009-06-27 19:48:09 -04:00
Tom Rothamel 88a44ea1a9 l2: scanning files for distribution
l2: builds windows distribution
2009-06-27 18:42:57 -04:00
Tom Rothamel d0aed4a284 l2: distribute interface. 2009-06-27 14:31:03 -04:00
Tom Rothamel 47f5cce2c3 l2: Now can choose between multiple kinds of themes. 2009-06-27 00:11:03 -04:00
Tom Rothamel 534f669e1d l2: editor
l2: lint
l2: delete persistent
l2: start on theme changing
2009-06-26 04:17:08 -04:00
Tom Rothamel 2f422080e9 l2: game directory. 2009-06-26 02:08:11 -04:00
Tom Rothamel 6efbd90a7c Beginning work on Launcher2. 2009-06-26 01:59:14 -04:00
Tom Rothamel 446b5fd32f Also adjust times on root. 2009-06-12 16:36:16 -04:00
Tom Rothamel 705dc5f53b Fixed a problem that could cause children of the various
MultiBox-based displayables (Fixed, HBox, VBox, and LiveComposite) to
display animations incorrectly.
2009-06-11 21:50:44 -04:00
Tom Rothamel c5dba9f4a1 The new ui.detached function allows one to use the ui functions to
define displayables without adding them to a layer.
2009-06-11 21:09:56 -04:00
Tom Rothamel 904c2ebe73 Fix bug that caused renders to be cached without respect to displayable time. 2009-06-09 21:27:31 -04:00
Tom Rothamel 275f52814f Fix im.py:703: DeprecationWarning: integer argument expected, got float 2009-05-27 23:39:42 -04:00
Tom Rothamel 693cf9f8c9 Version bumps for 6.9.2 2009-05-05 02:09:59 -04:00
Tom Rothamel 35c2ec5a83 Fixed a bug that could cause it to take two tries to define a joystick
button.
2009-05-02 23:31:13 -04:00
Tom Rothamel 3b60efd744 Update changelog.
Fix dequeue to have correct semantics.
2009-05-02 23:05:27 -04:00
Tom Rothamel daac5d8ebf Doing anything besides rollforward during rollback now terminates
rollback.

Queueing music immediately after a play statement now allows the first 
track from the play statement to play.
2009-05-02 22:41:04 -04:00
Tom Rothamel 1fab6d8707 Prevent slow_done from being repeatedly called. 2009-05-02 21:32:24 -04:00
Tom Rothamel aaff11668a Catch errors when saving screenshots. 2009-05-02 20:21:18 -04:00
Tom Rothamel 536341a819 Fix problem with window icon on 16bit screen. 2009-05-01 22:16:29 -04:00
Tom Rothamel b9c468e446 Fix repeate word in the question. 2009-04-27 07:50:09 -04:00
Tom Rothamel 03edec9785 Fix a bug with Container. 2009-04-24 19:22:04 -04:00
Tom Rothamel da70a85d75 Bring in changes from staging. 2009-04-23 00:53:14 -04:00
Tom Rothamel 4ba170b8d8 Bring in features from mainline. 2009-04-23 00:52:04 -04:00
Tom Rothamel 72ae15c635 Back out some changes that lead to a slowdown in dissolve. 2009-04-22 23:16:49 -04:00
Tom Rothamel 1179066dda Bump version to 6.9.1h 2009-04-20 23:05:00 -04:00
Tom Rothamel 62d0093bee End skipping on rollback. 2009-04-20 23:01:10 -04:00
Tom Rothamel 55c0d3b4a7 Convert to alpha before smoothscaling windows icon. 2009-04-19 16:03:42 -04:00
Tom Rothamel 92014eafdd Fix a bug with the icon on windows. 2009-04-19 16:01:55 -04:00
Tom Rothamel b1be4c8ed4 The library alias for config has been removed. 2009-04-19 02:00:53 -04:00
Tom Rothamel 06f36dd8d1 Prevent infinite loop in error handling. 2009-04-19 01:31:26 -04:00
Tom Rothamel 3a15f5c717 6.9.1g 2009-04-18 23:24:22 -04:00
Tom Rothamel 031f3338b1 Scale screenshot using an alpha image. 2009-04-17 19:44:00 -04:00
Tom Rothamel 66125b2e10 Bump version. 2009-04-16 21:03:48 -04:00
Tom Rothamel e6becffc4c Blacklist obsolete file formats.
Properly deallocate VideoStates of short/invalid media files.
2009-04-16 19:31:50 -04:00
Tom Rothamel d281e57879 Fix reported bugs.
Make scaling more accurate.
2009-04-16 18:04:10 -04:00
Tom Rothamel 5196a970a0 Channels now have a default tightness. 2009-04-15 12:12:40 -04:00
Tom Rothamel efcbc92e7a Reimplement smoothscale in terms of _renpy.pixellate and _renpy.bilinear. 2009-04-15 01:10:13 -04:00
Tom Rothamel 142fa33548 Changelog updates. 2009-04-13 23:49:39 -04:00
Tom Rothamel 4b6e871ac6 6.9.1d 2009-04-13 23:40:13 -04:00
Tom Rothamel 1fbbad053a Add _rollback. 2009-04-13 23:11:39 -04:00
Tom Rothamel 61aa933d97 Fix rendering of empty image-based fonts. 2009-04-13 19:31:11 -04:00
Tom Rothamel 70c3ea773e Fix conflict between window show and shift+>. 2009-04-13 11:54:40 -04:00
Tom Rothamel a16de04682 The demo now passes with RENPY_SCALE_FACTOR=1.5. This required various fixes.
Prevent blit_lock from being held over a traceback.
2009-04-13 01:27:34 -04:00
Tom Rothamel 0280a12589 In SayBehavior, when a click comes in at the same time as a skip
timeout, favor the click.
2009-04-12 23:53:22 -04:00
Tom Rothamel 4dc8fef9c1 Fix a problems in scaling caused when images of different physical
sizes map to the same virtual size.

Fix a problem with restart.
2009-04-12 23:47:42 -04:00
Tom Rothamel 2c02645ec7 Lint now reports all uses of missing files, rather than just the first. 2009-04-12 15:14:19 -04:00
Tom Rothamel 40bad327fe renpy.full_restart now takes a target parameter, which is a screen on
the main menu to target.
2009-04-12 14:48:26 -04:00
Tom Rothamel f5653d3c4d Releasing 6.9.1c. 2009-04-11 14:16:14 -04:00
Tom Rothamel 4026d7818b Provide a basic mechanism for invoking the main menu with a particular screen. 2009-04-11 14:04:54 -04:00
Tom Rothamel a0fda2f058 Do not offer an editor if none exists.
Modified setup.py to check dependencies. It can now be used to build
on a stock ubuntu system, if all dependencies are in place.
2009-04-11 13:47:35 -04:00
Tom Rothamel 93546e2d5c Allow the movie channel to play back while muted. 2009-04-11 01:41:29 -04:00
Tom Rothamel 85a562713a Fix memory leak in the redraw queue. 2009-04-11 00:47:51 -04:00
Tom Rothamel 4e9beb1a5d Minor tweaks to the includes of ffdecode.c 2009-04-10 11:01:12 -04:00
Tom Rothamel 522333e0f5 Update help file to include a link to renpy/LICENSE.txt. 2009-04-10 10:15:06 -04:00
Tom Rothamel b4c4d0264c Make scale correct and higher quality. 2009-04-10 02:40:15 -04:00
Tom Rothamel 21c3187fa3 Fix help on an imagemap menu. 2009-04-10 00:03:42 -04:00
Tom Rothamel b377cfcdef Only play activate and hover sounds if defined. 2009-04-09 22:52:09 -04:00
Tom Rothamel 5d384e531d Drop log level in ffdecode.
Bump version to 6.9.1b.
2009-04-09 18:41:25 -04:00
Tom Rothamel 2b00c64973 More accurate durations on streams. 2009-04-09 14:44:48 -04:00
Tom Rothamel 7c777dea22 Scaling is now automatically enabled if the window won't fit on the screen. 2009-04-08 00:41:10 -04:00
Tom Rothamel 9d0c77917d Remove debugging code in nvl mode. 2009-04-07 11:59:32 -04:00
Tom Rothamel 6d40ced435 Updated renpy.sh to work on the Mac again. 2009-04-07 02:13:36 -04:00
Tom Rothamel 0675ee7f79 Fix clipping of BMFonts. 2009-04-06 23:43:38 -04:00
Tom Rothamel 0aec15a848 Fix problem with sounds being changed upon exiting a context. 2009-04-05 21:25:50 -04:00
Tom Rothamel 2ff01a99ac Update distribute.py to deal with new module files. 2009-04-05 16:21:06 -04:00
Tom Rothamel 0596ed7739 Update license for 6.9.1. 2009-04-05 16:10:35 -04:00
Tom Rothamel d8beb99964 There is a new config.windows_icon variable, that lets one set the
window icon for Windows separately from Mac OS X and Linux.
2009-04-05 15:59:00 -04:00
Tom Rothamel 648dfd8d75 Fix bugs revealed by the mediatest game. 2009-04-05 14:53:02 -04:00
Tom Rothamel 279a7a3fc8 Don't use SDL_Mix_Audio, which can have weird alignment
rules. Instead, just mix things ourselves in C.

Random other release engineering things.
2009-04-05 12:07:59 -04:00
Tom Rothamel a62aede62f Add video to the demo.
Tweak video playback to remove some logging, and some force stops.
2009-04-04 22:13:20 -04:00
Tom Rothamel b07bbbc1c9 Report more relevant errors when various commands occur during the init phase. 2009-04-04 19:08:08 -04:00
Tom Rothamel 547ce87eaa Add more window control statements to demo.
Properly compute size of Transform.

Eliminate dependency loop that was causing Renders to leak.
2009-04-04 18:08:43 -04:00
Tom Rothamel c206456d00 Modify demo game to use window show and window hide. 2009-04-04 14:42:56 -04:00
Tom Rothamel 590dd13f8f The new window statement allows one to control if an empty window is
shown when no character is speaking. Specifically, the

window show [transition]

statement shows the window, and the 

window hide [transition]

statement hides it. Both can take an optional
transition. config.empty_window is responsible for displaying the
window, while config.window_show_transition and
config.window_hide_transition are default transitions. The state of
the window can be determined by testing _window. The
renpy.shown_window function can be called to suppress displaying the
empty window, and is called automatically when characters speak.



The new renpy.get_placement function returns information about the
placement of displayables.
2009-04-04 14:02:00 -04:00
Tom Rothamel afd0e70479 Deal with the case where a bmfont has a negative offset for the first
character in a string.
2009-04-04 03:58:21 -04:00
Tom Rothamel b9166b35b3 The define.move_transitions function can now pass keyword arguments to
the moves it creates. The most useful thing with this is to pass
subpixel=True, in order to create subpixel move transitions.
2009-04-04 03:32:44 -04:00
Tom Rothamel 333fa51862 Hotspots for the game menu buttons can be defined as part of
layout.imagemap_load_save, layout.imagemap_preferences, and
layout.imagemap_yesno_prompt. Doing so prevents layout.navigation from
being called for that screen. It also allows opaque imagemaps to be
used, rather than forcing them to be transparent to allow the
navigation to show through.
2009-04-04 03:00:31 -04:00
Tom Rothamel ec6d256707 Support play <channel>, queue <channel>, and stop <channel> statements. 2009-04-03 22:36:44 -04:00
Tom Rothamel 86764d92a6 Fixed a bug that could cause crashing when rolling back to a Zoom with
an after_child.
2009-04-03 17:50:45 -04:00
Tom Rothamel cf1c9b3e5e Fixed a bug that caused layout.imagemap_main_menu to call a label even
though there was a button with the same name.
2009-04-03 14:05:08 -04:00
Tom Rothamel b15d7179b6 Zooming was totally broken when bilinear=False. 2009-04-03 02:29:11 -04:00
Tom Rothamel 72312f1249 Update the keymap to support alt-enter to toggle fullscreen, alt-q to quit. 2009-04-03 02:08:03 -04:00
Tom Rothamel 373198f628 Various minor changes required to get movie_cutscene working, and keep it compatible with the old version. 2009-04-03 01:58:36 -04:00
Tom Rothamel e96d8c774b Reimplement movie_cutscene.
Fix bugs that prevented sound from looping in some cases.
2009-04-02 22:34:07 -04:00
Tom Rothamel 8e221e183d Implement changing the volume over time.
Re-implement sound in terms of music.
2009-04-02 18:15:59 -04:00
Tom Rothamel 2249c49303 Added the PNG save code back in, so we can save a PNG file into a
memory buffer. 

Scout is hereby banned from crayons until she figures out a way to use
them that doesn't buffer-overrun pygame's TGA-writer.
2009-04-01 22:21:11 -04:00
Tom Rothamel 388362d318 Many fixes to movie playback.
Munge filenames that include non-identifier characters.
2009-04-01 04:28:50 -04:00
Tom Rothamel a554ea8e8b Update munge algorithm to deal with characters that cannot appear in python identifiers. 2009-04-01 04:22:01 -04:00
Tom Rothamel 090719deee Make ffdecode drop frames to maintain sync.
debug_sound will now enable output of ffmpeg status information.
2009-04-01 04:00:53 -04:00
Tom Rothamel e29a162a85 Discover AVSEEK_SIZE. Implement it. Fix bug that caused AVI files not
to parse.  It's _never_ easy. :-)
2009-04-01 03:05:34 -04:00
Tom Rothamel e17fa9edc2 The code now builds properly on Windows, but immediately crashes upon playing
a video.
2009-03-30 02:26:09 -04:00
Tom Rothamel e57529257e Remove more references to save_png. 2009-03-30 01:03:23 -04:00
Tom Rothamel 866f9228ef Get the Movie displayable working.
Remove image writing from _renpy, now that it's in pygame.
2009-03-30 01:00:23 -04:00
Tom Rothamel 3a38a8b89b Fix seeking bug that was affecting AVI playback. 2009-03-29 18:54:20 -04:00
Tom Rothamel 0509a23881 Fullscreen movie playback works. 2009-03-29 16:19:49 -04:00
Tom Rothamel cbb0741ab9 Rewritten sound support now works. (At least in the sense of not
crashing or leaking memory.)
2009-03-29 04:19:15 -04:00
Tom Rothamel 716bb0fac1 style, not 'style'. 2009-03-28 11:07:50 -04:00
Tom Rothamel acb193bd7b Moved all of the motions into their own file, as there's a reasonably
logical split between them and the stuff that remained in
renpy.layout. (And since two ~1k line files are more readable than one
2k line file.)
2009-03-28 01:18:10 -04:00
Tom Rothamel 0a09beb731 Fix FactorScale, and add to demo to be sure it works. 2009-03-28 00:22:10 -04:00
Tom Rothamel 93dca3df73 The Motion (including Move and Pan), Zoom, RotoZoom, and FactorZoom
displayables now use the style.motion style, which now has xanchor and
yanchor both set to 0. This gives these movements the same semantics
when used inside an image clause as they have outside one.
2009-03-27 23:08:34 -04:00
Tom Rothamel 008143a3da im.Grayscale and im.Sepia now take properties, so they can be
positioned.
2009-03-27 04:58:40 -04:00
Tom Rothamel 30a4db432e Fix problem computing the size of the render of a Transform. 2009-03-27 04:39:30 -04:00
Tom Rothamel 65546baf01 Remove obsolete files. 2009-03-27 03:53:55 -04:00
Tom Rothamel 8be5069490 Fix fixes. 2009-03-26 03:18:39 -04:00
Tom Rothamel 802410644b Fix locking conflict that could cause movies & music to not end.
Add some checking that should deallocate all renders.
2009-03-26 02:23:01 -04:00
Tom Rothamel e74b172372 Remove debug prints.
Add better locking to codec open/close, which prevents ffmpeg from complaining.
2009-03-24 06:36:21 -04:00
Tom Rothamel 23ac59588e Fix problems with non-44100 sampling rates. 2009-03-24 04:58:46 -04:00
Tom Rothamel 7f6e9de5e5 Integrated ffmpeg with pss. 2009-03-24 01:16:43 -04:00
Tom Rothamel 143906ae9d Begin work to integrate ffmpeg. 2009-03-22 21:16:17 -04:00
Tom Rothamel b003371456 6.9.0h 2009-03-21 17:36:00 -04:00
Tom Rothamel 1e6fa37a10 Fix offset problem in RotoZoom 2009-03-21 02:35:01 -04:00
Tom Rothamel 935786a161 Fix prior fix. 2009-03-19 23:51:46 -04:00
Tom Rothamel 23c4d07432 Fix bug with clipping. 2009-03-19 01:41:25 -04:00
Tom Rothamel 77107ef1eb Fix memory leak in Grid when bigger than the screen. 2009-03-18 02:12:21 -04:00
Tom Rothamel cac4238b12 6.9.0g 2009-03-17 23:46:55 -04:00
Tom Rothamel 8c402c2dc3 Fix button_menu problem. 2009-03-17 23:12:31 -04:00
Tom Rothamel 9bff95826a Fix bug in is_pixel_opaque. 2009-03-17 23:06:22 -04:00
Tom Rothamel fc0f7cecc4 Fix for viewport focus bugs? 2009-03-16 01:42:27 -04:00
Tom Rothamel 0b5c5ce17e Fix memory leak bug. 2009-03-16 00:45:43 -04:00
Tom Rothamel 9aa61532ff Refix bugs in pefile.py. 2009-03-12 22:39:56 -04:00
Tom Rothamel 3271557f8a Fix pefile.py to match latest py2exe. 2009-03-11 21:08:31 -04:00
Tom Rothamel 9587342129 6.9.0f
Fixes an overflow bug in subpixel.
2009-03-10 20:07:08 -04:00
Tom Rothamel 9b4821308d Change semantics of set_pan to be slightly more useful.
6.9.0e.
2009-03-09 23:12:04 -04:00
Tom Rothamel 663978906a Added renpy.partial. 2009-03-08 20:49:12 -04:00
Tom Rothamel 60f3308b8b Autobar now uses floating point numbers, making it smoother when the range is small.
Up the script version to 6.9.0.
2009-03-08 10:09:43 -04:00
Tom Rothamel a305d6e725 6.9.0d 2009-03-08 01:58:50 -05:00
Tom Rothamel 1feff344b8 New clipping code. 2009-03-07 21:23:01 -05:00
Tom Rothamel 4fa4ffae54 Releasing 6.9.0c. 2009-03-06 18:32:31 -05:00
Tom Rothamel 4ecd72de6e Readying 6.9.0b 2009-03-02 22:40:15 -05:00
Tom Rothamel 3ec495c3fc Fix fill problem.
Move only named layers.
Fix focus problem.
2009-03-02 21:50:50 -05:00
Tom Rothamel 5efc437384 Fixed rounding issue in place. 2009-03-02 15:29:55 -05:00
Tom Rothamel a777f4d3b1 Fix negative render size. 2009-03-01 20:06:19 -05:00
Tom Rothamel ff139808ff 6.9.0a 2009-03-01 14:23:58 -05:00
Tom Rothamel 07136f9be8 2009 2009-03-01 13:37:06 -05:00
Tom Rothamel 35fc2295e9 Various fixes. 2009-03-01 13:35:36 -05:00
Tom Rothamel 2b262ccca3 Fix annoying windows bugs. 2009-03-01 03:10:42 -05:00
Tom Rothamel d42aab3dff Movement demo. 2009-02-28 12:20:32 -05:00
Tom Rothamel 612c347498 Add transform demo. 2009-02-28 12:09:06 -05:00
Tom Rothamel 3c4540131a Remove speex.
Images are now allowed outside of init blocks.

Unicode strings are automatically prefixed with u in python code.
2009-02-27 00:45:55 -05:00
Tom Rothamel 43317f6e02 Add config.editor_file_separator 2009-02-24 23:31:42 -05:00
Tom Rothamel 523742d8de Write out launcherinfo.py 2009-02-24 23:11:18 -05:00
Tom Rothamel 9516ee910e The reporting of parse errors involving missing quotes has been
improved.

Added scaling of the subpixel function.
2009-02-24 03:49:55 -05:00
Tom Rothamel 3ea31a3862 Added config.label_callback. 2009-02-23 01:35:07 -05:00
Tom Rothamel 649411a4ef ui.transform and ui.autobar 2009-02-22 02:31:56 -05:00
Tom Rothamel a0e60e5453 Added transform and renpy.Container. 2009-02-21 15:34:16 -05:00
Tom Rothamel e3f1f40a78 Fix it for ppc etc. as well. 2009-02-19 03:43:03 -05:00
Tom Rothamel d0177f4c52 Implemented Transform
Fixed segfault bug in transform32_mmx.
2009-02-19 03:38:25 -05:00
Tom Rothamel 84a3a55a03 Update the changelog. Ensure draw_func draws on an integer pixel boundary. 2009-02-16 03:14:38 -05:00
Tom Rothamel 048075b47a Subpixel blitting works. Transform + alpha blitting is untested. 2009-02-16 02:41:18 -05:00
Tom Rothamel fab097c92a Render rewrite is roughly at parity with previous functionality. 2009-02-14 17:44:08 -05:00
Tom Rothamel 9d26bd8c04 WIP on Render rewrite. 2009-02-10 00:32:51 -05:00
Tom Rothamel 664d243c23 Implemented subpixel rendering in _renpy. 2009-01-29 02:58:48 -05:00
Tom Rothamel 9a0906655d Fix problems with 16 bit platform and config.window_icon. 2009-01-11 20:46:01 -05:00
Tom Rothamel 13d60f2741 Began adding subpixel support. 2009-01-05 01:28:06 -05:00
Tom Rothamel 7d4de64d0b Fixed an issue with imouto-mode that cropped up when a Frame scales something down to nothing. 2008-12-30 15:00:18 -05:00
Tom Rothamel 9ada2d9884 Deal with environment.txt. 2008-12-30 12:37:52 -05:00
Tom Rothamel a5f1951cfb Fixed multiple imouto-mode problems. 2008-12-30 12:27:03 -05:00
Tom Rothamel 98850e4c5c Added im.FactorScale, renpy.game_menu, and ui.gamemenus. 2008-12-29 12:25:29 -05:00
Tom Rothamel 709e1f925d Added renpy.sound.set_pan 2008-12-24 13:45:43 -05:00
Tom Rothamel b11ae331a5 Update renpygame.
Autosave on quit.

Fix memory leak via adjustments.
2008-12-23 00:41:15 -05:00
Tom Rothamel 3ba4b26b99 Transform (Rotozoom) now support subpixel alpha. 2008-12-16 03:29:43 -05:00
Tom Rothamel b864077017 Improved Rotozoom's correctness and speed. 2008-12-15 21:57:27 -05:00
Tom Rothamel d411dff1c0 Overlay behavior change.
Fix divide-by-zero in Alpha.
2008-12-06 01:52:12 -05:00
Tom Rothamel 7fc7453450 Releasing 6.8.1a. 2008-11-23 13:05:47 -05:00
Tom Rothamel 1799971885 Implement RENPY_LESS_UPDATES and RENPY_LESS_MOUSE.
Build iLiad distributions.

Add support for rebuilding distributions.
2008-11-23 11:15:26 -05:00
Tom Rothamel b999911292 Untested support for building iLiad distributions. 2008-11-21 02:59:49 -05:00
Tom Rothamel 29e0f9ad21 Working on iLiad support. 2008-11-21 02:09:54 -05:00
Tom Rothamel d821b7eb8b Fixed a bug that occured when space characters were inserted
immediately after a newline.
2008-11-20 01:32:40 -05:00
Tom Rothamel 272a214304 Modified lint slightly.
Added Alpha.
2008-11-18 01:35:29 -05:00
Tom Rothamel 7f15b351ee Add support for a user-defined default statement.
Speed up parsing a little.
2008-11-17 02:40:55 -05:00
Tom Rothamel 5a6a12a14a Blacklist renpy.display from being reloaded. 2008-11-17 00:05:31 -05:00
Tom Rothamel 01493c7063 Splitting cardgame. 2008-11-10 01:30:01 -05:00
Tom Rothamel 244055fcb7 Modified presplash.py so that it ignores errors forking of a second process. 2008-11-09 15:50:22 -05:00
Tom Rothamel 0415af5f31 Better support for scaling.
The launcher will now may sys.executable point to an existing file.
2008-11-09 15:36:16 -05:00
Tom Rothamel f73372c924 iRex iLiad support. 2008-11-02 16:14:16 -05:00
Tom Rothamel 65cdc24e37 Add staticgray support, for iLiad. 2008-11-02 08:43:53 -05:00
Tom Rothamel 1b2d439651 Releasing 6.8.0 2008-10-25 14:52:49 -04:00
Tom Rothamel b383942c69 Create icon group for loaded icons. (Took a week :-( ) 2008-10-25 01:45:03 -04:00
Tom Rothamel 73bd109abb Another try at fixing icons. 2008-10-17 22:57:18 -04:00
Tom Rothamel 33ffd5dedb Fix for a problem with icons that specify a size and shouldn't. 2008-10-17 20:21:21 -04:00
Tom Rothamel 7422fe43b8 Fix a bug building mac distributions on windows.
Ready 6.8.0d.
2008-10-17 10:06:57 -04:00
Tom Rothamel 879c45a5b3 Releasing 6.8.0c 2008-10-15 15:43:29 -04:00
Tom Rothamel db0d205374 Added BMFont support. 2008-10-15 15:36:05 -04:00
Tom Rothamel f20594a2b5 Add build_launchertrans to version control.
Remove obsolete files.
2008-10-15 12:40:26 -04:00
Tom Rothamel ee017f4bc6 The launcher now deals better with long project names.
The launcher now warns if java is missing.
2008-10-14 21:20:14 -04:00
Tom Rothamel 4d089f9a0e Fixed various editor bugs. 2008-10-14 19:35:02 -04:00
Tom Rothamel e7f9c5c2ac Making ready for 6.8.0b 2008-10-14 17:43:31 -04:00
Tom Rothamel 2df8d38c2f Add config.missing_background. 2008-10-14 17:36:51 -04:00
Tom Rothamel 17ac44d610 Ren'Py now supports the MudgeFont image-based file format. The new
renpy.register_mudgefont function is used to register a
MudgeFont.
2008-10-14 17:30:56 -04:00
Tom Rothamel 3c52c2ae3f Fixed positioning of 640x480 preferences. 2008-10-14 16:29:45 -04:00
Tom Rothamel 5a5115e29f Fixed a problem with outlines and bold/italic text. 2008-10-14 16:07:29 -04:00
Tom Rothamel 5c7ff1c97b Fixed a bug that prevented styles from being rebuilt. 2008-10-13 23:19:04 -04:00
Tom Rothamel cc820a3595 Fix bugs pointed out by delta at:
http://lemmasoft.renai.us/forums/viewtopic.php?p=58835#p58835
2008-10-13 22:49:23 -04:00
Tom Rothamel 48fff48d28 Updated tag script. 2008-10-13 17:59:53 -04:00
363 changed files with 15804 additions and 21240 deletions
+41
View File
@@ -13,3 +13,44 @@ jedit
lint.txt
renpy.code
traceback.txt
doc/common.css
doc/images
doc/index.html
doc/monobook.css
doc/monobook2.css
doc/reference
doc/shared.css
doc/tutorials
doc/www.renpy.org
testing
translations.rpy
launchertrans.rpy
jcc
scite/scite.zip
screenshot*
.ropeproject
release_cardgame.sh
cardgame
dse.split
empty
empty-linux-x86.tar.bz2
empty-mac.zip
empty.zip
errors.txt
icons
iliad-icon.png
iliad-work
kuroi
lsprofcalltree.py
manifest.xml
mediatest
musicroom
nobmtest
renpy-iliad.sh
renpy.kcg
renpy.stats
renpygame-1.2.zip
speedtest
styles.txt
renpygame-demo/game/saves
./lib
+429 -5
View File
@@ -1,3 +1,417 @@
New in Ren'Py 6.9.3
-------------------
This release includes Launcher2, a near-total rewrite of the Ren'Py
launcher. Among the more important changes are:
* The launcher now supports a project directory. It is no longer
necessary to move projects around when upgrading Ren'Py.
* The launcher has support for selecting the editor to use. While we
ship with jEdit support, other editors can be downloaded from the
Ren'Py web site.
* When building distributions, the launcher now allows the user to
choose which distributions are built.
* The Macintosh distribution now places all non-documentation files
inside a single application.
* There is a new combined distribution, which includes support for
Windows, Linux, and Macintosh in a single zip file.
The new ui.detached function allows one to use the ui functions to
define displayables without adding them to a layer.
Ren'Py will now search for a directory named "Ren'Py Data" in the
directories above your Ren'Py installation. If found, save data will
be placed in that directory, rather than the system-specific default
location. This should help make it easier to develop Ren'Py games when
using a USB drive.
The save location for screenshots has now been standardized. It is now
the directory containing the executable used to start Ren'Py, be it a
.exe, .py, .sh, or .app. (The latter is handled specially.)
Allow config.layer_clipping to specify layers that are larger than the
screen.
The various layouts now change the mouse to the gamemenu or mainmenu
mouse, as appropriate.
This distribution include a new NVL-mode tutorial, teaching people how
to make NVL-mode games.
Fixed a long-standing problem that could cause Rollback to operate
incorrectly with object that were unreachable at the time of the
Rollback.
Fixed a problem that prevented animations from displaying correctly
when the animation was displayed more than once.
Fixed a problem that could cause children of the various
MultiBox-based displayables (Fixed, HBox, VBox, and LiveComposite) to
display animations incorrectly.
New in Ren'Py 6.9.2
-------------------
The semantics for play and queue have changed slightly. Now, when a
play statement is followed by one or more queue statements, the first
file in each play or queue statement will be played. For example:
play music "a.ogg"
queue music "b.ogg"
queue music "c.ogg"
will play "a.ogg", "b.ogg", and then loop "c.ogg". This change also
applies to renpy.music.play and renpy.music.queue.
Rollback was changed so that doing anything other than a roll-forward
while in rollback mode exits rollback immediately.
The library alias for config has been removed.
Fixed a regression that caused dissolves to be terribly slow.
Fixed a bug that caused Ren'Py to crash when playing music on Windows
when Data Execution Prevention was enabled. DEP is enabled by default
on 64-bit Windows Vista.
Fixed a bug that caused Ren'Py to crash when a window icon was used on
a computer with a 16-bit or 8-bit screen depth.
Fixed a bug that caused ui.sizer to malfunction.
Fixed a repeated word in "The Question".
Fixed a bug that could cause it to take two tries to define a joystick
button.
New in Ren'Py 6.9.1
-------------------
The music and video playback code has been completely rewritten. The
new implementation uses the ffmpeg library. It includes the following
features:
* Support for ogg, mp3, mp2, wav, and flac audio.
* Support for theora, mpeg4 part 2 (including DivX and Xvid), mpeg2,
and mpeg1 video.
* Support for an arbitrary number of named channels, replacing the
previous eight numbered channels.
* Audio files are now automatically converted to the output sampling
rate (by default, 44100hz). This prevents the problems that would
previously crop up when playing audio sampled at other rates.
* The play, queue, and stop statements now take a channel name as the
second argument, which makes using user-defined channels easier.
As part of this rewrite, we have eliminated support for mod formats,
as they are not supported by ffmpeg.
Please read the reference manual documentation for Audio and Movies to
learn the new interface.
The new code requires some changes in the saved data. As a result,
loading a file saved with a prior version of Ren'Py may lead to a lack
of music until the next track is played.
The new window statement allows one to control if an empty window is
shown when no character is speaking. Specifically, the
window show [transition]
statement shows the window, and the
window hide [transition]
statement hides it. Both can take an optional
transition. config.empty_window is responsible for displaying the
window, while config.window_show_transition and
config.window_hide_transition are default transitions. The state of
the window can be determined by testing _window. The
renpy.shown_window function can be called to suppress displaying the
empty window, and is called automatically when characters speak.
Hotspots for the game menu buttons can be defined as part of
layout.imagemap_load_save, layout.imagemap_preferences, and
layout.imagemap_yesno_prompt. Doing so prevents layout.navigation from
being called for that screen. It also allows opaque imagemaps to be
used, rather than forcing them to be transparent to allow the
navigation to show through.
There is a new config.windows_icon variable, that lets one set the
window icon for Windows separately from Mac OS X and Linux.
Ren'Py now automatically scales itself down when it detects that the
game window is too large for the screen.
The define.move_transitions function can now pass keyword arguments to
the moves it creates. The most useful thing with this is to pass
subpixel=True, in order to create subpixel move transitions.
The Motion (including Move and Pan), Zoom, RotoZoom, and FactorZoom
displayables now use the style.motion style, which now has xanchor and
yanchor both set to 0. This gives these movements the same semantics
when used inside an image clause as they have outside one.
im.Grayscale and im.Sepia now take properties, so they can be
positioned.
The new renpy.get_placement function returns information about the
placement of displayables.
Improved the render management code, so there should no longer be any
leaks reported during shutdown.
Deal with the case where a bmfont has a negative offset for the first
character in a string.
Added more verbose diagnostics when illegal statements are run in the
init phase.
Added _rollback, which controls if rollback is enabled.
Added a target parameter to renpy.full_restart, which allows the main
menu screen to be selected after a restart.
Fixed a bug that caused layout.imagemap_main_menu to call a label even
though there was a button with the same name.
Fixed a bug that prevented Zoom from working in non-bilinear mode.
Fixed a bug that could cause buttons not not consume events when using
an imagemap main menu.
Fixed a bug that caused Transform to produce an incorrectly-sized
render.
Fixed a bug that could cause crashing when rolling back to a Zoom with
an after_child.
Fixed a bug that could cause segfaults when saving overly-complicated
images.
New in Ren'Py 6.9.0
-------------------
This release features a rewritten rendering system. The rendering
subsystem is what manages drawing to the screen. There have been
several major improvements:
* The render system has been simplified. Although still complex, it's
now easier to understand than the old system, while also being
naturally a bit faster.
* That being said, the render system now focuses more on framerate
consistency than raw speed.
* The render system now supports subpixel drawing, drawing images at
locations that are not integer pixel boundaries. This is enabled by
setting the subpixel style property to True for a displayable. (It
makes the most sense to do this for Move and Pan, and less sense to
do this for non-moving displayables.)
* The render system supports specifying subpixel placement of
displayables. This is done using the new absolute type. (A
floating-point position is still interpreted as a fraction of the
area in which the displayable is placed.)
* The render system supports a rotate-zoom-alpha mode, in which allows
a displayable to be rotated, zoomed, and have its alpha
changed. When this mode is used, the cost remains constant, even
when multiple transformations are composed. Currently, this is only
used by Transform and ui.transform.
* The render system supports rotating and scaling focusable objects.
Improved the transform routine used by RotoZoom and Transform. It's
now both more accurate and faster. On Intel computers, it is now
accelerated using MMX instructions.
The image statement now implicitly places itself inside an init block
if it's not inside an init block to begin with. The code:
image bg world = "world.jpg"
is now equivalent to:
init 990:
image bg world = "world.jpg"
When compiling python blocks containing strings with a unicode
character in them, Ren'Py will automatically prepend a u to any string
that's missing it. This should make life easier for users of non-ASCII
languages.
The new ui.autobar function makes it easy to make a bar that
varies between two values over time.
The new renpy.Container class can be subclassed to create a user-defined
displayable thatr contains other displayables, like Transforms.
The new im.FactorScale image manipulator allows images to be scaled by
a specified factor at preload time. This is generally faster than doing the
equivalent scaling at display time with FactorZoom.
The new renpy.sound.set_pan function allows sound and music to be
smoothly panned over time.
The new config.label_callback variable allows a function to be called
whenever control reaches a label. It can distinguish between jumps to
that label and control falling through.
There have been a couple of places where properly documented functions
have superseded semi-documented calls into the Ren'Py internals:
The renpy.game_menu and ui.gamemenus functions are now the preferred ways
of getting access to the game menu.
The ui.jumps function now takes a transition argument, allowing it to subsume
the undocumented _intra_jumps.
Ren'Py now looks for the file environment.txt in the directory
containing Ren'Py itself. If it finds it, it loads the file as a
python file, and uses it to set the default values of environment
variables. This allows things like the editor or the scale factor to
be set even on platforms that don't make it easy to change environment
variables globally.
The reporting of parse errors involving missing quotes has been
improved.
Changed the behavior of overlays during transitions. Now, both the old
and new screens will use the new overlay. Previously, the overlay was
cleared out during a transition, which didn't work well, as (for
example) a dissolve would cause the overlay to blink out and then
dissolve back in again.
MoveTransition and define.move_transitions have been changed to take
a layers argument, giving the list of layers the transition applies
to. By default, this is only the master layer, which is a change in
their behavior.
Calling theme.roundrect() no longer implies layout.button_menu().
Ren'Py now autosaves when entering the quit prompt, and will not actually
quit until this autosave is complete.
The default framerate limit (config.framerate) has been raised to
100fps. This make tearing less noticable than on a 60hz screen.
Added renpy.partial as a version of renpy.curry that requires two
function calls, rather than three.
Fixed a divide by zero error that occured when Alpha was used for 0
seconds.
Libvorbis has been upgraded to version 1.2.0.
To reduce distribution size, OGG Speex support was dropped.
New in Ren'Py 6.8.1
-------------------
Added support for the iRex iLiad ebook reader platform. This required
adding the following features, which may prove useful for other
platforms:
Added support for the RENPY_SCALE_WIDTH environment variable, which
allows the game to be scaled to a specific width, if it's larger.
Added support for the RENPY_LESS_MEMORY environment variable, which
reduces the amount of memory used by Ren'Py in exchanged for reduced
speed.
Added support for the RENPY_LESS_UPDATES environment variable, which
tries to reduce the number of screen updates to one per interaction.
Added support for the RENPY_LESS_MOUSE environment variable, which
prevents the mouse from being shown.
The iLiad support was sponsored by Hixbooks.
It is now possible to rebuild the distribution of a game by unzipping
it underneath the Ren'Py directory, selecting it as a project, and
building the distributions. This makes it easy to upgrade the version
of Ren'Py used by a game, or to build a version of it that works on
your favorite platform.
The new Alpha function can be used to change the alpha level of a
displayable. (im.Alpha can only be used with other image
manipulators.)
User-defined statements are now documented in the reference manual,
making them officially supported.
A user-defined statement can now be used as the default
statement. This allows you to replace the say statement with an
alternate of your own devising.
Fixed a bug that occured when space characters were inserted
immediately after a newline.
Fixed a problem displaying a presplash image on the mac platform.
New in Ren'Py 6.8.0
-------------------
@@ -21,6 +435,12 @@ to have additional whitespace inserted between words so that the left
and right margins are even, except on the last line of a paragraph.
Ren'Py now supports the MudgeFont and BMFont image-based font file
formats. The new renpy.register_mudgefont function is used to register
a MudgeFont, and the renpy.register_bmfon function is used to register
a BMFont.
Newly-created games will have a Help option on the main and game
menus. This is controlled by the config.help variable. By default
the help system shows the README.html file in the game's base directory.
@@ -48,9 +468,10 @@ Game", for consistency with the game menu.
When config.developer is set and an undefined image is used in a show
or scene statement, a list of undefined images will appear centered at
the top of the screen. A black screen will be show instead of any missing
background. This makes it easier to write a script before all images are
present.
the top of the screen. A black screen (configurable with
config.missing_background) will be shown instead of any missing
background. This makes it easier to write a script before all images
are present.
The newly-documented Style.set_parent method lets you change the
@@ -74,7 +495,7 @@ Alt-F4 and Command-Q now trigger the quit event, as if you pressed the
quit button on the top of the window. The first press brings up the
quit prompt, and a second press forcibly terminates the game.
Alt-H and Command-H hide (iconify) the window.
Alt-M and Command-M iconify the window.
The new RENPY_SCREENSHOT_PATTERN environment variable lets you
@@ -91,6 +512,10 @@ The presplash code now looks for presplash.jpg in the game directory
if presplash.png is not found.
On Windows, config.window_icon will be scaled to 32x32 if it is wider
than 32 pixels. This allows the same icon to be used across platforms.
Custom mouse cursors should now be properly hidden when the mouse
leaves the window. Previously, this failed to work on the Mac OS X
platform.
@@ -4077,4 +4502,3 @@ controls which transitions are performed.
Added a Pan function which can be used in an at clause. This allows us
to pan over a background image.
+17 -51
View File
@@ -1,4 +1,5 @@
Copyright 2004-2007 PyTom <pytom@bishoujo.us>
Ren'Py itself is covered by the terms of the following (MIT) license:
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
@@ -19,9 +20,6 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---
(The above is the MIT License)
Please see each individual source file for a list of copyright
holders. The pictures of Eileen in the demo are Copyright 2006
@@ -34,25 +32,20 @@ launchers may contain code taken from the following projects:
* Pygame (LGPL)
* SDL (LGPL)
* SDL_image (LGPL)
* SDL_sound (LGPL)
* SDL_ttf (LGPL)
* SDL_mixer (LGPL)
* Freetype (LGPL)
* FFmpeg (LGPL)
* jpeg (JPEG License)
* libmodplug (Public Domain)
* libogg (Xiph.org License)
* libpng (PNG license)
* libvorbis (Xiph.org License)
* smpeg (LGPL)
* speex (Xiph.org License)
* zlib (Zlib License)
* zlib (Zlib License)
* bzip2 (Bzip2 License)
* pyobjc (MIT License)
The Linux launcher may also include code from:
The Linux build may also include code from:
* directfb (LGPL)
* svgalib (LGPL)
* svgalib (LGPL)
For the purpose of LGPL compliance, the source code to all LGPL
software we depend on is either in the Ren'Py package (available from
@@ -61,9 +54,13 @@ http://www.renpy.org/), or in the renpy-deps package
by including a copy of this license with every copy of Ren'Py you
distribute, and referring to it in your project's README file.
The default Ren'Py build distributes Ren'Py alongside jEdit, which is
licensed under the GNU GPL. The source code to jEdit is distributed as
part of the renpy-deps package (http://www.renpy.org/dl/lgpl/).
GNU Lesser General Public License
---------------------------------
=================================
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
@@ -575,7 +572,7 @@ That's all there is to it!
Python License
--------------
==============
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
@@ -625,7 +622,7 @@ Agreement.
Jpeg License
------------
============
In plain English:
@@ -674,39 +671,8 @@ commercial products, provided that all warranty or liability claims are
assumed by the product vendor.
Xiph.org License
----------------
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PNG License
-----------
===========
The PNG Reference Library is supplied "AS IS". The Contributing Authors
and Group 42, Inc. disclaim all warranties, expressed or implied,
@@ -734,9 +700,8 @@ supporting the PNG file format in commercial products. If you use this
source code in a product, acknowledgment is not required but would be
appreciated.
Zlib License
------------
============
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -754,8 +719,9 @@ Zlib License
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Bzip2 License
-------------
=============
This program, "bzip2", the associated library "libbzip2", and all
documentation, are copyright (C) 1996-2005 Julian R Seward. All
-55
View File
@@ -1,55 +0,0 @@
This file contains boilerplate information about running Ren'Py that
can be included into the README for your game. It may be necessary to
change some of the filenames in this document, to make it specific to
your game.
Feel free to use this in your projects.
Running the Game
================
(Windows)
If this game was installed on Windows using an installer, then you can
run it by choosing the shortcut left by the installer. If this game
was installed on Windows using the cross-platform zip file, then it
can be run by executing the run_game.exe file.
(Macintosh)
For information about running Ren'Py games on Mac OS 10.3 or higher,
please go to http://www.bishoujo.us/renpy/mac.html .
(Linux/Unix)
For information about running Ren'Py games under Linux and Unix,
please go to http://www.bishoujo.us/renpy/linux.html . At the very
least, you will need to compile the _renpy module. Read
the file module/README.txt for details.
Playing the Game
================
By default, the game starts running in full screen mode. On some
computers, especially some virtual machines, this can lead to mouse
problems. To fix this, press 'f'.
Some of the more interesting game actions can be performed as follows:
- The left mouse button is used to advance to the next line of
dialogue, or to pick menu options.
- The right mouse button brings you into a menu screen where you can
save the game, load the game, change preferences, return to the main
menu, or quit entirely.
- Scrolling the mouse wheel up or pushing page up returns you to the
previous screen.
- Holding down the CTRL key skips dialogue. By default, it only
skips read dialogue, but this can be changed by a preference. Tab
toggles skip mode.
-21
View File
@@ -1,21 +0,0 @@
A version of dissolve that only draws the pixels that are being
dissolved, while doing a straight-blit on pixels that remain the same
between the two images.
Figure out some way of having variables updated in a new context saved
permanently, even if we return to the outer context because of a
rollback or something. Need to be very careful here.
Dynamic variables, parameterized labels, etc.
Implement an extension mechanism of some sort, so that users can drop
packages of Ren'Py code into the Ren'Py directory, and get stuff like
speech support.
Implement speech control support.
BPP conversion (perhaps as a package).
Automatically scale to a fixed size.
Hide picture-mouse when leaving window, restore it when entering window.
-1
View File
@@ -1 +0,0 @@
build_exe.py run_game
+7 -1
View File
@@ -18,7 +18,9 @@ def main():
setup(name="RenPy",
windows=[ dict(script="renpy.py",
dest_base="renpy",
icon_resources=[ (1, "newicon.ico") ] ) ],
icon_resources=[ (1, "newicon.ico") ],
),
],
console=[ dict(script="renpy.py", dest_base="console") ],
@@ -29,6 +31,7 @@ def main():
'pygame.surfarray',
'pygame.mixer',
'pygame.mixer_music',
'pygame.font',
'_ssl',
'_hashlib',
'win32con',
@@ -57,6 +60,9 @@ def main():
if fn in seen:
continue
if fn == "SDL_mixer.dll":
continue
seen[fn] = True
zfnew.writestr(fn, zfold.read(fn))
+84
View File
@@ -0,0 +1,84 @@
1#!/usr/bin/env python
import collections
import glob
import re
import sys
import time
# A map from string to filename, line number where the string is found.
strings = collections.defaultdict(list)
def process(fn):
lineno = 0
for data in file(fn, "r"):
lineno += 1
matches = [ ]
matches += re.finditer(r'\bu\"(\\"|[^"])+\"', data)
matches += re.finditer(r"\bu\'(\\'|[^'])+\'", data)
for m in matches:
s = m.group(0)[2:-1]
if "\\u" in s:
continue
if len(s) == 1:
continue
strings[s].append("%s:%d" % (fn, lineno))
if __name__ == "__main__":
files = [ ]
files += glob.glob("launcher2/*.rpy")
files += glob.glob("common/*.rpy")
files += glob.glob("common/_layout/*.rpym")
files += glob.glob("common/_compat/*.rpym")
for fn in files:
process(fn)
converse = [ ]
for k, v in strings.iteritems():
v = " ".join(sorted(v))
converse.append((v, k))
converse.sort()
print """\
# Ren'Py Visual Novel Engine
# Copyright (C) 2009 PyTom <pytom@bishoujo.us>
# This file is distributed under the same license as the Ren'Py package.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: mainline\\n"
"Report-Msgid-Bugs-To: PyTom <pytom@bishoujo.us>\\n"
"POT-Creation-Date: %s\\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n"
"Language-Team: LANGUAGE <LL@li.org>\\n"
"MIME-Version: 1.0\\n"
"Content-Type: text/plain; charset=UTF-8\\n"
"Content-Transfer-Encoding: 8bit\\n"
""" % time.strftime("%Y-%m-%d %H:%M%z")
for v, k in converse:
print
print "#:", v
print "#, python-format"
print "msgid \"%s\"" % k
print "msgstr \"\""
+80
View File
@@ -0,0 +1,80 @@
1#!/usr/bin/env python
import collections
import glob
import re
import sys
import time
import os
# A map from string to filename, line number where the string is found.
strings = collections.defaultdict(list)
def process(fn):
lineno = 0
for data in file(fn, "r"):
lineno += 1
matches = [ ]
matches += re.finditer(r'\bu\"(\\"|[^"])+\"', data)
matches += re.finditer(r"\bu\'(\\'|[^'])+\'", data)
for m in matches:
s = m.group(0)[2:-1]
if "\\u" in s:
continue
if len(s) == 1:
continue
strings[s].append("%s:%d" % (fn, lineno))
if __name__ == "__main__":
files = [ ]
files += glob.glob("launcher/*.rpy")
files += glob.glob("common/*.rpy")
files += glob.glob("common/_layout/*.rpym")
files += glob.glob("common/_compat/*.rpym")
if "launcher/strings.rpy" in files:
files.remove("launcher/strings.rpy")
for fn in files:
process(fn)
converse = [ ]
for k, v in strings.iteritems():
v = " ".join(sorted(v))
converse.append((v, k))
converse.sort()
f = file("launcher/strings.rpy", "w")
files = set(i for i in os.listdir("launcher") if i.endswith(".rpy"))
print >>f, """\
init python:
LAUNCHER_RPYS = %r
TRANSLATION_STRINGS = [
""" % files
for v, k in converse:
# print
# print "#:", v
# print "#, python-format"
print >>f, " %r," % unicode(k)
print >>f, """\
]
"""
-62
View File
@@ -1,62 +0,0 @@
#!/usr/bin/python
import glob
import os
files = glob.glob("common/*.rpy")
files.sort()
styles = [ ]
for fn in files:
f = file(fn)
fi = iter(f)
for l in iter(fi):
l = l.strip()
if l.startswith("### "):
prefix, style, parent = l.split()
desc = ""
for l in fi:
l = l.strip()
if not l.startswith("# "):
break
desc = desc + " " + l[2:]
styles.append(' style.create("%s", "%s", "%s")' % (style, parent, desc[1:]))
f.close()
f = file("common/style.rpy")
of = file("common/style.rpy.new", "w")
fi = iter(f)
for l in fi:
of.write(l)
if l.startswith("# AUTOMATICALLY GENERATED"):
for l in styles:
of.write(l + "\n")
for l in fi:
if l.startswith("# END AUTOMATICALLY GENERATED"):
break
of.write(l)
f.close()
of.close()
os.rename("common/style.rpy", "common/style.rpy.bak")
os.rename("common/style.rpy.new", "common/style.rpy")
-48
View File
@@ -1,48 +0,0 @@
1#!/usr/bin/env python
import glob
import re
from sets import Set as set
import sys
seen_files = set()
seen_strings = set()
def tl(fn, s):
s = eval(s)
if s in seen_strings:
return
if fn not in seen_files:
print >>out
print >>out, " # Translatable strings found in", fn
print >>out
seen_files.add(fn)
print >>out, " config.translations[%r] = %r" % (s, s)
seen_strings.add(s)
def process(fn):
data = file(fn).read()
for m in re.finditer(r'\bu\"(\\"|[^"])+\"', data):
tl(fn, m.group(0))
for m in re.finditer(r"\bu\'(\\'|[^'])+\'", data):
tl(fn, m.group(0))
if __name__ == "__main__":
# out = file("extras/translations.rpy", "w")
out = sys.stdout
print >>out, "# This file contains a list of all of the phrases you can translate"
print >>out, "# from the Ren'Py common code."
print >>out, ""
print >>out, "init python:"
for fn in glob.glob("common/*.rpy") + glob.glob("common/_layout/*.rpym") + glob.glob("common/_compat/*.rpym"):
process(fn)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

-697
View File
@@ -1,697 +0,0 @@
# cardgame.rpy - Cardgame support for Ren'Py
# Copyright (C) 2008 PyTom <pytom@bishoujo.us>
#
# This software may be distributed in modified or unmodified form,
# provided:
#
# (1) This complete license notice is retained.
#
# (2) This software and all software and data files distributed
# alongside this software and intended to be loaded in the same
# memory space may be redistributed without requirement for
# payment, notification, or other forms of compensation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Commercial licensing for this software is available, please
# contact pytom@bishoujo.us for information.
init python:
import pygame
DRAG_NONE = 0
DRAG_CARD = 1
DRAG_ABOVE = 2
DRAG_STACK = 3
DRAG_TOP = 4
# Returns the overlap of the area between the two
# rectangles.
def __rect_overlap_area(r1, r2):
if r1 is None or r2 is None:
return 0
x1, y1, w1, h1 = r1
x2, y2, w2, h2 = r2
maxleft = max(x1, x2)
minright = min(x1 + w1, x2 + w2)
maxtop = max(y1, y2)
minbottom = min(y1 + h1, y2 + h2)
if minright < maxleft:
return 0
if minbottom < maxtop:
return 0
return (minright - maxleft) * (minbottom - maxtop)
def __default_can_drag(table, stack, card):
return table.get_faceup(card)
class Table(renpy.Displayable):
def __init__(self, back=None, base=None, springback=0.1, rotate=0.1, can_drag=__default_can_drag, doubleclick=.33, **kwargs):
renpy.Displayable.__init__(self, **kwargs)
# A map from card value to the card object corresponding to
# that value.
self.cards = { }
# A list of the stacks that have been defined.
self.stacks = [ ]
# The back of cards that don't have a more specific back
# defined.
self.back = renpy.easy.displayable_or_none(back)
# The base of stacks that don't have a more specific base
# defined.
self.base = renpy.easy.displayable_or_none(base)
# The amount of time it takes for cards to springback
# into their rightful place.
self.springback = springback
# The amount of time it takes for cards to rotate into
# their proper orientation.
self.rotate = rotate
# A function that is called to tell if we can drag a
# particular card.
self.can_drag = can_drag
# The time between clicks for the click to be considered a
# double-click.
self.doubleclick = doubleclick
# Are we sensitive to input? [doc]
self.sensitive = True
# The last click event.
self.last_event = CardEvent()
# The card that has been clicked.
self.click_card = None
# The stack that has been clicked.
self.click_stack = None
# The list of cards that are being dragged.
self.drag_cards = [ ]
# Are we dragging the cards?
self.dragging = False
# The position where we clicked.
self.click_x = 0
self.click_y = 0
# The amount of time we've been shown for.
self.st = 0
# This shows the table on the given layer.
def show(self, layer='master'):
for v in self.cards.itervalues():
v.offset = __Fixed(0, 0)
ui.layer(layer)
ui.add(self)
ui.close()
# This hides the table.
def hide(self, layer='master'):
ui.layer(layer)
ui.remove(self)
ui.close()
# This controls sensitivity.
def set_sensitive(self, value):
self.sensitive = value
def get_card(self, value):
if value not in self.cards:
raise Exception("No card has the value %r." % value)
return self.cards[value]
# This sets the faceup status of a card.
def set_faceup(self, card, faceup=True):
self.get_card(card).faceup = faceup
renpy.redraw(self, 0)
def get_faceup(self, card):
return self.get_card(card).faceup
# This sets the rotation of a card.
def set_rotate(self, card, rotation):
__Rotate(self.get_card(card), rotation)
renpy.redraw(self, 0)
def get_rotate(self, card):
return self.get_card(card).rotate.rotate_limit()
def add_marker(self, card, marker):
self.get_card(card).markers.append(marker)
renpy.redraw(self, 0)
def remove_marker(self, card, marker):
self.get_card(card).markers.remove(marker)
renpy.redraw(self, 0)
# Called to create a new card.
def card(self, value, face, back=None):
self.cards[value] = __Card(self, value, face, back)
# Called to create a new stack.
def stack(self, x, y, xoff=0, yoff=0, show=1024, base=None,
click=False, drag=DRAG_NONE, drop=False, hidden=False):
rv = __Stack(self, x, y, xoff, yoff, show, base, click, drag, drop, hidden)
self.stacks.append(rv)
return rv
# Force a redraw on each interaction.
def per_interact(self):
renpy.redraw(self, 0)
def render(self, width, height, st, at):
self.st = st
rv = renpy.Render(width, height)
for s in self.stacks:
if s.hidden:
s.rect = None
for c in s.cards:
c.rect = None
continue
s.render_to(rv, width, height, st, at)
for c in s.cards:
c.render_to(rv, width, height, st, at)
return rv
def event(self, ev, x, y, st):
self.st = st
if not self.sensitive:
return
grabbed = renpy.display.focus.get_grab()
if (grabbed is not None) and (grabbed is not self):
return
if ev.type == pygame.MOUSEBUTTONDOWN and ev.button == 1:
if self.click_stack:
return
stack = None
card = None
for s in self.stacks:
sx, sy, sw, sh = s.rect
if sx <= x and sy <= y and sx + sw > x and sy + sh > y:
stack = s
for c in s.cards[-s.show:]:
if c.rect is None:
continue
cx, cy, cw, ch = c.rect
if cx <= x and cy <= y and cx + cw > x and cy + ch > y:
card = c
stack = c.stack
if stack is None:
return
# Grab the display.
renpy.display.focus.set_grab(self)
# Don't let the user grab a moving card.
if card is not None:
xoffset, yoffset = card.offset.offset()
if xoffset or yoffset:
return
# Move the stack containing the card to the front.
self.stacks.remove(stack)
self.stacks.append(stack)
if stack.click or stack.drag:
self.click_card = card
self.click_stack = stack
if card is None or not self.can_drag(self, card.stack, card.value):
self.drag_cards = [ ]
elif card.stack.drag == DRAG_CARD:
self.drag_cards = [ card ]
elif card.stack.drag == DRAG_ABOVE:
self.drag_cards = [ ]
for c in card.stack.cards:
if c is card or self.drag_cards:
self.drag_cards.append(c)
elif card.stack.drag == DRAG_STACK:
self.drag_cards = list(card.stack.cards)
elif card.stack.drag == DRAG_TOP:
if card.stack.cards[-1] is card:
self.drag_cards = [ card ]
else:
self.drag_cards = [ ]
for c in self.drag_cards:
c.offset = __Fixed(0, 0)
self.click_x = x
self.click_y = y
self.dragging = False
renpy.redraw(self, 0)
raise renpy.IgnoreEvent()
if ev.type == pygame.MOUSEMOTION or (ev.type == pygame.MOUSEBUTTONUP and ev.button == 1):
if abs(x - self.click_x) > 7 or abs(y - self.click_y) > 7:
self.dragging = True
dx = x - self.click_x
dy = y - self.click_y
for c in self.drag_cards:
xoffset, yoffset = c.offset.offset()
cdx = dx - xoffset
cdy = dy - yoffset
c.offset = __Fixed(dx, dy)
if c.rect:
cx, cy, cw, ch = c.rect
cx += cdx
cy += cdy
c.rect = (cx, cy, cw, ch)
area = 0
dststack = None
dstcard = None
for s in self.stacks:
if not s.drop:
continue
for c in self.drag_cards:
if c.stack == s:
continue
a = __rect_overlap_area(c.rect, s.rect)
if a >= area:
dststack = s
dstcard = None
area = a
for c1 in s.cards:
a = __rect_overlap_area(c.rect, c1.rect)
if a >= area:
dststack = s
dstcard = c1
area = a
if area == 0:
dststack = None
dstcard = None
renpy.redraw(self, 0)
if ev.type == pygame.MOUSEMOTION:
raise renpy.IgnoreEvent()
if ev.type == pygame.MOUSEBUTTONUP and ev.button == 1:
# Ungrab the display.
renpy.display.focus.set_grab(None)
evt = None
if self.dragging:
if dststack is not None and self.drag_cards:
evt = CardEvent()
evt.type = "drag"
evt.table = self
evt.stack = self.click_stack
evt.card = self.click_card.value
evt.drag_cards = [c.value for c in self.drag_cards]
evt.drop_stack = dststack
if dstcard:
evt.drop_card = dstcard.value
evt.time = st
else:
if self.click_stack.click:
evt = CardEvent()
evt.type = "click"
evt.table = self
evt.stack = self.click_stack
if self.click_card:
evt.card = self.click_card.value
else:
evt.card = None
evt.time = st
if (evt.type == self.last_event.type
and evt.stack == self.last_event.stack
and evt.card == self.last_event.card
and evt.time < self.last_event.time + self.doubleclick):
evt.type = "doubleclick"
if evt is not None:
self.last_event = evt
for c in self.drag_cards:
c.springback()
self.click_card = None
self.click_stack = None
self.drag_cards = [ ]
if evt is not None:
return evt
else:
raise renpy.IgnoreEvent()
class CardEvent(object):
def __init__(self):
self.type = None
self.stack = None
self.card = None
self.drag_cards = None
self.drop_stack = None
self.drop_card = None
self.time = 0
# Represents a stack of one or more cards, which can be placed on the
# table.
class __Stack(object):
def __init__(
self, table,
x, y,
xoff, yoff,
show, base,
click, drag, drop,
hidden):
# The table this stack belongs to.
self.table = table
# The x and y coordinates of the center of the top card of
# this stack.
self.x = x
self.y = y
# The offset in the x and y directions of each successive
# card.
self.xoff = xoff
self.yoff = yoff
# The number of cards to show from this stack. (We show the
# last show cards if this is less than the numebr of cards
# in the stack.)
self.show = show
# The image that is shown behind the stack. If None, the
# background is taken from the table.
self.base = base
# Should we report click events on this stack?
self.click = click
# Should we allow dragging this stack? If so, how?
self.drag = drag
# Should we allow dropping to this stack?
self.drop = drop
# Is this stack hidden?
self.hidden = hidden
# The list of cards in this stack.
self.cards = [ ]
# The rectangle for the background of this effect.
self.rect = None
def insert(self, index, card):
card = self.table.get_card(card)
if card.stack:
card.stack.cards.remove(card)
card.stack = self
self.cards.insert(index, card)
self.table.stacks.remove(self)
self.table.stacks.append(self)
card.springback()
def append(self, card):
if card in self.cards:
self.insert(len(self.cards) - 1, card)
else:
self.insert(len(self.cards), card)
def remove(self, card):
card = self.table.get_card(card)
self.cards.remove(card)
card.stack = None
card.rect = None
def deal(self):
if not self.cards:
return None
card = self.cards[-1]
self.remove(card.value)
return card.value
def shuffle(self):
renpy.random.shuffle(self.cards)
renpy.redraw(self.table, 0)
def __len__(self):
return len(self.cards)
def __getitem__(self, idx):
return self.cards[idx].value
def __iter__(self):
for i in self.cards:
yield i.value
def __contains__(self, item):
return self.table.get_card(card) in self.cards
def render_to(self, rv, width, height, st, at):
base = self.base or self.table.base
if base is None:
return
surf = renpy.render(base, width, height, st, at)
cw, ch = surf.get_size()
cx = self.x - cw / 2
cy = self.y - ch / 2
self.rect = (cx, cy, cw, ch)
rv.blit(surf, (cx, cy))
class __Card(object):
def __init__(self, table, value, face, back):
# The table this card belongs to.
self.table = table
# The value of this card.
self.value = value
# The face of this card.
self.face = renpy.easy.displayable(face)
# The back of this card. If None, then the back is taken from
# the table the card belongs to.
self.back = renpy.easy.displayable_or_none(back)
# Is this card faceup (or face down?)
self.faceup = True
# Object that's called to decide how rotated this card should
# be.
self.rotate = None
# A series of highlights that should be drawn over this card.
self.highlights = [ ]
# The stack this card is in.
self.stack = None
# An object that gives the offset of this card relative to
# where it would normally be placed.
self.offset = __Fixed(0, 0)
# The rectangle where this card was last drawn to the screen
# at.
self.rect = None
__Rotate(self, 0)
# Returns the base x and y placement of this card.
def place(self):
s = self.stack
offset = max(len(s.cards) - s.show, 0)
index = max(s.cards.index(self) - offset, 0)
return (s.x + s.xoff * index, s.y + s.yoff * index)
def springback(self):
if self.rect is None:
self.offset = __Fixed(0, 0)
else:
self.offset = __Springback(self)
def render_to(self, rv, width, height, st, at):
x, y = self.place()
xoffset, yoffset = self.offset.offset()
x += xoffset
y += yoffset
if self.faceup:
d = self.face
else:
d = self.back or self.table.back
# TODO: Figure out if we can reuse some of this.
if self.highlights:
d = Fixed(* ([d] + [renpy.easy.displayable(i) for i in self.highlights]))
r = self.rotate.rotate()
if r:
d = RotoZoom(r, r, 0, 1, 1, 0)(d)
surf = renpy.render(d, width, height, st, at)
w, h = surf.get_size()
x -= w / 2
y -= h / 2
self.rect = (x, y, w, h)
rv.blit(surf, (x, y))
def __repr__(self):
return "<__Card %r>" % self.value
class __Springback(object):
def __init__(self, card):
self.card = card
self.table = table = card.table
self.start = table.st
cx, cy, cw, ch = self.card.rect
x = cx + cw / 2
y = cy + ch / 2
self.startx = x
self.starty = y
def offset(self):
t = (self.table.st - self.start) / self.table.springback
t = min(t, 1.0)
if t < 1.0:
renpy.redraw(self.table, 0)
px, py = self.card.place()
return int((self.startx - px) * (1.0 - t)), int((self.starty - py) * (1.0 - t))
class __Fixed(object):
def __init__(self, x, y):
self.x = x
self.y = y
def offset(self):
return self.x, self.y
class __Rotate(object):
def __init__(self, card, amount):
self.table = table = card.table
self.start = table.st
if card.rotate is None:
self.start_rotate = amount
else:
self.start_rotate = card.rotate.rotate()
self.end_rotate = amount
card.rotate = self
def rotate(self):
if self.start_rotate == self.end_rotate:
return self.start_rotate
t = (self.table.st - self.start) / self.table.springback
t = min(t, 1.0)
if t < 1.0:
renpy.redraw(self.table, 0)
return self.start_rotate + (self.end_rotate - self.start_rotate) * t
def rotate_limit(self):
return self.end_rotate
Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

-336
View File
@@ -1,336 +0,0 @@
# klondike.rpy - Klondike Solitaire
# Copyright (C) 2008 PyTom <pytom@bishoujo.us>
#
# This software may be distributed in modified or unmodified form,
# provided:
#
# (1) This complete license notice is retained.
#
# (2) This software and all software and data files distributed
# alongside this software and intended to be loaded in the same
# memory space may be redistributed without requirement for
# payment, notification, or other forms of compensation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Commercial licensing for this software is available, please
# contact pytom@bishoujo.us for information.
init python:
class Klondike(object):
# We represent a card as a (suit, rank) tuple. The suit is one of the
# following four constants, while the rank is 1 for ace, 2 for 2,
# ..., 10 for 10, 11 for jack, 12 for queen, 13 for king.
CLUB = 0
SPADE = 1
HEART = 2
DIAMOND = 3
def __init__(self, deal=3):
# Constants that let us easily change where the game is
# located.
LEFT=140
TOP=58
COL_SPACING = 90
ROW_SPACING = 120
CARD_XSPACING = 20
CARD_YSPACING = 30
# Store the parameters.
self.deal = deal
# Create the table, stock, and waste.
self.table = t = Table(base="card/base.png", back="card/back.png")
self.stock = t.stack(LEFT, TOP, xoff=0, yoff=0, click=True)
self.waste = t.stack(LEFT + COL_SPACING, TOP, xoff=CARD_XSPACING, drag=DRAG_TOP, show=self.deal, click=True)
# The 4 foundation stacks.
self.foundations = [ ]
for i in range(0, 4):
s = t.stack(LEFT + COL_SPACING * (i + 3), TOP, xoff=0, yoff=0, drag=DRAG_TOP, drop=True)
self.foundations.append(s)
# The 7 tableau stacks.
self.tableau = [ ]
for i in range(0, 7):
s = t.stack(LEFT + COL_SPACING * i, TOP + ROW_SPACING, xoff=0, yoff=CARD_YSPACING, drag=DRAG_ABOVE, click=True, drop=True)
self.tableau.append(s)
# Create the stock and shuffle it.
for rank in range(1, 14):
for suit in range(0, 4):
value = (suit, rank)
t.card(value, "card/%d.png" % self.card_num(suit, rank))
t.set_faceup(value, False)
self.stock.append(value)
self.stock.shuffle()
# Deal out the initial tableau.
for i in range(0, 7):
for j in range(i, 7):
c = self.stock.deal()
self.tableau[j].append(c)
# Ensure that the bottom of each tableau is faceup.
for i in range(0, 7):
if self.tableau[i]:
self.table.set_faceup(self.tableau[i][-1], True)
# This figures out the image filename for a given suit and rank.
def card_num(self, suit, rank):
ranks = [ None, 1, 49, 45, 41, 37, 33, 29, 25, 21, 17, 13, 9, 5 ]
return suit + ranks[rank]
def show(self):
self.table.show()
def hide(self):
self.table.hide()
def tableau_drag(self, evt):
card = evt.drag_cards[0]
cards = evt.drag_cards
stack = evt.drop_stack
csuit, crank = card
# If the stack is empty, allow a king to be dragged to it.
if not stack:
if crank == 13:
for i in cards:
stack.append(i)
return "tableau_drag"
# Otherwise, the stack has a bottom card.
bottom = stack[-1]
bsuit, brank = bottom
# Figure out which of the stacks are black.
cblack = (csuit == self.SPADE) or (csuit == self.CLUB)
bblack = (bsuit == self.SPADE) or (bsuit == self.CLUB)
# Can we legally place the cards?
if (bblack != cblack) and (crank == brank - 1):
# Place the cards:
for i in cards:
stack.append(i)
return "tableau_drag"
return False
def foundation_drag(self, evt):
# We can only drag one card at a time to a foundation.
if len(evt.drag_cards) != 1:
return False
suit, rank = evt.drag_cards[0]
# If there is a card on the foundation already, then
# check to see if we're dropping then next one in
# sequence.
if len(evt.drop_stack):
dsuit, drank = evt.drop_stack[-1]
if suit == dsuit and rank == drank + 1:
evt.drop_stack.append(evt.drag_cards[0])
return "foundation_drag"
# Otherwise, make sure we're dropping an ace.
else:
if rank == 1:
evt.drop_stack.append(evt.drag_cards[0])
return "foundation_drag"
return False
def tableau_doubleclick(self, evt):
# Make sure that there's at least one card in the stack.
if not evt.stack:
return False
# The bottom card in the stack.
card = evt.stack[-1]
suit, rank = card
# If the card is an ace, find an open foundation and put it
# there.
if rank == 1:
for i in self.foundations:
if not i:
i.append(card)
break
return "foundation_drag"
# Otherwise, see if there's a foundation where we can put
# the card.
for i in self.foundations:
if not i:
continue
fsuit, frank = i[-1]
if suit == fsuit and rank == frank + 1:
i.append(card)
return "foundation_drag"
return False
def stock_click(self, evt):
# If there are cards in the stock, dispense up to three3
# of them.
if self.stock:
for i in range(0, self.deal):
if self.stock:
c = self.stock[-1]
self.table.set_faceup(c, True)
self.waste.append(c)
return "stock_click"
# Otherwise, move the contents of the waste to the stock.
else:
while self.waste:
c = self.waste[-1]
self.table.set_faceup(c, False)
self.stock.append(c)
return "stock_click"
def interact(self):
evt = ui.interact()
rv = False
# Check the various events, and dispatch them to the methods
# that handle them.
if evt.type == "drag":
if evt.drop_stack in self.tableau:
rv = self.tableau_drag(evt)
elif evt.drop_stack in self.foundations:
rv = self.foundation_drag(evt)
elif evt.type == "click":
if evt.stack == self.stock:
rv = self.stock_click(evt)
elif evt.type == "doubleclick":
if (evt.stack in self.tableau) or (evt.stack is self.waste):
rv = self.tableau_doubleclick(evt)
# Ensure that the bottom card in each tableau is faceup.
for i in range(0, 7):
if self.tableau[i]:
self.table.set_faceup(self.tableau[i][-1], True)
# Check to see if any of the foundations has less than
# 13 cards in it. If it does, return False. Otherwise,
# return True.
for i in self.foundations:
if len(i) != 13:
return rv
return "win"
# Sets things as sensitive (or not).
def set_sensitive(self, value):
self.table.set_sensitive(value)
# Utility functions.
# Is it okay to drag the over card onto under, where under is
# part of a tableau.
def can_hint(self, under, over):
usuit, urank = under
osuit, orank = over
if orank == 1:
return False
ublack = (usuit == self.SPADE) or (usuit == self.CLUB)
oblack = (osuit == self.SPADE) or (osuit == self.CLUB)
if (oblack != ublack) and (orank == urank - 1):
return True
# Returns the first faceup card in the stack.
def first_faceup(self, s):
for c in s:
if self.table.get_faceup(c):
return c
# This tries to find a reasonable hint, and returns it as a
# pair of cardnames.
def hint(self):
for i in self.tableau:
if not i:
continue
over = self.first_faceup(i)
for j in self.tableau:
if not j or i is j:
continue
under = j[-1]
if self.can_hint(under, over):
return (under, over)
if self.waste:
over = self.waste[-1]
for j in self.tableau:
if not j:
continue
under = j[-1]
if self.can_hint(under, over):
return (under, over)
return None, None
def card_name(self, c):
suit, rank = c
return [
"INVALID",
"Ace",
"Two",
"Three",
"four",
"Five",
"Six",
"Seven",
"Eight",
"Nine",
"Ten",
"Jack",
"Queen",
"King" ][rank] + " of " + [
"Clubs",
"Spades",
"Hearts",
"Diamonds" ][suit]
Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

-247
View File
@@ -1,247 +0,0 @@
## This file contains some of the options that can be changed to customize
## your Ren'Py game. It only contains the most common options... there
## is quite a bit more customization you can do.
##
## Lines beginning with two '#' marks are comments, and you shouldn't
## uncomment them. Lines beginning with a single '#' mark are
## commented-out code, and you may want to uncomment them when
## appropriate.
init -1 python hide:
## Should we enable the use of developer tools? This should be
## set to False before the game is released, so the user can't
## cheat using developer tools.
config.developer = True
## These control the width and height of the screen.
config.screen_width = 800
config.screen_height = 600
## This controls the title of the window, when Ren'Py is
## running in a window.
config.window_title = u"Ren'Py Cardgame Demo"
#########################################
# Layouts
## This enables the use of an in-game menu that is made out of
## buttons.
layout.button_menu()
#########################################
# Themes
## We then want to call a theme function. themes.roundrect is
## a theme that features the use of rounded rectangles. It's
## the only theme we currently support.
##
## The theme function takes a number of parameters that can
## customize the color scheme.
theme.roundrect(
## The color of an idle widget face.
widget = "#7AA27B",
## The color of a focused widget face.
widget_hover = "#A3C7A3",
## The color of the text in a widget.
widget_text = "#CDE0CE",
## The color of the text in a selected widget. (For
## example, the current value of a preference.)
widget_selected = "#ffffff",
## The color of a disabled widget face.
disabled = "#426143",
## The color of disabled widget text.
disabled_text = "#819981",
## The color of informational labels.
label = "#ffffff",
## The color of a frame containing widgets.
frame = "#245536",
## If this is True, the in-game window is rounded. If False,
## the in-game window is square.
rounded_window = False,
## The background of the main menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
mm_root = "mainmenu.jpg",
## The background of the game menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
gm_root = "table.jpg",
## And we're done with the theme. The theme will customize
## various styles, so if we want to change them, we should
## do so below.
)
#########################################
## These settings let you customize the window containing the
## dialogue and narration, by replacing it with an image.
## The background of the window. In a Frame, the two numbers
## are the size of the left/right and top/bottom borders,
## respectively.
# style.window.background = Frame("frame.png", 12, 12)
## Margin is space surrounding the window, where the background
## is not drawn.
# style.window.left_margin = 6
# style.window.right_margin = 6
# style.window.top_margin = 6
# style.window.bottom_margin = 6
## Padding is space inside the window, where the background is
## drawn.
# style.window.left_padding = 6
# style.window.right_padding = 6
# style.window.top_padding = 6
# style.window.bottom_padding = 6
## This is the minimum height of the window, including the margins
## and padding.
# style.window.yminimum = 250
#########################################
## This lets you change the placement of the main menu.
## The way placement works is that we find an anchor point
## inside a displayable, and a position (pos) point on the
## screen. We then place the displayable so the two points are
## at the same place.
## An anchor/pos can be given as an integer or a floating point
## number. If an integer, the number is interpreted as a number
## of pixels from the upper-left corner. If a floating point,
## the number is interpreted as a fraction of the size of the
## displayable or screen.
# style.mm_menu_frame.xpos = 0.5
# style.mm_menu_frame.xanchor = 0.5
# style.mm_menu_frame.ypos = 0.75
# style.mm_menu_frame.yanchor = 0.5
#########################################
## These let you customize the default font used for text in Ren'Py.
## The file containing the default font.
# style.default.font = "DejaVuSans.ttf"
## The default size of text.
# style.default.size = 22
## Note that these only change the size of some of the text. Other
## buttons have their own styles.
#########################################
## These settings let you change some of the sounds that are used by
## Ren'Py.
## Set this to False if the game does not have any sound effects.
config.has_sound = True
## Set this to False if the game does not have any music.
config.has_music = True
## Set this to False if the game does not have voicing.
config.has_voice = True
## Sounds that are used when button and imagemaps are clicked.
# style.button.activate_sound = "click.wav"
# style.imagemap.activate_sound = "click.wav"
## Sounds that are used when entering and exiting the game menu.
# config.enter_sound = "click.wav"
# config.exit_sound = "click.wav"
## A sample sound that can be played to check the sound volume.
# config.sample_sound = "click.wav"
## Music that is played while the user is at the main menu.
# config.main_menu_music = "main_menu_theme.ogg"
#########################################
## Transitions.
## Used when entering the game menu from the game.
config.enter_transition = dissolve
## Used when exiting the game menu to the game.
config.exit_transition = dissolve
## Used between screens of the game menu.
config.intra_transition = dissolve
## Used when entering the game menu from the main menu.
config.main_game_transition = dissolve
## Used when returning to the main menu from the game.
config.game_main_transition = dissolve
## Used when entering the main menu from the splashscreen.
config.end_splash_transition = dissolve
## Used when entering the main menu after the game has ended.
config.end_game_transition = fade
## Used when a game is loaded.
config.after_load_transition = dissolve
#########################################
## Default values of Preferences.
## Note: These options are only evaluated the first time a
## game is run. To have them run a second time, delete
## game/saves/persistent
## Should we start in fullscreen mode?
config.default_fullscreen = False
## The default text speed in characters per second. 0 is infinite.
config.default_text_cps = 0
config.save_directory = "cardgame-11754"
-184
View File
@@ -1,184 +0,0 @@
# You can place the script of your game in this file.
init:
$ e = Character('Eileen', color="#c8ffc8")
image eileen happy = "eileen_happy.png"
image bg table = "table.jpg"
image dim = "#0008"
# Some styles for show text.
$ style.centered_text.drop_shadow = (2, 2)
$ style.centered_text.drop_shadow_color = "#000b"
label start:
scene bg table
python:
k = Klondike(1)
k.set_sensitive(False)
k.show()
show dim
show eileen happy
with dissolve
e "Welcome to the cardgame demo. Let's play some solitaire!"
e "I might show up from time to time to give you some advice, but it's up to you if you want to take it."
e "Good luck!"
label continue:
hide dim
hide eileen
with dissolve
label quick_continue:
$ hint_count = renpy.random.randint(10, 20)
while True:
python:
ui.textbutton("Give Up", ui.jumps("giveup"), xalign=.02, yalign=.98)
k.set_sensitive(True)
event = k.interact()
if event:
renpy.checkpoint()
if event == "win":
jump win
if event == "tableau_drag" or event == "stock_click":
$ hint_count -= 1
if hint_count <= 0:
jump hint
label win:
show dim
show eileen happy
with dissolve
"Congratulations!"
jump newgame
label giveup:
$ k.set_sensitive(False)
show dim
show eileen happy
with dissolve
menu:
e "Are you sure you want to give up?"
"Yes":
"Oh well, better luck next time."
jump newgame
"No":
jump continue
label newgame:
menu:
e "Would you like to try again?"
"Yes":
pass
"No":
e "Well, I hope to see you again soon."
return
e "Okay, here we go!"
scene bg table
python:
k = Klondike(1)
k.sensitive = False
k.show()
jump continue
label hint:
$ under, over = k.hint()
$ print under, over
if under is None:
jump quick_continue
$ under = k.card_name(under)
$ over = k.card_name(over)
$ k.set_sensitive(False)
show dim
show eileen happy
with dissolve
$ hint = renpy.random.randint(0, 2)
if hint == 0:
e "Maybe put the %(over)s on top of the %(under)s."
elif hint == 1:
e "You can try moving the %(over)s to the %(under)s."
elif hint == 2:
e "I think something can go on the %(under)s."
jump continue
# This has nothing to do with card games.
label splashscreen:
scene bg table
$ renpy.pause(1.0)
show text "According to legend, prospectors in the klondike would carry with them a deck of cards."
with dissolve
with Pause(5.0)
hide text
with dissolve
with Pause(1.0)
show text "If they were ever lost, they'd start playing a game of solitaire."
with dissolve
with Pause(4.0)
hide text
with dissolve
with Pause(1.0)
show text "Without fail, help would soon arrive..."
with dissolve
with Pause(3.0)
hide text
with dissolve
with Pause(1.0)
show text "... saying \"put the Five of Spades on the Six of Hearts.\""
with dissolve
with Pause(4.0)
hide text
with dissolve
with Pause(1.0)
return
Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

+6
View File
@@ -13,6 +13,9 @@ init -1210 python:
if version <= (6, 5, 0):
layout.compat()
if version <= (6, 9, 1):
store.library = store.config
init 1210 python hide::
# This returns true if the script_version is <= the
@@ -54,6 +57,9 @@ init 1210 python hide::
if compat(6, 2, 0):
config.reject_backslash = False
if compat(6, 9, 0):
style.motion.clear()
if "Fullscreen" in config.translations:
fs = _("Fullscreen")
config.translations.setdefault("Fullscreen 4:3", fs + " 4:3")
+27 -18
View File
@@ -62,60 +62,69 @@ init -1110 python:
return .5 - math.cos(math.pi * x) / 2.0
# This defines a family of move transitions.
def move_transitions(prefix, delay, time_warp=None, in_time_warp=None, out_time_warp=None, old=False):
def move_transitions(prefix, delay, time_warp=None, in_time_warp=None, out_time_warp=None, old=False, layers=[ 'master' ], **kwargs):
moves = {
"" : MoveTransition(
delay,
old=old,
factory=MoveFactory(time_warp=time_warp)),
layers=layers,
factory=MoveFactory(time_warp=time_warp, **kwargs)),
"inright" : MoveTransition(
delay,
old=old,
factory=MoveFactory(time_warp=time_warp),
enter_factory=MoveIn((1.0, None, 0.0, None), time_warp=in_time_warp)),
layers=layers,
factory=MoveFactory(time_warp=time_warp, **kwargs),
enter_factory=MoveIn((1.0, None, 0.0, None), time_warp=in_time_warp, **kwargs)),
"inleft" : MoveTransition(
delay,
old=old,
factory=MoveFactory(time_warp=time_warp),
enter_factory=MoveIn((0.0, None, 1.0, None), time_warp=in_time_warp)),
layers=layers,
factory=MoveFactory(time_warp=time_warp, **kwargs),
enter_factory=MoveIn((0.0, None, 1.0, None), time_warp=in_time_warp, **kwargs)),
"intop" : MoveTransition(
delay,
old=old,
factory=MoveFactory(time_warp=time_warp),
enter_factory=MoveIn((None, 0.0, None, 1.0), time_warp=in_time_warp)),
layers=layers,
factory=MoveFactory(time_warp=time_warp, **kwargs),
enter_factory=MoveIn((None, 0.0, None, 1.0), time_warp=in_time_warp, **kwargs)),
"inbottom" : MoveTransition(
delay,
old=old,
factory=MoveFactory(time_warp=time_warp),
enter_factory=MoveIn((None, 1.0, None, 0.0), time_warp=in_time_warp)),
layers=layers,
factory=MoveFactory(time_warp=time_warp, **kwargs),
enter_factory=MoveIn((None, 1.0, None, 0.0), time_warp=in_time_warp, **kwargs)),
"outright" : MoveTransition(
delay,
old=old,
factory=MoveFactory(time_warp=time_warp),
leave_factory=MoveOut((1.0, None, 0.0, None), time_warp=out_time_warp)),
layers=layers,
factory=MoveFactory(time_warp=time_warp, **kwargs),
leave_factory=MoveOut((1.0, None, 0.0, None), time_warp=out_time_warp, **kwargs)),
"outleft" : MoveTransition(
delay,
old=old,
factory=MoveFactory(time_warp=time_warp),
leave_factory=MoveOut((0.0, None, 1.0, None), time_warp=out_time_warp)),
layers=layers,
factory=MoveFactory(time_warp=time_warp, **kwargs),
leave_factory=MoveOut((0.0, None, 1.0, None), time_warp=out_time_warp, **kwargs)),
"outtop" : MoveTransition(
delay,
old=old,
factory=MoveFactory(time_warp=time_warp),
leave_factory=MoveOut((None, 0.0, None, 1.0), time_warp=out_time_warp)),
layers=layers,
factory=MoveFactory(time_warp=time_warp, **kwargs),
leave_factory=MoveOut((None, 0.0, None, 1.0), time_warp=out_time_warp, **kwargs)),
"outbottom" : MoveTransition(
delay,
old=old,
factory=MoveFactory(time_warp=time_warp),
leave_factory=MoveOut((None, 1.0, None, 0.0), time_warp=time_warp)),
layers=layers,
factory=MoveFactory(time_warp=time_warp, **kwargs),
leave_factory=MoveOut((None, 1.0, None, 0.0), time_warp=time_warp, **kwargs)),
}
for k, v in moves.iteritems():
+4 -1
View File
@@ -196,6 +196,9 @@ label _style_hierarchy:
jump _developer_screen
init -1050 python:
config.missing_background = "black"
init 1050 python:
if renpy.game.options.remote:
@@ -238,7 +241,7 @@ init 1050 python:
global __missing_scene
if __missing_scene:
renpy.show(name, what="black")
renpy.show(name, what=config.missing_background)
__missing_scene = False
what = " ".join(what).replace("{", "{{")
+1 -1
View File
@@ -18,7 +18,7 @@ init -1105 python:
# This takes care of actually displaying button menus.
def _display_button_menu(menuitems):
narration = [ s for s, i in menuitems if i is None and s ]
menuitems = [ (s, i) for s, i in menuitems if i is not None or not s ]
+55 -44
View File
@@ -69,6 +69,12 @@ init -1180 python:
config.with_callback = _default_with_callback
def _default_empty_window():
store.narrator("", interact=False)
config.empty_window = _default_empty_window
style.skip_indicator = Style(style.default, heavy=True, help='The skip indicator.')
style.skip_indicator.xpos = 10
style.skip_indicator.ypos = 10
@@ -123,10 +129,13 @@ init -1180 python:
return
_preferences.fullscreen = False
import webbrowser
webbrowser.open_new("file:///" + config.basedir + "/" + config.help)
try:
import webbrowser
webbrowser.open_new("file:///" + config.basedir + "/" + config.help)
except:
pass
init -1180 python hide:
@@ -134,18 +143,36 @@ init -1180 python hide:
def screenshot():
import os.path
import os
pattern = os.environ.get("RENPY_SCREENSHOT_PATTERN", "screenshot%04d.png")
import __main__
pattern = os.environ.get("RENPY_SCREENSHOT_PATTERN", "screenshot%04d.png")
# Pick the directory to save into.
dest = config.renpy_base.rstrip("/")
# Guess if we're an OSX App.
if dest.endswith("/Contents/Resources/autorun"):
# Go up 4 directories.
dest = os.path.dirname(dest)
dest = os.path.dirname(dest)
dest = os.path.dirname(dest)
dest = os.path.dirname(dest)
# Try to pick a filename.
i = 1
while True:
fn = pattern % i
fn = dest + "/" + pattern % i
if not os.path.exists(fn):
break
i += 1
renpy.screenshot(fn)
try:
renpy.screenshot(fn)
except:
import traceback
traceback.print_exc()
def dump_styles():
if config.developer:
renpy.style.write_text("styles.txt")
@@ -182,7 +209,8 @@ init -1180 python hide:
filename, line = renpy.get_filename_line()
renpy.launch_editor([ filename ], line)
# The default keymap.
# The default keymap. We might also want to put some of this into
# the launcher.
km = renpy.Keymap(
rollback = renpy.rollback,
screenshot = screenshot,
@@ -283,32 +311,13 @@ label _hide_windows:
python:
_windows_hidden = True
ui.saybehavior(dismiss=['dismiss', 'hide_windows'])
ui.interact(suppress_overlay=True)
ui.interact(suppress_overlay=True, suppress_window=True)
_windows_hidden = False
return
# This code here handles check for the correct version of the Ren'Py module.
label _check_module:
if not config.module_warning:
return
python hide:
module_info = _(u"While Ren'Py games may be playable without the renpy module, some features may be disabled. For more information, read the module/README.txt file or go to http://www.bishoujo.us/renpy/.")
if renpy.module_version() == 0:
_show_exception(_(u"renpy module not found."),
_(u"The renpy module could not be loaded on your system.") + "\n\n" + module_info)
elif renpy.module_version() < config.module_version:
_show_exception(_(u"Old renpy module found."),
_(u"An old version (%d) of the Ren'Py module was found on your system, while this game requires version %d.") % (renpy.module_version(), config.module_version) + "\n\n" + module_info)
return
label _save_reload_game:
python hide:
@@ -508,7 +517,7 @@ init 1180 python:
label _enter_menu:
python hide:
renpy.movie_stop()
renpy.movie_stop(only_fullscreen=True)
renpy.take_screenshot((config.thumbnail_width, config.thumbnail_height))
renpy.context()._menu = True
@@ -517,9 +526,11 @@ label _enter_menu:
renpy.context().main_menu = False
renpy.context_dynamic("main_menu")
renpy.context_dynamic("_window_subtitle")
renpy.context_dynamic("_window")
store.main_menu = False
store._window_subtitle = config.menu_window_subtitle
store._window = False
store.mouse_visible = True
store.suppress_overlay = True
@@ -598,7 +609,7 @@ label _return:
if renpy.context().main_menu:
$ renpy.transition(config.game_main_transition)
jump _main_menu
jump _main_menu_screen
$ renpy.transition(config.exit_transition)
@@ -651,7 +662,7 @@ label _start:
for i in config.start_callbacks:
i()
call _check_module from _call__check_module_1
# call _check_module from _call__check_module_1
call _load_reload_game from _call__load_reload_game_1
scene black
@@ -673,12 +684,6 @@ label _start:
$ renpy.block_rollback()
python hide:
for i in range(0, 7):
# renpy.music.stop(channel=i)
# renpy.sound.stop(channel=i)
pass
if config.main_menu_music:
$ renpy.music.play(config.main_menu_music, if_changed=True)
else:
@@ -694,15 +699,19 @@ label _start:
jump expression _restart[1]
label _invoke_main_menu:
$ renpy.call_in_new_context("_enter_main_menu")
if _restart:
$ renpy.call_in_new_context(_restart[2])
else:
$ renpy.call_in_new_context("_main_menu")
# If the main menu returns, then start the game.
jump start
# At this point, we've been switched into a new context. So we
# initialize it.
label _enter_main_menu:
label _main_menu(_main_menu_screen="_main_menu_screen"):
call _enter_menu from _call__enter_menu_1
@@ -712,9 +721,11 @@ label _enter_main_menu:
renpy.context().main_menu = True
store.main_menu = True
jump expression _main_menu_screen
# This is called to show the main menu to the user.
label _main_menu:
label _main_menu_screen:
# Let the user completely override the main menu. (But please note
# it still lives in the menu context, rather than the game context.)
+2
View File
@@ -29,6 +29,8 @@ init -1150 python:
]
label _quit_prompt:
$ renpy.loadsave.force_autosave()
if layout.yesno_prompt(None, u"Are you sure you want to quit?"):
jump _quit
else:
+17 -5
View File
@@ -1,17 +1,29 @@
# This file contains code that sets up the various mixers, based on how
# the user sets config.has_music, .has_sound, and .has_voice.
init -1130:
init -1130 python hide:
# Set to true in the very unlikely event you want to manually init
# the sound system.
$ config.force_sound = False
config.force_sound = False
# basics: True if the game will have music.
$ config.has_music = True
config.has_music = True
# basics: True if the game will have sound effects.
$ config.has_sound = True
config.has_sound = True
# Register 8 channels by default, for compatiblity with older version
# of Ren'Py.
for i in xrange(0, 8):
renpy.music.register_channel(i)
renpy.music.register_channel("movie", "music", False, stop_on_mute=False)
# Set up default names for some of the channels.
renpy.music.alias_channel(0, "sound")
renpy.music.alias_channel(7, "music")
renpy.music.alias_channel(2, "voice")
init 1130:
+11 -2
View File
@@ -78,7 +78,7 @@ init -1100 python:
return s
def nvl_show_core():
if renpy.in_rollback():
nvl_window = __s(style.nvl_window)['rollback']
nvl_vbox = __s(style.nvl_vbox)['rollback']
@@ -99,8 +99,14 @@ init -1100 python:
rv = config.nvl_show_display_say(who, what, variant=nvl_variant, **kw)
ui.close()
renpy.shown_window()
return rv
def nvl_window():
nvl_show_core()
def nvl_show(with_):
nvl_show_core()
renpy.with_statement(with_)
@@ -208,7 +214,6 @@ init -1100 python:
kind=adv)
def nvl_clear():
store.nvl_list = [ ]
# Run clear at the start of the game.
@@ -219,6 +224,10 @@ init -1100 python:
if nvl_list is None:
store.nvl_list = [ ]
ui.layer("transient")
ui.clear()
ui.close()
ui.window(style=__s(style.nvl_window))
ui.vbox(style=__s(style.nvl_vbox))
+121 -1
View File
@@ -164,7 +164,6 @@ python early hide:
renpy.music.queue(eval(p["file"]), channel=channel)
renpy.statements.register('queue music',
parse=parse_queue_music,
execute=execute_queue_music,
@@ -254,10 +253,131 @@ python early hide:
parse=parse_stop_music,
execute=execute_stop_sound)
# Generic play/queue/stop statements. These take a channel name as
# the second thing.
def parse_play_generic(l, parse_play_music=parse_play_music):
channel = l.name()
if channel is None:
renpy.error('play requires a channel')
rv = parse_play_music(l)
if rv["channel"] is None:
rv["channel"] = repr(channel)
return rv
def parse_queue_generic(l, parse_queue_music=parse_queue_music):
channel = l.name()
if channel is None:
renpy.error('queue requires a channel')
rv = parse_queue_music(l)
if rv["channel"] is None:
rv["channel"] = repr(channel)
return rv
def parse_stop_generic(l, parse_stop_music=parse_stop_music):
channel = l.name()
if channel is None:
renpy.error('stop requires a channel')
rv = parse_stop_music(l)
if rv["channel"] is None:
rv["channel"] = repr(channel)
return rv
def lint_play_generic(p, lint_play_music=lint_play_music):
channel = eval(p["channel"])
if not renpy.music.channel_defined(channel):
renpy.error("channel %r is not defined" % channel)
lint_play_music(p)
def lint_stop_generic(p):
channel = eval(p["channel"])
if not renpy.music.channel_defined(channel):
renpy.error("channel %r is not defined" % channel)
renpy.statements.register('play',
parse=parse_play_generic,
execute=execute_play_music,
predict=predict_play_music,
lint=lint_play_generic)
renpy.statements.register('queue',
parse=parse_queue_generic,
execute=execute_queue_music,
lint=lint_play_generic)
renpy.statements.register('stop',
parse=parse_stop_generic,
execute=execute_stop_music,
lint=lint_stop_generic)
# The "window show" and "window hide" statements.
def parse_window(l):
p = l.simple_expression()
if not l.eol():
renpy.error('expected end of line')
return p
def lint_window(p):
if p is not None:
_try_eval(p, 'window transition')
def execute_window_show(p):
if store._window:
return
if p is not None:
trans = eval(p)
else:
trans = config.window_show_transition
renpy.with_statement(None)
store._window = True
renpy.with_statement(trans)
def execute_window_hide(p):
if not _window:
return
if p is not None:
trans = eval(p)
else:
trans = config.window_hide_transition
renpy.with_statement(None)
store._window = False
renpy.with_statement(trans)
renpy.statements.register('window show',
parse=parse_window,
execute=execute_window_show,
lint=lint_window)
renpy.statements.register('window hide',
parse=parse_window,
execute=execute_window_hide,
lint=lint_window)
init -1200 python:
config.window_show_transition = None
config.window_hide_transition = None
def _try_eval(e, what):
try:
return eval(e)
+11 -1
View File
@@ -33,6 +33,7 @@ init -1200 python hide:
style.image_placement = Style(style.default, help='default placement of images on the screen')
style.image = Style(style.default, help="default style of images")
style.motion = Style(style.default, help="default style of motions and zooms.")
style.animation = Style(style.default, help="default style of animations.")
style.say_label = Style(style.default, help='the name of the character speaking dialogue.')
@@ -68,6 +69,7 @@ init -1200 python hide:
style.hyperlink_text = Style(style.default, help='hyperlinked text')
style.viewport = Style(style.default, help='default style of viewports')
style.transform = Style(style.motion, help='default style of transforms')
style.list = Style(style.default)
style.list_box = Style(style.vbox)
@@ -166,7 +168,8 @@ init -1090 python:
style.default.ymaximum = None
style.default.xoffset = 0
style.default.yoffset = 0
style.default.subpixel = False
# Sound properties.
style.default.sound = None
@@ -197,6 +200,10 @@ init -1090 python:
style.hbox.box_layout = 'horizontal'
style.vbox.box_layout = 'vertical'
# Motions, zooms, rotozooms, and transforms.
style.motion.xanchor = 0
style.motion.yanchor = 0
# Windows.
style.window.background = Solid((0, 0, 0, 192))
style.window.xpadding = 6
@@ -263,6 +270,9 @@ init -1090 python:
# Viewport
style.viewport.clipping = True
# Transform
style.transform.subpixel = True
# Menu windows.
style.mm_root.background = "#000"
style.mm_root.xfill = True
+7 -1
View File
@@ -298,13 +298,19 @@ init -1110 python hide:
# Compat for the old roundrect theme.
window = None,
button_menu = True,
button_menu = None,
rounded_window = True,
outline_bars = False,
mm_root = None,
gm_root = None):
if button_menu is None:
if (config.script_version is not None) and (config.script_version < (6, 9, 0)):
button_menu = True
else:
button_menu = False
layout.defaults()
if config.screen_width <= 640:
+1 -1
View File
@@ -52,7 +52,7 @@ init -1120:
# This is called on each interaction, to ensure that the
# appropriate voice file is played for the user.
def voice_interact():
if not config.has_voice:
return
@@ -28,8 +28,6 @@ init python:
style.js_prefs_button.xminimum = 0.5
style.js_prefs_box.box_first_spacing = 10
config.joystick_keys = [
(u'Left', 'joy_left'),
(u'Right', 'joy_right'),
@@ -42,8 +40,6 @@ init python:
(u'Hide Text', 'joy_hide'),
(u'Menu', 'joy_menu'),
]
def _joystick_select_binding():
@@ -55,8 +51,8 @@ init python:
layout.button(_(label) + " - " + _(_preferences.joymap.get(key, u"Not Assigned")), "prefs_js", clicked=my_clicked, index=label)
def _joystick_get_binding():
ui.add(renpy.display.joystick.JoyBehavior())
ui.saybehavior()
ui.add(renpy.display.joystick.JoyBehavior())
def _joystick_take_binding(binding, key):
@@ -79,7 +75,7 @@ init python:
ui.close()
_joystick_get_binding()
binding = ui.interact()
binding = ui.interact(mouse="gamemenu")
_joystick_take_binding(binding, key)
return True
@@ -104,7 +100,7 @@ label joystick_preferences_screen:
python:
layout.navigation("joystick_preferences")
_joystick_preferences()
ui.interact()
ui.interact(mouse="gamemenu")
+1 -1
View File
@@ -291,7 +291,7 @@ init python:
ui.close() # slots
ui.close() # whole thing
result = ui.interact()
result = ui.interact(mouse="gamemenu")
type, value = result
if type == "return":
+1 -1
View File
@@ -50,7 +50,7 @@ label main_menu_screen:
ui.close()
ui.interact()
ui.interact(mouse="mainmenu")
return
+1 -1
View File
@@ -22,7 +22,7 @@ init python:
style.prefs_column.box_spacing = 5
style.prefs_frame.top_margin = 5
style.prefs_left.xpos = 100
style.prefs_left.xpos = 110
style.prefs_center.xpos = 320
style.prefs_right.xpos = 530
@@ -54,7 +54,7 @@ init python:
ui.close()
ui.interact()
ui.interact(mouse="gamemenu")
class _Preference(object):
"""
+1 -1
View File
@@ -49,7 +49,7 @@ init python hide:
ui.close()
ui.close()
rv = ui.interact()
rv = ui.interact(mouse="gamemenu")
renpy.transition(config.intra_transition)
return rv
+1 -1
View File
@@ -62,7 +62,7 @@ label main_menu_screen:
ui.close() # outer box
ui.interact()
ui.interact(mouse="mainmenu")
return
+22 -3
View File
@@ -2,7 +2,7 @@ init python:
class _ImageMapper(object):
def __init__(self, ground, idle, hover, selected_idle, selected_hover, hotspots):
def __init__(self, screen, ground, idle, hover, selected_idle, selected_hover, hotspots):
self.idle = idle
self.hover = hover
@@ -13,10 +13,29 @@ init python:
for (x1, y1, x2, y2, name) in hotspots:
self.hotspots[name] = (x1, y1, x2, y2)
# Display the layout navigation only if there are no
# game menu buttons defined.
for i in config.game_menu:
if i[1] in self.hotspots:
break
else:
layout.navigation(screen)
ui.fixed(style='imagemap')
ui.image(ground)
# Display any navigation buttons that exist.
for e in config.game_menu:
screen_ = e[0]
name = e[1]
act = e[2]
enable = e[3]
if not eval(enable):
continue
self.button(name, act, screen == screen_)
def button(self, name, clicked, selected):
if name not in self.hotspots:
@@ -32,8 +51,8 @@ init python:
hover = self.selected_hover
else:
idle = self.idle
hover = self.selected_hover
hover = self.hover
ui.imagebutton(
LiveCrop((x1, y1, (x2 - x1), (y2 - y1)), idle),
LiveCrop((x1, y1, (x2 - x1), (y2 - y1)), hover),
+2 -4
View File
@@ -233,10 +233,8 @@ init python:
__scratch.file_picker_page = fpp
# Show navigation
layout.navigation(screen)
ime = _ImageMapper(
screen,
config.load_save_ground,
config.load_save_idle,
config.load_save_hover,
@@ -291,7 +289,7 @@ init python:
ime.close()
result = ui.interact()
result = ui.interact(mouse="gamemenu")
type, value = result
if type == "return":
+6 -2
View File
@@ -32,7 +32,8 @@ label main_menu_screen:
rv = renpy.imagemap(
config.main_menu_ground,
config.main_menu_selected,
config.main_menu_hotspots)
config.main_menu_hotspots,
mouse="mainmenu")
for e in config.main_menu:
name = e[0]
@@ -44,9 +45,12 @@ label main_menu_screen:
if isinstance(act, basestring):
act = ui.jumpsoutofcontext(act)
act()
break
else:
ui.jumpsoutofcontext(rv)()
jump main_menu_screen
+2 -3
View File
@@ -39,9 +39,8 @@ init python:
def __show_preferences():
layout.navigation("prefs")
ime = _ImageMapper(
"preferences",
config.preferences_ground,
config.preferences_idle,
config.preferences_hover,
@@ -128,7 +127,7 @@ init python:
ime.bar("Voice Volume", 128, int(_preferences.get_volume('voice') * 128), set_voice)
ime.close()
ui.interact()
ui.interact(mouse="gamemenu")
label preferences_screen:
+2 -3
View File
@@ -17,9 +17,8 @@ init python hide:
def yesno_prompt(screen, message):
renpy.transition(config.intra_transition)
layout.navigation(screen)
ime = _ImageMapper(
screen,
config.yesno_prompt_ground,
config.yesno_prompt_idle,
config.yesno_prompt_hover,
@@ -34,7 +33,7 @@ init python hide:
layout.prompt(message, "yesno")
rv = ui.interact()
rv = ui.interact(mouse="gamemenu")
renpy.transition(config.intra_transition)
return rv
+1 -1
View File
@@ -182,7 +182,7 @@ init python:
ui.add(DynamicDisplayable(_file_picker_thumbnail))
try:
rv = ui.interact()
rv = ui.interact(mouse="gamemenu")
finally:
__session.scrollbar_position = adj.value
__session.thumbnail = None
+8 -1
View File
@@ -6,6 +6,8 @@ init:
image logo crop = im.Crop("logo.png", 0, 0, 100, 307)
image logo scale = im.Scale("logo.png", 100, 150)
image logo factorscale = im.FactorScale("logo.png", 1.5, 1.5)
image logo composite = im.Composite((200, 407),
(0, 0), "logo.png",
@@ -101,8 +103,13 @@ label demo_imageops:
show logo scale at logopos
with dissolve
e "The im.Scale operation lets us change the size of images."
e "The im.Scale operation lets us scale an image to a particular size."
show logo factorscale at logopos
with dissolve
e "im.FactorScale lets us do the same thing, except to a factor of the original size."
show logo green at logopos
with dissolve

Some files were not shown because too many files have changed in this diff Show More