Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9483a7daa5 | |||
| 89d93544a7 | |||
| 5f08daa85a | |||
| d891dd290c | |||
| 0b366f6850 | |||
| 899bf47d34 | |||
| 888c485186 | |||
| dbbabbb2dc | |||
| 7a38331f8c | |||
| 0dbcb352c9 | |||
| 1ab0b43202 | |||
| 106d95e795 | |||
| cf9005e457 | |||
| be7fd4fa13 | |||
| b0f848b089 | |||
| 07077e89b1 | |||
| bc2a0451db | |||
| 4e38257900 | |||
| f934838a59 | |||
| ee0fb68d60 | |||
| 37e8fd19cd | |||
| f600e6a24b | |||
| ca9009f5fe | |||
| 9a299a9b38 | |||
| 845ae6e7ba | |||
| 8f706107ac | |||
| d489199e00 | |||
| bf023dc2e3 | |||
| ac6b04b5e3 | |||
| a34de5d601 | |||
| b9900776a8 |
@@ -98,3 +98,9 @@ lib/python
|
||||
lib/update-version.txt
|
||||
sphinx/game/saves
|
||||
tutorial/game/saves
|
||||
doc
|
||||
unparse.py
|
||||
module/glrtt_fbo.c
|
||||
module/glrtt_fbo.html
|
||||
tutorial/game/cache
|
||||
renpy.exe.log
|
||||
|
||||
@@ -38,7 +38,6 @@ Ren'Py binaries include code from the following projects:
|
||||
* SDL (LGPL)
|
||||
* SDL_image (LGPL)
|
||||
* SDL_ttf (LGPL)
|
||||
* SDL_mixer (LGPL)
|
||||
* Freetype (LGPL)
|
||||
* FFmpeg (LGPL)
|
||||
* Fribidi (LGPL)
|
||||
@@ -49,7 +48,6 @@ Ren'Py binaries include code from the following projects:
|
||||
* pyobjc (MIT License)
|
||||
* py2exe (MIT License)
|
||||
* GLEW (Modified BSD, MIT)
|
||||
* tegl (Modified BSD)
|
||||
|
||||
For the purpose of LGPL compliance, the source code to all LGPL
|
||||
software we depend on is either in the Ren'Py package (available from
|
||||
|
||||
+11
-2
@@ -94,7 +94,7 @@ init -1180 python:
|
||||
|
||||
|
||||
def _default_empty_window():
|
||||
|
||||
|
||||
who = _last_say_who
|
||||
|
||||
if who is not None:
|
||||
@@ -238,7 +238,8 @@ init -1180 python:
|
||||
|
||||
config.screenshot_callback = _screenshot_callback
|
||||
|
||||
|
||||
_predict_screens = [ ]
|
||||
|
||||
init -1180 python hide:
|
||||
|
||||
def dump_styles():
|
||||
@@ -352,6 +353,11 @@ init -1180 python hide:
|
||||
|
||||
# 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:
|
||||
@@ -367,6 +373,7 @@ init -1180 python hide:
|
||||
renpy.predict_screen(s)
|
||||
return
|
||||
|
||||
|
||||
config.predict_callbacks.append(predict)
|
||||
|
||||
def imagemap_auto_function(auto_param, variant):
|
||||
@@ -782,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
|
||||
|
||||
+74
-2
@@ -989,6 +989,9 @@ init -1140 python:
|
||||
If true, then this file will be marked as the newest save
|
||||
file when it's saved. (Set this to false for a quicksave,
|
||||
for example.)
|
||||
|
||||
`page`
|
||||
The name of the page that it will be saved to.
|
||||
"""
|
||||
|
||||
def __init__(self, name, confirm=True, newest=True, page=None):
|
||||
@@ -1025,6 +1028,9 @@ init -1140 python:
|
||||
return True
|
||||
|
||||
def get_selected(self):
|
||||
if not self.confirm:
|
||||
return False
|
||||
|
||||
return persistent._file_newest == __filename(self.name, self.page)
|
||||
|
||||
class FileLoad(Action):
|
||||
@@ -1060,6 +1066,9 @@ init -1140 python:
|
||||
return renpy.scan_saved_game(__filename(self.name, self.page))
|
||||
|
||||
def get_selected(self):
|
||||
if not self.confirm:
|
||||
return False
|
||||
|
||||
return persistent._file_newest == __filename(self.name, self.page)
|
||||
|
||||
class FileDelete(Action):
|
||||
@@ -1132,7 +1141,7 @@ init -1140 python:
|
||||
def get_sensitive(self):
|
||||
if self.page == "auto" and not config.has_autosave:
|
||||
return False
|
||||
elif self.page == "quicksave" and not config.has_quicksave:
|
||||
elif self.page == "quick" and not config.has_quicksave:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
@@ -1140,7 +1149,70 @@ init -1140 python:
|
||||
def get_selected(self):
|
||||
return self.page == persistent._file_page
|
||||
|
||||
|
||||
def FilePageName(auto="a", quick="q"):
|
||||
"""
|
||||
:doc: file_action_function
|
||||
|
||||
Returns the name of the current file page, as a string. If a normal
|
||||
page, this returns the page number. Otherwise, it returns
|
||||
`auto` or `quick`.
|
||||
"""
|
||||
|
||||
page = persistent._file_page
|
||||
|
||||
if page == "quick":
|
||||
return quick
|
||||
elif page == "auto":
|
||||
return auto
|
||||
else:
|
||||
return page
|
||||
|
||||
def FileSlotName(slot, slots_per_page, auto="a", quick="q", format="%s%d"):
|
||||
"""
|
||||
:doc: file_action_function
|
||||
|
||||
Returns the name of the numbered slot. This assumes that slots on
|
||||
normal pages are numbered in a linear order starting with 1, and
|
||||
that page numbers start with 1. When slot is 2, and slots_per_page
|
||||
is 10, and the other variables are the defauts:
|
||||
|
||||
* When the first page is slowing, this returns "2".
|
||||
* When the second page is showing, this returns "12".
|
||||
* When the auto page is showing, this returns "a2".
|
||||
* When the quicksave page is showing, this returns "q2".
|
||||
|
||||
`slot`
|
||||
The number of the slot to access.
|
||||
|
||||
`slots_per_page`
|
||||
The number of slots per page.
|
||||
|
||||
`auto`
|
||||
A prefix to use for the auto page.
|
||||
|
||||
`quick`
|
||||
A prefix to use for the quick page.
|
||||
|
||||
`format`
|
||||
The formatting code to use. This is given two arguments: A string
|
||||
giving the page prefix, and an integer giving the slot number.
|
||||
"""
|
||||
|
||||
page = persistent._file_page
|
||||
|
||||
if page == "quick":
|
||||
prefix = quick
|
||||
page = 0
|
||||
elif page == "auto":
|
||||
prefix = auto
|
||||
page = 0
|
||||
else:
|
||||
prefix = ""
|
||||
page = int(page) - 1
|
||||
|
||||
return format % (prefix, page * slots_per_page + slot)
|
||||
|
||||
|
||||
class FilePageNext(Action):
|
||||
"""
|
||||
:doc: file_action
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import os
|
||||
# ***** ***** ***** ***** ***** ***** **** ***** ***** ***** *****
|
||||
# Be sure to change script_version in launcher/script_version.rpy, too!
|
||||
# Be sure to change _renpy.pyx and module.py, if necessary.
|
||||
version = "Ren'Py 6.12.0c"
|
||||
version = "Ren'Py 6.12.0f"
|
||||
|
||||
|
||||
# Other versions.
|
||||
|
||||
+3
-3
@@ -359,13 +359,13 @@ class Say(Node):
|
||||
if renpy.config.say_menu_text_filter:
|
||||
what = renpy.config.say_menu_text_filter(what) # E1102
|
||||
|
||||
say_menu_with(self.with_, renpy.game.interface.set_transition)
|
||||
renpy.exports.say(who, what, interact=getattr(self, 'interact', True))
|
||||
|
||||
if getattr(who, "record_say", True):
|
||||
renpy.store._last_say_who = self.who
|
||||
renpy.store._last_say_what = what
|
||||
|
||||
say_menu_with(self.with_, renpy.game.interface.set_transition)
|
||||
renpy.exports.say(who, what, interact=getattr(self, 'interact', True))
|
||||
|
||||
return self.next
|
||||
|
||||
def predict(self):
|
||||
|
||||
@@ -167,8 +167,8 @@ cdef class GLDraw:
|
||||
# Should we use the fast (but incorrect) dissolve mode?
|
||||
self.fast_dissolve = False # renpy.android
|
||||
|
||||
# Should we use clipping planes or stencils?
|
||||
self.use_clipping_planes = True
|
||||
# Should we use clipping planes or scissors?
|
||||
self.use_clipping_planes = False
|
||||
|
||||
# Should we always report pixels as being always opaque?
|
||||
self.always_opaque = renpy.android
|
||||
@@ -428,11 +428,6 @@ cdef class GLDraw:
|
||||
|
||||
renpy.log.info("Number of texture units: %d", texture_units)
|
||||
|
||||
if texture_units < 4 and not self.fast_dissolve:
|
||||
renpy.log.info("Not enough texture units.")
|
||||
return False
|
||||
|
||||
|
||||
# Count the number of clip planes.
|
||||
cdef GLint clip_planes = 0
|
||||
|
||||
|
||||
+7
-3
@@ -154,7 +154,7 @@ class Cache(object):
|
||||
# image. It also takes care of updating the age of images in the
|
||||
# cache to be current, and maintaining the size of the current
|
||||
# generation of images.
|
||||
def get(self, image):
|
||||
def get(self, image, predict=False):
|
||||
|
||||
if not isinstance(image, ImageBase):
|
||||
raise Exception("Expected an image of some sort, but got" + str(image) + ".")
|
||||
@@ -201,8 +201,12 @@ class Cache(object):
|
||||
renpy.display.render.mutated_surface(ce.surf)
|
||||
|
||||
if renpy.config.debug_image_cache:
|
||||
renpy.log.debug("IC Added %r (%.02f%%)", ce.what, 100.0 * self.total_cache_size / self.cache_limit)
|
||||
|
||||
if predict:
|
||||
renpy.log.debug("IC Added %r (%.02f%%)", ce.what, 100.0 * self.total_cache_size / self.cache_limit)
|
||||
else:
|
||||
renpy.log.debug("IC Total Miss %r", ce.what)
|
||||
|
||||
renpy.display.draw.load_texture(ce.surf)
|
||||
|
||||
self.lock.release()
|
||||
@@ -317,7 +321,7 @@ class Cache(object):
|
||||
|
||||
if image not in self.preload_blacklist:
|
||||
try:
|
||||
self.get(image)
|
||||
self.get(image, True)
|
||||
except:
|
||||
self.preload_blacklist.add(image)
|
||||
|
||||
|
||||
+5
-14
@@ -350,15 +350,9 @@ class Frame(renpy.display.core.Displayable):
|
||||
dw = int(width)
|
||||
dh = int(height)
|
||||
|
||||
xb = self.xborder
|
||||
yb = self.yborder
|
||||
|
||||
if xb * 2 >= sw:
|
||||
xb = sw / 2 - 1
|
||||
|
||||
if yb * 2 >= sh:
|
||||
yb = sh / 2 - 1
|
||||
|
||||
xb = min(self.xborder, sw / 2 - 1, width / 2 - 1)
|
||||
yb = min(self.yborder, sh / 2 - 1, height / 2 - 1)
|
||||
|
||||
rv = Render(dw, dh)
|
||||
|
||||
self.draw_pattern(draw, xb, yb)
|
||||
@@ -417,12 +411,9 @@ class Frame(renpy.display.core.Displayable):
|
||||
sw, sh = source.get_size()
|
||||
dw, dh = dest.get_size()
|
||||
|
||||
if xb * 2 >= sw:
|
||||
xb = sw / 2 - 1
|
||||
xb = min(xb, sw / 2 - 1, dw / 2 - 1)
|
||||
yb = min(yb, sh / 2 - 1, dh / 2 - 1)
|
||||
|
||||
if yb * 2 >= sh:
|
||||
yb = sh / 2 - 1
|
||||
|
||||
def draw(x0, x1, y0, y1):
|
||||
|
||||
# Compute the coordinates of the left, right, top, and
|
||||
|
||||
@@ -589,7 +589,9 @@ def SnowBlossom(d,
|
||||
as long as the second number in a tuple is larger than the first.
|
||||
|
||||
`start`
|
||||
The delay, in seconds, to start each particle.
|
||||
The delay, in seconds, before each particle is added. This can be
|
||||
allows the particles to start at the top of the screen, while not
|
||||
looking like a "wave" effect.
|
||||
|
||||
`fast`
|
||||
If true, particles start in the center of the screen, rather than
|
||||
|
||||
@@ -127,7 +127,8 @@ def prediction_coroutine(root_widget):
|
||||
renpy.display.screen.predict_screen(name, **kwargs)
|
||||
except:
|
||||
if renpy.config.debug_image_cache:
|
||||
traceback.print_exc()
|
||||
renpy.log.debug("While predicting screen %s %r", name, kwargs)
|
||||
renpy.log.debug_exception()
|
||||
|
||||
predicting = False
|
||||
|
||||
|
||||
@@ -26,8 +26,6 @@ import threading
|
||||
import renpy
|
||||
import gc
|
||||
|
||||
cdef class Render
|
||||
|
||||
# We grab the blit lock each time it is necessary to blit
|
||||
# something. This allows call to the pygame.transform functions to
|
||||
# disable blitting, should it prove necessary.
|
||||
|
||||
+5
-7
@@ -412,16 +412,14 @@ def predict_menu():
|
||||
#
|
||||
# An item lets us load imagebuttons as necessary.
|
||||
|
||||
items = [ ("Menu Prediction", True, "button", "caption") ]
|
||||
props = {
|
||||
"button" : { "style" : "menu_choice_button" },
|
||||
"caption" : { "style" : "menu_choice" },
|
||||
}
|
||||
if not renpy.config.choice_screen_chosen:
|
||||
return
|
||||
|
||||
items = [ ("Menu Prediction", True, False) ]
|
||||
|
||||
predict_screen(
|
||||
"choice",
|
||||
items=items,
|
||||
_widget_properties=props,
|
||||
)
|
||||
|
||||
|
||||
@@ -547,7 +545,7 @@ def display_menu(items,
|
||||
# Mark this as chosen.
|
||||
for label, val in items:
|
||||
if rv == val:
|
||||
chosen[(location, val)] = True
|
||||
chosen[(location, label)] = True
|
||||
|
||||
|
||||
for label, val in items:
|
||||
|
||||
+1
-1
@@ -162,7 +162,7 @@ class Preferences(renpy.object.Object):
|
||||
self.volumes[mixer] = volume
|
||||
|
||||
def get_volume(self, mixer):
|
||||
return self.volumes[mixer]
|
||||
return self.volumes.get(mixer, 0)
|
||||
|
||||
def set_mute(self, mixer, mute):
|
||||
self.mute[mixer] = mute
|
||||
|
||||
+2
-2
@@ -309,7 +309,7 @@ autosave_counter = 0
|
||||
def autosave_thread(take_screenshot):
|
||||
|
||||
global autosave_counter
|
||||
|
||||
|
||||
renpy.display.core.cpu_idle.wait()
|
||||
cycle_saves("auto-", renpy.config.autosave_slots)
|
||||
|
||||
@@ -318,7 +318,7 @@ def autosave_thread(take_screenshot):
|
||||
extra_info = renpy.config.auto_save_extra_info()
|
||||
else:
|
||||
extra_info = ""
|
||||
|
||||
|
||||
try:
|
||||
try:
|
||||
if take_screenshot:
|
||||
|
||||
+1
-1
@@ -404,7 +404,7 @@ class StyleManager(object):
|
||||
|
||||
rest = name
|
||||
|
||||
while "_" in name:
|
||||
while "_" in rest:
|
||||
first, rest = rest.split("_", 1)
|
||||
if rest in style_map:
|
||||
s = Style(rest)
|
||||
|
||||
@@ -97,7 +97,9 @@ Screens
|
||||
Ren'Py now ships with a default set of screens, which are used by the
|
||||
demo and installed by default when a new game is created. You can find
|
||||
them in template/game/screens.rpy, and they can be used by copying
|
||||
that file into your project.
|
||||
that file into your project. These screens are not 100% compatible
|
||||
with the previous layout system - for example, some styles have
|
||||
changed. That's why games must opt-in to them.
|
||||
|
||||
The definition of the `items` parameter of the :ref:`Choice` and
|
||||
:ref:`NVL` screens has changed, and games will need to be updated to work
|
||||
@@ -114,6 +116,9 @@ imagemaps and imagebuttons.
|
||||
|
||||
The imagemap caching behavior described above applies only to screens.
|
||||
|
||||
The :func:`FilePageName` and :func:`FileSlotName` functions make it easier
|
||||
to name slots
|
||||
|
||||
Other Improvements
|
||||
------------------
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.. Automatically generated file - do not modify.
|
||||
|
||||
.. class:: Drag(d=None, drag_name=None, draggable=True, droppable=True, drag_raise=True, dragged=None, dropped=None, drag_handle=(0.0, 0.0, 1.0, 1.0), drag_joined=<function default_drag_joined at 0x1b922a8>, clicked=None, hovered=None, unhovered=None, replaces=None, **properties)
|
||||
.. class:: Drag(d=None, drag_name=None, draggable=True, droppable=True, drag_raise=True, dragged=None, dropped=None, drag_handle=(0.0, 0.0, 1.0, 1.0), drag_joined=<function default_drag_joined at 0x1de72a8>, clicked=None, hovered=None, unhovered=None, replaces=None, **properties)
|
||||
|
||||
A displayable that represents an object that can be dragged around
|
||||
its enclosing area. A Drag can also represent an area that
|
||||
|
||||
@@ -50,6 +50,9 @@
|
||||
If true, then this file will be marked as the newest save
|
||||
file when it's saved. (Set this to false for a quicksave,
|
||||
for example.)
|
||||
|
||||
`page`
|
||||
The name of the page that it will be saved to.
|
||||
|
||||
.. function:: FileTakeScreenshot()
|
||||
|
||||
|
||||
@@ -5,6 +5,12 @@
|
||||
This is a function that returns true
|
||||
if the file is loadable, and false otherwise.
|
||||
|
||||
.. function:: FilePageName(auto='a', quick='q')
|
||||
|
||||
Returns the name of the current file page, as a string. If a normal
|
||||
page, this returns the page number. Otherwise, it returns
|
||||
`auto` or `quick`.
|
||||
|
||||
.. function:: FileSaveName(name, empty='', page=None)
|
||||
|
||||
Return the save_name that was in effect when the file was saved,
|
||||
@@ -18,6 +24,34 @@
|
||||
|
||||
The return value is a displayable.
|
||||
|
||||
.. function:: FileSlotName(slot, slots_per_page, auto='a', quick='q', format='%s%d')
|
||||
|
||||
Returns the name of the numbered slot. This assumes that slots on
|
||||
normal pages are numbered in a linear order starting with 1, and
|
||||
that page numbers start with 1. When slot is 2, and slots_per_page
|
||||
is 10, and the other variables are the defauts:
|
||||
|
||||
* When the first page is slowing, this returns "2".
|
||||
* When the second page is showing, this returns "12".
|
||||
* When the auto page is showing, this returns "a2".
|
||||
* When the quicksave page is showing, this returns "q2".
|
||||
|
||||
`slot`
|
||||
The number of the slot to access.
|
||||
|
||||
`slots_per_page`
|
||||
The number of slots per page.
|
||||
|
||||
`auto`
|
||||
A prefix to use for the auto page.
|
||||
|
||||
`quick`
|
||||
A prefix to use for the quick page.
|
||||
|
||||
`format`
|
||||
The formatting code to use. This is given two arguments: A string
|
||||
giving the page prefix, and an integer giving the slot number.
|
||||
|
||||
.. function:: FileTime(name, format='%b %d, %H:%M', empty='', page=None)
|
||||
|
||||
Returns the time the file was saved, formatted according
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
as long as the second number in a tuple is larger than the first.
|
||||
|
||||
`start`
|
||||
The delay, in seconds, to start each particle.
|
||||
The delay, in seconds, before each particle is added. This can be
|
||||
allows the particles to start at the top of the screen, while not
|
||||
looking like a "wave" effect.
|
||||
|
||||
`fast`
|
||||
If true, particles start in the center of the screen, rather than
|
||||
|
||||
@@ -93,23 +93,24 @@ with the menu statement. It is given the following parameter:
|
||||
|
||||
screen choice:
|
||||
|
||||
window:
|
||||
id "window"
|
||||
window:
|
||||
style "menu_window"
|
||||
|
||||
vbox:
|
||||
id "menu"
|
||||
style "menu"
|
||||
|
||||
for caption, action, button_id, caption_id in items:
|
||||
for caption, action, chosen in items:
|
||||
|
||||
if action:
|
||||
|
||||
if action:
|
||||
button:
|
||||
action action
|
||||
id button_id
|
||||
style "menu_choice_button"
|
||||
|
||||
text caption id caption_id
|
||||
text caption style "menu_choice"
|
||||
|
||||
else:
|
||||
text caption id caption_id
|
||||
text caption style "menu_caption"
|
||||
|
||||
|
||||
Input
|
||||
|
||||
+43
-35
@@ -65,9 +65,12 @@ screen choice:
|
||||
|
||||
window:
|
||||
style "menu_window"
|
||||
|
||||
xalign 0.5
|
||||
yalign 0.5
|
||||
|
||||
vbox:
|
||||
style "menu"
|
||||
spacing 2
|
||||
|
||||
for caption, action, chosen in items:
|
||||
|
||||
@@ -82,13 +85,10 @@ screen choice:
|
||||
else:
|
||||
text caption style "menu_caption"
|
||||
|
||||
init python:
|
||||
init -2 python:
|
||||
config.narrator_menu = True
|
||||
|
||||
style.menu.box_spacing = 2
|
||||
style.menu_window.set_parent(style.default)
|
||||
style.menu_window.xalign = 0.5
|
||||
style.menu_window.yalign = 0.5
|
||||
style.menu_choice.set_parent(style.button_text)
|
||||
style.menu_choice.clear()
|
||||
style.menu_choice_button.set_parent(style.button)
|
||||
@@ -189,7 +189,7 @@ screen main_menu:
|
||||
textbutton _("Help") action Help()
|
||||
textbutton _("Quit") action Quit(confirm=False)
|
||||
|
||||
init python:
|
||||
init -2 python:
|
||||
|
||||
# Make all the main menu buttons be the same size.
|
||||
style.mm_button.size_group = "mm"
|
||||
@@ -210,7 +210,9 @@ screen navigation:
|
||||
# The various buttons.
|
||||
frame:
|
||||
style_group "gm_nav"
|
||||
|
||||
xalign .98
|
||||
yalign .98
|
||||
|
||||
has vbox
|
||||
|
||||
textbutton _("Return") action Return()
|
||||
@@ -221,10 +223,8 @@ screen navigation:
|
||||
textbutton _("Help") action Help()
|
||||
textbutton _("Quit") action Quit()
|
||||
|
||||
init python:
|
||||
init -2 python:
|
||||
style.gm_nav_button.size_group = "gm_nav"
|
||||
style.gm_nav_frame.xalign = .98
|
||||
style.gm_nav_frame.yalign = .98
|
||||
|
||||
|
||||
##############################################################################
|
||||
@@ -262,15 +262,18 @@ screen file_picker:
|
||||
|
||||
textbutton _("Next"):
|
||||
action FilePageNext()
|
||||
|
||||
$ columns = 2
|
||||
$ rows = 5
|
||||
|
||||
# Display a grid of file slots.
|
||||
grid 2 5:
|
||||
grid columns rows:
|
||||
transpose True
|
||||
xfill True
|
||||
style_group "file_picker"
|
||||
|
||||
# Display ten file slots, numbered 1 - 10.
|
||||
for i in range(1, 11):
|
||||
for i in range(1, columns * rows + 1):
|
||||
|
||||
# Each file slot is a button.
|
||||
button:
|
||||
@@ -283,7 +286,11 @@ screen file_picker:
|
||||
add FileScreenshot(i)
|
||||
|
||||
# Format the description, and add it as text.
|
||||
$ description = "% 2d. %s\n%s" % (i, FileTime(i, empty=_("Empty Slot.")), FileSaveName(i))
|
||||
$ description = "% 2s. %s\n%s" % (
|
||||
FileSlotName(i, columns * rows),
|
||||
FileTime(i, empty=_("Empty Slot.")),
|
||||
FileSaveName(i))
|
||||
|
||||
text description
|
||||
|
||||
key "save_delete" action FileDelete(i)
|
||||
@@ -305,7 +312,7 @@ screen load:
|
||||
use navigation
|
||||
use file_picker
|
||||
|
||||
init python:
|
||||
init -2 python:
|
||||
style.file_picker_frame = Style(style.menu_frame)
|
||||
|
||||
style.file_picker_nav_button = Style(style.small_button)
|
||||
@@ -427,15 +434,19 @@ screen preferences:
|
||||
action Play("voice", config.sample_voice)
|
||||
style "soundtest_button"
|
||||
|
||||
init python:
|
||||
init -2 python:
|
||||
style.pref_frame.xfill = True
|
||||
style.pref_frame.xmargin = 5
|
||||
style.pref_frame.top_margin = 5
|
||||
|
||||
style.pref_vbox.xfill = True
|
||||
|
||||
style.pref_button.size_group = "pref"
|
||||
style.pref_button.xalign = 1.0
|
||||
|
||||
style.pref_slider.xmaximum = 192
|
||||
style.pref_slider.xalign = 1.0
|
||||
|
||||
style.soundtest_button.xalign = 1.0
|
||||
|
||||
|
||||
@@ -455,31 +466,28 @@ screen yesno_prompt:
|
||||
frame:
|
||||
style_group "yesno"
|
||||
|
||||
has vbox
|
||||
|
||||
label _(message)
|
||||
xfill True
|
||||
xmargin .05
|
||||
ypos .1
|
||||
yanchor 0
|
||||
ypadding .05
|
||||
|
||||
has vbox:
|
||||
xalign .5
|
||||
yalign .5
|
||||
spacing 30
|
||||
|
||||
label _(message):
|
||||
xalign 0.5
|
||||
|
||||
hbox:
|
||||
xalign 0.5
|
||||
spacing 100
|
||||
|
||||
textbutton _("Yes") action yes_action
|
||||
textbutton _("No") action no_action
|
||||
|
||||
|
||||
init python:
|
||||
|
||||
style.yesno_frame.xfill = True
|
||||
style.yesno_frame.xmargin = .05
|
||||
style.yesno_frame.ypos = .1
|
||||
style.yesno_frame.yanchor = 0
|
||||
style.yesno_frame.ypadding = .05
|
||||
|
||||
style.yesno_vbox.xalign = 0.5
|
||||
style.yesno_vbox.yalign = 0.5
|
||||
style.yesno_vbox.box_spacing = 30
|
||||
|
||||
style.yesno_hbox.xalign = 0.5
|
||||
style.yesno_hbox.spacing = 100
|
||||
|
||||
init -2 python:
|
||||
style.yesno_button.size_group = "yesno"
|
||||
|
||||
style.yesno_label.xalign = 0.5
|
||||
style.yesno_label_text.text_align = 0.5
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
title=Ren'Py Demo
|
||||
author=PyTom
|
||||
orientation=landscape
|
||||
api_version=1
|
||||
+43
-35
@@ -65,9 +65,12 @@ screen choice:
|
||||
|
||||
window:
|
||||
style "menu_window"
|
||||
|
||||
xalign 0.5
|
||||
yalign 0.5
|
||||
|
||||
vbox:
|
||||
style "menu"
|
||||
spacing 2
|
||||
|
||||
for caption, action, chosen in items:
|
||||
|
||||
@@ -82,13 +85,10 @@ screen choice:
|
||||
else:
|
||||
text caption style "menu_caption"
|
||||
|
||||
init python:
|
||||
init -2 python:
|
||||
config.narrator_menu = True
|
||||
|
||||
style.menu.box_spacing = 2
|
||||
style.menu_window.set_parent(style.default)
|
||||
style.menu_window.xalign = 0.5
|
||||
style.menu_window.yalign = 0.5
|
||||
style.menu_choice.set_parent(style.button_text)
|
||||
style.menu_choice.clear()
|
||||
style.menu_choice_button.set_parent(style.button)
|
||||
@@ -189,7 +189,7 @@ screen main_menu:
|
||||
textbutton _("Help") action Help()
|
||||
textbutton _("Quit") action Quit(confirm=False)
|
||||
|
||||
init python:
|
||||
init -2 python:
|
||||
|
||||
# Make all the main menu buttons be the same size.
|
||||
style.mm_button.size_group = "mm"
|
||||
@@ -210,7 +210,9 @@ screen navigation:
|
||||
# The various buttons.
|
||||
frame:
|
||||
style_group "gm_nav"
|
||||
|
||||
xalign .98
|
||||
yalign .98
|
||||
|
||||
has vbox
|
||||
|
||||
textbutton _("Return") action Return()
|
||||
@@ -221,10 +223,8 @@ screen navigation:
|
||||
textbutton _("Help") action Help()
|
||||
textbutton _("Quit") action Quit()
|
||||
|
||||
init python:
|
||||
init -2 python:
|
||||
style.gm_nav_button.size_group = "gm_nav"
|
||||
style.gm_nav_frame.xalign = .98
|
||||
style.gm_nav_frame.yalign = .98
|
||||
|
||||
|
||||
##############################################################################
|
||||
@@ -262,15 +262,18 @@ screen file_picker:
|
||||
|
||||
textbutton _("Next"):
|
||||
action FilePageNext()
|
||||
|
||||
$ columns = 2
|
||||
$ rows = 5
|
||||
|
||||
# Display a grid of file slots.
|
||||
grid 2 5:
|
||||
grid columns rows:
|
||||
transpose True
|
||||
xfill True
|
||||
style_group "file_picker"
|
||||
|
||||
# Display ten file slots, numbered 1 - 10.
|
||||
for i in range(1, 11):
|
||||
for i in range(1, columns * rows + 1):
|
||||
|
||||
# Each file slot is a button.
|
||||
button:
|
||||
@@ -283,7 +286,11 @@ screen file_picker:
|
||||
add FileScreenshot(i)
|
||||
|
||||
# Format the description, and add it as text.
|
||||
$ description = "% 2d. %s\n%s" % (i, FileTime(i, empty=_("Empty Slot.")), FileSaveName(i))
|
||||
$ description = "% 2s. %s\n%s" % (
|
||||
FileSlotName(i, columns * rows),
|
||||
FileTime(i, empty=_("Empty Slot.")),
|
||||
FileSaveName(i))
|
||||
|
||||
text description
|
||||
|
||||
key "save_delete" action FileDelete(i)
|
||||
@@ -305,7 +312,7 @@ screen load:
|
||||
use navigation
|
||||
use file_picker
|
||||
|
||||
init python:
|
||||
init -2 python:
|
||||
style.file_picker_frame = Style(style.menu_frame)
|
||||
|
||||
style.file_picker_nav_button = Style(style.small_button)
|
||||
@@ -427,15 +434,19 @@ screen preferences:
|
||||
action Play("voice", config.sample_voice)
|
||||
style "soundtest_button"
|
||||
|
||||
init python:
|
||||
init -2 python:
|
||||
style.pref_frame.xfill = True
|
||||
style.pref_frame.xmargin = 5
|
||||
style.pref_frame.top_margin = 5
|
||||
|
||||
style.pref_vbox.xfill = True
|
||||
|
||||
style.pref_button.size_group = "pref"
|
||||
style.pref_button.xalign = 1.0
|
||||
|
||||
style.pref_slider.xmaximum = 192
|
||||
style.pref_slider.xalign = 1.0
|
||||
|
||||
style.soundtest_button.xalign = 1.0
|
||||
|
||||
|
||||
@@ -455,31 +466,28 @@ screen yesno_prompt:
|
||||
frame:
|
||||
style_group "yesno"
|
||||
|
||||
has vbox
|
||||
|
||||
label _(message)
|
||||
xfill True
|
||||
xmargin .05
|
||||
ypos .1
|
||||
yanchor 0
|
||||
ypadding .05
|
||||
|
||||
has vbox:
|
||||
xalign .5
|
||||
yalign .5
|
||||
spacing 30
|
||||
|
||||
label _(message):
|
||||
xalign 0.5
|
||||
|
||||
hbox:
|
||||
xalign 0.5
|
||||
spacing 100
|
||||
|
||||
textbutton _("Yes") action yes_action
|
||||
textbutton _("No") action no_action
|
||||
|
||||
|
||||
init python:
|
||||
|
||||
style.yesno_frame.xfill = True
|
||||
style.yesno_frame.xmargin = .05
|
||||
style.yesno_frame.ypos = .1
|
||||
style.yesno_frame.yanchor = 0
|
||||
style.yesno_frame.ypadding = .05
|
||||
|
||||
style.yesno_vbox.xalign = 0.5
|
||||
style.yesno_vbox.yalign = 0.5
|
||||
style.yesno_vbox.box_spacing = 30
|
||||
|
||||
style.yesno_hbox.xalign = 0.5
|
||||
style.yesno_hbox.spacing = 100
|
||||
|
||||
init -2 python:
|
||||
style.yesno_button.size_group = "yesno"
|
||||
|
||||
style.yesno_label.xalign = 0.5
|
||||
style.yesno_label_text.text_align = 0.5
|
||||
|
||||
Reference in New Issue
Block a user