Allow several achievements to be displayed at the same time
like in steam the change to popup_animation is not thoroughly tested
This commit is contained in:
parent
3b5f35a732
commit
f714e482f6
@ -60,7 +60,7 @@ init python:
|
|||||||
|
|
||||||
class Achievements(object):
|
class Achievements(object):
|
||||||
"""
|
"""
|
||||||
Useless class, to be rolled out.
|
Useless class, can't be rolled out because of pickle and save compatibility.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -84,7 +84,7 @@ init python:
|
|||||||
|
|
||||||
if not silent:
|
if not silent:
|
||||||
renpy.play('sounds/achievement.ogg')
|
renpy.play('sounds/achievement.ogg')
|
||||||
renpy.show_screen("achievement_window", msg=achievements_db[id].title, title="Achievement unlocked!", icon=achievements_db[id].icon)
|
__popup_stack.append(id)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def lock(self, id):
|
def lock(self, id):
|
||||||
@ -118,6 +118,21 @@ default achievements = Achievements()
|
|||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
|
init python:
|
||||||
|
# intentionaly not a define nor a default
|
||||||
|
__popup_stack = []
|
||||||
|
|
||||||
|
config.after_default_callbacks.append(__popup_stack.clear)
|
||||||
|
config.always_shown_screens.append("achievement_main")
|
||||||
|
|
||||||
|
screen achievement_main():
|
||||||
|
layer "interface"
|
||||||
|
|
||||||
|
vbox:
|
||||||
|
for id index id in __popup_stack[:3]:
|
||||||
|
use achievement_window(msg=achievements_db[id].title, title="Achievement unlocked!", icon=achievements_db[id].icon)
|
||||||
|
timer 6 action Function(__popup_stack.remove, id)
|
||||||
|
|
||||||
label popup(msg="", title="", icon=None, xpos=0, ypos=60, sound=True, soundfile='sounds/achievement.ogg'):
|
label popup(msg="", title="", icon=None, xpos=0, ypos=60, sound=True, soundfile='sounds/achievement.ogg'):
|
||||||
if sound:
|
if sound:
|
||||||
play sound soundfile
|
play sound soundfile
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
transform popup_animation(time=4.0, xx=-200):
|
transform popup_animation(time=4.0, xx=-200):
|
||||||
on start:
|
xoffset xx
|
||||||
xoffset xx
|
linear 0.5 xoffset absolute(0)
|
||||||
on show:
|
pause time
|
||||||
xoffset xx
|
linear 0.5 xoffset absolute(xx)
|
||||||
linear 0.5 xoffset absolute(0)
|
|
||||||
pause time
|
|
||||||
linear 0.5 xoffset absolute(xx)
|
|
||||||
|
|
||||||
screen popup_window(msg="", xpos=0, ypos=60):
|
screen popup_window(msg="", xpos=0, ypos=60):
|
||||||
tag popup_window
|
tag popup_window
|
||||||
|
Loading…
Reference in New Issue
Block a user