And this is giving me problems again.Ayutac wrote:[Problem with nested interactions]Until the point I encountered another one in this very context.Ayutac wrote:[method in screen problem]
EDIT: Today on the 6.1.'13 was the first time I found a topic of mine with search function and it helped me solving the problem. Prosit!
So, I'm calling an inventory screen by clicking on a button of the quickmenu, wich is itself within the say screen.
[...]
So basically, how do I create new content and be sure to (automatically) jump back to the old one after I'm finished
Basically I want to put the player into an unescapable while-loop (yes, I'm just that evil), but he can escape with escape because he is still in some kind of screen. Code!
Code: Select all
screen quick_menu:
[...]
textbutton _("Inventory") action ShowMenu('inventory')Code: Select all
screen inventory:
tag menu
window:
$ count = int(math.ceil(math.sqrt(len(inventory))))
$ pc = count*count
grid count count:
style_group "inventory_menu"
for i in range(0,len(inventory)):
[sItemName# generation]
if inventory[i].hasWithD() and invMode == invToUse:
imagebutton:
idle sItemName1
hover sItemName2
action [SetVariable('item', i), SetVariable('mouseOverItem', -1), useItem]
hovered SetVariable('mouseOverItem', i)
elif [other situations]
else:
text Null()
for i in range(len(inventory), pc):
text Null()
vbox:
yalign 0.9
style "say_vbox"
python:
if mouseOverItem > -1:
hoveredItemText = inventory[mouseOverItem].Name + (
" x" + str(inventory[mouseOverItem].getCarryingD()) ) + (
" (stored: " + str(inventory[mouseOverItem].getStoredD()) + ")" )
else:
hoveredItemText = " "
text "[hoveredItemText]"
textbutton _("back") action [SetVariable("item",-1),Return]Code: Select all
init -10 python:
def useItem(): #needed for proper returning from inventory
renpy.call('useItemLabel')
returnCode: Select all
## here is specified what certain items do.
## kwargs needed for proper use of renpy.call
## when adding return anywhere, do not forget to set item = -1
label useItemLabel(**kwargs):
#global item
python:
renpy.hide_screen('inventory')
if girl != -1 or inventory[item].hasWithD() != True:
if girl == -1: ## if not we need to remember the item
$ item = -1
return
python:
if [uses of many items]
elif item == ITEM_RECURSIVE_BOX:
narrator("Are you sure?", interact = False)
if menu([("Yes", True),("No", False)]) == True:
narrator("Very, very sure?", interact = False)
if menu([("Yes", True),("No", False)]) == True:
narrator("Okay! You open the recursive box.")
eRecursiveBoxOpened = True
while True:
narrator("Inside it is another recursive box.")
narrator("You take the recursive box out of the recursive box.")
narrator("You open the recursive box.")
narrator("You leave the box be.")
else:
Oak("[prota.Name], this isn't the right time for this.")
Prota("Professor?")
item = -1
returnI'm very afraid I will have to use curry to make the problem (that the player can escape) go away, but I think I'm finally ready for it. It's just I don't know how to use it to solve the problem :(
