Page 1 of 1

On press hotspot opens PopUp

Posted: Sun Jun 02, 2019 5:16 pm
by richycapy
Greetins!

I made this little screen

Code: Select all

screen comingsoon:
    modal True
    zorder 100

    fixed:
        area 500, 500, 620, 200
        add "images/gui/notify-comingsoon.png"
        hbox:
                yalign 0.10
                xalign 0.03
                text _('Still under development')

    timer 3.25 action Hide('comingsoon')

screen bg_casa_andy_room:
    imagemap:
        ground "images/bgs/casa/andy-room.png"
        hover "images/bgs/casa/andy-room-hover.png"
        hotspot(811, 336, 269, 281) action Return("casa_cama_andy")
        hotspot(1163, 122, 114, 596) action Return("casa_hallway")
        
label label_casa_andy_room:
    hide bg_casa_hallway
    call screen bg_casa_andy_room
    if _return == "casa_cama_andy":
        hide bg_casa_andy_room
        jump label_casa_frente
    elif  _return == "casa_hallway":
        show screen comingsoon
        
label label_casa_bathroom:
    hide bg_casa_hallway
    call screen bg_casa_bathroom
    if _return == "casa_livingroom":
        hide bg_casa_hallway
        jump label_casa_hallway        
So it should show the pop up when I press the hotspot casa_hallway. The problem is that it shows the popup, but it also continues the script, meening it goes to the next "jump" in the code, in this case call screen bg_casa_bathroom is there a way to just show the pop up with out continuing the script?

Thanks!

Re: On press hotspot opens PopUp

Posted: Sun Jun 02, 2019 5:41 pm
by Imperf3kt
Add modal True to the screen bg_casa_andy_room

Re: On press hotspot opens PopUp

Posted: Sun Jun 02, 2019 5:58 pm
by richycapy
Nop, didnt work either :(

Re: On press hotspot opens PopUp

Posted: Mon Jun 03, 2019 4:42 am
by Matalla
You can do several things, probably a combination of them

- Call the screen comingsoon, instead of showing it
- Put a pause and/or a jump to where it should go after showing the screen
- Put some order in your code, like, taking your screens to another file

Re: On press hotspot opens PopUp

Posted: Mon Jun 03, 2019 5:01 pm
by strayerror
Need take both responses so far and glue them together!
Matalla wrote:
Mon Jun 03, 2019 4:42 am
- Put a pause and/or a jump to where it should go after showing the screen
Using a jump after showing the popup will ensure that you stay in the same room, instead of accidentally ending up in the bathroom code:

Code: Select all

    elif  _return == "casa_hallway":
        show screen comingsoon
        jump label_casa_andy_room # <--- restart the room
    return # <-- safety to prevent accidentally continuing to the bathroom in future
Imperf3kt wrote:
Sun Jun 02, 2019 5:41 pm
Add modal True to the screen bg_casa_andy_room
After the jump change, the popup will display on top of the bg_casa_andy_room, which is hopefully what you're going for. Adding the modal setting Imperf3kt metions will ensure that you can't click any of the hotspots again until after the popup has hidden itself.

Hope that helps!

Re: On press hotspot opens PopUp

Posted: Mon Jun 03, 2019 6:01 pm
by richycapy
It helped! :D Thanks a lot! :D