Save screen exiting through X on the window

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Ryue
Miko-Class Veteran
Posts: 745
Joined: Fri Nov 02, 2012 8:41 am
Projects: Red eyes in the darkness
Contact:

Save screen exiting through X on the window

#1 Post by Ryue »

I've got a save screen which does not take up the whole screen itself. When I use right click to leave it the story continues normally. But if I use the X on the screen I need to click with the right mouse key still to come back to the story.

Anyone got an idea how to correct this?

CupCakeComedy
Regular
Posts: 26
Joined: Sun Feb 22, 2015 7:46 pm
Contact:

Re: Save screen exiting through X on the window

#2 Post by CupCakeComedy »

That depend on the code you used for that X button.

Ryue
Miko-Class Veteran
Posts: 745
Joined: Fri Nov 02, 2012 8:41 am
Projects: Red eyes in the darkness
Contact:

Re: Save screen exiting through X on the window

#3 Post by Ryue »

CupCakeComedy wrote:That depend on the code you used for that X button.
Took me a while to get it what you meant (overread the imagebutton the whole time)

In the options.rpythe modified save screen:

Code: Select all

screen save:
    modal True
    window id "save" at slidein:
        style "smallwindow"
        add "Assets/UserInterface/labels/save.png" xalign 0.5 yalign 0.335
            
        imagebutton auto "Assets/UserInterface/close_%s.png" action [Hide("save"), Play("sound", "Assets/SoundEffects/close.ogg")] hovered Play("sound", "Assets/SoundEffects/select.ogg") style "smallwindowclose"
        use file_picker
thus the question is how do I need to correct it so that it really closes the save screen instead of just hiding.

Ryue
Miko-Class Veteran
Posts: 745
Joined: Fri Nov 02, 2012 8:41 am
Projects: Red eyes in the darkness
Contact:

Re: Save screen exiting through X on the window

#4 Post by Ryue »

I tested around a bit and saw that:

Code: Select all

screen save:
    modal True
    window id "save" at slidein:
        style "smallwindow"
        add "Assets/UserInterface/labels/save.png" xalign 0.5 yalign 0.335
            
        imagebutton auto "Assets/UserInterface/close_%s.png" action [Return(), Play("sound", "Assets/SoundEffects/close.ogg")] hovered Play("sound", "Assets/SoundEffects/select.ogg") style "smallwindowclose"
        use file_picker
Solves the rightclick problem BUT the slideout which hide does disappears.


Then I used the original code and added: on "hide" action Return() this did exactly....nothing aka no difference to the starting case

Ryue
Miko-Class Veteran
Posts: 745
Joined: Fri Nov 02, 2012 8:41 am
Projects: Red eyes in the darkness
Contact:

Re: Save screen exiting through X on the window

#5 Post by Ryue »

To sum things up:

The save screen is sliding in and needs to slide out again so taht things look good. MY main problem here right now is that if I use Return() as action on the imagebutton it does not slideout but I get back to game. When I instead hide the save screen it slides out nicely BUT I need to rightclick to get back to game.

Is there any solution for this?

User avatar
Marionette
Regular
Posts: 128
Joined: Thu Apr 21, 2011 12:04 pm
Completed: https://marionette.itch.io/
Projects: Get Meowt of Here
Deviantart: rexx9224
itch: marionette
Location: Ireland
Discord: Marionette#2995
Contact:

Re: Save screen exiting through X on the window

#6 Post by Marionette »

Is it possible to have Hide() and then return() within the same action block?
Something like:

Code: Select all

imagebutton auto "Assets/UserInterface/close_%s.png" action [Hide("save"), Return(), Play("sound", "Assets/SoundEffects/close.ogg")]
I'm not sure if this is even possible, but i might be worth trying if you haven't already.

Other than that maybe you can have it make a call to another label/screen/function that performs both actions.

Ryue
Miko-Class Veteran
Posts: 745
Joined: Fri Nov 02, 2012 8:41 am
Projects: Red eyes in the darkness
Contact:

Re: Save screen exiting through X on the window

#7 Post by Ryue »

Marionette wrote:Is it possible to have Hide() and then return() within the same action block?
Something like:

Code: Select all

imagebutton auto "Assets/UserInterface/close_%s.png" action [Hide("save"), Return(), Play("sound", "Assets/SoundEffects/close.ogg")]
I'm not sure if this is even possible, but i might be worth trying if you haven't already.

Other than that maybe you can have it make a call to another label/screen/function that performs both actions.
Sadly doesn't work. was one of my first tests. It works in a way though BUT the Return() triggers so fasrt that there is no fadeout animation the screen just disappears and the game continues (I want to still be able to have the fadeout where possible)

SundownKid
Lemma-Class Veteran
Posts: 2299
Joined: Mon Feb 06, 2012 9:50 pm
Completed: Icebound, Selenon Rising Ep. 1-2
Projects: Selenon Rising Ep. 3-4
Organization: Fastermind Games
Deviantart: sundownkid
Location: NYC
Contact:

Re: Save screen exiting through X on the window

#8 Post by SundownKid »

Hide is indeed the correct command. I don't see why the X button on the save screen should also exit the base menu, that's kind of bad usability. The whole idea behind getting rid of the save screen is to allow the player to press other options on the base menu instead of simply returning to the game.

Ryue
Miko-Class Veteran
Posts: 745
Joined: Fri Nov 02, 2012 8:41 am
Projects: Red eyes in the darkness
Contact:

Re: Save screen exiting through X on the window

#9 Post by Ryue »

Hmmmmm although in that case there is no menu popping up. Just the disappearinh screen and nothing else

Post Reply

Who is online

Users browsing this forum: Bing [Bot]