Display blurb each time we launch a game.
For now, these blurbs teach users about keyboard features, like shift+R and shift+O.
This commit is contained in:
@@ -385,7 +385,7 @@ init python in interface:
|
||||
common(_("INFORMATION"), store.INFO_COLOR, message, submessage, pause0=True, **kwargs)
|
||||
|
||||
|
||||
def interaction(title, message, submessage=None, **kwargs):
|
||||
def interaction(title, message, submessage=None, pause=0, **kwargs):
|
||||
"""
|
||||
Put up on the screen while an interaction with an external program occurs.
|
||||
This shows the message, then immediately returns.
|
||||
@@ -398,9 +398,13 @@ init python in interface:
|
||||
|
||||
`submessage`
|
||||
An optional sub message.
|
||||
|
||||
`pause`
|
||||
The amount of time to pause for after showing the message.
|
||||
"""
|
||||
|
||||
common(title, store.INTERACTION_COLOR, message, submessage, pause0=True, **kwargs)
|
||||
common(title, store.INTERACTION_COLOR, message, submessage=None, pause=pause, show_screen=True, **kwargs)
|
||||
renpy.pause(pause)
|
||||
|
||||
def processing(message, submessage=None, complete=None, total=None, **kwargs):
|
||||
"""
|
||||
|
||||
@@ -23,6 +23,15 @@ init python in project:
|
||||
import re
|
||||
import tempfile
|
||||
|
||||
if persistent.blurb is None:
|
||||
persistent.blurb = 0
|
||||
|
||||
LAUNCH_BLURBS = [
|
||||
_("After making changes to the script, press shift+R to reload your game."),
|
||||
_("Press shift+O (the letter) to access the console."),
|
||||
_("Press shift+D to access the developer menu."),
|
||||
]
|
||||
|
||||
class Project(object):
|
||||
|
||||
def __init__(self, path):
|
||||
@@ -480,8 +489,16 @@ init python in project:
|
||||
def get_sensitive(self):
|
||||
return self.project is not None
|
||||
|
||||
def post_launch(self):
|
||||
blurb = LAUNCH_BLURBS[persistent.blurb % len(LAUNCH_BLURBS)]
|
||||
persistent.blurb += 1
|
||||
|
||||
interface.interaction(_("Launching"), blurb, pause=2.5)
|
||||
|
||||
|
||||
def __call__(self):
|
||||
self.project.launch()
|
||||
renpy.invoke_in_new_context(self.post_launch)
|
||||
|
||||
class Rescan(Action):
|
||||
def __call__(self):
|
||||
|
||||
Reference in New Issue
Block a user