Compare commits

...

943 Commits

Author SHA1 Message Date
Tom Rothamel 8f706107ac 6.12.0d 2011-02-05 21:28:37 -05:00
Tom Rothamel d489199e00 Screen tweaks, doc fixes. 2011-02-05 21:06:39 -05:00
Tom Rothamel bf023dc2e3 Only select FileSave if confirm=True. 2011-02-05 20:17:00 -05:00
Tom Rothamel ac6b04b5e3 Add FilePageName. 2011-02-05 16:53:14 -05:00
Tom Rothamel a34de5d601 Predict main_menu while in splashscreen.
Better logging on image cache misses.

Minor bug/doc fixes.
2011-02-05 13:58:15 -05:00
Tom Rothamel b9900776a8 Fix choice example 2011-02-03 23:53:57 -05:00
Tom Rothamel 12a444c11f Bump version. 2011-02-03 22:14:29 -05:00
Tom Rothamel 433473e53e No predict when a movie is playing; image cache debugging; gl debugging. 2011-02-03 21:39:57 -05:00
Tom Rothamel d5f889767a Multiple changes.
* Change how chosen choices are reported to screens.
* Don't use raw pygame to report an error.
* Check in the documentation includes.
2011-02-03 00:20:03 -05:00
Tom Rothamel 9873dd487c Don't go fullscreen on Android. 2011-02-02 00:30:44 -05:00
Tom Rothamel ec8bed61f1 Add xminimum property. Rewrite compute_subrect as compute_subline, which
winds up with clearer code.
2011-02-02 00:24:48 -05:00
Tom Rothamel d76971385d Fix typos. (Thanks backansi.) 2011-01-30 21:50:36 -05:00
Tom Rothamel b87fed5541 Remove unnecessary change. 2011-01-30 20:46:41 -05:00
Tom Rothamel bd8d3dbc38 Use the 6.11.2 (hacky) frame code when using the software renderer, to
prevent visual artifacts.
2011-01-30 20:38:14 -05:00
Tom Rothamel 6022e3fa2b Fixes. 2011-01-30 19:47:49 -05:00
Tom Rothamel c5c8a6e20e Allow unicode in ATL. 2011-01-30 09:19:21 -05:00
Tom Rothamel 3306bc848a Start work on b. 2011-01-30 09:03:36 -05:00
Tom Rothamel 2911ef54e5 Fix UTF-8 code. 2011-01-30 08:35:54 -05:00
Tom Rothamel cc54d1970b Windows & Distribution fixes. 2011-01-29 18:26:49 -05:00
Tom Rothamel e6915fffd3 Ensure that we can load Matrix2Ds. 2011-01-29 12:16:36 -05:00
Tom Rothamel 964d746f6d Move yesno_prompt back to 6.11 location. 2011-01-29 10:44:33 -05:00
Tom Rothamel de6af43d74 Bump copyright year. 2011-01-29 09:27:48 -05:00
Tom Rothamel 0dc1a6e46c Android docs. 2011-01-29 00:23:53 -05:00
Tom Rothamel 4098830804 Prevent get_screenshot from returning None. 2011-01-28 00:29:48 -05:00
Tom Rothamel 304ab15b8f Doc and tutorial additions/fixes. 2011-01-28 00:26:24 -05:00
Tom Rothamel 16fa9410db Pixel opacity can't be determined in GLES mode - so don't bother trying. 2011-01-28 00:10:38 -05:00
Tom Rothamel 9ff69de20c Kill a possible INVALID_ENUM error. 2011-01-27 21:51:14 -05:00
Tom Rothamel cd50f1ee86 Document snowblossom. 2011-01-27 19:07:19 -05:00
Tom Rothamel 195f3d6130 Documentation; Particle fix; Sprite demo. 2011-01-27 18:36:10 -05:00
Tom Rothamel 89d8622f6f Typo fix in tutorial. Change how we setup modulefinder. 2011-01-27 01:58:18 -05:00
Tom Rothamel d71e054eb4 Changes to import so that we can build packages. 2011-01-27 01:17:27 -05:00
Tom Rothamel 48a648eecd A far more minimial solution. 2011-01-27 00:07:16 -05:00
Tom Rothamel 63268d079e Remove the clipper from the software renderer, as it was causing problems
with transformed scaled images.
2011-01-26 23:24:54 -05:00
Tom Rothamel 743d5ca81a Add starfield effect. 2011-01-26 16:30:44 -05:00
Tom Rothamel dffb33c8e0 Fix the demo. 2011-01-25 21:36:11 -05:00
Tom Rothamel a6ea0931dd Fix Philippines flag orientation.
Never trust mugenjohncel.
2011-01-24 23:33:36 -05:00
Tom Rothamel 17016c0eb2 Fix bugs, tweak memory usage. 2011-01-24 23:33:31 -05:00
Tom Rothamel 67c703d934 Use big textures for RTT. 2011-01-24 22:28:58 -05:00
Tom Rothamel c163d1c936 Add focus_mask to screen language. 2011-01-24 21:12:33 -05:00
Tom Rothamel e3c15a2c58 Automatically size the window on initial load. 2011-01-24 19:28:43 -05:00
Tom Rothamel dfc149f292 Use glrtt fbo to render to textures.
Fix problem w/ rtt format.
2011-01-23 23:57:49 -05:00
Tom Rothamel 627ba65b9a Partially fix distribute, fixes for android. 2011-01-22 21:02:57 -05:00
Tom Rothamel a92170d88a Various fixes required to fix the Ren'Py tutorial. 2011-01-22 13:35:26 -05:00
Tom Rothamel 503653cb5e Fix sound problem. 2011-01-22 10:55:47 -05:00
Tom Rothamel 68c277ff9a Cleanup after merging. 2011-01-21 23:13:22 -05:00
Tom Rothamel 7b171b4f9b Spacing. 2011-01-21 22:42:34 -05:00
Tom Rothamel 30956e4c58 Rewrite the code that writes bytecode.rpyb, so that it uses md5 hashes
so that we don't have to recompile the code every time Ren'Py is
upgraded. (This matters on android.)
2011-01-21 22:36:40 -05:00
Tom Rothamel 6a956aacab Ren'Py now treats filenames as if they were case-insensitive. This
means that filename mismatches on Linux should no longer be a problem.
2011-01-21 00:20:33 -05:00
Tom Rothamel 681c845e2d Fix ordering problem the meant a parent's per_interact could be called
before its children's.

Fix lp:680266.
2011-01-19 23:45:07 -05:00
Tom Rothamel 11594ef5e8 Fix problems with SnowBlossom/Particles. 2011-01-19 00:19:21 -05:00
Tom Rothamel 28f06291db sl: add spacing 2011-01-18 23:04:14 -05:00
Tom Rothamel c6937698ed Fix screen prediction, especially for menus.
Rewrote tutorial to use an imagemap-screen.
2011-01-18 21:01:21 -05:00
Tom Rothamel 15f85c8b80 Merge with mainline. 2011-01-17 23:04:27 -05:00
Tom Rothamel 7fd5695f83 More build tweaks. 2011-01-17 23:03:18 -05:00
Tom Rothamel 952880287b Change how we version the module. 2011-01-17 22:01:44 -05:00
Tom Rothamel f76c7cf25a Lower the double-click to quit time to .75 seconds, to prevent confusion. 2011-01-16 14:03:17 -05:00
Tom Rothamel 7c14b4d381 Fix bug that prevented canvas from working in GL mode. 2011-01-16 13:59:42 -05:00
Tom Rothamel c67389f0a3 Fix dbz in audio code. 2011-01-16 11:13:35 -05:00
Tom Rothamel 219994ced2 Fix problems switching from sw -> gl, in 00gltest. 2011-01-15 23:21:28 -05:00
Tom Rothamel 274f08807e Allow Ren'Py to run on ancient OpenGL implementations. 2011-01-15 21:35:03 -05:00
Tom Rothamel 7601b4d3da Ensure Ren'Py can start even when OpenGL is missing. 2011-01-15 20:13:56 -05:00
Tom Rothamel 05d14b4bfd Fix im.matrix.colorize. 2011-01-15 19:24:24 -05:00
Tom Rothamel c5b63fd1c5 Fix get_screenshot regression. 2011-01-15 19:05:58 -05:00
Tom Rothamel 0bb6a926b2 Add config.screenshot_callback. 2011-01-15 18:54:38 -05:00
Tom Rothamel 0124eacb15 Add hovered and unhovered to Bar.
Remove spritemanager sl statement.
2011-01-15 18:19:04 -05:00
Tom Rothamel 7ac06761d6 Add MouseArea/mousearea. Add spritemanager to screen language. 2011-01-15 16:59:47 -05:00
Tom Rothamel c8c6226045 Add screen prediction to say, menu, and call screen statements, and
to several Actions.
2011-01-15 13:53:58 -05:00
Tom Rothamel 507d9610c7 Implement screen variants. 2011-01-15 00:10:53 -05:00
Tom Rothamel 5f4075fc35 Add NVL screen. 2011-01-14 09:39:07 -05:00
Tom Rothamel 514571cc80 Fix problems with options and shift+R reloading. 2011-01-13 01:09:51 -05:00
Tom Rothamel 6ff34b71cf Round stencil box coordinates more accurately. 2011-01-13 01:06:09 -05:00
Tom Rothamel 37416daa53 Fixes for menu screens. 2011-01-13 00:20:23 -05:00
Tom Rothamel 6bd5401633 Make the tutorial game use screens; improve screen support as necessary. 2011-01-12 23:59:25 -05:00
Tom Rothamel ea6b9571b5 Fixed software rendering / transform for now. This required ensuring that
there is always a 2-pixel band around the border of each image, up from
the previous 1-pixel border.
2011-01-10 02:06:00 -05:00
Tom Rothamel bd7c403986 Rewrite Solid and Frame so that they use the GPU to do scaling. Frame
no longer requires its argument to be an image manipulator.
2011-01-09 22:44:14 -05:00
Tom Rothamel 99417726ce Prediction of screens. 2011-01-09 18:14:52 -05:00
Tom Rothamel 4319e542f7 Add accessor for prefixed style properties.
Add prediction for images used in windows, buttons, and bars.
2011-01-09 00:25:44 -05:00
Tom Rothamel 61d8445949 Rewrote image prediction code. 2011-01-08 23:42:13 -05:00
Tom Rothamel 743095064d Update logging. 2011-01-08 01:41:29 -05:00
Tom Rothamel efa12ab5a6 Add logging infrastructure. 2011-01-08 01:15:39 -05:00
Tom Rothamel b49b1b392c Action prediction code. 2011-01-08 00:16:16 -05:00
Tom Rothamel 09e54e9915 Doc fix. 2011-01-07 23:39:14 -05:00
Tom Rothamel 373d175f2d Make imagemap caching configurable on a per-screen basis. 2011-01-04 01:57:10 -05:00
Tom Rothamel 5f3955a04a Cache imagemap hotspots to disk. 2011-01-04 01:37:33 -05:00
Tom Rothamel 98c0e51527 Document images and image manipulators. 2011-01-01 01:03:43 -05:00
Tom Rothamel 8b3a6e8fc6 Checkin to merge docs from wrong place. 2011-01-01 00:47:13 -05:00
Tom Rothamel b2d2e8ba7e Brillantly documented im.py in the wrong place. Checking in for a merge. 2011-01-01 00:46:29 -05:00
Tom Rothamel f1efced19c merge from trunk 2010-12-29 23:54:46 -05:00
Tom Rothamel 5b09dfc80c merge from trunk 2010-12-29 23:54:22 -05:00
Tom Rothamel 39f91a4368 Doc work 2010-12-29 23:52:37 -05:00
Tom Rothamel 3b6c9bde63 Fix sprites and add documentation. 2010-12-29 00:57:54 -05:00
Tom Rothamel 1df05ea53e fix bug when computing determinant. 2010-12-29 00:34:33 -05:00
Tom Rothamel 3e9aee1c6f Documentation. 2010-12-28 00:09:13 -05:00
Tom Rothamel 5231a460da Document Drag and Drop. 2010-12-26 21:10:31 -05:00
Tom Rothamel e6b3b36df9 Tweak sphinx building to handle methods; add (some) docs to dragdrop. 2010-12-25 10:13:22 -05:00
Tom Rothamel 060d510658 Random tweaks to work better with cardgame. 2010-12-25 02:34:23 -05:00
Tom Rothamel 3b21a4aa97 Redo joining support to be a better design; add clicked, hovered, and
unhovered to drag and drop.
2010-12-24 16:19:26 -05:00
Tom Rothamel 4824b44950 Added joins to achieve reasonably working drag and drop. 2010-12-24 01:25:31 -05:00
Tom Rothamel 988a92d4a5 Drag and drop uses style prefixes. 2010-12-23 11:21:53 -05:00
Tom Rothamel 378e2e61bd Implement drag & drop callbacks. 2010-12-23 01:29:23 -05:00
Tom Rothamel eb94a7d9bb Implement drag groups. 2010-12-23 00:40:25 -05:00
Tom Rothamel fe2ba07a57 Remember drag position. 2010-12-22 01:12:57 -05:00
Tom Rothamel 2788b12eb2 Add drag to SL and UI, restrict positions to the screen. 2010-12-21 00:01:59 -05:00
Tom Rothamel 265b553b4e Initial working drag and drop code. 2010-12-20 22:39:55 -05:00
Tom Rothamel 5f800681aa Make field presentable, preventing a memory leak. 2010-12-16 21:56:50 -05:00
Tom Rothamel 890c9cf591 Delete the correct file on restart. 2010-12-16 11:29:23 -05:00
Tom Rothamel 2c356b80ed Reset clear color to black. 2010-12-15 23:20:00 -05:00
Tom Rothamel cc097ba7da Use glScissor for clipping. 2010-12-15 23:12:08 -05:00
Tom Rothamel 78401f1c4a implement config.linear_saves_page_size 2010-12-14 21:43:48 -05:00
Tom Rothamel 8802363544 implement config.linear_saves_page_size 2010-12-14 21:39:51 -05:00
Tom Rothamel 05388c3733 Setup android keymap. 2010-12-14 11:51:54 -05:00
Tom Rothamel 8f84301b39 Android fixes. 2010-12-12 16:26:05 -05:00
Tom Rothamel 774ba5d990 Merge changes from lp:renpy. 2010-12-05 16:46:21 -05:00
Tom Rothamel 6bf0cd93d1 Merge bug fixes. 2010-12-05 16:43:56 -05:00
Tom Rothamel 7f63c26348 Since OpenGL ES doesn't support ClipPlanes, don't use them. 2010-12-05 13:04:22 -05:00
Tom Rothamel bce3e6ede1 More android fixes. 2010-12-05 00:17:48 -05:00
Tom Rothamel 4f642041f9 Change how reloading a game works.
Other minor android-related fixes.
2010-12-04 00:49:02 -05:00
Tom Rothamel b990b2768c Implement fast dissolve, config.simulate_android. 2010-11-29 22:28:42 -05:00
Tom Rothamel 53b8d37d8c Android fixes. 2010-11-28 16:29:47 -05:00
Tom Rothamel db9f63c2d9 Sound on Android Ren'Py. 2010-11-23 12:00:47 -05:00
Tom Rothamel 87df4ff487 Add power management support. 2010-11-16 23:08:49 -05:00
Tom Rothamel f0fe459460 GLES Video Working. 2010-11-14 23:02:07 -05:00
Tom Rothamel f71a35751a Fix problem with texture signedness. 2010-11-08 19:39:32 -05:00
Tom Rothamel 2458d9cbb3 Starting to display using GLES. 2010-11-07 22:15:15 -05:00
Tom Rothamel 81c6d33005 Limited environment. 2010-11-06 23:54:56 -04:00
Tom Rothamel dba5c20e34 Use RGBA instead of BGRA. 2010-11-05 22:34:38 -04:00
Tom Rothamel c2eddb21e5 Android work. 2010-11-04 00:06:55 -04:00
Tom Rothamel de1d289670 Better fix. 2010-11-01 08:01:12 -04:00
Tom Rothamel 623201fd75 fix crash bugs 2010-10-31 23:18:29 -04:00
Tom Rothamel 2f900b6bc7 Bump minimum GL version to 1.3. Rewrite drawing to use array-based functions that are supported by OpenGL ES. 2010-10-31 23:10:48 -04:00
Tom Rothamel 375af0cccd 6.11.2b 2010-10-26 22:12:50 -04:00
Tom Rothamel 8ae8e887f5 Fix a bug in Frame that can cause an image to be drawn more than once
a border size is 0.
2010-10-24 18:06:36 -04:00
Tom Rothamel 201b6432c4 6.11.2a 2010-10-24 14:59:33 -04:00
Tom Rothamel fc10bbf6b6 Update themes code to support Aleema's new themes. 2010-10-23 14:14:27 -04:00
Tom Rothamel 1c82c71aea Defensively code adding an event to the queue. 2010-10-23 00:13:53 -04:00
Tom Rothamel a59abd3135 Rewrote MoveTransition to deal with changes in order more gracefully. 2010-10-22 01:15:41 -04:00
Tom Rothamel a51633b511 Fixed :lpbug:647324, where ImageDissolves are rendered as if
specified with alpha=True whether or not alpha=True was set.
2010-10-21 23:26:41 -04:00
Tom Rothamel 2b40d265f9 Search for environment.txt in the directory containing the mac .app file. 2010-10-21 22:56:54 -04:00
Tom Rothamel 734b5b02f8 Buttons now only pass key events to their children when they are
focused. This allows a screen language key statement to be used as the
child of a button, and only activate when the button is focused.
2010-10-21 22:34:44 -04:00
Tom Rothamel 4120434e5a Add four themes contributed by Aleema. 2010-10-21 20:15:49 -04:00
Tom Rothamel 6d9c4dc6d9 Preserve statement names over more changes. 2010-10-21 19:47:21 -04:00
Tom Rothamel ce94a1360a Fixed a problem that prevented AnimatedValue from functioning properly
when delay was not 1.0. Thanks to Scout for the fix.
2010-10-20 01:09:56 -04:00
Tom Rothamel 27a61f4faf Proofreading by Doomfest. 2010-10-20 00:57:07 -04:00
Tom Rothamel 36f50a482b Deallocate movie surface when a movie is not playing, to prevent the last frame of the previous movie. 2010-10-20 00:47:10 -04:00
Tom Rothamel 28d681b29b Change movie drawing so that we use swscale to convert to RGB, rather
than the SDL stuff. The SDL was broken when video resize was used.
2010-10-20 00:38:32 -04:00
Tom Rothamel ddb53bfce1 Fixed :lpbug:661983, which caused insensitive hotspots to default to
the idle, rather than ground, image when no insensitive image was
supplied.
2010-10-17 02:02:33 -04:00
Tom Rothamel 81414254f9 The maximum default physical size of the Ren'Py window is now 102
pixels smaller than the height of the screen.
2010-10-16 23:33:14 -04:00
Tom Rothamel 4af4481a17 Fixed launchpad bug 647686, a regression that prevented sounds from looping properly.
Added lpbug documentation reference.
2010-10-16 19:06:28 -04:00
Tom Rothamel 1e6e0f0800 Fix spritemanager when st=0, add destroy_all method. 2010-10-11 18:20:48 -04:00
Tom Rothamel f1cff045e1 Better handle the overloading of Return(). 2010-10-09 18:13:11 -04:00
Tom Rothamel b3b3c55473 Factor environments and RTTs out into their own files, so we don't have
to compile them for Android.
2010-10-09 13:50:34 -04:00
Tom Rothamel 7f2c6fd977 Fix software rendering. 2010-10-09 13:22:10 -04:00
Tom Rothamel 59338d3ae3 Eliminate the use of the tegl and pysdlgl modules. 2010-10-09 12:41:55 -04:00
Tom Rothamel 98a5647f97 Convert glenviron and glshader to use GL directly. 2010-10-09 11:26:41 -04:00
Tom Rothamel 5d11642776 Convert gldraw and gltexture to use GL directly. 2010-10-09 10:52:11 -04:00
Tom Rothamel 297277451f Use the TEGL infrastructure to auto-generate gl.pxd. (The result is
checked in for convenience's sake.)
2010-10-09 02:37:12 -04:00
Tom Rothamel d5ec269811 Rewrite Particles in terms of SpriteManager. 2010-10-09 00:25:58 -04:00
Tom Rothamel 02bbe29ccb Finished sprite manager.
Expose python objects in store.
2010-10-08 18:48:39 -04:00
Tom Rothamel 3844ace955 New SpriteManager. 2010-10-08 01:04:20 -04:00
Tom Rothamel 3715a03598 Checkpoint. 2010-10-06 00:25:07 -04:00
Tom Rothamel 82c695a199 make buildable 2010-10-05 23:09:11 -04:00
Tom Rothamel 09ff58a1a6 Add a gc-based to checking for memory leakes in Renders. 2010-10-05 22:58:53 -04:00
Tom Rothamel 0fbe522235 More speedup of transform_render. 2010-10-03 23:57:21 -04:00
Tom Rothamel cc38b5e5c3 Add missing files. 2010-10-03 23:09:32 -04:00
Tom Rothamel c6101f5565 More improvements. 2010-10-03 23:09:18 -04:00
Tom Rothamel f4e50ae4d8 Add config.imagereference_respects_position. When set to False, ImageReference
ignores positions in its styles - much faster.
2010-10-03 18:21:37 -04:00
Tom Rothamel 3f42edbb08 Add some types to draw_render_textures. 2010-10-03 18:04:18 -04:00
Tom Rothamel c63ff665b2 Checkpointing work. 2010-10-03 17:06:23 -04:00
Tom Rothamel 230ef6d4ca Add pxds. 2010-10-02 20:52:43 -04:00
Tom Rothamel 9d1783f4d6 Checkpoint progress. 2010-10-02 20:52:23 -04:00
Tom Rothamel 99d14d9521 Improve the speed of the render function. 2010-10-02 15:30:24 -04:00
Tom Rothamel 57ed7e692e Annotate render fields, implement mark-sweep render gc. 2010-10-02 14:40:43 -04:00
Tom Rothamel 6aaf974049 Make sure everything can build with the latest cython, and remove
cython-generated code from the tree.
2010-09-27 23:03:17 -04:00
Tom Rothamel 1fce0f5557 Add infrastructure for automatically building and loading cython
Ren'Py modules, when they change.
2010-09-27 22:38:12 -04:00
Tom Rothamel f75f0ccb14 Allow the default property to be set in the screen language. 2010-09-16 08:31:39 -04:00
Tom Rothamel 01f82aaf4c Bump version. 2010-09-15 23:37:44 -04:00
Tom Rothamel 8b294e05ad Fix problem where if you hit quit, no at the main menu, the game starts. 2010-09-15 23:34:14 -04:00
Tom Rothamel 5b2fcb85e5 Fixed character not respecting the interact argument. 2010-09-15 22:34:29 -04:00
Tom Rothamel fb1d38dc3a Enter the with mode on with None. 2010-09-14 23:18:08 -04:00
Tom Rothamel 5cc6a8d75a Ensure that empty strings render with 0 width. 2010-09-13 23:22:58 -04:00
Tom Rothamel fbe2a03933 Normalize file line endings during updates. 2010-09-13 21:04:48 -04:00
Tom Rothamel 915bccf099 Fixed problem with modes (reported with patch by Spiky Catapillar.) 2010-09-12 23:52:08 -04:00
Tom Rothamel 0943e368e7 Fix mode to work with nvl and extend. 2010-09-12 23:48:39 -04:00
Tom Rothamel d35c6e190c Fix docs. 2010-09-09 11:37:34 -04:00
Tom Rothamel 1025ad5a6a Reduce size of updates. 2010-09-09 11:23:42 -04:00
Tom Rothamel fd74541318 Check that sayer is valid. 2010-09-09 11:23:24 -04:00
Tom Rothamel 821db477ae Update default enter/leave factories to work with offsets. 2010-09-09 10:06:40 -04:00
Tom Rothamel ed66034930 Fix bug that caused atl revolution not to work. 2010-09-09 09:58:30 -04:00
Tom Rothamel a9c91378fd Another version bump. 2010-09-08 22:17:48 -04:00
Tom Rothamel 1dc58f2ed1 Add AlphaDissolve to the tutorial. 2010-09-08 09:36:56 -04:00
Tom Rothamel ae916e2a59 More updater work. 2010-09-07 22:17:31 -04:00
Tom Rothamel f3af72e67e Properly notify on update events. 2010-09-07 21:52:45 -04:00
Tom Rothamel 939c2121b7 Fixes to updater. 2010-09-07 21:41:02 -04:00
Tom Rothamel 46699bfc1e Update copyright, and bump versions. 2010-09-07 21:19:54 -04:00
Tom Rothamel 63d381d5a6 FieldValues with max_is_zero set to True now work properly. Thanks to
SleepKirby for the fix.
2010-09-07 08:13:30 -04:00
Tom Rothamel c608d18684 Update distribution building to reflect new Windows layout. 2010-09-07 00:05:11 -04:00
Tom Rothamel c31f61e7b6 Integrate updater support w/ launcher. 2010-09-06 23:45:41 -04:00
Tom Rothamel 9912c15c04 Don't consider hidden screens when assigning default focus. 2010-09-06 14:19:07 -04:00
Tom Rothamel 651653593c Make MoveTransition respect offsets. 2010-09-06 12:52:29 -04:00
Tom Rothamel 85858974b8 Add urllib to dependencies. 2010-09-05 23:48:52 -04:00
Tom Rothamel a265fbb797 Fix problem with screen language lines numbers being in error. 2010-09-05 23:26:24 -04:00
Tom Rothamel e353ea2d56 Don't crash when compiling shaders. 2010-09-05 22:54:00 -04:00
Tom Rothamel 6f91db067a Fix a bug with hotbars not working.
Fix a bug caused by an incorrect texture unit check.
2010-09-05 18:32:49 -04:00
Tom Rothamel 8ed51cc810 Add renpy.notify and Notify. 2010-09-04 17:25:59 -04:00
Tom Rothamel f256f174f9 The new :func:HideInterface action allows the interface to
temporarily be hidden, as a screen language action.
2010-09-04 15:59:30 -04:00
Tom Rothamel 49d3796378 Added the :ref:renpy.focus_coordinates function, which returns the
coordinates of the currently focused displayable, when possible.
2010-09-04 15:46:30 -04:00
Tom Rothamel bfb6a18527 The new :ref:modes system allows one to invoke callbacks when
switching from one type of interaction to another. This can be used,
for example, to automatically hide the window before transitions.
2010-09-04 12:30:21 -04:00
Tom Rothamel 2960220a74 Improvements to updater. 2010-09-03 22:52:10 -04:00
Tom Rothamel c6605f1742 Add experimental update code. 2010-09-03 18:17:48 -04:00
Tom Rothamel cebffcfee1 Imagemaps created using the screen language now only have a size equal
to that of their ground image. (Previously, they took up the entire
screen.) This change makes it easier to position an imagemap at a
different location on screen, such as the bottom.

Imagemaps now take an alpha argument. If true (the default), hotspots
are only focused if the mouse is over a non-transparent part of the
idle or hover image. If set to false, the hotspot is focused whenever
the mouse is within its boundaries.
2010-09-03 17:42:46 -04:00
Tom Rothamel 006cdb8c3b The developer menu now includes a command that will list all the files
in the game directory.
2010-09-02 01:08:18 -04:00
Tom Rothamel 374e0697bf Fix documentation generation from curried functions. 2010-09-02 00:48:57 -04:00
Tom Rothamel f988878424 Transforms no longer cause a divide by zero exception when the zoom,
xzoom, or yzoom properties are 0.
2010-09-02 00:02:46 -04:00
Tom Rothamel e59b252dce Fix problems with scaling (and especially, switching back and forth
between GL and scaled SW modes.)
2010-08-31 16:36:00 -04:00
Tom Rothamel b2747914d8 Fix hotspot so that it properly handles insensitive and selected images. 2010-08-28 18:47:15 -04:00
Tom Rothamel 41aeb625f3 Try to fix backwards compatibility problem. 2010-08-24 21:55:20 -04:00
Tom Rothamel 4cfa8aa06c Document AlphaDissolve. 2010-08-24 21:51:42 -04:00
Tom Rothamel 8cb4a4e3b9 Merge alphadissolve. 2010-08-24 21:46:58 -04:00
Tom Rothamel 9a84c9715f Use 256 as the parameter - allows alphablend to use the full 8 bits of alpha
range.
2010-08-24 21:17:52 -04:00
Tom Rothamel 38538f1d9a Add AlphaBlend. 2010-08-24 02:33:29 -04:00
Tom Rothamel 6a42b2a107 Initial implementation of AlphaDissolve transition. 2010-08-24 02:20:38 -04:00
Tom Rothamel 486790b810 merge w/ renpy 2010-08-22 16:11:15 -04:00
Tom Rothamel 0e538e2261 Remove obsolete files.
Remove symlinks in documentation.
2010-08-22 16:08:03 -04:00
Tom Rothamel 9042fcca55 Redo the windows build process, so that no symlinks are involved, and so
that dlls are no longer bundled inside renpy.code.
2010-08-22 15:53:55 -04:00
Tom Rothamel 040035adbc Allow keymap to take a list of actions. 2010-08-21 11:58:32 -04:00
Tom Rothamel d72097de18 add comment 2010-08-19 13:23:27 -04:00
Tom Rothamel d9771bdade Draw mouse cursor in right place. 2010-08-19 13:01:20 -04:00
Tom Rothamel 07ca905373 Fix the parameters for define_screen. 2010-08-19 08:48:58 -04:00
Tom Rothamel ccd0d45a67 A sub-render should inherit alpha from the parent render. 2010-08-18 19:54:59 -04:00
Tom Rothamel 15a15870e7 Start of new updater code. 2010-08-18 18:11:09 -04:00
Tom Rothamel 28108c7796 Remove launcher1. 2010-08-18 12:30:05 -04:00
Tom Rothamel 171f388120 6.11.0k 2010-08-17 21:19:01 -04:00
Tom Rothamel bc50f171db Add transition parameters to Show and Hide. 2010-08-17 01:08:10 -04:00
Tom Rothamel ea4c955f1f Modal and zorder are now expressions. Note that this changes the signature to define_screen. 2010-08-16 02:22:54 -04:00
Tom Rothamel 27524457d0 Copy a screen when keeping it around after a hide, rather than modifying the original screen. 2010-08-16 01:53:51 -04:00
Tom Rothamel 01fe67cfa9 Fix problems with screens caused by renpy.transition being given None as an argument, by making it handle that case properly, rather than simply delegating to with_none. 2010-08-15 21:46:21 -04:00
Tom Rothamel f4d493465d Fix problem with iterating over a list that's changing. 2010-08-15 19:15:32 -04:00
Tom Rothamel 33cbe44390 Only call _hide on direct children of the screen. 2010-08-15 02:53:41 -04:00
Tom Rothamel 5214f08d1a Assign ids to displayables correctly.
Remove non-transitions from screens at hide-time.x
2010-08-15 01:50:46 -04:00
Tom Rothamel 608fc986c4 Now can hide screens by name and tag. 2010-08-15 00:39:01 -04:00
Tom Rothamel 779a96f97f Things in a screen without an on hide method go away once hidden. 2010-08-15 00:32:53 -04:00
Tom Rothamel faf48246d7 Don't let a hiding displayable pass along focus. 2010-08-14 20:10:10 -04:00
Tom Rothamel 81ec2a6c35 fix modal when hiding. 2010-08-14 19:12:56 -04:00
Tom Rothamel 803423f12b Was over-aggressive in combining screen and old_transfers - split them. 2010-08-14 17:17:11 -04:00
Tom Rothamel b384ee0381 Make the gl-test strings translatable. Bump version. 2010-08-14 13:29:41 -04:00
Tom Rothamel b8862d6b24 Add support for a "Graphics Acceleration" menu, which allows the user
to choose between software and opengl rendering.
2010-08-13 00:50:48 -04:00
Tom Rothamel dbfa4ed46d Fix problem where displayables on a screen of one name could inherit transforms and state from displayables on a screen of a different name. 2010-08-13 00:38:43 -04:00
Tom Rothamel d9eb999775 Report when a grid is overfull. 2010-08-11 16:30:43 -04:00
Tom Rothamel b4a9ca3f87 Tweaks to gltest.
FilePageNext grows a max argument.

Report screen errors better.
2010-08-11 16:25:31 -04:00
Tom Rothamel d087c86d1a Set correct variable when setting default afm time. 2010-08-10 22:08:14 -04:00
Tom Rothamel 0cfc7b25a6 Remove imagemap rectangle from the image picker. 2010-08-10 00:35:50 -04:00
Tom Rothamel 8f3c9bd2ba Cycle through OpenGL logfile. 2010-08-09 23:19:55 -04:00
Tom Rothamel 91c79cdac9 sl: add default statement. 2010-08-09 21:42:49 -04:00
Tom Rothamel 20e4e110ce Add a check for calling ui.interact inside itself. 2010-08-09 18:57:12 -04:00
Tom Rothamel 870d7ffe2c Try the opengl test twice. 2010-08-09 16:29:10 -04:00
Tom Rothamel 6ff88c914d Fix use of modal in docs. 2010-08-08 22:46:59 -04:00
Tom Rothamel 2a2078517f Only don't transition when failing to go to the game menu from the main
menu.
2010-08-08 22:33:27 -04:00
Tom Rothamel c09f697293 6.11.0i 2010-08-08 20:20:20 -04:00
Tom Rothamel a9e273a13d Document modal more precisely. 2010-08-07 14:53:50 -04:00
Tom Rothamel 592665aa9a Various fixes to cause modal displayables to work better. 2010-08-07 14:43:13 -04:00
Tom Rothamel 3745788f06 Store the OpenGL-giveup value on startup, and use it on a restart. 2010-08-07 10:59:18 -04:00
Tom Rothamel 52b09d8f4c Fix problems with y aspect ratio. 2010-08-07 10:47:22 -04:00
Tom Rothamel 32f25cdcec Fix problem with lint_play_sound. 2010-08-07 09:06:41 -04:00
Tom Rothamel 6f022a9b6a 6.11.0h 2010-08-07 08:52:31 -04:00
Tom Rothamel eea6970929 (doc) Clarify that the hide event isn't called on scene or context exit. 2010-08-07 07:59:41 -04:00
Tom Rothamel 35ecfd279f Tweak when we run the hide event. 2010-08-07 07:52:49 -04:00
Tom Rothamel 1f5c610843 Better logic before picking between adv and nvl windows. 2010-08-07 00:30:52 -04:00
Tom Rothamel 05f4c52c33 Always render to an alpha texture, for dissolve/imagedissolve in sw mode. 2010-08-06 12:27:54 -04:00
Tom Rothamel 326f773e75 Constrain drawing area using glViewport. 2010-08-06 02:08:03 -04:00
Tom Rothamel 2079b518a2 F11 now toggles fullscreen. 2010-08-04 01:15:20 -04:00
Tom Rothamel 70ed15e5ac Add If function. 2010-08-04 00:59:09 -04:00
Tom Rothamel f1d7fe0c73 Rename group -> style_group. 2010-08-03 22:59:53 -04:00
Tom Rothamel 08e4b9bafc Minor optimizations in GL code. 2010-08-03 22:22:01 -04:00
Tom Rothamel 56a0212316 Fix problem with mouse, when going fullscreen. 2010-08-03 22:17:09 -04:00
Tom Rothamel 5df6506191 Take file_prefix and file_suffix into account for lint. 2010-08-02 23:36:10 -04:00
Tom Rothamel 39779be980 Fix problems with lint and call. Humanize lint output. 2010-08-02 18:22:13 -04:00
Tom Rothamel bdacdddf14 Fix crash with shift+Y and generated styles. 2010-08-02 17:59:40 -04:00
Tom Rothamel 4b32337ef3 Command the mouse to be displayed once a second. 2010-08-02 17:58:01 -04:00
Tom Rothamel 4897d5b7a9 Ensure Ren'Py starts when the GL modules can't be loaded. 2010-08-02 12:29:58 -04:00
Tom Rothamel 6daa64facd Store and restore the windows size on a shift+R reload. 2010-08-02 12:19:31 -04:00
Tom Rothamel 07651e414d Ensure we always check for yesno_prompt. 2010-08-01 21:33:29 -04:00
Tom Rothamel 7e1e76f0d8 When loading textures, load the borders with adjacent pixels, rather than
transparency. This means we no longer have to distort textures when
upscaling, which improves quality.
2010-08-01 13:47:05 -04:00
Tom Rothamel b91a5d1a16 Check in keywords file. 2010-07-31 23:19:39 -04:00
Tom Rothamel 39b0646f24 Change around some things involving clip planes to try to fix a
problem with them on the mac.

6.11.0g
2010-07-31 21:08:58 -04:00
Tom Rothamel ea6406f144 When upscaling, adjust texture coordinates so that we never go outside
the loaded texture.
2010-07-31 13:30:23 -04:00
Tom Rothamel 7ed3f3fbad Add the quickstart to the manual. 2010-07-30 13:16:50 -04:00
Tom Rothamel cacb4ac40e Allow {fast} to work in menus and all-at-once mode. 2010-07-28 23:27:52 -04:00
Tom Rothamel 9503744631 Unbranding error messages. 2010-07-28 22:45:00 -04:00
Tom Rothamel 58dfd5dbfa Document focus, and use it to ensure that menus do not have any choice highlighted by default. 2010-07-28 22:40:48 -04:00
Tom Rothamel 60d5507184 Only call unhovered when a non-default unhover occurs. 2010-07-28 22:34:39 -04:00
Tom Rothamel 5641cec146 Give a proper error when someone tries to use an empty string as a displayable. 2010-07-28 22:32:51 -04:00
Tom Rothamel dd455e3d14 Fix problems with window hide / window show and NVL-mode. 2010-07-28 21:55:16 -04:00
Tom Rothamel 6876697f74 Fixed proble with default focus and subsurface. 2010-07-25 23:15:40 -04:00
Tom Rothamel 4373cab8cf 6.11.0f 2010-07-25 20:10:01 -04:00
Tom Rothamel eeccb5833b Doc fixes, remove AutoForward as an independent action. 2010-07-25 20:07:22 -04:00
Tom Rothamel 790dad0330 Fix / document screens. 2010-07-25 19:58:48 -04:00
Tom Rothamel 078a38af5d Pass transform events through to children of Transforms. 2010-07-25 13:55:44 -04:00
Tom Rothamel 8c186d2eb1 Remove extraneous print. 2010-07-25 13:40:04 -04:00
Tom Rothamel 81b94b27e0 Display problems documentation.
Limit display to screen size.
2010-07-25 01:15:20 -04:00
Tom Rothamel 17e8616e8c Do not buffer playback of movies.
Change get_playing to return audio that's queued up to play, as well as audio that's currently playing.
2010-07-24 16:44:39 -04:00
Tom Rothamel 50b0dc3c5e Add the ability to blacklist mugen's video card. 2010-07-24 13:24:49 -04:00
Tom Rothamel 9e217e722f Introduce StoreProxy object. 2010-07-24 11:41:22 -04:00
Tom Rothamel f466b44b66 Fix problem with negative line_spacing. 2010-07-23 02:32:31 -04:00
Tom Rothamel 34e0fc7cba Always take screenshots from the main thread. 2010-07-23 01:53:39 -04:00
Tom Rothamel bb88a7bb95 Remove letterboxing when taking a screenshot. 2010-07-23 01:14:06 -04:00
Tom Rothamel 71ba444e62 6.11.0e. 2010-07-18 10:39:09 -04:00
Tom Rothamel 3e0baee463 Update documentation. 2010-07-17 22:44:53 -04:00
Tom Rothamel a0064f5511 Disable OpenGL in launcher. 2010-07-17 22:37:01 -04:00
Tom Rothamel e7ce23f377 Fix potential video race. 2010-07-17 22:35:11 -04:00
Tom Rothamel 9c6d93968c Stop defining default in terms of other transforms, to allow those
transforms to be re-defined.
2010-07-17 22:00:21 -04:00
Tom Rothamel e4b29d58f4 Include indentation in text size. 2010-07-17 17:38:44 -04:00
Tom Rothamel a48b87a0d6 Fixed a bug that could cause ATL transforms to over-compute changes,
this leading to problems when used in parallel
2010-07-17 16:17:26 -04:00
Tom Rothamel 763515a937 Add GL Performance test. 2010-07-17 14:02:00 -04:00
Tom Rothamel 46a8242e51 Make sure that lexer revert also reverts the line. 2010-07-17 12:59:18 -04:00
Tom Rothamel efa8d66d3d Make placement of developer menu more friendly. 2010-07-15 23:28:37 -04:00
Tom Rothamel b7c71bb3b8 Work better with broken fonts. 2010-07-15 22:36:05 -04:00
Tom Rothamel aca5438b5a Use shift to disable OpenGL. Add deinit to swdraw. 2010-07-15 17:15:54 -04:00
Tom Rothamel e7eb23ab5e Create layout.yesno_screen function.
Doc update.

Bump to 6.11.0d.
2010-07-14 21:47:46 -04:00
Tom Rothamel 05dd8bfcc7 Use "screen" as the screen type and mouse for screens. 2010-07-14 20:39:30 -04:00
Tom Rothamel 2c299ab079 Share code between fullscreen and displayable versions of video playback. 2010-07-14 19:00:33 -04:00
Tom Rothamel 62acff5c75 CTRL on startup aborts OpenGL mode. 2010-07-14 01:22:40 -04:00
Tom Rothamel 316d146893 Make imagedissolve use the correct texture units. 2010-07-13 22:28:41 -04:00
Tom Rothamel e69fee2108 Auto-vivification of styles.
New styles.
2010-07-13 01:09:14 -04:00
Tom Rothamel 8fe6e1cf20 Add group argument to ui functions. 2010-07-13 00:27:48 -04:00
Tom Rothamel 6fcf7dbbba Blacklist Mesa Indirect GLX renderer. 2010-07-12 21:13:32 -04:00
Tom Rothamel f55c5f0ce5 Make screen language automatically prefix unicode-containing strings with u"" - like we do for other strings. 2010-07-12 20:42:32 -04:00
Tom Rothamel aaf8369421 Deallocate textures on shutdown. 2010-07-12 20:40:41 -04:00
Tom Rothamel 8e26c7730c Finish has rename.
Fix bugs with screens.
2010-07-11 22:46:19 -04:00
Tom Rothamel 556ca0611a Add has statement. 2010-07-11 17:25:46 -04:00
Tom Rothamel e2e78c175b Tweak the parser so that it recognizes \$ as a word unto itself. 2010-07-11 15:14:44 -04:00
Tom Rothamel 7b8033e6b2 A reference loop was preventing the weakref-based way of dealing with
PyCode from working. So instead, manually control when PyCodes are
recorded.
2010-07-11 13:04:44 -04:00
Tom Rothamel d602645fee Use button_text rather than default as the default button text style. 2010-07-11 11:57:06 -04:00
Tom Rothamel f8ac9c9e83 Bump version to 6.11.0c. 2010-07-10 16:06:22 -04:00
Tom Rothamel 98c90f8ab3 Shutdown trace.
Restrict minimum window size to 256x256.

Ensure window caption and icon are set when reiniting pygame.
2010-07-10 16:03:54 -04:00
Tom Rothamel 16bb21ee62 Always have an auto-forward length of 1. 2010-07-10 13:44:00 -04:00
Tom Rothamel 46bfec93d4 Set the window caption and icon whenenver we reinit the display. 2010-07-10 13:42:38 -04:00
Tom Rothamel 00e1ecf37d Fix DBZ protection. 2010-07-10 11:45:41 -04:00
Tom Rothamel a3e7b290fb Make references to PyCode weak, so that they are not compiled if they
do not live into the final game script.
2010-07-09 01:35:40 -04:00
Tom Rothamel 27ce59963f Document ui.detached, and make it work in an init block. 2010-07-09 01:02:10 -04:00
Tom Rothamel 54e3a97447 Play test sounds on the "sound" channel. 2010-07-09 00:36:41 -04:00
Tom Rothamel f886f710b7 Make video transient.
Fix most problems with ui.textbutton.
2010-07-09 00:06:30 -04:00
Tom Rothamel a895e1dc6c Always use copy RTT.
Deinitialize pygame on shutdown, and log that deinit, so we can notice where a crash there occurs.
2010-07-08 23:22:27 -04:00
Tom Rothamel 6f24d8eebd 6.11.0b 2010-07-07 19:40:03 -04:00
Tom Rothamel 000174c2c4 Implement renpy.get_renderer_info.
Change RENPY_DRAW -> RENPY_RENDERER.
2010-07-07 14:19:53 -04:00
Tom Rothamel 192aaea186 Make a click while AFM is enabled disable AFM. 2010-07-07 14:01:20 -04:00
Tom Rothamel eb0d6b696e Adds label and ui.label. 2010-07-07 02:42:40 -04:00
Tom Rothamel 94e1b0eb56 Update gl-screen when soft mouse moves. 2010-07-07 02:05:48 -04:00
Tom Rothamel 694a1cd6d5 Ensure we always project the mouse location into virtual coordinates. 2010-07-07 01:26:40 -04:00
Tom Rothamel 0600897a26 Check the number of texture units, and give up on OpenGL if less than 4. 2010-07-06 22:32:14 -04:00
Tom Rothamel e8c52f9417 Disable texture units w/o a texture bound to them. 2010-07-06 22:19:49 -04:00
Tom Rothamel 6d86963b1d Restart the video system when switching from GL to SW rendering. 2010-07-06 21:35:40 -04:00
Tom Rothamel 01e621067a Fix spelling error. 2010-07-06 12:11:03 -04:00
Tom Rothamel cd379ef1a3 Fix aspect ratio problem. 2010-07-06 11:07:20 -04:00
Tom Rothamel 41a4fbfb4d Rewrite icon changing to use the standard PEfile library.
Fix other bugs found through testing.
2010-07-05 22:25:48 -04:00
Tom Rothamel 04db2112c3 Rewrote Character and Text so that text is only parsed once. 2010-07-04 23:40:38 -04:00
Tom Rothamel d20bfb18bc Handle syntax errors in screen language code. 2010-07-04 16:44:20 -04:00
Tom Rothamel d02d83f896 Try to ensure that runtime errors in screen language code are
reported at the right location.
2010-07-04 02:25:31 -04:00
Tom Rothamel 6b45c92a58 Rewrite screenlang.py so that it generates and compiles python code
directly.
2010-07-03 13:58:25 -04:00
Tom Rothamel 871ad8c07f Ensure the screen reflects the end of a pause before the pause finishes.
Actually limit gl framerate.
2010-06-30 01:14:13 -04:00
Tom Rothamel 997290cd28 Work on improving screen speed. 2010-06-30 00:30:20 -04:00
Tom Rothamel fcfab5ada6 spelling fix 2010-06-29 02:23:13 -04:00
Tom Rothamel 005f45bad3 Stop Popen.__del__ from throwing errors on shutdown. 2010-06-28 23:48:46 -04:00
Tom Rothamel ef64872af5 Set the projects directory to None if it no longer exists. 2010-06-27 23:15:58 -04:00
Tom Rothamel 2cd5528df9 Take the condition parameter to Characters into account when scrying to
determine if the statement interacts.
2010-06-27 22:44:45 -04:00
Tom Rothamel 0a73e6f905 Stop sounds and movies on a rollback event. 2010-06-27 22:04:46 -04:00
Tom Rothamel b9f468e3f4 Update the license.
Fix a bar regression.

Ensure that slow_done always triggers, and the ctc indicator is always shown. (Fixes lp:520276)
2010-06-27 21:01:47 -04:00
Tom Rothamel ad5631ffc1 Fix bug 595532 - wrong text in tutorial game. 2010-06-27 18:40:25 -04:00
Tom Rothamel 50767c211a Sphinx style and indexing tweaks. 2010-06-27 18:11:44 -04:00
Tom Rothamel 8223545b72 Add sphinx ATL documentation. 2010-06-27 16:55:28 -04:00
Tom Rothamel 9925fa78e7 More documentation work. 2010-06-27 12:38:48 -04:00
Tom Rothamel 7834365803 Adding various changelogs. 2010-06-27 11:16:45 -04:00
Tom Rothamel 5bfeea6e30 Finish style documentation (for now at least). 2010-06-27 10:28:09 -04:00
Tom Rothamel 1877fcfe65 Link style lists from screens. 2010-06-27 02:23:36 -04:00
Tom Rothamel 98437bc207 Adding styles documentation. 2010-06-27 02:04:56 -04:00
Tom Rothamel 49e9560e91 Rename docs a bit more.
Add dlls to distribute.py files.
2010-06-25 01:56:09 -04:00
Tom Rothamel 9c5084ef14 Move doc directory.
Add automatic keyword generation support to examples.rpy.
2010-06-25 00:32:50 -04:00
Tom Rothamel 401c503c91 Mark the newest save file as selected.
Fix a problem with buttons showing up as insensitive during a transition.
2010-06-24 23:31:36 -04:00
Tom Rothamel 73d4515f9e Fix SaveMenu. 2010-06-24 22:09:13 -04:00
Tom Rothamel 9faadbd077 Fix tutorial game ATL.
Add renpy.list_files.
2010-06-24 21:05:32 -04:00
Tom Rothamel c886f16308 Change tutorial to deal with new Transform semantics.
Change DynamicDisplayable to be sure we can always get_position.
2010-06-24 11:01:10 -04:00
Tom Rothamel 6b4b410708 Ensure that we don't fail to set a transform's pos and anchor because
we're setting it to the old default value.
2010-06-24 08:46:51 -04:00
Tom Rothamel d6e50d840f pos and anchor are now considered part of the execution state of a
transform.
2010-06-24 01:26:59 -04:00
Tom Rothamel c1848159a9 The new LiveTile displayable tiles its child, without consuming a
large amount of memory to do so.
2010-06-23 23:49:36 -04:00
Tom Rothamel 46f503ec3c Wait until the adjustment is done being created before setting the
focusable property on a bar.
2010-06-23 22:05:05 -04:00
Tom Rothamel 71f40a33f7 Add the language basics document. 2010-06-23 21:05:33 -04:00
Tom Rothamel 94e789efde More windows distribution fixes. 2010-06-23 19:02:36 -04:00
Tom Rothamel d738da4272 Update build_exe and pefile to support python 2.6. 2010-06-23 18:52:38 -04:00
Tom Rothamel 8bbf9cb618 Update modules to build on Windows.
Read the surface masks out of a surface.
2010-06-23 15:49:35 -04:00
Tom Rothamel c5276e5073 Use a screen for the tutorial game tutorials menu.
Document viewport, add XScrollValue and YScrollValue.
2010-06-21 20:34:13 -04:00
Tom Rothamel 9b0a739872 Make bar actually respect a supplied style. 2010-06-20 22:55:54 -04:00
Tom Rothamel b3e817e1d4 Make subsurfaces depend on a surface. Fixes render leak bug. 2010-06-20 21:19:25 -04:00
Tom Rothamel 96a73712eb Try fixing a bug with masks on Linux. 2010-06-20 20:51:35 -04:00
Tom Rothamel dc91721ca2 Add config to doc. 2010-06-20 20:47:10 -04:00
Tom Rothamel 7175bb664c Tweak doc look. 2010-06-20 01:00:28 -04:00
Tom Rothamel 2a49120ac2 Add special screens. 2010-06-18 00:49:57 -04:00
Tom Rothamel 4ef546649b Document python mode. 2010-06-17 22:44:28 -04:00
Tom Rothamel f1a77bd2b0 Fix bug with old load/saves and invalid files.
Fix bug with screens and rollback.
2010-06-17 14:13:05 -04:00
Tom Rothamel aa8b6d364b Moved button and bar specialness into the displayables, rather than
the ui functions.

Changed the _replaces method to be a replaces constructor parameter.

Make the periodic method take st.

Add a periodic method to BarValue.

Implement AnimatedValue.
2010-06-17 12:56:04 -04:00
Tom Rothamel 1245c6120e Wrote a lot of screen documentation. 2010-06-15 23:32:03 -04:00
Tom Rothamel 2995118cae Re-implement subsurface clipping, to improve performance in some cases.
Make call scene (and renpy.call_scene) participate in rollback, roll
forward, and set _return as appropriate.
2010-06-15 13:40:37 -04:00
Tom Rothamel a201418d1a Implement is_pixel_opaque. 2010-06-15 11:54:36 -04:00
Tom Rothamel 1b46904897 Modify yesno_prompt so it uses actions, rather than interacting.
Add FileTakeScreenshot.
2010-06-15 00:42:10 -04:00
Tom Rothamel 1cf6764a08 Allow an input screen. 2010-06-15 00:09:47 -04:00
Tom Rothamel 6527b4e198 Implement screens for NVL-mode. 2010-06-14 23:48:45 -04:00
Tom Rothamel fd4d01374f Implement the show screen, hide screen, and call screen user-statements. 2010-06-14 11:08:31 -04:00
Tom Rothamel c77a11382d Rewrite parsing in terms of a trie, for flexibility and speed reasons. 2010-06-14 09:47:37 -04:00
Tom Rothamel 1239153a1c The distribution code has been moved into launcher/distribute.py. This
file can be run from the command line to build distributions in shell
scripts and other automated processes.

Plug games.renpy.org when building distributions.

Change xoffset and yoffset in transforms so that they stack with that
of the child.
2010-06-13 22:46:28 -04:00
Tom Rothamel ae7152a5fc The renpy.music.register_channel method now has two additional
parameters, file_prefix and file_suffix. These are prepended and
appended to filenames provided to the registered channel,
respectively.
2010-06-13 21:24:02 -04:00
Tom Rothamel eec4eb73b5 Added the rotate_pad transform property, which controls how Transform
pads rotated displayables. When set to False, _not_ the default, it's
now possible to rotate a (100, 50) displayable by 90 degrees, and have
the result be (50, 100) in size.
2010-06-13 19:51:02 -04:00
Tom Rothamel 0ab3521005 The screen language (and ui) now allows you to write action rather
than clicked.
2010-06-13 17:44:13 -04:00
Tom Rothamel 660ef587c9 Add mute preferences, and SetDict/ToggleDict to support them.
Add InvertSelected.
2010-06-13 16:47:13 -04:00
Tom Rothamel 541dd7b3c3 Implement _replaced on various displayables (Text, Input, Timer, and Viewport).
Implement _ctc screen.
2010-06-13 15:19:53 -04:00
Tom Rothamel ca53e2f696 Implement the basic framework for _replaces, which is called when
one widget replaces another as part of a screen.
2010-06-13 11:54:10 -04:00
Tom Rothamel 80764e130f Make opengl logging flush the file on each write.
Make opengl fullscreen quit and reinit the video system, so that we
can properly read out the size of the desktop.
2010-06-11 22:46:55 -04:00
Tom Rothamel 6afd0120c1 Add the screenshot action. 2010-06-10 22:21:23 -04:00
Tom Rothamel 953be074f2 The config.screenshot_crop configuration variable controls the area of
the screen that it stored when the user presses the screenshot key.
2010-06-10 22:16:19 -04:00
Tom Rothamel 03781d24d6 Ensure that actions only run when they are sensitive.
Ensure we can have more than one yesno_prompt up at a time.

Add CallInNewContext.

Make the inspector show things on the screens layer.
2010-06-10 22:01:41 -04:00
Tom Rothamel 55d87064a8 config.game_menu_action allows one to specify an action that is run
when entering the game menu.
2010-06-10 20:54:35 -04:00
Tom Rothamel 512478b945 Allow the user to specify an action that is run when someone hits the
quit button. (The one in the upper-right corner of the screen.)
2010-06-10 20:45:18 -04:00
Tom Rothamel 1c19ca8062 Add yes/no prompting. 2010-06-10 09:22:47 -04:00
Tom Rothamel fc764b464d ui.add can now take transform properties as keyword arguments. If at least
one transform property is present, ui.add will create a transform that
wraps the displayable it's adding to the screen.
2010-06-09 08:56:54 -04:00
Tom Rothamel 945b4fc1cd Add python statement (short and long forms) to screen language.
Change include statement to use statement.
2010-06-09 08:32:22 -04:00
Tom Rothamel 902b17462e Implement loading and saving using Actions, and various improvements
to screens, screen language, and ui to make sure we can pull off a
sensible implementation.
2010-06-09 00:27:54 -04:00
Tom Rothamel 8b0b39829a Use renpy.context()._main_menu rather than main_menu; ensure the former is always set. 2010-06-08 01:35:04 -04:00
Tom Rothamel 356ca9cd1e Implement the Play, Queue, and Stop actions, which control music/sound/etc.
Add a periodic method to actions, which is called on a periodic basis
while a button has that action.
2010-06-08 01:04:05 -04:00
Tom Rothamel 634da84442 Implement yesno_prompt for Quit and MainMenu, make ShowMenu-shown
screens transient, and clear out the screens when we enter a new
context.
2010-06-08 00:20:17 -04:00
Tom Rothamel 1d109ddaee Implement the Preference action/value constructor. 2010-06-07 23:37:01 -04:00
Tom Rothamel c1f996da07 Various fixes required to allow a working SL preferences screen. 2010-06-07 02:08:18 -04:00
Tom Rothamel b14c9f8954 Change ShowMenu so that it takes a short screen name, without the
"_screen" suffix.
2010-06-07 00:55:19 -04:00
Tom Rothamel 126050b4f3 Able to display an operational imagemap screen based main menu.
Rewrote screens so they are now use single word names, with an
optional explicit tag parameter.
2010-06-07 00:09:54 -04:00
Tom Rothamel 313e417f28 The choice screen allows in-game menus to be defined using screens. 2010-06-05 23:32:54 -04:00
Tom Rothamel e98ef1025c Implement more Actions and BarValues.
Ensure the say screen still works.
2010-06-05 23:02:46 -04:00
Tom Rothamel 3729e4bc3a sl: Ensure execution errors are reported in a relevant location. 2010-06-05 16:16:13 -04:00
Tom Rothamel ac071777ad Implement BarValue. 2010-06-05 01:15:59 -04:00
Tom Rothamel 445972756d sl: add on statement. 2010-06-04 01:22:32 -04:00
Tom Rothamel 91732e7def sl: Implement the for statement. 2010-06-03 01:25:38 -04:00
Tom Rothamel 5b7e4af26c Add key, timer, and transform statements to ATL. 2010-05-29 23:24:55 -04:00
Tom Rothamel 2bb459cda5 screen: Implement support for transient screens. 2010-05-28 23:03:16 -04:00
Tom Rothamel d410c73074 screen: refactor screens into Screen and ScreenDisplayable classes. 2010-05-28 08:59:08 -04:00
Tom Rothamel da70f197fe screen, sl: add zorder parameter. 2010-05-27 23:03:33 -04:00
Tom Rothamel c18ffb28d0 Pass transform events to the children of a screen. Allow the screen to
respond to a hide event.
2010-05-27 21:56:02 -04:00
Tom Rothamel d5f17ef9f1 Events propagate to all children. 2010-05-25 23:42:54 -04:00
Tom Rothamel 79c3f426e5 sl: Add xmaximum and ymaximum to the list of properties we support. 2010-05-25 23:02:29 -04:00
Tom Rothamel b004dd138f Add code for customizing the say screen. 2010-05-25 22:47:58 -04:00
Tom Rothamel 45b479e324 sl: implement if statement.
screen: trigger a redraw on each interaction.
2010-05-23 22:50:22 -04:00
Tom Rothamel b07cbd4193 sl: add include statement. 2010-05-23 21:58:00 -04:00
Tom Rothamel ae2739f32d Hooked up the screen language to the screen system. 2010-05-23 20:43:37 -04:00
Tom Rothamel dd51fcb1fd Fix ui.at, get things going with visit. 2010-05-22 22:07:58 -04:00
Tom Rothamel edc26fe0a4 First working screens. 2010-05-22 19:16:08 -04:00
Tom Rothamel c9215b3b71 Add renpy.ui.remove_above, for use by screens. (Not sure I'll bother
publically documenting this.)

Improve documentation of Scene Lists.
2010-05-16 01:06:13 -04:00
Tom Rothamel 115338bdeb Basic initial implementation of screens.
Rewrote the scene lists. This added support for "replaced" images, but
more importantly, cleaned up the code quite a bit, by making it be in
terms of objects rather than tuples.
2010-05-15 20:24:28 -04:00
Tom Rothamel b0b10ac7d3 Add all existing ui functions to the screen language parser. 2010-05-11 23:42:51 -04:00
Tom Rothamel 5a6013aac9 Update changelog.
Tweak config.default_transform behavior so that it only applies to
non-transforms, so we better match the old behavior.

fix renpy.ui.Many to work with with.
2010-05-04 01:58:10 -04:00
Tom Rothamel f3aa299aa0 Remove obsolete files from the gl-renpy branch. 2010-05-04 01:30:19 -04:00
Tom Rothamel 8e44536133 Merge in changes from old mainline. 2010-05-04 01:27:59 -04:00
Tom Rothamel 0cb937298e Add checkmark background when the screen is left empty, with no background.
Fix backwards compatibility bugs.
2010-05-04 01:26:01 -04:00
Tom Rothamel 6ed0491520 Add hotbars. 2010-05-02 00:27:58 -04:00
Tom Rothamel af7748920c Add hotspots. 2010-05-01 22:55:51 -04:00
Tom Rothamel 3c1c0310d8 Merge in screen language changes. 2010-04-30 01:29:57 -04:00
Tom Rothamel 91a67304dd Rewrite the ui module in terms of wrapper code. 2010-04-30 01:28:37 -04:00
Tom Rothamel 04d0e46c3e Rewrite how things are added in renpy.ui. 2010-04-29 01:08:10 -04:00
Tom Rothamel ed27eac80b Added support for composite style properties, that allow several style
properties to be set using a single parameter. The new composite style
properties are:

* pos - takes a pair, and uses it to set xpos and ypos.
* anchor - takes a pair, and uses it to set xanchor and yanchor.
* align - takes a pair, and uses it to set xalign and yalign. (And
  hence xpos, ypos, xanchor, and yanchor.)
* area - take (x, y, height, width) pair, and tries to set properties
  such that the displayable will be placed inside the rectangle. This 
  sets the xpos, ypos, xanchor, yanchor, xfill, yfill, xminimum, yminimum,
  xmaximum, and ymaximum properties.
2010-04-28 01:19:45 -04:00
Tom Rothamel 1f3e02bbdc More SL parsing. 2010-04-28 00:31:02 -04:00
Tom Rothamel 275e938602 Snapshot of work on screen system. 2010-04-27 00:24:33 -04:00
Tom Rothamel 3f80320d37 The python compiler has been rewritten to use the python ast module.
This should both improve performance, and improve error handling for
python syntax.
2010-04-23 23:12:11 -04:00
Tom Rothamel 0e44ce7636 Update docs. 2010-04-23 22:06:24 -04:00
Tom Rothamel 8fe727a8a1 Start on sphinx documentation for build system. 2010-04-18 01:51:17 -04:00
Tom Rothamel b82f7a5548 Use default_transform as the main way of positioning images on the screen. 2010-04-17 12:15:27 -04:00
Tom Rothamel fe15242479 Allow the position properties to be specified independently when transforms are composed. 2010-04-17 00:44:06 -04:00
Tom Rothamel 677a9b0dab Transform (and ui.transform) have been changed so that their arguments
can now be prefixed with a style prefix. One can write
ui.transform(idle_rotate=30, hover_rotate=90) and have it work. [doc]
2010-04-13 23:57:37 -04:00
Tom Rothamel 309001e2fe Pick mask based on platform. Fixes a bug in ubuntu 10.4 beta. 2010-03-30 02:06:25 -04:00
Tom Rothamel 90e782c9c6 Actually put textures on the free-lists, so we can reuse them. 2010-03-23 00:03:15 -04:00
Tom Rothamel f95d9cacb5 Sleep to prevent swdraw from speeding up the CPU. 2010-03-17 11:34:44 -04:00
Tom Rothamel 308d1e6b00 Choose directory for opengl.txt. 2010-03-17 11:16:23 -04:00
Tom Rothamel c57b3004a0 Reset display after renpygame. 2010-03-17 11:12:11 -04:00
Tom Rothamel 00bd5c96e9 Shift-reload now works in GL mode. 2010-03-16 22:08:45 -04:00
Tom Rothamel 371b11370a Allow Ren'Py to keep working even if GL can't be loaded. 2010-03-16 10:13:49 -04:00
Tom Rothamel b9338a7446 Video support. 2010-03-16 01:54:05 -04:00
Tom Rothamel e39ae375f4 Refactor things so texture caching takes place in the draw modules, using
weak references.
2010-03-15 13:24:48 -04:00
Tom Rothamel 975907aebf Fixed spelling, thanks to ZeikJT. 2010-03-15 00:45:51 -04:00
Tom Rothamel ccfbdf6f3a Software mouse works in GL Ren'Py. 2010-03-15 00:42:55 -04:00
Tom Rothamel 7934d40b7c Refactor mouse code. 2010-03-15 00:21:45 -04:00
Tom Rothamel 3b569a10bd Implement screenshots. 2010-03-14 16:49:11 -04:00
Tom Rothamel 941d959ee5 Reinitialize OpenGL (except for various detection) each time the window
is resized. This allows us to work on Mac OS X, which can't share any 
OpenGL state through a window resize. (At least with SDL+Pygame.)
2010-03-13 21:20:13 -05:00
Tom Rothamel d5a51c8139 Implement pixellate in gl-mode. 2010-03-13 19:01:46 -05:00
Tom Rothamel fc79078d51 Implement RENPY_GL_VSYNC, which control OpenGL vertical sync. 2010-03-13 12:42:43 -05:00
Tom Rothamel d6615410dd Allow the user to resize the GL window by dragging (or hitting the maximize
button).
2010-03-13 12:34:30 -05:00
Tom Rothamel adee372b4b Always add a left border to images. 2010-03-13 02:06:25 -05:00
Tom Rothamel 9c7542a357 Track total texture size. 2010-03-12 01:17:21 -05:00
Tom Rothamel bc18285a61 Allow renpy_draw to pick between software and hardware rendering. 2010-03-12 00:46:53 -05:00
Tom Rothamel 7b6c3f52e0 Implement imageblend. 2010-03-12 00:30:15 -05:00
Tom Rothamel f95c6e479d Add an extra row and column of pixels to textures that aren't full, to
ensure we don't interpolate in junk during subpixel rendering.
2010-03-11 21:47:27 -05:00
Tom Rothamel e4e224348f Merge premultiplied textures. 2010-03-11 01:50:59 -05:00
Tom Rothamel 7e914da261 Initial writing of premultiplied textures. 2010-03-11 01:49:33 -05:00
Tom Rothamel ae3eb40a0e Code to read from FB to surface.
Fix shaders to handle alpha blending.
2010-03-10 22:19:48 -05:00
Tom Rothamel 2f8cd81870 Dissolve works (with copy RTT). FBO rtt is buggy. 2010-03-09 23:50:55 -05:00
Tom Rothamel a1e7b60dab Implement basic render-to-texture.
Implement non-aligned clipping.
2010-03-09 17:02:12 -05:00
Tom Rothamel 92515fca49 Implement aligned clipping. 2010-03-09 02:27:41 -05:00
Tom Rothamel 6a8abf2a79 Basic support for clipping using glClipPlane. 2010-03-09 01:24:52 -05:00
Tom Rothamel 9a47b02840 Allocate texture numbers in the GL thread. 2010-03-08 18:49:19 -05:00
Tom Rothamel 488c1c34cd Use the right direction for the transform. 2010-03-08 02:03:42 -05:00
Tom Rothamel 52bd7de14f First drawing via GL to the screen. 2010-03-08 01:36:36 -05:00
Tom Rothamel deb0f813ca Making progress towards getting gl-drawing working. 2010-03-07 18:46:00 -05:00
Tom Rothamel 5030513375 Rewrite the text handling to create textures. 2010-03-06 20:16:55 -05:00
Tom Rothamel 53deb04137 Rewrite im to use textures instead of surfaces directly.
Add support for textures (really just surfaces) to swdraw.

Move rle cache code into swdraw.
2010-02-28 23:01:58 -05:00
Tom Rothamel 2c60f5251f Rewrite RotoZoom in terms of Transform. 2010-02-26 14:47:33 -05:00
Tom Rothamel 64ac5a9317 Rewrote Zoom, FactorZoom, and SizeZoom in terms of Renders. 2010-02-26 01:33:10 -05:00
Tom Rothamel 607113b31c Move pixellate into swdraw. 2010-02-24 21:47:32 -05:00
Tom Rothamel 5a472ef44b Finished factoring out dissolve and imagedissolve. 2010-02-24 01:28:27 -05:00
Tom Rothamel c67ba9b4e4 Restructured dissolve and imagedissolve. 2010-02-24 01:04:11 -05:00
Tom Rothamel 3f36d3a881 get_parameterized -> _get_parameterized 2010-02-24 01:03:10 -05:00
Tom Rothamel d188618785 Sync with main branch. 2010-02-23 16:31:25 -05:00
Tom Rothamel e6827bdff8 * lp:526297 - im.Rotozoom()s crash when Ren'Py is scaled down. (Thanks to Spiky Caterpillar for the bug report and fix.)
Renamed the internal show and hide methods of Displayable, so those
names can once again be used by user-defined displayables.
2010-02-23 15:12:44 -05:00
Tom Rothamel 85ac26fb1e Move the drawing code from render.py to swdraw.py. Now, none of the
code in render.py should be software-renderer specific.
2010-02-23 01:52:33 -05:00
Tom Rothamel abea49df8e Massive restructuring of the display system. The methods in Display
were split between the new SWDraw class and Interface. The idea is to
separate the software renderer out from the common code.
2010-02-23 01:13:02 -05:00
Tom Rothamel bfc7de0d16 glcore -> gldraw 2010-02-22 22:05:35 -05:00
Tom Rothamel aa8c3ecec9 Move gl stuff into the display directory. 2010-02-22 22:02:11 -05:00
Tom Rothamel 7ab984972e Started work on glcore.py. 2010-02-22 21:55:57 -05:00
Tom Rothamel da09c4d04f Implement the subsurface operation. 2010-02-21 20:02:31 -05:00
Tom Rothamel c42457446f Implemented a shader-based GL environment. 2010-02-21 02:35:30 -05:00
Tom Rothamel 40bb6ca557 Can compile shaders. 2010-02-20 23:25:58 -05:00
Tom Rothamel f2cc5d25e8 Implement render-to-texture using EXT_framebuffer_object, with
acceptable performance on both Nvidia and 950.
2010-02-20 13:50:49 -05:00
Tom Rothamel 04a5460e8b Init rtt and environ in a function, so we don't have to wait for them. 2010-02-20 11:04:20 -05:00
Tom Rothamel 12ef8ee199 Refactor render-to-texture code into a class, so we can have an
alternative implementation of it.
2010-02-20 02:41:26 -05:00
Tom Rothamel 9c2d2f3a06 Implement render to texture.
Implement (GL 1.1) blank texture loading.

Add EXT_framebuffer_object to tegl.
2010-02-19 19:56:11 -05:00
Tom Rothamel 94bcfe5c58 Change to using BGRA textures for speed on Nvida chips.
Make work on the mac.
2010-02-18 10:41:22 -05:00
Tom Rothamel fecd13c733 Allow textures of various sizes, from 512 to 64 pixels. 2010-02-17 22:54:43 -05:00
Tom Rothamel a9a6595d43 Implemented fixed-function imageblend. Also, tweaked normal blend so
textures are taken in the right order.
2010-02-16 00:20:02 -05:00
Tom Rothamel e4e9ea4e87 Working blend operation. 2010-02-14 21:14:29 -05:00
Tom Rothamel 588682f0d2 Change the representation of texgrids to include a tile index, rather
than implying the tile index.

Work on environments continues.
2010-02-14 19:17:32 -05:00
Tom Rothamel 0b502d5530 C-accelerated the rectangle drawing code. 2010-02-13 23:53:27 -05:00
Tom Rothamel 86a2b5d4e5 Move the GL setup code into a module. 2010-02-13 20:05:12 -05:00
Tom Rothamel 312a657e78 Rename surface.py to gltexture.py 2010-02-11 20:00:32 -05:00
Tom Rothamel 6197597ec9 Can now draw a TextureGrid to the screen. 2010-02-11 19:35:19 -05:00
Tom Rothamel c3ee29a9b0 Work on loading textures. 2010-02-11 09:01:42 -05:00
Tom Rothamel d5b26aa973 Work on loading textures. 2010-02-11 08:58:36 -05:00
Tom Rothamel 5d926ad49b Build modules in module directory. 2010-02-10 00:38:44 -05:00
Tom Rothamel b5f133ce17 Have working direct transfer of SDL surface -> texture. 2010-02-09 00:32:01 -05:00
Tom Rothamel 6ee4474e5e Prevent completing a rollback from triggering an exception if
other code is updating objects that it uses.
2010-02-07 13:06:58 -05:00
Tom Rothamel d515d07110 Customized TEGL for our purposes. 2010-02-04 20:58:57 -05:00
Tom Rothamel 3d2e5124d4 Add a clean tegl. 2010-02-04 20:50:51 -05:00
Tom Rothamel 48a826a13d Fix bug that could cause last element of a MultipleTransition to show twice. 2010-02-04 16:53:57 -05:00
Tom Rothamel 64e82c2c62 Rewrote MultipleTransition (which is used by Fade) to fix some
problems it was exhibiting.
2010-02-04 15:43:21 -05:00
Tom Rothamel 9c5d4d7ad5 Do not query volume if a mixer is disabled, in the imagemap
preferences screen.
2010-01-26 20:42:17 -05:00
Tom Rothamel 5f006c8f4c Bump version. 2010-01-22 11:00:07 -05:00
Tom Rothamel 3d8b6cbecb Remove default_transform test code that got stuck in a release. 2010-01-22 10:56:36 -05:00
Tom Rothamel 7e2e123af7 Bump version, update changelog. 2010-01-21 18:53:32 -05:00
Tom Rothamel 14aa4c4e3d Do not display ctc when interact=False. 2010-01-21 18:04:22 -05:00
Tom Rothamel 2c15237b8a Implement renpy.config.default_transform, but don't make it the default yet. 2010-01-21 16:54:10 -05:00
Tom Rothamel b4845252c1 Bump version. 2010-01-20 13:03:58 -05:00
Tom Rothamel 2f513235b3 The launcher now accepts a RENPY_DEFAULT_PROJECTS_DIRECTORY, which sets
the default for the projects directory, if it has not already been set 
by the user. It also will report an error when creating a project fails,
rather than producing a traceback.
2010-01-20 11:16:55 -05:00
Tom Rothamel c68b3bae89 The new voice_replay function replays the voice played on the current
interaction. The new voice_can_replay function returns True if a voice
can be replayed.
2010-01-20 01:01:24 -05:00
Tom Rothamel 3825e88883 Properly purge images from the image cache. 2010-01-20 00:10:20 -05:00
Tom Rothamel bbe0fdb98f It's now possible to assign style properties to individual imagemap
buttons, by indexing style.imagemap_button. (So for example, one could 
assign to style.imagemap_button["Start Game"].hover_sound .)
2010-01-18 22:46:56 -05:00
Tom Rothamel 009969dab5 Can't pop from a tuple. 2010-01-18 03:04:02 -05:00
Tom Rothamel 376ac7ad81 Add a link to the Ren'Py Games List to the launcher. 2010-01-17 17:07:38 -05:00
Tom Rothamel de8257f459 Ren'Py now builds zip files in distributions 64k at a time. 2010-01-14 22:03:14 -05:00
Tom Rothamel 3b0fbcc55f Previously, it was impossible to pass an arguments list to a call
expression. Now, we allow the pass keyword to be used to distinguish 
the two, using code like:

call expression foo pass (bar, baz)
2010-01-14 12:48:54 -05:00
Tom Rothamel e33abc05fb Prevent infinite looping when iterating over an object with
__getitem__ defined.
2010-01-14 11:37:59 -05:00
Tom Rothamel 430ee03d45 Bump version to 6.10.2b. 2010-01-14 00:12:46 -05:00
Tom Rothamel 03477d1c75 Fix lp:506322 - MoveTransition wouldn't work on the overlay layer, even if explicitly specified. 2010-01-13 23:20:15 -05:00
Tom Rothamel ef9ee657f7 Add cache_unpin 2010-01-12 23:48:57 -05:00
Tom Rothamel e31f1ac63f Mark one pylint spurious warning. 2010-01-10 15:42:11 -05:00
Tom Rothamel 33a6c97446 Finalize changelog. 2010-01-10 15:37:57 -05:00
Tom Rothamel 99e9e6e9ba Bump version to 6.10.2a. 2010-01-10 15:34:31 -05:00
Tom Rothamel 1d81cede71 Unpack ScaledSurfaces before using them as a sample for an alpha channel. 2010-01-10 01:52:00 -05:00
Tom Rothamel 54ab9e0f1b Add copyright information to files that have it missing. 2010-01-09 13:25:18 -05:00
Tom Rothamel f0df9a7a05 Bump copyright to 2010. 2010-01-09 13:14:42 -05:00
Tom Rothamel adc3bf820b Fixed a bug that caused the overlay to display twice in some cases. 2010-01-05 18:07:28 -05:00
Tom Rothamel d26ac890a5 Add the ability to pin images into the cache, using the renpy.cache_pin function. 2010-01-05 02:30:39 -05:00
Tom Rothamel d0397b2111 The new config.automatic_images_strip variable can strip out prefixes
when automatically defining images.
2010-01-03 16:32:21 -05:00
Tom Rothamel 0229de3f0d The new config.menu_clear_layers variable allows layers to be cleared
when entering the game menu. This makes it easier for a layer to have 
overlay-like things on it when in the game, but not when in the game
menu.
2010-01-03 16:25:20 -05:00
Tom Rothamel 176150be7f Add renpylint script, a wrapper around pylint that gets rid of some
false positives where pylint isn't able to fully analyze Ren'Py.

Add annotations to Ren'Py to further supress false positives. The result
is that we can now run pylint and pick out regressions.
2010-01-02 02:38:07 -05:00
Tom Rothamel 04992fa431 Flag spurious pylint warnings, in the renpy/ directory. 2010-01-01 16:30:38 -05:00
Tom Rothamel b26725fd01 pylint done. 2010-01-01 15:09:36 -05:00
Tom Rothamel 601e7b1949 pylint: Initial pass through renpy directory. 2010-01-01 14:27:20 -05:00
Tom Rothamel 37c1571792 pylint: ast.py and atl.py 2010-01-01 13:30:39 -05:00
Tom Rothamel 812144bdf0 Fixed a bug that caused pixellate to crash. 2009-12-31 16:16:20 -05:00
Tom Rothamel 6e616fda4e When a music filename is unknown, remove it from the loop, so we don't keep
trying to access it.
2009-12-31 15:44:40 -05:00
Tom Rothamel 3f120ce658 Ren'Py now caches the individual words of text that are rendered. This
can lead to a speedup in text display when there are many words of
text on the screen, and that text is re-displayed, as is the case
where the text text speed is not the maximum. This is especially 
beneficial for eastasian languages, where every character is treated
as a word.
2009-12-30 16:24:18 -05:00
Tom Rothamel 5446da46dc Ren'Py now caches the individual words of text that are rendered. This
can lead to a speedup in text display when there are many words of
text on the screen, and that text is re-displayed, as is the case
where the text text speed is not the maximum. This is especially 
beneficial for eastasian languages, where every character is treated
as a word.
2009-12-30 15:41:29 -05:00
Tom Rothamel 172efcac94 Surface creation parameter was missing when creating a Frame with tile=True.
Fixes lp:501351.
2009-12-30 00:24:27 -05:00
Tom Rothamel c5ce6c0f4b Bump version. 2009-12-17 09:36:36 -05:00
Tom Rothamel 40f8644ac2 Export time from renpy.exports. 2009-12-17 09:35:34 -05:00
Tom Rothamel d45cf0d79a Bump version. 2009-12-16 19:17:18 -05:00
Tom Rothamel 68937a71b9 Add developer menu to string scanner. 2009-12-14 22:06:00 -05:00
Tom Rothamel db435f5a0a Bump version. 2009-12-14 19:06:43 -05:00
Tom Rothamel 40c469fa23 Add ctc_timedpause. 2009-12-14 19:04:10 -05:00
Tom Rothamel fe7c7e2299 Decode the tutorial properly, so international characters can be used. 2009-12-14 16:51:43 -05:00
Tom Rothamel 2f9d9f9dee Bump version numbers. 2009-12-13 11:26:44 -05:00
Tom Rothamel 293508969a The layout.imagemap_main_menu and layout.imagemap_load_save functions
now allow one to define variant screens. This allows one to select an 
imagemap main menu screen to use, or to define different screens for
loading and saving.
2009-12-13 11:05:58 -05:00
Tom Rothamel 5908546828 Ensure we get an alpha surface even if pygame hasn't been initialized.
Take the position from the transform, not something enclosing the transform.

Fix the archiver to not error out on import.
2009-12-12 23:16:59 -05:00
Tom Rothamel b80f6a1e8e Fix a bug with the last checkin. 2009-12-12 15:45:12 -05:00
Tom Rothamel d3434400cd The layout.imagemap_load_save function can now take dictionaries for
each of its arguments. This allows separate values of the arguments to
be specified for load and save.
2009-12-12 15:28:16 -05:00
Tom Rothamel 11a20e21d1 Update the font to the latest version. 2009-12-12 03:11:18 -05:00
Tom Rothamel 0de0aa292a ATL now has a "function" statement, which allows an ATL transform to
use the same functions that are supplied to Transform.
2009-12-12 01:28:41 -05:00
Tom Rothamel aa0d357bdc The transform state transfer now looks inside ImageReferences. This means
that it works when a transform is defined as part of an image, as well as
part of an at clause (or as an ATL block).

Parameterize ctc indicators.
2009-12-12 00:22:04 -05:00
Tom Rothamel ca16c24fc4 Make all of Ren'Py pyflakes-clean. 2009-12-11 01:38:28 -05:00
Tom Rothamel d32db0c9a3 Fix Pyflakes warnings. 2009-12-11 01:20:33 -05:00
Tom Rothamel 60b9f0522c Make shown_window an attribute of scene_lists. This tracks it better.
Change overlay semantics to match everything else.

Make core.py and exports.py pyflakes clean.
2009-12-11 00:39:17 -05:00
Tom Rothamel d3c58da216 Make core.py pyflakes-clean. 2009-12-10 11:31:46 -05:00
Tom Rothamel e81044465d Fix various bugs, incl lp:494820. 2009-12-10 01:01:59 -05:00
Tom Rothamel 75a0741c33 Scaling bug fixes. 2009-12-09 02:49:00 -05:00
Tom Rothamel a68f4af35d Vaguely working (not immediately crashing) rewrite of the scaling code. 2009-12-09 02:24:02 -05:00
Tom Rothamel 9e0932af5a Fix typo that prevented ui.at from working. 2009-12-07 09:58:04 -05:00
Tom Rothamel 112c0bce66 Only allow rollbacks to be committed in the top-level context. Fixes lp:493062.
Error handling improvements.

Allow ui.imagemap to take arbitrary displayables as the ground.
2009-12-06 15:30:36 -05:00
Tom Rothamel d640759ab8 Fixed a bug that prevented Ren'Py from interpolating image rotation
before image rotation was specified.
2009-12-05 17:05:14 -05:00
Tom Rothamel bb628bd9cd Make bilinear scaling precise.
Make im.Scale use the smooth scaling code. Fixes lp:488814.
2009-12-05 15:42:31 -05:00
Tom Rothamel ed3c0937d9 Check in cython-created files. 2009-12-05 13:32:26 -05:00
Tom Rothamel 48cf0cd50a Fixed a bug that caused Ren'Py to fail when scaling was enabled. 2009-12-05 03:09:56 -05:00
Tom Rothamel a39934d0c4 The image text tag can now take any textual image representation. So
something like {image=eileen happy} is legal, if odd.


Fixed a bug that could prevent files from being loaded if Ren'Py was
run from a path that contains non-ascii characters. (Even in directories
that were not part of the Ren'Py distribution.)
2009-12-05 00:38:30 -05:00
Tom Rothamel 2a9eaf9dea Fix a no-shutdown bug. 2009-12-05 00:15:07 -05:00
Tom Rothamel 0d07b4dcb6 Be sure blit lock is held. 2009-12-02 18:14:11 -05:00
Tom Rothamel 76fbce3304 Fix bug that could cause shift+R to fail when going back to a menu after a restart.
Fix bug that could prevent Ren'Py from exiting if image or auto-save threads felt like keeping us around.
2009-12-02 17:51:08 -05:00
Tom Rothamel 510eba1628 Hide deprecation warnings on Python 2.6. 2009-11-30 02:54:16 -05:00
Tom Rothamel c37fede2f1 Add precise mode for transform32.
Remove can_ tests from the module as obsolete.
2009-11-30 02:01:45 -05:00
Tom Rothamel 3ccb522e33 Replace all surface creation with calls to
renpy.display.pgrender.surface and other functions in that
module. This function creates a surface with a 1px border in
all directions. This will let us not have to worry about transform32 
overrunning the surface.
2009-11-29 16:01:42 -05:00
Tom Rothamel a067d0c830 Bump version to 6.10.0e 2009-11-16 23:20:12 -05:00
Tom Rothamel 2f82c7466d Adjust the types of ATL properties as necessary. 2009-11-16 02:22:37 -05:00
Tom Rothamel 9e9a6b7f8e Change the strategy used for cropping in Transform. The new one allows for floating pointy crop windows. 2009-11-16 02:04:41 -05:00
Tom Rothamel 9db36905c6 Fix bug that prevented ATL default parameters from working. 2009-11-15 19:29:17 -05:00
Tom Rothamel e5ae260c33 Add ATL warp construct. 2009-11-15 19:24:17 -05:00
Tom Rothamel 4e3a579eed ATL: fix bug with bare number as pause. 2009-11-15 15:44:49 -05:00
Tom Rothamel 4cd1e62978 Simplify module.py, now that we error out if the module isn't loadable.
Make it possible to build on a stock ubuntu.
2009-11-15 15:31:09 -05:00
Tom Rothamel babd95540d ATL add contains expression statement. 2009-11-15 00:51:53 -05:00
Tom Rothamel 905de15883 Clear lint error.
Bump version for release.
2009-11-14 22:14:48 -05:00
Tom Rothamel 00f31ca351 Bar style tweak, and replace missing main menu file. 2009-11-14 22:10:12 -05:00
Tom Rothamel cb82cfae3e Allow Transforms to embed Dissolve et al.
Add concert to tutorial game. Add new main menu to tutorial game.
2009-11-14 22:03:51 -05:00
Tom Rothamel 1a36f1feb7 Add show_transform to character. 2009-11-13 18:18:47 -05:00
Tom Rothamel d1893c6e17 Do not change the style prefix of a button when changing the style
prefix of a button that contains it.
2009-11-13 15:12:08 -05:00
Tom Rothamel 330ec0e68c Optimize transforms when alpha is 0.
Trim happy_alley.

Bump version to 6.10.0b.
2009-11-13 14:24:19 -05:00
Tom Rothamel 830304b79e In ATL, changed child -> contains, so as not to mask access to the child variable. 2009-11-10 23:05:07 -05:00
Tom Rothamel dc5940ac56 Ensure layer_at_list works with ATL transforms properly. 2009-11-10 22:55:12 -05:00
Tom Rothamel 437cc8784f Choose default focus when leaving a context in which at least one interaction occured. 2009-11-10 01:58:41 -05:00
Tom Rothamel 8e08e6647a Update .bzrignore 2009-11-09 21:04:11 -05:00
Tom Rothamel 60a21a7bbe Add child statement to ATL.
Allow ATL Transform to be used as transition.
2009-11-09 21:01:04 -05:00
Tom Rothamel 6251a86cfe Add new lucy art - thanks, Mugen! 2009-11-09 16:48:43 -05:00
Tom Rothamel 580ea88cd0 Make transforms take a list of declared parameters.
Fix problem where transform and define would declare a label.
2009-11-09 16:42:15 -05:00
Tom Rothamel c93734cd9c Have the caret change color when a color parameter is supplied to Input. 2009-11-08 13:55:19 -05:00
Tom Rothamel f7e2f0dd1a Fix bug that prevented styles from rebuilding. 2009-11-08 13:22:02 -05:00
Tom Rothamel 943b505ec2 Fix the version number to be 6.10.0a. 2009-11-07 19:43:01 -05:00
Tom Rothamel 75304e781a Don't let REDRAW or TIMEEVENT hold up motions.
Final tweaks for release.
2009-11-07 19:41:46 -05:00
Tom Rothamel d73326af11 Rename the bidi module.
Bump the version numbers.

Fix the demo a bit.

Fix problem in which TIMEEVENT could starve redraws.
2009-11-07 17:55:27 -05:00
Tom Rothamel 670eca455d Update strings.
Get things building on all platforms, bump library versions.
2009-11-07 02:49:07 -05:00
Tom Rothamel ab38c2e521 The freetype library has been updated, and we have added support for
the use of TrueType collections. Using a name of 0@font.ttc will get
the first font in the collection, 1@font.ttc will get the second font,
and so on.

ATL typo.
2009-11-07 00:54:53 -05:00
Tom Rothamel 1ded9b2959 Changelog updates.
Add align and anchor ATL properties, for symmetry with pos.
2009-11-06 02:12:20 -05:00
Tom Rothamel 7c67db202f Preserve the illusion of linear time in transforms. 2009-11-05 21:30:39 -05:00
Tom Rothamel ba4321956b Basically done with the tutorial game. Removed a lot of files that are
no longer used.
2009-11-05 02:50:39 -05:00
Tom Rothamel 79e4b5a2fa Finished the ATL tutorial. 2009-11-04 23:09:07 -05:00
Tom Rothamel 5b84b0507c Added a .001s sleep for frames that are framerate-limited. This should
prevent Ren'Py from consuming all CPU unless the game is CPU-bound.
2009-11-04 19:25:12 -05:00
Tom Rothamel c15d13e543 Allow LiveComposites bigger than the screen. Fixes lp:473624. 2009-11-03 21:11:50 -05:00
Tom Rothamel 3ef27787b4 Various ATL fixes. Commit ATL tutorial. Off to go vote... 2009-11-03 11:10:26 -05:00
Tom Rothamel e84e8102b6 The new config.auto_load variable allows you to specify a save file
that is automatically loaded when Ren'Py starts. For example, setting
this to "1" loads the game in save slot 1. This is intended for use by
developers, so they can easily return to a point in the game after 
restarting Ren'Py.
2009-11-02 01:53:17 -05:00
Tom Rothamel ee8d1a531a Work on the ATL demo.
Fix yet another segfault bug in transform32, this one probably having to 
do with precision of floating point numbers.
2009-11-02 01:28:47 -05:00
Tom Rothamel 2d4d1903b2 More work on the tutorial. 2009-10-31 20:10:52 -04:00
Tom Rothamel d1cc2015ac Move demo/ to tutorial/. 2009-10-31 14:47:20 -04:00
Tom Rothamel be44f0805c Minor focus behavior changes to deal with viewports better.
More work on the demo. The quickstart is now covered.
2009-10-31 14:31:19 -04:00
Tom Rothamel 612207510c Working on turning the demo game into the tutorial game. 2009-10-31 02:19:29 -04:00
Tom Rothamel c2875e4a7d More tutorial work. Finished the dialogue section. 2009-10-28 00:50:20 -04:00
Tom Rothamel b8d2433a79 Demo work.
Add basic RTL support.
2009-10-26 18:46:21 -04:00
Tom Rothamel 43cc8b425a Make _args and _kwargs dynamically scoped. This fixes a problem with
_after_load when at a label, and may also fix a problem with return 
labels being missing.
2009-10-25 02:13:50 -04:00
Tom Rothamel 7962073926 The play statement takes an if_changed modifier, which prevents a song
from being restarted if it is already playing on the channel.
2009-10-25 00:06:22 -04:00
Tom Rothamel 281a35bc66 Fix problems with imagemap load & save. 2009-10-24 23:26:31 -04:00
Tom Rothamel a4f6a18bb8 Python blocks are now compiled in a mode that allows the python "with"
statement. Container displayables now support the context manager
protocol, automatically closing at the end of a with block. (Note
that the python with statement postdates the Ren'Py with statement,
and has totally different semantics.)
2009-10-24 04:19:35 -04:00
Tom Rothamel f50adf3ed2 Add the ui.tag function. 2009-10-22 09:57:41 -04:00
Tom Rothamel f1b78b4a05 Make a copy of an ATL displayable before running a hide handler. This
allows us to roll back to before the hide handler has run.
2009-10-22 09:43:38 -04:00
Tom Rothamel 7953f8adf1 Have ATL give a parse error if it sees two expressions in a row. 2009-10-22 08:59:29 -04:00
Tom Rothamel f3062e6f22 Add ability for ATL to run an event on hide, and suppress hide until
done. (Not sure if this is totally desirable, though. It interacts with
rollback poorly.)
2009-10-22 01:37:19 -04:00
Tom Rothamel fe4eda2661 Try to ensure that loading and saving ATL works out. 2009-10-20 21:51:42 -04:00
Tom Rothamel 2be10ba84c Alias Character to Speaker. 2009-10-20 21:14:31 -04:00
Tom Rothamel 82b3d0e78e The layout.imagemap_yesno_prompt now supports a prompt_images
argument, which is can be used to specify images to replace the
text of a yes/no prompt.

Make buttons give out the role + hover status.

Allow transform to control the render size of its child.
2009-10-18 21:49:54 -04:00
Tom Rothamel 079180f4ce Changed MoveTransition to preserve the timebases of the thing being moved
in all circumstances.

Fixes lp:451464
2009-10-17 23:30:26 -04:00
Tom Rothamel 9a3369c27c The developer screen was getting a bit large, so load it from a module
only if config.developer is enabled.
2009-10-17 15:12:23 -04:00
Tom Rothamel b87e10cdcf Added the Image Location Picker to the Developer (shift+D) menu. This
tool lets the user pick an image, and then pick locations that
image. It display the mouse coordinates, imagemap rectangle, and
cropping rectangle.
2009-10-17 15:07:15 -04:00
Tom Rothamel 229c542d68 ATL: Propagate events to child as well as parent. 2009-10-17 13:40:34 -04:00
Tom Rothamel 3478d079d6 The displayable code has been adjusted to consider strings that do not
contain at least one dot as image references. Now, one can write
"eileen happy" to refer to an image with that name.

ATL: Fix Child.
2009-10-17 00:25:09 -04:00
Tom Rothamel a7fc70402e The play and queue statements now take optional loop and noloop
modifiers, which force looping (or lack of looping) on that channel.
2009-10-16 23:41:40 -04:00
Tom Rothamel 5df6419a59 Added the pause statement. 2009-10-16 23:30:52 -04:00
Tom Rothamel 8b03bc5072 The new config.automatic_images variable, when set correctly, will
cause Ren'Py to automatically define images for appropriately-named
image files found in the archives and game directory.
2009-10-16 23:22:55 -04:00
Tom Rothamel 6ca8a37cc6 The new config.window_overlay_functions variable contains a list of
functions that should be called only when once the dialogue window has
been shown.
2009-10-16 22:40:23 -04:00
Tom Rothamel 9fbf1ee1b2 Add the define statement. 2009-10-16 22:17:03 -04:00
Tom Rothamel 84b7741fa4 Rewrite transform to fix segfaulting. Eliminate most fixed-point arithmetic.
Add to ATL corner1, corner2.
2009-10-16 03:41:42 -04:00
Tom Rothamel e6efaa5f9f Add ability of ATLTransform to take events from its child, and for
button to generate ATL events.

Fix focusing the child of an ATL displayable.
2009-10-16 01:19:13 -04:00
Tom Rothamel 330c2e247e Allow rotation of clipped render. 2009-10-15 11:35:48 -04:00
Tom Rothamel 923f56273c Add to ATL support for spline interpolation. 2009-10-14 01:33:44 -04:00
Tom Rothamel 8b761aa689 Update icon to 7-ready one.
Minor fix to ATLTransform.
2009-10-12 15:21:53 -04:00
Tom Rothamel fa538db11f Add ATL support for polar coordinates and revolution. 2009-10-12 02:57:17 -04:00
Tom Rothamel e4dff364e1 Add language support for revolution. 2009-10-12 02:56:36 -04:00
Tom Rothamel 5d7faf0274 Add basic revolution support. 2009-10-12 02:38:17 -04:00
Tom Rothamel ee0cafcf67 Change ATL to use warpers. 2009-10-11 15:38:25 -04:00
Tom Rothamel 94506ad601 Give people a fighting chance of debugging ATL errors. 2009-10-11 00:27:25 -04:00
Tom Rothamel f0b54ea7f9 Mark window is shown in renpy.display_menu. 2009-10-08 19:58:03 -04:00
Tom Rothamel 11dbf23952 Applied patch from spikey to fix lp:409151 2009-10-08 01:15:34 -04:00
Tom Rothamel 8957aa4f2f fixes lp:413209. 2009-10-08 01:09:22 -04:00
Tom Rothamel 7e206549fd Attempt a fix for lp:435595. 2009-10-08 00:32:11 -04:00
Tom Rothamel f365408bbc Fix lp:415110. 2009-10-08 00:17:04 -04:00
Tom Rothamel 0bdf5cd904 Be more aggressive in handling events, so the queue is less likely to
overflow.
2009-10-07 23:41:53 -04:00
Tom Rothamel 9ba28e5cd2 Fixed style.rebuild. 2009-10-07 02:07:12 -04:00
Tom Rothamel 49ae49a82e Add ui.button's keymap argument.
Add support for deleting save games.
2009-10-07 01:35:55 -04:00
Tom Rothamel 23e9fffd68 Fix function leaking into atl interpolators. 2009-10-07 00:43:08 -04:00
Tom Rothamel 1c6df6230d Various improvements to ui.input, in support of a failed effort to
allow the user to change the label of a savegame.
2009-10-07 00:22:39 -04:00
Tom Rothamel 88584747e4 renpy.get_roll_forward 2009-10-05 14:09:12 -04:00
Tom Rothamel d77d1c266b When an image is shown, Ren'Py checks to see if there was a previous
image with that tag, and if that image used a transform. If this is
true, Ren'Py does two things:

# If the new image is not a transform, it wraps it in a transform.
# The transform is initialized to have the properties of the old transform.

The generally has the effect of "remembering" the position of images
shown on the screen. In some cases, this memory effect may override a
position encoded into an image. In that case, the image must be hidden
and shown again.
2009-10-04 22:45:03 -04:00
Tom Rothamel d9738a2809 Added a FPS meter to the Developer (shift+D) menu.
Added a .001s sleep for frames that are framerate-limited. This should
prevent Ren'Py from consuming all CPU unless the game is CPU-bound.
2009-10-04 16:38:38 -04:00
Tom Rothamel a40d997413 Implement visit method on the various ATL classes. 2009-10-04 12:02:06 -04:00
Tom Rothamel d444558b06 Add ATL image prediction.
Add ATL On and Event statements.
2009-10-04 11:48:22 -04:00
Tom Rothamel 07164c156b Pass statement, remove requirement for choice to take an expression. 2009-10-04 03:36:09 -04:00
Tom Rothamel 625df4c7ac Implement Transform statement.
Implement calling an ATLTransform, and using an ATLTransform as a parameterized image.
2009-10-04 02:59:28 -04:00
Tom Rothamel 75a047e18d Implement the time statement. 2009-10-04 01:54:25 -04:00
Tom Rothamel ade3d4f935 Implemented choice. 2009-10-04 00:05:16 -04:00
Tom Rothamel a0bc604d92 Implement ATL statements, including repeat and parallel. 2009-10-03 22:59:55 -04:00
Tom Rothamel 10743adcee Fix a bug that could cause us to read a negative amount from a file, with disasterous results. 2009-10-03 15:36:35 -04:00
Tom Rothamel 4e9af0789c First ATL animation. 2009-10-01 03:21:37 -04:00
Tom Rothamel 83f7ef6fd7 WIP checkin of ATL. 2009-09-30 15:44:19 -04:00
Tom Rothamel b2850cc6ac ATL work. 2009-09-29 03:03:46 -04:00
Tom Rothamel e41c71da98 Add ATL, parse multipurpose statement. 2009-09-27 01:07:22 -04:00
Tom Rothamel 0e3468872b Fix strings to not double-escape. 2009-09-01 10:06:42 -04:00
Tom Rothamel cd6a49e679 Allow translation. 2009-08-31 01:36:55 -04:00
Tom Rothamel 494e1a944b Fix regression that prevented {w=1} from working. 2009-08-13 20:19:58 -04:00
Tom Rothamel 1361825f5d Bump version. 2009-08-03 21:33:34 -04:00
Tom Rothamel b977e20156 Export RENPY_BASE environment variable to help editors find Ren'Py.
Make SciTE use this mechanism to launch games.
2009-08-03 21:28:45 -04:00
Tom Rothamel ff858e599d Ensure that distribute works with non-unicode directories. 2009-08-03 19:26:26 -04:00
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
617 changed files with 59906 additions and 29211 deletions
+89 -4
View File
@@ -5,11 +5,96 @@ renpy.app
**/*.rpyc
**/*.rpyb
**/*.rpymc
_renpy.c
nativemidi.c
sound.c
winmixer.c
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
Lucy Sprites.zip
translate
close_bugs.py
.logplayer
scite-6.10.zip
scite-renpy-20090803.zip
module/cython.sh
old_demo
opengl.txt
Microsoft.VC90.CRT.manifest
console.exe
msvcr90.dll
python26.dll
renpy.exe
lib/windows-x86
sphinx/source/inc/*
doc/*
updates/prerelease
module/render.c
module/_renpy.c
module/_renpy_pysdlgl.c
module/_renpybidi.c
module/sound.c
module/winmixer.c
module/accelerator.html
module/gldraw.html
module/glenviron_fixed.html
module/glenviron.html
module/glenviron_limited.html
module/glenviron_shader.html
module/glrtt_copy.html
module/glshader.html
module/gltexture.html
module/render.html
module/accelerator.c
module/gldraw.c
module/glenviron.c
module/glenviron_fixed.c
module/glenviron_limited.c
module/glenviron_shader.c
module/glrtt_copy.c
module/glshader.c
module/gltexture.c
log.txt
lib/linux-x86
lib/python
lib/update-version.txt
sphinx/game/saves
tutorial/game/saves
+721 -5
View File
@@ -1,3 +1,709 @@
New in Ren'Py 6.10.2
--------------------
Ren'Py now caches the individual words of text that are rendered. This
can lead to a speedup in text display when there are many words of
text on the screen, and that text is re-displayed, as is the case
where the text text speed is not the maximum. This is especially
beneficial for eastasian languages, where every character is treated
as a word.
The new config.menu_clear_layers variable allows layers to be cleared
when entering the game menu. This makes it easier for a layer to have
overlay-like things on it when in the game, but not when in the game
menu.
The new renpy.cache_pin function pins images into memory, loading them
as soon as possible and keeping them loaded. The renpy.cache_unpin function
undoes this.
The new config.automatic_images_strip variable can strip out prefixes
when automatically defining images.
It's now possible to assign style properties to individual imagemap
buttons, by indexing style.imagemap_button. (So for example, one could
assign to style.imagemap_button["Start Game"].hover_sound .)
The new voice_replay function replays the voice played on the current
interaction. The new voice_can_replay function returns True if a voice
can be replayed.
The launcher now accepts a RENPY_DEFAULT_PROJECTS_DIRECTORY, which sets
the default for the projects directory, if it has not already been set
by the user. It also will report an error when creating a project fails,
rather than producing a traceback.
The launcher now links to the new Ren'Py Games List, at
http://games.renpy.org/.
Previously, it was impossible to pass an arguments list to a call
expression. Now, we allow the pass keyword to be used to distinguish
the two, using code like:
call expression foo pass (bar, baz)
Ren'Py will now not show the click-to-continue indicator when a
character is called with interact=False, unless that character is also
called with ctc_force=True.
Ren'Py now builds zip files in distributions 64k at a time.
Ren'Py will now ignore music files that do not exist. Previously, it
could loop trying to play them. (This would increase CPU usage, rather
than causing a crash.)
The following numbered bugs were fixed:
* lp:501351 - Displaying a Frame() with tile=True crashes
* lp:506322 - MoveTransition is not applied to overlay even when explicitly stated
In addition:
* Fixed a bug that caused pixellate to crash.
* Fixed a bug that caused the overlay to display twice in some cases.
* Fix an infinite loop that could rarely occur when rolling back or saving.
New in Ren'Py 6.10.1
--------------------
Images and other surfaces are now created with a 1px transparent border
around them. This change allows transform to work correctly with a 1:1
scale, where as previously Ren'Py would blur the image slightly, while
trying to ensure it never accessed a pixel outside of the original
image bounds.
ATL now has a "function" statement, which allows an ATL transform to
use the same functions that are supplied to Transform.
The layout.imagemap_main_menu and layout.imagemap_load_save functions
now allow one to define variant screens. This allows one to select an
imagemap main menu screen to use, or to define different screens for
loading and saving.
The overlay semantics were changed such that transitions apply to overlays
in the same way they apply to everything else. (So, for example, dissolves
will apply to overlays.)
The image text tag can now take any textual image representation. So
something like {image=eileen happy} is legal, if odd.
The following numbered bugs were fixed:
lp:366412 - Ren'Py could crash on shift+R at the main menu, under some circumstances.
lp:485631 - The transfer of state from a transfrom to a transform supplied as part of an image didn't work.
lp:487688 - non-ASCII characters didn't display in the window title bar.
lp:487701 - Ren'Py didn't work when in a directory containing non-ASCII characters.
lp:488814 - Scaling to the same size could blur an image.
lp:489212 - Interpolation didn't work when the starting value was None.
lp:493062 - One could roll back into an imagemap main menu.
lp:494779 - The window shown state wasn't being tracked correctly.
lp:494820 - Error handling in ATL hid too many error messages.
A major bug that caused Ren'Py to fail as scaling was enabled was fixed.
A number of minor bugs revealed by pyflakes were fixed.
New in Ren'Py 6.10.0
--------------------
The demo game is in the process of being converted into a new tutorial
game, which shows recommended Ren'Py code examples rather than
requiring the user to learn from the game itself's source code.
Ren'Py now supports an Animation and Transformation language
(ATL). This provides a convenient syntax for animating an image, or
transforming it by positioning it, rotating it, zooming it, and
adjusting its opacity.
To a large extent, ATL supersedes the Animation, TransitionAnimation,
anim.SMAnimation, anim.Blink, Zoom, FactorZoom, RotoZoom, SizeZoom,
LiveCrop, Move, Pan, Position, Motion, and Revolve functions, and
perhaps others. As it allows properties to be scripted, ATL is more
powerful that all of these functions. (For example, many of these
functions can only do relatively simple repeats, while ATL allows
complex patterns to be easily specified.)
ATL can be used in the new transform statement, and new variants of
the image, scene, and show statements.
When an image is shown, Ren'Py checks to see if there was a previous
image with that tag, and if that image used a transform. If this is
true, Ren'Py does two things:
# If the new image is not a transform, it wraps it in a transform.
# The transform is initialized to have the properties of the old transform.
The generally has the effect of "remembering" the position of images
shown on the screen. In some cases, this memory effect may override a
position encoded into an image. In that case, the image must be hidden
and shown again.
The default positions (left, right, center, truecenter, offscreenleft,
and offscreenright) are now defined as ATL transforms. This means that showing
an image at such a position will cause the position to be remembered.
Support for Arabic and Hebrew has been added to Ren'Py. To enable this
support, config.rtl needs to be set to True. It may also be necessary
to set various style properties to do a credible job of right-to-left
layout.)
The freetype library has been updated, and we have added support for
the use of TrueType collections. Using a name of 0@font.ttc will get
the first font in the collection, 1@font.ttc will get the second font,
and so on.
The displayable code has been adjusted to consider strings that do not
contain at least one dot as image references. Now, one can write
"eileen happy" to refer to an image with that name.
A pause statement has been added to Ren'Py.
The new config.auto_load variable allows you to specify a save file
that is automatically loaded when Ren'Py starts. For example, setting
this to "1" loads the game in save slot 1. This is intended for use by
developers, so they can easily return to a point in the game after
restarting Ren'Py.
The layout.imagemap_yesno_prompt now supports a prompt_images
argument, which is can be used to specify images to replace the
text of a yes/no prompt.
The new ui.tag function allows one to specify the image tag of a UI
widget. This can have positive interactions with transforms.
Ren'Py now has a define statement, which combines into a single
statement running code at init time, and assigning it to a
variable. Ren'Py keeps track of these definitions, which may in the
future make it easier for editors to determine where something is
defined.
The new config.window_overlay_functions variable contains a list of
functions that should be called only when once the dialogue window has
been shown.
The new config.automatic_images variable, when set correctly, will
cause Ren'Py to automatically define images for appropriately-named
image files found in the archives and game directory.
Python blocks are now compiled in a mode that allows the python "with"
statement. Container displayables now support the context manager
protocol, automatically closing at the end of a with block. (Note
that the python with statement postdates the Ren'Py with statement,
and has totally different semantics.)
The play and queue statements now take optional loop and noloop
modifiers, which force looping (or lack of looping) on that channel.
The play statement takes an if_changed modifier, which prevents a song
from being restarted if it is already playing on the channel. [doc]
Ren'Py now allows save games to be deleted. To do this, select a save
game (either with the keyboard, or by hovering the mouse over it), and
hit delete.
Buttons now take a keymap argument, which specifies an alternate
keymap that is used when the button is focused.
Added the Image Location Picker to the Developer (shift+D) menu. This
tool lets the user pick an image, and then pick locations that
image. It displays the mouse coordinates, imagemap rectangle, and
cropping rectangle.
Added a FPS meter to the Developer (shift+D) menu.
Added a .001s sleep for frames that are framerate-limited. This should
prevent Ren'Py from consuming all CPU unless the game is CPU-bound.
Added config.file_open_callback, which allows Ren'Py to load files
from user-definable archive types.
Added the renpy.get_roll_forward function, which is the infrastructure
needed to create a button that lets the user roll forward.
Changed MoveTransition to preserve the timebases of the thing being moved
in all circumstances.
Ren'Py is now built using SDL-1.2.13. On Linux systems with pulseaudio
support, it will use pulseaudio for audio output.
Fixed a bug with archive files that could cause crashing in some
circumstances.
Fixed a bug that prevented {w=1} from working.
Fixed a bug that prevented style.rebuild from working.
Fixed a potential segfault bug with certain transforms, zooms, and
rotations.
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 +727,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 +760,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 +787,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 +804,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 +4794,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.
+723 -713
View File
File diff suppressed because it is too large Load Diff
-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.
+2
View File
@@ -5,6 +5,8 @@ if [ "x$1" = "x" ]; then
exit
fi
rsync -av updates tom@onegeek.org:/home/tom/WWW.update/renpy/
mkdir ~/ab/website/renpy/dl/$1
cp dists/renpy-$1-* ~/ab/website/renpy/dl/$1
cp CHANGELOG.txt ~/ab/website/renpy/dl/$1
-1
View File
@@ -1 +0,0 @@
build_exe.py run_game
+51 -13
View File
@@ -1,34 +1,55 @@
#!/usr/bin/env python
import modulefinder
import shutil
from distutils.core import setup
import py2exe
import sys
import zipfile
import traceback
import os
# The pythonpath on my system.
sys.path.insert(0, 'c:\\msys\\1.0\\newbuild25\\install\\bin')
sys.path.insert(0, 'c:\\msys\\1.0\\newbuild25\\install\\python')
sys.path.insert(0, 'c:\\msys\\1.0\\newbuild\\install\\bin')
sys.path.insert(0, 'c:\\msys\\1.0\\newbuild\\install\\python')
def move_from_dist(fn):
"""
Moves the file `fn` from the dist directory to the main
directory. (This means we don't need symlinks on windows.)
"""
if os.path.isdir(fn):
shutil.rmtree(fn)
elif os.path.exists(fn):
os.unlink(fn)
os.rename("dist/" + fn, fn)
import renpy
renpy.setup_modulefinder(modulefinder)
def main():
sys.argv[1:] = [ 'py2exe', '--bundle', '2', '-a', '--dll-excludes', 'w9xpopen.exe', ]
# sys.argv[1:] = [ 'py2exe', '-a', '--dll-excludes', 'w9xpopen.exe', ]
sys.argv[1:] = [ 'py2exe', '-a', '--dll-excludes', 'w9xpopen.exe', ]
setup(name="RenPy",
setup(name="Ren'Py",
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") ],
zipfile='renpy.code',
zipfile='lib/windows-x86/renpy.code',
options={ 'py2exe' : { 'excludes' : [ 'doctest',
'pygame.macosx',
'pygame.surfarray',
'pygame.mixer',
'pygame.mixer_music',
'pygame.font',
'_ssl',
'_hashlib',
'win32con',
@@ -45,18 +66,25 @@ def main():
)
zfold = zipfile.ZipFile("dist/renpy.code")
zfnew = zipfile.ZipFile("renpy.code", "w", zipfile.ZIP_STORED)
zfold = zipfile.ZipFile("dist/lib/windows-x86/renpy.code")
zfnew = zipfile.ZipFile("dist/lib/windows-x86/renpy.code.new", "w", zipfile.ZIP_STORED)
seen = { }
for fn in zfold.namelist():
if fn.startswith("renpy/"):
continue
# Keep around .pyo files that load pyd files.
pydfn = fn.replace("/", ".").replace(".pyo", ".pyd")
if not os.path.exists("dist/lib/windows-x86/" + pydfn):
continue
if fn in seen:
continue
if fn == "SDL_mixer.dll":
continue
seen[fn] = True
zfnew.writestr(fn, zfold.read(fn))
@@ -64,11 +92,21 @@ def main():
zfold.close()
zfnew.close()
os.unlink("dist/lib/windows-x86/renpy.code")
os.rename("dist/lib/windows-x86/renpy.code.new", "dist/lib/windows-x86/renpy.code")
shutil.copy("c:/Python26/Microsoft.VC90.CRT.manifest", "Microsoft.VC90.CRT.manifest")
shutil.copy("c:/Python26/msvcr90.dll", "msvcr90.dll")
move_from_dist("lib/windows-x86")
move_from_dist("console.exe")
move_from_dist("python26.dll")
move_from_dist("renpy.exe")
try:
main()
except:
traceback.print_exc()
print
print "Press return to quit."
raw_input()
+81
View File
@@ -0,0 +1,81 @@
#!/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/*.rpym")
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, " u\"%s\"," % 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

+35
View File
@@ -0,0 +1,35 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This file contains warpers that are used by ATL. They need to be defined
# early, so Ren'Py knows about them when parsing other files.
python early hide:
# pause is defined internally, but would look like:
#
# @renpy.atl_warper
# def pause(t):
# if t >= 1.0:
# return 1.0
# else:
# return 0.0
@renpy.atl_warper
def linear(t):
return t
@renpy.atl_warper
def easeout(x):
import math
return 1.0 - math.cos(x * math.pi / 2.0)
@renpy.atl_warper
def easein(x):
import math
return math.cos((1.0 - x) * math.pi / 2.0)
@renpy.atl_warper
def ease(x):
import math
return .5 - math.cos(math.pi * x) / 2.0
+41
View File
@@ -1,3 +1,6 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init -1210 python:
# This is called when script_version is set, to immediately
@@ -13,6 +16,41 @@ init -1210 python:
if version <= (6, 5, 0):
layout.compat()
if version <= (6, 9, 1):
store.library = store.config
if version <= (6, 9, 3):
# Before 6.10, these were positions, rather than transforms.
store.left = Position(xalign=0.0)
store.center = Position(xalign=0.5)
store.truecenter = Position(xalign=0.5, yalign=0.5)
store.right = Position(xalign=1.0)
store.offscreenleft = Position(xpos=0.0, xanchor=1.0)
store.offscreenright = Position(xpos=1.0, xanchor=0.0)
if version <= (6, 10, 2):
# Before 6.11, we used the image placement to handle
# the location of things on the screen.
style.image_placement.xpos = 0.5
style.image_placement.ypos = 1.0
style.image_placement.xanchor = 0.5
style.image_placement.yanchor = 1.0
config.transform_uses_child_position = False
config.default_transform = None
config.start_scene_black = True
if version <= (6, 11, 0):
config.movetransition_respects_offsets = False
if version <= (6, 11, 2):
config.imagereference_respects_position = True
config.predict_screens = False
config.choice_screen_chosen = False
init 1210 python hide::
# This returns true if the script_version is <= the
@@ -54,6 +92,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")
+70 -35
View File
@@ -1,27 +1,51 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This file contains a number of definitions of standard
# locations and transitions. We've moved them into the common
# directory so that it's easy for an updated version of all of these
# definitions.
init -1110:
transform reset:
alpha 1 rotate None zoom 1 xzoom 1 yzoom 1 align (0, 0) alignaround (0, 0) subpixel False size None crop None
# These are positions that can be used inside at clauses. We set
# them up here so that they can be used throughout the program.
transform left:
xpos 0.0 xanchor 0.0 ypos 1.0 yanchor 1.0
transform right:
xpos 1.0 xanchor 1.0 ypos 1.0 yanchor 1.0
transform center:
xpos 0.5 xanchor 0.5 ypos 1.0 yanchor 1.0
transform truecenter:
xpos 0.5 xanchor 0.5 ypos 0.5 yanchor 0.5
# Offscreen positions for use with the move transition. Images at
# these positions are still shown (and consume
# resources)... remember to hide the image after the transition.
transform offscreenleft:
xpos 0.0 xanchor 1.0 ypos 1.0 yanchor 1.0
transform offscreenright:
xpos 1.0 xanchor 0.0 ypos 1.0 yanchor 1.0
transform default:
alpha 1 rotate None zoom 1 xzoom 1 yzoom 1 align (0, 0) alignaround (0, 0) subpixel False size None crop None
xpos 0.5 xanchor 0.5 ypos 1.0 yanchor 1.0
python:
config.default_transform = default
init -1110 python:
_define = define = object()
# Positions ##############################################################
# These are positions that can be used inside at clauses. We set
# them up here so that they can be used throughout the program.
left = Position(xalign=0.0)
center = Position(xalign=0.5)
truecenter = Position(xalign=0.5, yalign=0.5)
right = Position(xalign=1.0)
# Offscreen positions for use with the move transition. Images at
# these positions are still shown (and consume
# resources)... remember to hide the image after the transition.
offscreenleft = Position(xpos=0.0, xanchor=1.0)
offscreenright = Position(xpos=1.0, xanchor=0.0)
# Transitions ############################################################
# Simple transitions.
@@ -62,60 +86,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():
@@ -131,8 +164,6 @@ init -1110 python:
zoomin = MoveTransition(0.5, enter_factory=ZoomInOut(0.01, 1.0))
zoomout = MoveTransition(0.5, leave_factory=ZoomInOut(1.0, 0.01))
zoominout = MoveTransition(0.5, enter_factory=ZoomInOut(0.01, 1.0), leave_factory=ZoomInOut(1.0, 0.01))
# These shake the screen up and down for a quarter second.
# The delay needs to be an integer multiple of the period.
@@ -156,3 +187,7 @@ init 1110 python:
if not hasattr(store, 'centered'):
centered = Character(None, what_style="centered_text", window_style="centered_window")
# This is necessary to ensure that config.default_transform works.
if config.default_transform:
config.default_transform._show()
+188
View File
@@ -0,0 +1,188 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This contains code to choose between OpenGL and Software rendering, when
# a system supports both.
init -1024:
screen _gl_test:
frame:
xalign .5
yalign .33
xpadding 20
ypadding 20
has vbox
label _(u"Graphics Acceleration")
null height 10
textbutton _(u"Automatically Choose"):
size_group "gl"
action SetField(persistent, "_gl_test", "auto")
textbutton _(u"Prefer Software Renderer"):
size_group "gl"
action SetField(persistent, "_gl_test", "sw")
textbutton _(u"Prefer OpenGL Renderer"):
size_group "gl"
action SetField(persistent, "_gl_test", "gl")
null height 10
textbutton _(u"Continue"):
size_group "gl"
action Return(True)
init -1024 python:
# The image that we fill the screen with in GL-test mode.
config.gl_test_image = "black"
class __GLTest(renpy.Displayable):
"""
This counts the number of times it's been rendered, and
the number of seconds it's been displayed, and uses them
to make the decisions as to if OpenGL is working or not.
"""
def __init__(self, frames, fps, timeout):
super(__GLTest, self).__init__()
self.target = 1.0 * frames / fps
self.frames = frames
self.timeout = timeout
self.times = [ ]
self.success = False
def render(self, width, height, st, at):
self.times.append(st)
renpy.redraw(self, 0)
renpy.renpy.log.info("Frame drawn at %f seconds." % st)
if len(self.times) >= self.frames:
frames_timing = self.times[-1] - self.times[-self.frames]
renpy.renpy.log.info("It took %f seconds to render %d frames.", frames_timing, self.frames)
if frames_timing <= self.target:
self.success = True
renpy.timeout(0)
rv = renpy.Render(width, height)
return rv
def event(self, ev, x, y, st):
if self.success:
return True
if st > self.timeout:
return False
renpy.timeout(self.timeout - st)
def __gl_prefer_renderers(renderers):
"""
Forces the current renderer to be renderer, one of gl or sw.
"""
if renpy.display.prefer_renderers == renderers:
return
renpy.display.prefer_renderers = renderers
renpy.display_reset()
def __gl_prompt():
"""
Decides if we want to prompt the user to enable OpenGL mode.
If so, shows a screen that allows the user to alter the
OpenGL setting.
"""
if not renpy.display.interface.safe_mode:
return
__gl_prefer_renderers("sw")
renpy.call_screen("_gl_test")
renpy.display.interface.safe_mode = False
def __gl_test():
"""
Makes the decision as to if we should use GL or SW mode.
"""
import os
if "RENPY_RENDERER" in os.environ:
return
# Our decision survives a restart.
if _restart:
return
renpy.renpy.log.info("GL test mode: %s", persistent._gl_test)
# If GL is disabled, don't bother.
if not config.gl_enable:
return
__gl_prompt()
if persistent._gl_test == "gl":
__gl_prefer_renderers("gl,sw")
return
if persistent._gl_test == "sw":
__gl_prefer_renderers("sw")
return
__gl_prefer_renderers("gl,sw")
ui.pausebehavior(0)
ui.interact(suppress_underlay=True, suppress_overlay=True)
# If GL is able to render FRAMES frames at FPS fps in less
# than DELAY seconds, we consider it to be operational, and
# continue in GL mode. Otherwise, we rever to software
# rendering mode.
FRAMES = 5
FPS = 15
DELAY = 1
renpy.transition(Dissolve(DELAY), always=True, force=True)
ui.add(__GLTest(FRAMES, FPS, DELAY))
result = ui.interact(suppress_overlay=True, suppress_underlay=True)
if result:
__gl_prefer_renderers("gl,sw")
else:
__gl_prefer_renderers("sw")
# Init-time code:
# Make a guess as to what modes we should be in.
if persistent._gl_test is None:
persistent._gl_test = "auto"
if persistent._gl_test == "sw":
renpy.display.prefer_renderers = "sw"
label _gl_test:
# Show the test image.
scene
show expression config.gl_test_image
$ __gl_test()
# Hide the test image.
scene
return
+107 -29
View File
@@ -1,7 +1,5 @@
# Copyright 2004-2007 PyTom
#
# Please see the LICENSE.txt distributed with Ren'Py for permission to
# copy and modify.
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init -1105 python:
@@ -16,17 +14,6 @@ init -1105 python:
layout.compat_funcs = [ ]
layout.provided = set()
# 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 ]
if narration:
renpy.say(None, "\n".join(narration), interact=False)
return renpy.display_menu(menuitems)
init -1105 python hide:
# Called to indicate that the given kind of layout has been
@@ -58,6 +45,21 @@ init -1105 python hide:
joystick_preferences=layout.classic_joystick_preferences,
)
if renpy.has_screen("main_menu"):
defaults["main_menu"] = layout.screen_main_menu
if renpy.has_screen("load") and renpy.has_screen("save"):
defaults["load_save"] = layout.screen_load_save
if renpy.has_screen("yesno_prompt"):
defaults["yesno_prompt"] = layout.screen_yesno_prompt
if renpy.has_screen("preferences"):
defaults["preferences"] = layout.screen_preferences
if renpy.has_screen("joystick_preferences"):
defaults["joystick_preferences"] = layout.screen_joystick_preferences
for k, v in defaults.iteritems():
if k not in layout.provided:
v()
@@ -198,7 +200,7 @@ init -1105 python hide:
@layout
def button_menu():
store.menu = _display_button_menu
config.narrator_menu = True
style.menu.box_spacing = 2
style.menu_window.set_parent(style.default)
@@ -288,13 +290,14 @@ init -1105 python hide:
@layout
def imagemap_main_menu(ground, selected, hotspots):
def imagemap_main_menu(ground, selected, hotspots, idle=None, variant=None):
renpy.load_module("_layout/imagemap_main_menu")
config.main_menu_ground = ground
config.main_menu_selected = selected
config.main_menu_hotspots = hotspots
config.main_menu_ground[variant] = ground
config.main_menu_selected[variant] = selected
config.main_menu_hotspots[variant] = hotspots
config.main_menu_idle[variant] = idle
@layout
def imagemap_navigation(ground, idle, hover, selected_idle, selected_hover,
hotspots):
@@ -322,7 +325,7 @@ init -1105 python hide:
config.preferences_hotspots = hotspots
@layout
def imagemap_yesno_prompt(ground, idle, hover, hotspots):
def imagemap_yesno_prompt(ground, idle, hover, hotspots, prompt_images={ }):
renpy.load_module("_layout/imagemap_yesno_prompt")
@@ -330,16 +333,91 @@ init -1105 python hide:
config.yesno_prompt_idle = idle
config.yesno_prompt_hover = hover
config.yesno_prompt_hotspots = hotspots
config.yesno_prompt_message_images = prompt_images
@layout
def imagemap_load_save(ground, idle, hover, selected_idle, selected_hover,
hotspots):
hotspots, variant=None):
renpy.load_module("_layout/imagemap_load_save")
config.load_save_ground = ground
config.load_save_idle = idle
config.load_save_hover = hover
config.load_save_selected_idle = selected_idle
config.load_save_selected_hover = selected_hover
config.load_save_hotspots = hotspots
config.load_save_ground[variant] = ground
config.load_save_idle[variant] = idle
config.load_save_hover[variant] = hover
config.load_save_selected_idle[variant] = selected_idle
config.load_save_selected_hover[variant] = selected_hover
config.load_save_hotspots[variant] = hotspots
@layout
def screen_main_menu():
renpy.load_module("_layout/screen_main_menu")
@layout
def screen_load_save():
renpy.load_module("_layout/screen_load_save")
@layout
def screen_preferences():
renpy.load_module("_layout/screen_preferences")
@layout
def screen_joystick_preferences():
renpy.load_module("_layout/screen_joystick_preferences")
@layout
def screen_yesno_prompt():
renpy.load_module("_layout/screen_yesno_prompt")
layout.ARE_YOU_SURE = u"Are you sure?"
layout.DELETE_SAVE = u"Are you sure you want to delete this save?"
layout.OVERWRITE_SAVE = u"Are you sure you want to overwrite your save?"
layout.LOADING = u"Loading will lose unsaved progress.\nAre you sure you want to do this?"
layout.QUIT = u"Are you sure you want to quit?"
layout.MAIN_MENU = u"Are you sure you want to return to the main menu?\nThis will lose unsaved progress."
@layout
def yesno_screen(message, yes=None, no=None):
"""
:doc: other
This causes the a yes/no prompt screen with the given message
to be displayed. The screen will be hidden when the user hits
yes or no.
`message`
The message that will be displayed.
`yes`
An action that is run when the user chooses yes.
`no`
An action that is run when the user chooses no.
"""
if renpy.has_screen("yesno_prompt"):
yes_action = [ Hide("yesno_prompt") ]
no_action = [ Hide("yesno_prompt") ]
if yes is not None:
yes_action.append(yes)
if no is not None:
no_action.append(no)
renpy.show_screen(
"yesno_prompt",
message=message,
yes_action=yes_action,
no_action=no_action)
renpy.restart_interaction()
return
if renpy.invoke_in_new_context(layout.yesno_prompt, None, message):
if yes is not None:
yes()
else:
if no is not None:
no()
+312 -109
View File
@@ -1,7 +1,5 @@
# Copyright 2004-2007 PyTom
#
# Please see the LICENSE.txt distributed with Ren'Py for permission to
# copy and modify.
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This file consists of renpy functions that aren't expected to be
# touched by the user too much. We reserve the _ prefix for names
@@ -49,6 +47,31 @@ init -1180 python:
# preference when the game is first run.
config.default_text_cps = None
# If not None, the default value of afm_time
config.default_afm_time = None
# If not None, the default value of afm_enable
config.default_afm_enable = None
# Should we automatically define images?
config.automatic_images = None
# Prefixes to strip from automatic images.
config.automatic_images_strip = [ ]
# A save to automatically load, if it exists.
config.auto_load = None
# Layers to clear when entering the menus.
config.menu_clear_layers = [ ]
# Should we start the game with scene black or just scene?
config.start_scene_black = False
# Voice and Sound samples.
config.sample_sound = None
config.sample_voice = None
# This is updated to give the user an idea of where a save is
# taking place.
save_name = ''
@@ -69,6 +92,24 @@ init -1180 python:
config.with_callback = _default_with_callback
def _default_empty_window():
who = _last_say_who
if who is not None:
who = eval(who)
if who is None:
who = narrator
if isinstance(who, NVLCharacter):
nvl_show_core()
else:
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
@@ -80,7 +121,6 @@ init -1180 python:
_intra_jumps = renpy.curry(_intra_jumps_core)
# The function that's used to translate strings in the game menu.
def _(s):
"""
@@ -95,11 +135,33 @@ init -1180 python:
return s
config.extend_interjection = "{fast}"
def extend(what, interact=True):
who = _last_say_who
if who is not None:
who = eval(who)
if who is None:
who = narrator
if isinstance(who, basestring):
who = unknown.copy(who)
# This ensures extend works even with NVL mode.
who.do_extend()
what = _last_say_what + config.extend_interjection + what
renpy.exports.say(who, what, interact=interact)
store._last_say_what = what
extend.record_say = False
# Are the windows currently hidden?
_windows_hidden = False
init -1180 python:
def toggle_skipping():
if not config.skipping:
@@ -114,47 +176,90 @@ init -1180 python:
config.help = None
def _help():
if not config.help:
def _help(help=None):
if help is None:
help = config.help
if help is None:
return
if renpy.has_label(config.help):
renpy.call_in_new_context(config.help)
if renpy.has_label(help):
renpy.call_in_new_context(help)
return
_preferences.fullscreen = False
import webbrowser
webbrowser.open_new("file:///" + config.basedir + "/" + config.help)
init -1180 python hide:
try:
import webbrowser
webbrowser.open_new("file:///" + config.basedir + "/" + help)
except:
pass
# Called to make a screenshot happen.
def screenshot():
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()
if config.screenshot_callback is not None:
config.screenshot_callback(fn)
def _screenshot_callback(fn):
renpy.notify(_("Saved screenshot as %s.") % fn)
config.screenshot_callback = _screenshot_callback
_predict_screens = [ ]
init -1180 python hide:
def dump_styles():
if config.developer:
renpy.style.write_text("styles.txt")
# This is run when entering the game menu.
config.game_menu_action = None
def invoke_game_menu():
if renpy.context()._menu:
renpy.jump("_noisy_return")
if renpy.context()._main_menu:
return
else:
renpy.jump("_noisy_return")
else:
renpy.call_in_new_context('_game_menu')
if config.game_menu_action:
renpy.display.behavior.run(config.game_menu_action)
else:
renpy.call_in_new_context('_game_menu')
def keymap_toggle_skipping():
if renpy.context()._menu:
@@ -182,10 +287,11 @@ 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,
screenshot = _screenshot,
toggle_fullscreen = renpy.toggle_fullscreen,
toggle_music = renpy.toggle_music,
toggle_skip = keymap_toggle_skipping,
@@ -244,32 +350,42 @@ init -1180 python hide:
config.hyperlink_styler = hyperlink_styler
config.hyperlink_callback = hyperlink_function
# Prediction of screens.
def predict():
for s in _predict_screens:
if renpy.has_screen(s):
renpy.predict_screen(s)
s = _game_menu_screen
if s is None:
return
if renpy.has_screen(s):
renpy.predict_screen(s)
return
if s.endswith("_screen"):
s = s[:-7]
if renpy.has_screen(s):
renpy.predict_screen(s)
return
config.predict_callbacks.append(predict)
def imagemap_auto_function(auto_param, variant):
rv = auto_param % variant
if renpy.loadable(rv):
return rv
else:
return None
config.extend_interjection = "{fast}"
init -1180 python:
def extend(what, interact=True):
who = _last_say_who
if who is not None:
who = eval(who)
if who is None:
who = narrator
if isinstance(who, basestring):
who = unknown.copy(who)
# This ensures extend works even with NVL mode.
who.do_extend()
what = _last_say_what + config.extend_interjection + what
renpy.exports.say(who, what, interact=interact)
store._last_say_what = what
extend.record_say = False
config.imagemap_auto_function = imagemap_auto_function
label _hide_windows:
@@ -283,45 +399,26 @@ 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:
renpy.take_screenshot((config.thumbnail_width, config.thumbnail_height))
renpy.music.stop()
ui.add(Solid((0, 0, 0, 255)))
ui.text("Saving game...",
size=32, xalign=0.5, yalign=0.5, color=(255, 255, 255, 255))
renpy.pause(0)
renpy.save("reload", "reload save game")
persistent._reload_save = "reload"
renpy.save("_reload-1", "reload save game")
ui.add(Solid((0, 0, 0, 255)))
ui.text("Reloading script...",
@@ -332,13 +429,12 @@ label _save_reload_game:
renpy.utter_restart()
label _load_reload_game:
if not persistent._reload_save:
return
if not renpy.can_load("_reload-1"):
return
python hide:
save = persistent._reload_save
persistent._reload_save = 0
renpy.rename_save("_reload-1", "_reload-2")
ui.add(Solid((0, 0, 0, 255)))
ui.text("Reloading game...",
@@ -347,7 +443,7 @@ label _load_reload_game:
ui.pausebehavior(0)
ui.interact(suppress_underlay=True, suppress_overlay=True)
renpy.load(save)
renpy.load("_reload-2")
return
@@ -370,6 +466,17 @@ init 1180 python:
if config.default_text_cps is not None:
_preferences.text_cps = config.default_text_cps
if config.default_afm_time is not None:
_preferences.afm_time = config.default_afm_time
if config.default_afm_enable is not None:
_preferences.afm_enable = config.default_afm_enable
_preferences.using_afm_enable = True
else:
_preferences.afm_enable = True
_preferences.using_afm_enable = False
if config.developer:
def _inspector(l):
@@ -381,7 +488,6 @@ init 1180 python:
ui.text("Style Inspector")
ui.text("")
if not l:
ui.text("Nothing to inspect.")
@@ -508,18 +614,23 @@ 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))
for i in config.menu_clear_layers:
renpy.scene(layer=i)
renpy.context()._menu = True
# This may be changed, if we are already in the main menu.
renpy.context().main_menu = False
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
@@ -552,9 +663,14 @@ label _game_menu(_game_menu_screen=_game_menu_screen):
$ renpy.play(config.enter_sound)
call _enter_game_menu from _call__enter_game_menu_0
if renpy.has_label("game_menu"):
jump expression "game_menu"
if renpy.has_screen(_game_menu_screen):
$ renpy.show_screen(_game_menu_screen)
$ ui.interact()
jump _noisy_return
jump expression _game_menu_screen
@@ -596,16 +712,15 @@ label _noisy_return:
# Return to the game.
label _return:
if renpy.context().main_menu:
if renpy.context()._main_menu:
$ renpy.transition(config.game_main_transition)
jump _main_menu
jump _main_menu_screen
$ renpy.transition(config.exit_transition)
return
label _confirm_quit:
call _enter_menu from _call__enter_menu_3
if renpy.has_label("confirm_quit"):
jump expression "confirm_quit"
@@ -631,6 +746,7 @@ init -1180 python hide:
# after_load.
label _after_load:
$ renpy.context()._menu = False
$ renpy.context()._main_menu = False
if config.after_load_transition:
$ renpy.transition(config.after_load_transition, force=True)
@@ -647,15 +763,25 @@ label _start:
python hide:
renpy.context()._menu = False
renpy.context()._main_menu = False
for i in config.start_callbacks:
i()
call _check_module from _call__check_module_1
$ renpy.block_rollback()
call _gl_test
call _load_reload_game from _call__load_reload_game_1
scene black
if not _restart and config.auto_load and renpy.can_load(config.auto_load):
$ renpy.load(config.auto_load)
if config.start_scene_black:
scene black
else:
scene
if not _restart:
$ ui.pausebehavior(0)
$ ui.interact(suppress_underlay=True, suppress_overlay=True)
@@ -663,7 +789,9 @@ label _start:
$ renpy.block_rollback()
$ _old_game_menu_screen = _game_menu_screen
$ _old_predict_screens = _predict_screens
$ _game_menu_screen = None
$ _predict_screens = [ 'main_menu' ]
if renpy.has_label("splashscreen") and not _restart:
call expression "splashscreen" from _call_splashscreen_1
@@ -673,36 +801,43 @@ 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:
$ renpy.music.stop()
# Clean out any residual scene from the splashscreen.
scene black
if _restart is None:
$ renpy.transition(config.end_splash_transition)
if config.start_scene_black:
scene black
else:
$ renpy.transition(_restart[0])
jump expression _restart[1]
scene
# This has to be python, to deal with a case where _restart may
# change across a shift-reload.
python:
if _restart is None:
renpy.transition(config.end_splash_transition)
else:
renpy.transition(_restart[0])
renpy.jump(_restart[1])
label _invoke_main_menu:
$ renpy.call_in_new_context("_enter_main_menu")
# Again, this has to be python.
python:
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
@@ -710,11 +845,13 @@ label _enter_main_menu:
renpy.dynamic("_load_prompt")
_load_prompt = False
renpy.context().main_menu = True
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.)
@@ -722,11 +859,77 @@ label _main_menu:
jump expression "main_menu"
# New name.
if renpy.has_label("main_menu_screen"):
elif renpy.has_label("main_menu_screen"):
jump expression "main_menu_screen"
# Compatibility name.
if renpy.has_label("_library_main_menu"):
elif renpy.has_label("_library_main_menu"):
jump expression "_library_main_menu"
return
init 1180 python hide:
def create_automatic_images():
seps = config.automatic_images
if seps is True:
seps = [ ' ', '/', '_' ]
for dir, fn in renpy.loader.listdirfiles():
if fn.startswith("_"):
continue
# Only .png and .jpg
if not fn.lower().endswith(".png") and not fn.lower().endswith(".jpg"):
continue
# Strip the extension, replace slashes.
shortfn = fn[:-4].replace("\\", "/")
# Determine the name.
name = ( shortfn, )
for sep in seps:
name = tuple(j for i in name for j in i.split(sep))
# Strip name components.
while name:
for i in config.automatic_images_strip:
if name[0] == i:
name = name[1:]
break
else:
break
# Only names of 2 components or more.
if len(name) < 2:
continue
# Reject if it already exists.
if name in renpy.exports.images:
continue
renpy.image(name, fn)
if config.automatic_images:
create_automatic_images()
# Load the developer screen, if necessary.
init 1180 python hide:
if config.developer:
renpy.load_module("_developer")
# Entry point for the developer screen. The rest of it is loaded from
# _developer.rpym
label _developer:
if not config.developer:
return
call _enter_menu from _call__enter_menu_4
jump expression "_developer_screen"
+8 -6
View File
@@ -1,7 +1,5 @@
# Copyright 2008 PyTom
#
# Please see the LICENSE.txt distributed with Ren'Py for permission to
# copy and modify.
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# Common stuff that's used by the various Ren'Py menus. This includes
# the default definitions of config.main_menu and config.game_menu, as
@@ -29,13 +27,17 @@ init -1150 python:
]
label _quit_prompt:
if layout.yesno_prompt(None, u"Are you sure you want to quit?"):
$ renpy.loadsave.force_autosave()
if layout.yesno_prompt(None, layout.QUIT):
jump _quit
else:
return
label _main_menu_prompt:
if layout.yesno_prompt(None, u"Are you sure you want to return to the main menu?\nThis will lose unsaved progress."):
$ renpy.loadsave.force_autosave()
if layout.yesno_prompt(None, layout.MAIN_MENU):
$ renpy.full_restart(transition=config.game_main_transition)
else:
return
+20 -5
View File
@@ -1,17 +1,32 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This file contains code that sets up the various mixers, based on how
# the user sets config.has_music, .has_sound, and .has_voice.
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, buffer_queue=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:
+117 -28
View File
@@ -1,3 +1,6 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This is an implementation of NVL-mode, which can be used to show
# dialogue in a fullscreen way, like NVL-style games. Multiple lines
# of dialogue are shown on the screen at once, whenever a line of
@@ -76,9 +79,57 @@ init -1100 python:
return s[nvl_variant]
else:
return s
def nvl_show_core():
def __nvl_screen_dialogue():
"""
Returns widget_properties and dialogue for the current NVL
mode screen.
"""
widget_properties = { }
dialogue = [ ]
for i, entry in enumerate(nvl_list):
if not entry:
continue
who, what, kwargs = entry
if i == len(nvl_list) - 1:
who_id = "who"
what_id = "what"
window_id = "window"
else:
who_id = "who%d" % i
what_id = "what%d" % i
window_id = "window%d" % i
widget_properties[who_id] = kwargs["who_args"]
widget_properties[what_id] = kwargs["what_args"]
widget_properties[window_id] = kwargs["window_args"]
dialogue.append((who, what, who_id, what_id, window_id))
return widget_properties, dialogue
def __nvl_show_screen(screen_name, **scope):
"""
Shows an nvl-mode screen. Returns the "what" widget.
"""
widget_properties, dialogue = __nvl_screen_dialogue()
renpy.show_screen(screen_name, _transient=True, _widget_properties=widget_properties, dialogue=dialogue, **scope)
renpy.shown_window()
return renpy.get_widget(screen_name, "what")
def nvl_show_core(who=None, what=None):
# Screen version.
if renpy.has_screen("nvl"):
return __nvl_show_screen("nvl", items=[ ])
if renpy.in_rollback():
nvl_window = __s(style.nvl_window)['rollback']
nvl_vbox = __s(style.nvl_vbox)['rollback']
@@ -99,8 +150,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_)
@@ -185,16 +242,19 @@ init -1100 python:
else:
checkpoint = True
renpy.display_say(nvl_show_core,
checkpoint=checkpoint,
**display_args)
renpy.display_say(
who,
what,
nvl_show_core,
checkpoint=checkpoint,
**display_args)
def do_done(self, who, what):
if self.clear:
nvl_clear()
def do_extend(self):
renpy.mode(self.mode)
store.nvl_list = store.nvl_list[:-1]
# The default NVLCharacter.
@@ -204,21 +264,54 @@ init -1100 python:
what_style='nvl_dialogue',
window_style='nvl_entry',
type='nvl',
mode='nvl',
clear=False,
kind=adv)
def nvl_clear():
store.nvl_list = [ ]
# Run clear at the start of the game.
config.start_callbacks.append(nvl_clear)
def nvl_menu(items):
renpy.mode('nvl_menu')
if nvl_list is None:
store.nvl_list = [ ]
screen = None
if renpy.has_screen("nvl_choice"):
screen = "nvl_choice"
elif renpy.has_screen("nvl"):
screen = "nvl"
if screen is not None:
widget_properties, dialogue = __nvl_screen_dialogue()
return renpy.display_menu(
items,
widget_properties=widget_properties,
screen=screen,
scope={ "dialogue" : dialogue },
window_style=__s(style.nvl_menu_window),
choice_style=__s(style.nvl_menu_choice),
choice_chosen_style=__s(style.nvl_menu_choice_chosen),
choice_button_style=__s(style.nvl_menu_choice_button),
choice_chosen_button_style=__s(style.nvl_menu_choice_chosen_button),
type="nvl",
)
# Traditional version.
ui.layer("transient")
ui.clear()
ui.close()
ui.window(style=__s(style.nvl_window))
ui.vbox(style=__s(style.nvl_vbox))
@@ -246,32 +339,28 @@ init -1100 python:
return rv
NVLSpeaker = NVLCharacter
config.nvl_adv_transition = None
config.adv_nvl_transition = None
init 1140 python:
if config.nvl_adv_transition or config.adv_nvl_transition:
# This is used to execute the nvl and adv mode transitions.
def _nvl_adv_callback(mode, old_modes):
def _nvl_adv_callback(event, interact, type, **kwargs):
if event != "begin" or not interact or renpy.get_transition():
return
old_type = renpy.last_interact_type()
if old_type == "say" and type == "nvl":
# We have an extra line in the nvl_list as we do this. So
# take it out for the duration of the nvl_show.
old_nvl_list = store.nvl_list
store.nvl_list = old_nvl_list[:-1]
nvl_show(config.adv_nvl_transition)
store.nvl_list = old_nvl_list
elif old_type == "nvl" and type == "say":
nvl_hide(config.nvl_adv_transition)
config.all_character_callbacks.insert(0, _nvl_adv_callback)
old = old_modes[0]
if config.adv_nvl_transition:
if mode == "nvl" or mode == "nvl_menu":
if old == "say" or old == "menu":
nvl_show(config.adv_nvl_transition)
if config.nvl_adv_transition:
if mode == "say" or mode == "menu":
if old == "nvl" or old == "nvl_menu":
nvl_hide(config.nvl_adv_transition)
config.mode_callbacks.append(_nvl_adv_callback)
python early hide:
+1497
View File
File diff suppressed because it is too large Load Diff
+8 -4
View File
@@ -63,15 +63,19 @@ init -1080 python:
def init_values(self, sizes):
def to_abs_(value, size):
if isinstance(value, float):
if type(value) == float:
return value * size
else:
return value
def coord_(c):
if len(c) == 2:
c = c + (0, 0)
return ( to_abs_(c[0], sizes[0]) - to_abs_(c[2], sizes[2]),
to_abs_(c[1], sizes[1]) - to_abs_(c[3], sizes[3]) )
for p in self.points:
for i in range(1, len(p)):
p[i] = coord_(p[i])
@@ -122,8 +126,8 @@ init -1080 python:
t3 = t**3
result = [ t_ppp * start[i] + t_pp * self.points[segment][2][i] + t_p * self.points[segment][3][i] + t3 * end[i] for i in 0,1 ]
return ( int(result[0]), int(result[1]), 0, 0 )
return ( absolute(result[0]), absolute(result[1]), 0, 0 )
def SplineMotion(points, time, child=None, anchors=(0.5, 0.5), repeat=False, bounce=False, anim_timebase=False, style='default', time_warp=None, **properties):
return Motion(_SplineInterpolator(points, anchors), time, child, repeat=repeat, bounce=bounce, anim_timebase=anim_timebase, style=style, time_warp=time_warp, add_sizes=True, **properties)
+321 -26
View File
@@ -1,3 +1,6 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This file contains code that creates a few new statements. We'll
# also describe here the API for defining your own statements.
#
@@ -67,6 +70,8 @@ python early hide:
fadeout = "None"
fadein = "0"
channel = None
loop = None
if_changed = False
while True:
@@ -93,42 +98,63 @@ python early hide:
renpy.error('expected simple expression')
continue
if l.keyword('loop'):
loop = True
continue
if l.keyword('noloop'):
loop = False
continue
if l.keyword('if_changed'):
if_changed = True
continue
renpy.error('could not parse statement.')
return dict(file=file,
fadeout=fadeout,
fadein=fadein,
channel=channel)
channel=channel,
loop=loop,
if_changed=if_changed)
def execute_play_music(p):
if p["channel"] is not None:
channel = eval(p["channel"])
else:
channel = 7
channel = "music"
renpy.music.play(eval(p["file"]),
fadeout=eval(p["fadeout"]),
fadein=eval(p["fadein"]),
channel=channel)
channel=channel,
loop=p.get("loop", None),
if_changed=p.get("if_changed", False))
def predict_play_music(p):
return [ ]
def lint_play_music(p):
def lint_play_music(p, channel="music"):
file = _try_eval(p["file"], 'filename')
if p["channel"] is not None:
_try_eval(p["channel"], 'channel')
if p["channel"] is not None:
channel = _try_eval(p["channel"], 'channel')
if not isinstance(file, list):
file = [ file ]
for fn in file:
if isinstance(fn, basestring) and not renpy.loadable(fn):
renpy.error("%r is not loadable" % fn)
if isinstance(fn, basestring):
try:
if not renpy.music.playable(fn, channel):
renpy.error("%r is not loadable" % fn)
except:
pass
renpy.statements.register('play music',
parse=parse_play_music,
execute=execute_play_music,
@@ -145,24 +171,37 @@ python early hide:
renpy.error("queue requires a file")
channel = None
if l.keyword('channel'):
channel = l.simple_expression()
if channel is None:
renpy.error('expected simple expression')
loop = None
while not l.eol():
if l.keyword('channel'):
channel = l.simple_expression()
if channel is None:
renpy.error('expected simple expression')
if not l.eol():
renpy.error("expected end of line")
if l.keyword('loop'):
loop = True
continue
if l.keyword('noloop'):
loop = False
continue
return dict(file=file, channel=channel)
renpy.error('expected end of line')
return dict(file=file, channel=channel, loop=loop)
def execute_queue_music(p):
if p["channel"] is not None:
channel = eval(p["channel"])
else:
channel = 7
channel = "music"
renpy.music.queue(eval(p["file"]), channel=channel)
renpy.music.queue(
eval(p["file"]),
channel=channel,
loop=p.get("loop", None))
renpy.statements.register('queue music',
@@ -195,7 +234,7 @@ python early hide:
if p["channel"] is not None:
channel = eval(p["channel"])
else:
channel = 7
channel = "music"
renpy.music.stop(fadeout=eval(p["fadeout"]), channel=channel)
@@ -212,7 +251,7 @@ python early hide:
if p["channel"] is not None:
channel = eval(p["channel"])
else:
channel = 0
channel = "sound"
fadeout = eval(p["fadeout"]) or 0
@@ -220,17 +259,20 @@ python early hide:
fadeout=fadeout,
fadein=eval(p["fadein"]),
channel=channel)
def lint_play_sound(p, lint_play_music=lint_play_music):
return lint_play_music(p, channel="sound")
renpy.statements.register('play sound',
parse=parse_play_music,
execute=execute_play_sound,
lint=lint_play_music)
lint=lint_play_sound)
def execute_queue_sound(p):
if p["channel"] is not None:
channel = eval(p["channel"])
else:
channel = 0
channel = "sound"
renpy.sound.queue(eval(p["file"]), channel=channel)
@@ -244,7 +286,7 @@ python early hide:
if p["channel"] is not None:
channel = eval(p["channel"])
else:
channel = 0
channel = "sound"
fadeout = eval(p["fadeout"]) or 0
@@ -254,13 +296,266 @@ 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, channel)
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)
##########################################################################
# "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)
##########################################################################
# Pause statement.
def parse_pause(l):
delay = l.simple_expression()
if not l.eol():
renpy.error("expected end of line.")
return { "delay" : delay }
def lint_pause(p):
if p["delay"]:
_try_eval(p["delay"], 'pause statement')
def execute_pause(p):
if p["delay"]:
delay = eval(p["delay"])
renpy.with_statement(Pause(delay))
else:
renpy.pause()
renpy.statements.register('pause',
parse=parse_pause,
lint=lint_pause,
execute=execute_pause)
init -1200 python:
config.window_show_transition = None
config.window_hide_transition = None
def _try_eval(e, what):
try:
return eval(e)
except:
renpy.error('unable to evaluate %s %r' % (what, e))
##############################################################################
# Screen-related statements.
python early hide:
def parse_show_call_screen(l):
# Parse a name.
name = l.require(l.name)
# Parse a parameter list. (name -> expression string)
parameters = { }
if l.match(r"\("):
while True:
pname = l.name()
if not pname:
break
l.require(r"=")
expr = l.delimited_python(",)")
if not expr:
l.error("expected expression.")
parameters[pname] = expr
if not l.match(r','):
break
l.require(r'\)')
l.expect_eol()
return dict(name=name, parameters=parameters)
def parse_hide_screen(l):
name = l.require(l.name)
l.expect_eol()
return dict(name=name)
def predict_screen(p):
if not p["parameters"]:
renpy.predict_screen(p["name"])
def execute_show_screen(p):
name = p["name"]
parameters = p["parameters"]
kwargs = { }
for k, v in parameters.iteritems():
kwargs[k] = eval(v)
renpy.show_screen(name, **kwargs)
def execute_call_screen(p):
name = p["name"]
parameters = p["parameters"]
kwargs = { }
for k, v in parameters.iteritems():
kwargs[str(k)] = eval(v)
store._return = renpy.call_screen(name, **kwargs)
def execute_hide_screen(p):
name = p["name"]
renpy.hide_screen(name)
def lint_screen(p):
name = p["name"]
if not renpy.has_screen(name):
renpy.error("Screen %s does not exist." % name)
renpy.statements.register("show screen",
parse=parse_show_call_screen,
execute=execute_show_screen,
predict=predict_screen,
lint=lint_screen)
renpy.statements.register("call screen",
parse=parse_show_call_screen,
execute=execute_call_screen,
predict=predict_screen,
lint=lint_screen)
renpy.statements.register("hide screen",
parse=parse_hide_screen,
execute=execute_hide_screen)
+33 -18
View File
@@ -1,7 +1,5 @@
# Copyright 2004-2008 PyTom
#
# Please see the LICENSE.txt distributed with Ren'Py for permission to
# copy and modify.
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This file is responsible for creating and defining the default styles
# used by the system.
@@ -24,15 +22,20 @@ init -1200 python hide:
# Style Declarations #################################################
style.default = Style(None, help='root of style hierarchy')
style.text = Style(style.default, help='style of text')
style.fixed = Style(style.default, help='fixed layouts')
style.hbox = Style(style.default, help='horizontal boxes')
style.vbox = Style(style.default, help='vertical boxes')
style.grid = Style(style.default, help='grid layouts')
style.side = Style(style.default, help='side layouts')
style.window = Style(style.default, help='windows created with ui.window')
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.')
@@ -51,7 +54,8 @@ init -1200 python hide:
style.menu_choice_chosen_button = Style(style.menu_choice_button, help='buttons containing chosen in-game menu choices')
style.menu_window = Style(style.window, help='a window containing a menu')
style.input_text = Style(style.default, help='text of an input box')
style.input = Style(style.default, help='style of an input control')
style.input_text = Style(style.input, help='text of an input box')
style.input_prompt = Style(style.default, help='prompt of an input box')
style.input_window = Style(style.window, help='window of an input box')
@@ -59,8 +63,10 @@ init -1200 python hide:
style.centered_text = Style(style.default, help='centered text')
style.imagemap = Style(style.image_placement, help='default style of imagemaps')
style.imagemap_button = Style(style.default, help='default style of buttons inside imagemaps')
style.hotspot = Style(style.default, help='default style of hotspots inside imagemaps')
style.hotbar = Style(style.default, help='default style of hotbars inside imagemaps')
style.imagemap_button = style.hotspot
style.image_button = Style(style.default, help='default style of image buttons')
style.image_button_image = Style(style.default, help='default style of images inside image buttons')
@@ -68,6 +74,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)
@@ -76,6 +83,8 @@ init -1200 python hide:
style.list_spacer = Style(style.default)
style.list_text = Style(style.default)
style.tile = Style(style.default, help='default style of tile')
# The base styles that can be customized by themes.
style.frame = Style(style.default, help='base style for frames.')
@@ -166,7 +175,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 +207,12 @@ 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
style.motion.xpos = 0
style.motion.ypos = 0
# Windows.
style.window.background = Solid((0, 0, 0, 192))
style.window.xpadding = 6
@@ -206,16 +222,9 @@ init -1090 python:
style.window.xfill = True
style.window.yfill = False
style.window.yminimum = 150 # Includes margins and padding.
style.window.xalign = 0.5
style.window.yalign = 1.0
# Image placement.
style.image_placement.xpos = 0.5
style.image_placement.ypos = 1.0
style.image_placement.xanchor = 0.5
style.image_placement.yanchor = 1.0
# Dialogue
style.say_label.bold = True
style.say_vbox.spacing = 8
@@ -231,7 +240,7 @@ init -1090 python:
# Menus.
style.menu_choice.idle_color = "#0ff"
style.menu_choice.hover_color = "#ff0"
style.input_text.color = "#ff0"
style.input.color = "#ff0"
# Styles used by centered.
style.centered_window.xalign = 0.5
@@ -263,6 +272,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
@@ -285,7 +297,10 @@ init -1090 python:
style.list_text.color = "#000"
style.list_text.size = 14
style.list_spacer.xminimum = 15
# Tile
style.tile.clipping = True
######################################################################
+310 -285
View File
@@ -1,7 +1,5 @@
# Copyright 2004-2008 PyTom
#
# Please see the LICENSE.txt distributed with Ren'Py for permission to
# copy and modify.
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init -1110 python:
@@ -73,9 +71,7 @@ init -1110 python hide:
style.vscrollbar.bar_vertical = True
style.vscrollbar.bar_invert = True
# This recolors the given image using one or two colors.
@theme
def OneOrTwoColor(image, color):
@@ -84,300 +80,329 @@ init -1110 python hide:
else:
return im.Twocolor(image, color, color)
@theme
def roundrect_frames(
less_rounded,
frame):
def roundrect_based_theme(name, file_prefix, Box=None, frame_png=None):
theme.clear_frames()
style.frame.background = RoundRect(frame, less_rounded)
if Box is None:
def Box(color, ignored):
return Frame(theme.OneOrTwoColor(file_prefix + "_box.png", color), 12, 12)
style.frame.xpadding = 6
style.frame.ypadding = 6
@theme
def roundrect_buttons(text_size,
less_rounded,
widget,
widget_hover,
widget_text,
widget_selected,
disabled,
disabled_text):
theme.clear_buttons()
style.button.background = RoundRect(widget, less_rounded)
style.button.hover_background = RoundRect(widget_hover, less_rounded)
style.button.insensitive_background = RoundRect(disabled, less_rounded)
style.button_text.size = text_size
style.button_text.color = widget_text
style.button_text.selected_color = widget_selected
style.button_text.insensitive_color = disabled_text
if less_rounded:
style.button.xpadding = 6
if frame_png is not None:
def FrameBox(color, ignored):
return Frame(theme.OneOrTwoColor(file_prefix + frame_png, color), 12, 12)
else:
style.button.xpadding = 12
style.button.ypadding = 1
style.button.xmargin = 1
style.button.ymargin = 1
style.button_text.xalign = 0.5
style.button_text.yalign = 0.5
style.button_text.text_align = 0.5
@theme
def roundrect_large_buttons(
text_size,
less_rounded,
widget,
widget_hover,
widget_text,
widget_selected,
disabled,
disabled_text):
theme.clear_large_buttons()
if less_rounded:
style.large_button.xpadding = 6
else:
style.large_button.xpadding = 12
style.large_button.ypadding = 1
style.large_button.xmargin = 1
style.large_button.ymargin = 1
style.large_button.background = RoundRect(widget, less_rounded)
style.large_button.hover_background = RoundRect(widget_hover, less_rounded)
style.large_button.insensitive_background = RoundRect(disabled, less_rounded)
style.large_button_text.size = text_size
style.large_button_text.color = widget_text
style.large_button_text.selected_color = widget_selected
style.large_button_text.insensitive_color = disabled_text
style.large_button_text.xalign = 0
style.large_button_text.yalign = 0
@theme
def roundrect_labels(
text_size,
label):
theme.clear_labels()
style.label_text.size = text_size
style.label_text.color = label
@theme
def roundrect_prompts(
text_size,
label):
theme.clear_prompts()
style.prompt_text.size = text_size
style.prompt_text.color = label
style.prompt.xalign = 0.5
style.prompt_text.text_align = 0.5
style.prompt_text.layout = "subtitle"
@theme
def roundrect_bars(
widget,
widget_hover):
theme.clear_bars()
def img(name, color, x, y):
rv = theme.OneOrTwoColor("_roundrect/" + name + ".png", color)
if x is not None:
rv = Frame(rv, x, y)
return rv
# Bars.
style.bar.ymaximum = 24
style.bar.left_gutter = 6
style.bar.right_gutter = 6
style.bar.thumb_offset = 6
style.bar.left_bar = img("rrslider_full", widget, 12, 0)
style.bar.right_bar = img("rrslider_empty", widget, 12, 0)
style.bar.thumb = img("rrslider_thumb", widget, None, None)
style.bar.hover_left_bar = img("rrslider_full", widget_hover, 12, 0)
style.bar.hover_right_bar = img("rrslider_empty", widget_hover, 12, 0)
style.bar.hover_thumb = img("rrslider_thumb", widget_hover, None, None)
style.vbar.xmaximum = 24
style.vbar.top_gutter = 6
style.vbar.bottom_gutter = 6
style.vbar.thumb_offset = 6
style.vbar.bottom_bar = img("rrvslider_full", widget, 0, 12)
style.vbar.top_bar = img("rrvslider_empty", widget, 0, 12)
style.vbar.thumb = img("rrvslider_thumb", widget, None, None)
style.vbar.hover_bottom_bar = img("rrvslider_full", widget_hover, 0, 12)
style.vbar.hover_top_bar = img("rrvslider_empty", widget_hover, 0, 12)
style.vbar.hover_thumb = img("rrvslider_thumb", widget_hover, None, None)
# Sliders.
style.slider.ymaximum = 24
style.slider.left_gutter = 6
style.slider.right_gutter = 6
style.slider.thumb_offset = 6
style.slider.left_bar = img("rrslider_full", widget, 12, 0)
style.slider.right_bar = img("rrslider_empty", widget, 12, 0)
style.slider.thumb = img("rrslider_thumb", widget, None, None)
style.slider.hover_left_bar = img("rrslider_full", widget_hover, 12, 0)
style.slider.hover_right_bar = img("rrslider_empty", widget_hover, 12, 0)
style.slider.hover_thumb = img("rrslider_thumb", widget_hover, None, None)
style.vslider.xmaximum = 24
style.vslider.top_gutter = 6
style.vslider.bottom_gutter = 6
style.vslider.thumb_offset = 6
style.vslider.bottom_bar = img("rrvslider_full", widget, 0, 12)
style.vslider.top_bar = img("rrvslider_empty", widget, 0, 12)
style.vslider.thumb = img("rrvslider_thumb", widget, None, None)
style.vslider.hover_bottom_bar = img("rrvslider_full", widget_hover, 0, 12)
style.vslider.hover_top_bar = img("rrvslider_empty", widget_hover, 0, 12)
style.vslider.hover_thumb = img("rrvslider_thumb", widget_hover, None, None)
# Scrollbars.
style.scrollbar.left_gutter = 6
style.scrollbar.right_gutter = 6
style.scrollbar.thumb_offset = 6
style.scrollbar.ymaximum = 12
style.scrollbar.left_bar = img("rrscrollbar", widget, 12, 0)
style.scrollbar.right_bar = img("rrscrollbar", widget, 12, 0)
style.scrollbar.thumb = img("rrscrollbar_thumb", widget, None, None)
style.scrollbar.hover_left_bar = img("rrscrollbar", widget_hover, 12, 0)
style.scrollbar.hover_right_bar = img("rrscrollbar", widget_hover, 12, 0)
style.scrollbar.hover_thumb = img("rrscrollbar_thumb", widget_hover, None, None)
style.vscrollbar.top_gutter = 6
style.vscrollbar.bottom_gutter = 6
style.vscrollbar.thumb_offset = 6
style.vscrollbar.xmaximum = 12
style.vscrollbar.left_bar = img("rrvscrollbar", widget, 0, 12)
style.vscrollbar.right_bar = img("rrvscrollbar", widget, 0, 12)
style.vscrollbar.thumb = img("rrvscrollbar_thumb", widget, None, None)
style.vscrollbar.hover_left_bar = img("rrvscrollbar", widget_hover, 0, 12)
style.vscrollbar.hover_right_bar = img("rrvscrollbar", widget_hover, 0, 12)
style.vscrollbar.hover_thumb = img("rrvscrollbar_thumb", widget_hover, None, None)
@theme
def roundrect(
widget = (0, 60, 120, 255),
widget_hover = (0, 80, 160, 255),
widget_text = (200, 225, 255, 255),
widget_selected = (255, 255, 200, 255),
disabled = (64, 64, 64, 255),
disabled_text = (200, 200, 200, 255),
label = (255, 255, 255, 255),
frame = (100, 150, 200, 255),
window = (0, 0, 0, 192),
mm_root = Solid((220, 235, 255, 255)),
gm_root = Solid((220, 235, 255, 255)),
text_size=None,
small_text_size=None,
less_rounded = False,
# Compat for the old roundrect theme.
window = None,
button_menu = True,
rounded_window = True,
outline_bars = False,
mm_root = None,
gm_root = None):
layout.defaults()
if config.screen_width <= 640:
text_size = text_size or 18
small_text_size = small_text_size or 12
less_rounded = True
FrameBox = Box
else:
text_size = text_size or 22
small_text_size = small_text_size or 16
radius = 12
theme.roundrect_frames(
def frames(
less_rounded,
frame)
frame):
theme.roundrect_buttons(
text_size,
less_rounded,
widget,
widget_hover,
widget_text,
widget_selected,
disabled,
disabled_text)
theme.clear_frames()
theme.roundrect_large_buttons(
small_text_size,
less_rounded,
widget,
widget_hover,
widget_text,
widget_selected,
disabled,
disabled_text)
style.frame.background = Box(frame, less_rounded)
theme.roundrect_labels(
text_size,
label)
style.frame.xpadding = 6
style.frame.ypadding = 6
setattr(theme, name + "_frames", frames)
theme.roundrect_prompts(
text_size,
label)
theme.roundrect_bars(
widget,
widget_hover)
if mm_root is not None:
style.mm_root.background = mm_root
def buttons(text_size,
less_rounded,
widget,
widget_hover,
widget_text,
widget_selected,
disabled,
disabled_text):
if gm_root is not None:
style.gm_root.background = gm_root
if window is not None:
theme.clear_buttons()
if rounded_window:
style.window.background = RoundRect(window, less_rounded)
style.window.xpadding = 6
style.window.xmargin = 6
style.window.ypadding = 6
style.window.ymargin = 6
style.button.background = Box(widget, less_rounded)
style.button.hover_background = Box(widget_hover, less_rounded)
style.button.insensitive_background = Box(disabled, less_rounded)
style.button_text.size = text_size
style.button_text.color = widget_text
style.button_text.selected_color = widget_selected
style.button_text.insensitive_color = disabled_text
if less_rounded:
style.button.xpadding = 6
else:
style.window.background = Solid(window)
style.window.xpadding = 6
style.window.xmargin = 0
style.window.ypadding = 6
style.window.ymargin = 0
style.button.xpadding = 12
style.button.ypadding = 1
style.button.xmargin = 1
style.button.ymargin = 1
style.button_text.xalign = 0.5
style.button_text.yalign = 0.5
style.button_text.text_align = 0.5
setattr(theme, name + "_buttons", buttons)
def large_buttons(
text_size,
less_rounded,
widget,
widget_hover,
widget_text,
widget_selected,
disabled,
disabled_text):
theme.clear_large_buttons()
if less_rounded:
style.large_button.xpadding = 6
else:
style.large_button.xpadding = 12
style.large_button.ypadding = 1
style.large_button.xmargin = 1
style.large_button.ymargin = 1
style.large_button.background = Box(widget, less_rounded)
style.large_button.hover_background = Box(widget_hover, less_rounded)
style.large_button.insensitive_background = Box(disabled, less_rounded)
style.large_button_text.size = text_size
style.large_button_text.color = widget_text
style.large_button_text.selected_color = widget_selected
style.large_button_text.insensitive_color = disabled_text
style.large_button_text.xalign = 0
style.large_button_text.yalign = 0
setattr(theme, name + "_large_buttons", large_buttons)
def labels(
text_size,
label):
theme.clear_labels()
style.label_text.size = text_size
style.label_text.color = label
setattr(theme, name + "_labels", labels)
def prompts(
text_size,
label):
theme.clear_prompts()
style.prompt_text.size = text_size
style.prompt_text.color = label
style.prompt.xalign = 0.5
style.prompt_text.text_align = 0.5
style.prompt_text.layout = "subtitle"
setattr(theme, name + "_prompts", prompts)
def bars(
widget,
widget_hover):
theme.clear_bars()
def img(name, color, x, y):
rv = theme.OneOrTwoColor(file_prefix + name + ".png", color)
if x is not None:
rv = Frame(rv, x, y, tile=True)
return rv
# Bars.
style.bar.ymaximum = 24
style.bar.left_gutter = 6
style.bar.right_gutter = 6
style.bar.thumb_offset = 6
style.bar.left_bar = img("slider_full", widget, 12, 0)
style.bar.right_bar = img("slider_empty", widget, 12, 0)
style.bar.thumb = img("slider_thumb", widget, None, None)
style.bar.hover_left_bar = img("slider_full", widget_hover, 12, 0)
style.bar.hover_right_bar = img("slider_empty", widget_hover, 12, 0)
style.bar.hover_thumb = img("slider_thumb", widget_hover, None, None)
style.vbar.xmaximum = 24
style.vbar.top_gutter = 6
style.vbar.bottom_gutter = 6
style.vbar.thumb_offset = 6
style.vbar.bottom_bar = img("vslider_full", widget, 0, 12)
style.vbar.top_bar = img("vslider_empty", widget, 0, 12)
style.vbar.thumb = img("vslider_thumb", widget, None, None)
style.vbar.hover_bottom_bar = img("vslider_full", widget_hover, 0, 12)
style.vbar.hover_top_bar = img("vslider_empty", widget_hover, 0, 12)
style.vbar.hover_thumb = img("vslider_thumb", widget_hover, None, None)
# Sliders.
style.slider.ymaximum = 24
style.slider.left_gutter = 6
style.slider.right_gutter = 6
style.slider.thumb_offset = 6
style.slider.left_bar = img("slider_full", widget, 12, 0)
style.slider.right_bar = img("slider_empty", widget, 12, 0)
style.slider.thumb = img("slider_thumb", widget, None, None)
style.slider.hover_left_bar = img("slider_full", widget_hover, 12, 0)
style.slider.hover_right_bar = img("slider_empty", widget_hover, 12, 0)
style.slider.hover_thumb = img("slider_thumb", widget_hover, None, None)
style.vslider.xmaximum = 24
style.vslider.top_gutter = 6
style.vslider.bottom_gutter = 6
style.vslider.thumb_offset = 6
style.vslider.bottom_bar = img("vslider_full", widget, 0, 12)
style.vslider.top_bar = img("vslider_empty", widget, 0, 12)
style.vslider.thumb = img("vslider_thumb", widget, None, None)
style.vslider.hover_bottom_bar = img("vslider_full", widget_hover, 0, 12)
style.vslider.hover_top_bar = img("vslider_empty", widget_hover, 0, 12)
style.vslider.hover_thumb = img("vslider_thumb", widget_hover, None, None)
if button_menu:
layout.button_menu()
# Scrollbars.
style.scrollbar.left_gutter = 6
style.scrollbar.right_gutter = 6
style.scrollbar.thumb_offset = 6
style.scrollbar.ymaximum = 12
style.scrollbar.left_bar = img("scrollbar", widget, 12, 0)
style.scrollbar.right_bar = img("scrollbar", widget, 12, 0)
style.scrollbar.thumb = img("scrollbar_thumb", widget, None, None)
style.scrollbar.hover_left_bar = img("scrollbar", widget_hover, 12, 0)
style.scrollbar.hover_right_bar = img("scrollbar", widget_hover, 12, 0)
style.scrollbar.hover_thumb = img("scrollbar_thumb", widget_hover, None, None)
style.vscrollbar.top_gutter = 6
style.vscrollbar.bottom_gutter = 6
style.vscrollbar.thumb_offset = 6
style.vscrollbar.xmaximum = 12
style.vscrollbar.left_bar = img("vscrollbar", widget, 0, 12)
style.vscrollbar.right_bar = img("vscrollbar", widget, 0, 12)
style.vscrollbar.thumb = img("vscrollbar_thumb", widget, None, None)
style.vscrollbar.hover_left_bar = img("vscrollbar", widget_hover, 0, 12)
style.vscrollbar.hover_right_bar = img("vscrollbar", widget_hover, 0, 12)
style.vscrollbar.hover_thumb = img("vscrollbar_thumb", widget_hover, None, None)
setattr(theme, name + "_bars", bars)
def main(
widget = (0, 60, 120, 255),
widget_hover = (0, 80, 160, 255),
widget_text = (200, 225, 255, 255),
widget_selected = (255, 255, 200, 255),
disabled = (64, 64, 64, 255),
disabled_text = (200, 200, 200, 255),
label = (255, 255, 255, 255),
frame = (100, 150, 200, 255),
text_size=None,
small_text_size=None,
less_rounded = False,
# Compat for the old roundrect theme.
window = None,
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:
text_size = text_size or 18
small_text_size = small_text_size or 12
less_rounded = True
else:
text_size = text_size or 22
small_text_size = small_text_size or 16
radius = 12
frames(
less_rounded,
frame)
buttons(
text_size,
less_rounded,
widget,
widget_hover,
widget_text,
widget_selected,
disabled,
disabled_text)
large_buttons(
small_text_size,
less_rounded,
widget,
widget_hover,
widget_text,
widget_selected,
disabled,
disabled_text)
labels(
text_size,
label)
prompts(
text_size,
label)
bars(
widget,
widget_hover)
if mm_root is not None:
style.mm_root.background = mm_root
if gm_root is not None:
style.gm_root.background = gm_root
if window is not None:
if rounded_window:
style.window.background = RoundRect(window, less_rounded)
style.window.xpadding = 6
style.window.xmargin = 6
style.window.ypadding = 6
style.window.ymargin = 6
else:
style.window.background = Solid(window)
style.window.xpadding = 6
style.window.xmargin = 0
style.window.ypadding = 6
style.window.ymargin = 0
if button_menu:
layout.button_menu()
setattr(theme, name, main)
roundrect_based_theme("roundrect", "_roundrect/rr", RoundRect)
roundrect_based_theme("bordered", "_theme_bordered/br")
roundrect_based_theme("diamond", "_theme_diamond/d")
roundrect_based_theme("tv", "_theme_tv/t")
roundrect_based_theme("glow", "_theme_glow/g", None, "_outline.png")
@theme
def ancient():
+21 -6
View File
@@ -1,3 +1,6 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This extra contains a basic implementation of voice support. Right
# now, voice is given its own toggle, and can either be turned on or
# turned off. In the future, we'll probably provide some way of
@@ -27,15 +30,17 @@ init -1120:
_voice.play = None
_voice.sustain = False
_voice.seen_in_lint = False
# Call this to specify the voice file that will be played for
# the user.
def voice(file, **kwargs):
if not config.has_voice:
return
_voice.play = file
_last_voice_play = file
# Call this to specify that the currently playing voice file
# should be sustained through the current interaction.
def voice_sustain(ignored="", **kwargs):
@@ -44,6 +49,14 @@ init -1120:
_voice.sustain = True
# Call this to replay the last bit of voice.
def voice_replay():
renpy.sound.play(_last_voice_play, channel="voice")
# Returns true if we can replay the voice.
def voice_can_replay():
return _last_voice_play != None
python hide:
# basics: True if the game will have voice.
@@ -52,14 +65,16 @@ 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
if _voice.play and not config.skipping:
renpy.sound.play(_voice.play, channel=2)
renpy.sound.play(_voice.play, channel="voice")
store._last_voice_play = _voice.play
elif not _voice.sustain:
renpy.sound.stop(channel=2)
renpy.sound.stop(channel="voice")
store._last_voice_play = _voice.play
_voice.play = None
_voice.sustain = False
@@ -68,7 +83,7 @@ init -1120:
config.say_sustain_callbacks.append(voice_sustain)
def voice_afm_callback():
return not renpy.sound.is_playing(channel=2)
return not renpy.sound.is_playing(channel="voice")
config.afm_callback = voice_afm_callback
Binary file not shown.
+3 -2
View File
@@ -1,4 +1,5 @@
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below)
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below)
Bitstream Vera Fonts Copyright
------------------------------
@@ -95,4 +96,4 @@ dealings in this Font Software without prior written authorization
from Tavmjong Bah. For further information, contact: tavmjong @ free
. fr.
$Id: LICENSE 778 2006-04-20 18:14:24Z moyogo $
$Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $
+3
View File
@@ -1,3 +1,6 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
######################################################################
+3
View File
@@ -1,3 +1,6 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init:
python:
+3
View File
@@ -1,3 +1,6 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init -1170 python hide:
config.old_names['Quit'] = 'Quit Game'
+4 -1
View File
@@ -1,4 +1,7 @@
# Copyright 2004-2006 PyTom
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# Copyright 2004-2011 Tom Rothamel
#
# Please see the LICENSE.txt distributed with Ren'Py for permission to
# copy and modify.
+3
View File
@@ -1,3 +1,6 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python hide:
style.menu_button = Style(style.button, heavy=True, help='Buttons that are part of the main or game menus.')
+4 -1
View File
@@ -1,4 +1,7 @@
# Copyright 2004-2007 PyTom
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# Copyright 2004-2011 Tom Rothamel
#
# Please see the LICENSE.txt distributed with Ren'Py for permission to
# copy and modify.
+241 -26
View File
@@ -1,32 +1,34 @@
# Entry point for the developer console.
label _developer:
# This file contains code that helps support the development of Ren'Py
# games.
if not config.developer:
return
screen _developer:
window style "gm_root"
call _enter_menu from _call__enter_menu_4
frame:
style_group "_developer"
align (.025, .05)
has vbox:
first_spacing 10
label "Developer Menu"
textbutton _(u"Return") action Return()
textbutton _(u"Reload Game (Shift + R)") action ui.callsinnewcontext("_save_reload_game")
textbutton _(u"Variable Viewer") action Jump("_debugger_screen")
textbutton _(u"Theme Test") action Jump("_theme_test")
textbutton _(u"Style Hierarchy") action Jump("_style_hierarchy")
textbutton _(u"Image Location Picker") action Jump("_image_location_picker")
textbutton _(u"Filename List") action Jump("_filename_list")
init python hide:
style._developer_button = Style(style.button)
style._developer_button.size_group = "_developer"
label _developer_screen:
python hide:
ui.window(style=style.gm_root)
ui.null()
ui.frame(xpos=10, ypos=10, style=style.menu_frame)
ui.vbox(box_first_spacing=10)
layout.label(u"Developer Menu", None)
sg = "developer_menu"
layout.button("Return", None, clicked=ui.returns(True), size_group=sg)
layout.button("Reload Game (Shift+R)", None, clicked=ui.callsinnewcontext("_save_reload_game"), size_group=sg)
layout.button("Variable Viewer", None, clicked=ui.jumps("_debugger_screen"), size_group=sg)
layout.button("Theme Test", None, clicked=ui.jumps("_theme_test"), size_group=sg)
layout.button("Style Hierarchy", None, clicked=ui.jumps("_style_hierarchy"), size_group=sg)
ui.close()
ui.interact()
call screen _developer
return
@@ -95,7 +97,7 @@ label _theme_test:
return ""
toggle_var = True
adj = ui.adjustment(100, 25, page=25)
adj = ui.adjustment(100, 25, page=25, adjustable=True)
while True:
@@ -196,6 +198,9 @@ label _style_hierarchy:
jump _developer_screen
init -1050 python:
config.missing_background = "black"
init 1050 python:
if renpy.game.options.remote:
@@ -238,7 +243,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("{", "{{")
@@ -284,3 +289,213 @@ init 1050 python:
config.missing_show = __missing_show_callback
config.missing_hide = __missing_hide_callback
config.overlay_functions.append(__missing_overlay)
init -1050 python:
class __FPSMeter(object):
def __init__(self):
self.last_frames = None
self.last_time = None
def __call__(self, st, at):
if self.last_time is not None:
frames = config.frames - self.last_frames
time = st - self.last_time
text = "FPS: %.1f" % (frames / time)
else:
text = "FPS: --.-"
self.last_frames = config.frames
self.last_time = st
return Text(text, xalign=1.0), .5
label _fps_meter:
python hide:
def fps_overlay():
ui.add(DynamicDisplayable(__FPSMeter()))
# We normally don't want to change this at runtime... but here
# it's okay, because we don't want to save the FPS meter anyway.
#
# Do as I say, not as I do.
config.overlay_functions.append(fps_overlay)
return
init python:
# This is a displayable that can keep track of the mouse coordinates,
# and show them to the user.
class __ImageLocationPicker(renpy.Displayable):
def __init__(self, fn, **kwargs):
super(__ImageLocationPicker, self).__init__(**kwargs)
self.child = Image(fn)
self.mouse = None
self.point1 = None
self.point2 = None
def render(self, width, height, st, at):
rv = renpy.Render(width, height)
cr = renpy.render(self.child, width, height, st, at)
rv.blit(cr, (0, 0))
text = [ ]
if self.point1 and self.point2 and not self.point1 == self.point2:
x1, y1 = self.point1
x2, y2 = self.point2
x1 = min(x1, cr.width)
x2 = min(x2, cr.width)
y1 = min(y1, cr.height)
y2 = min(y2, cr.height)
minx = min(x1, x2)
miny = min(y1, y2)
maxx = max(x1, x2)
maxy = max(y1, y2)
w = maxx - minx
h = maxy - miny
if w and h:
sr = renpy.render(Solid("#0ff4"), w, h, st, at)
rv.blit(sr, (minx, miny))
# text.append("Imagemap rectangle: %r" % ((minx, miny, maxx, maxy),))
text.append("Rectangle: %r" % ((minx, miny, w, h),))
if self.mouse:
mx, my = self.mouse
if mx < cr.width and my < cr.height:
text.append(_("Mouse position: %r") % (self.mouse,))
text.append(_("Right-click or escape to quit."))
td = Text("\n".join(text), size=14, color="#fff", outlines=[ (1, "#000", 0, 0 ) ])
tr = renpy.render(td, width, height, st, at)
rv.blit(tr, (0, height - tr.height))
return rv
def event(self, ev, x, y, st):
import pygame
self.mouse = (x, y)
renpy.redraw(self, 0)
if ev.type == pygame.MOUSEBUTTONDOWN and ev.button == 1:
self.point1 = (x, y)
self.point2 = (x, y)
elif ev.type == pygame.MOUSEMOTION and ev.buttons[0]:
self.point2 = (x, y)
elif ev.type == pygame.MOUSEBUTTONUP and ev.button == 1:
self.point2 = (x, y)
label _image_location_picker:
scene black
python hide:
image_files = [
fn
for dir, fn in renpy.loader.listdirfiles()
if fn.lower().endswith(".jpg") or fn.lower().endswith(".png")
if not fn[0] == "_"
]
image_files.sort()
xadjustment = ui.adjustment()
yadjustment = ui.adjustment()
while True:
ui.frame()
ui.vbox()
layout.label(u"Image Location Picker", None)
ui.textbutton(_(u"Done"), clicked=ui.returns(False), size_group="files")
ui.side(['c', 'b', 'r'], spacing=5)
vp = ui.viewport(xadjustment=xadjustment, yadjustment=yadjustment, mousewheel=True)
ui.vbox()
for fn in image_files:
ui.button(clicked=ui.returns(fn), size_group="files", xminimum=1.0)
ui.text(fn, style="button_text", xalign=0.0)
ui.close()
ui.bar(adjustment=xadjustment, style='scrollbar')
ui.bar(adjustment=yadjustment, style='vscrollbar')
ui.close()
ui.close()
rv = ui.interact()
if rv is False:
renpy.jump("_developer_screen")
# Now, allow the user to pick the image.
ui.keymap(game_menu=ui.returns(True))
ui.add(__ImageLocationPicker(rv))
ui.interact()
# ...
renpy.jump("_image_location_picker")
label _filename_list:
python hide:
import os
f = file("files.txt", "w")
for dirname, dirs, files in os.walk(config.gamedir):
dirs.sort()
files.sort()
for fn in files:
fn = os.path.join(dirname, fn)
fn = fn[len(config.gamedir) + 1:]
print >>f, fn
print fn
f.close()
renpy.launch_editor(["files.txt"], transient=1)
jump _developer_screen
init python:
config.underlay.append(im.Tile("_transparent_tile.png"))
@@ -1,3 +1,6 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('joystick_preferences')
@@ -28,8 +31,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 +43,6 @@ init python:
(u'Hide Text', 'joy_hide'),
(u'Menu', 'joy_menu'),
]
def _joystick_select_binding():
@@ -55,8 +54,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 +78,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 +103,7 @@ label joystick_preferences_screen:
python:
layout.navigation("joystick_preferences")
_joystick_preferences()
ui.interact()
ui.interact(mouse="gamemenu")
+56 -34
View File
@@ -1,3 +1,6 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('load_save')
@@ -73,7 +76,9 @@ init python:
ui.button(style=style.file_picker_entry[index],
clicked=clicked,
role=("selected_" if newest else ""))
role=("selected_" if newest else ""),
keymap={ "save_delete" : ui.returns(("unlink", name)) }
)
ui.hbox(style=style.file_picker_entry_box[index])
@@ -183,8 +188,11 @@ init python:
else:
base += 1
return base + int((int(filename) - 1) / per_page)
try:
return base + int((int(filename) - 1) / per_page)
except:
return base
# Processes a screenshot.
def _file_picker_process_screenshot(s):
return s
@@ -193,36 +201,45 @@ init python:
# the list of save files.
def _file_picker(screen, save):
# The number of slots in a page.
file_page_length = config.file_page_cols * config.file_page_rows
saved_games = renpy.list_saved_games(regexp=r'(auto-|quick-)?[0-9]+')
newest = None
newest_mtime = None
save_info = { }
for fn, extra_info, screenshot, mtime in saved_games:
screenshot = _file_picker_process_screenshot(screenshot)
save_info[fn] = (extra_info, screenshot, mtime)
if not fn.startswith("auto-") and mtime > newest_mtime:
newest = fn
newest_mtime = mtime
# The index of the first entry in the page.
fpp = __scratch.file_picker_page
if fpp is None:
if newest:
fpp = _file_picker_file_page(newest)
else:
fpp = _file_picker_file_page("1")
# Should we update the list of saved games?
update = True
while True:
if update:
update = False
# The number of slots in a page.
file_page_length = config.file_page_cols * config.file_page_rows
# The list of saved games.
saved_games = renpy.list_saved_games(regexp=r'(auto-|quick-)?[0-9]+')
# Figure out which game is the newest and so on.
newest = None
newest_mtime = None
save_info = { }
for fn, extra_info, screenshot, mtime in saved_games:
screenshot = _file_picker_process_screenshot(screenshot)
save_info[fn] = (extra_info, screenshot, mtime)
if not fn.startswith("auto-") and mtime > newest_mtime:
newest = fn
newest_mtime = mtime
# The index of the first entry in the page.
fpp = __scratch.file_picker_page
if fpp is None:
if newest:
fpp = _file_picker_file_page(newest)
else:
fpp = _file_picker_file_page("1")
if fpp < 0:
fpp = 0
@@ -291,9 +308,14 @@ init python:
ui.close() # slots
ui.close() # whole thing
result = ui.interact()
result = ui.interact(mouse="gamemenu")
type, value = result
if type == "unlink":
if layout.yesno_prompt(screen, layout.DELETE_SAVE):
renpy.unlink_save(value)
update = True
if type == "return":
return value
@@ -311,7 +333,7 @@ label save_screen:
fn = _file_picker("save", True)
if renpy.can_load(fn):
if not layout.yesno_prompt("save", u"Are you sure you want to overwrite your save?"):
if not layout.yesno_prompt("save", layout.OVERWRITE_SAVE):
continue
renpy.save(fn, extra_info=store.save_name)
@@ -325,7 +347,7 @@ label load_screen:
fn = _file_picker("load", False)
if _load_prompt:
if not layout.yesno_prompt("load", u"Loading will lose unsaved progress.\nAre you sure you want to do this?"):
if not layout.yesno_prompt("load", layout.LOADING):
continue
renpy.load(fn)

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