Showing quick menu only when text box out

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.
Message
Author
User avatar
Coren
Mindscrew Driver
Posts: 1691
Joined: Fri Sep 18, 2009 9:24 am
Completed: Dear Mariko, Six Rules, Ribbon of Green, RE: Prince of Nigeria, Doppelganger, Cole's Gate Demo, Crimson Rafflesia Demo, Mica: Apoptosis Demo
Projects: Crimson Rafflesia, Mica: Apoptosis, Fantasy Euthanasia
Organization: Soyasushi Productions
Tumblr: CorenBaili
Deviantart: CorenB
Skype: coren.baili
Contact:

Showing quick menu only when text box out

#1 Post by Coren »

Is there a way to only show the quick menu when the text box is visible, or do I have to show and hide it manually?

tuna_sushi
Veteran
Posts: 299
Joined: Thu Jul 07, 2011 9:33 am
Projects: BloomingBlossoms
Contact:

Re: Showing quick menu only when text box out

#2 Post by tuna_sushi »

You could make the quick menu as a part of the textbox, then imagemap it.

User avatar
Kuroneko_rg
Veteran
Posts: 294
Joined: Sat Oct 22, 2011 8:39 pm
Projects: Dark Pleasures, Kiss of Blood, Midnight Park
Organization: Black Cat Alleyway
Location: Yomi
Contact:

Re: Showing quick menu only when text box out

#3 Post by Kuroneko_rg »

I can't look in it since I'm not using the computer I use to work, but you can look for "hide windows" in "00library.rpy" or "00screens.rpy" in the "common" folder of renpy. I'm not sure if there is it, but if you find it, you can add some code to make it hide and show the quick menu alongside the say window.
I'm not sure if it can be done that way, but give it a try if everything else fails.

Sorry I can't be of any more help right now (I'm in the middle of a blackout (T_T)...)

User avatar
Coren
Mindscrew Driver
Posts: 1691
Joined: Fri Sep 18, 2009 9:24 am
Completed: Dear Mariko, Six Rules, Ribbon of Green, RE: Prince of Nigeria, Doppelganger, Cole's Gate Demo, Crimson Rafflesia Demo, Mica: Apoptosis Demo
Projects: Crimson Rafflesia, Mica: Apoptosis, Fantasy Euthanasia
Organization: Soyasushi Productions
Tumblr: CorenBaili
Deviantart: CorenB
Skype: coren.baili
Contact:

Re: Showing quick menu only when text box out

#4 Post by Coren »

tuna_sushi wrote:You could make the quick menu as a part of the textbox, then imagemap it.
Yeah I have been trying to ask how to do that since months ago, but nobody would respond so I ended up thinking it was impossible (which resulted in me separating the quickmenu from the text box). S: Can you tell me how to imagemap the messagebox?

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Showing quick menu only when text box out

#5 Post by nyaatrap »

Code: Select all

screen say:
    ......
    use quick_menu

screen quick_menu:
    ......
implement imagemaps in these ....... parts.

User avatar
Coren
Mindscrew Driver
Posts: 1691
Joined: Fri Sep 18, 2009 9:24 am
Completed: Dear Mariko, Six Rules, Ribbon of Green, RE: Prince of Nigeria, Doppelganger, Cole's Gate Demo, Crimson Rafflesia Demo, Mica: Apoptosis Demo
Projects: Crimson Rafflesia, Mica: Apoptosis, Fantasy Euthanasia
Organization: Soyasushi Productions
Tumblr: CorenBaili
Deviantart: CorenB
Skype: coren.baili
Contact:

Re: Showing quick menu only when text box out

#6 Post by Coren »

I tried that, but that makes the quickmenu visible even when you are showing centered text, which I do not want.

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Showing quick menu only when text box out

#7 Post by nyaatrap »

what is your code and what the case your want to exclude exactly?
It can be done using if statement inside of the say screen.

tuna_sushi
Veteran
Posts: 299
Joined: Thu Jul 07, 2011 9:33 am
Projects: BloomingBlossoms
Contact:

Re: Showing quick menu only when text box out

#8 Post by tuna_sushi »

Edit : nevermind :oops: :oops: :oops:

I found this thread and it might help you...
[link]

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Showing quick menu only when text box out

#9 Post by nyaatrap »

Code: Select all

screen say:
    if show_quick_menu:
         use quick_menu

label start:
    $show_quick_menu=false
BTW, this is a code I'm using to control showing the quick menu

User avatar
FatUnicornGames
Miko-Class Veteran
Posts: 576
Joined: Sun Mar 25, 2012 7:54 pm
Projects: Club Shuffle
Contact:

Re: Showing quick menu only when text box out

#10 Post by FatUnicornGames »

I used the technique I learned in this thread to make a quickmenu and mine disappears when the textbox does.

http://lemmasoft.renai.us/forums/viewto ... =8&t=15769
Image
Developer Blog for Club Shuffle - Follow and Share?
-Also! You can call me Crystal if you want.-

User avatar
Coren
Mindscrew Driver
Posts: 1691
Joined: Fri Sep 18, 2009 9:24 am
Completed: Dear Mariko, Six Rules, Ribbon of Green, RE: Prince of Nigeria, Doppelganger, Cole's Gate Demo, Crimson Rafflesia Demo, Mica: Apoptosis Demo
Projects: Crimson Rafflesia, Mica: Apoptosis, Fantasy Euthanasia
Organization: Soyasushi Productions
Tumblr: CorenBaili
Deviantart: CorenB
Skype: coren.baili
Contact:

Re: Showing quick menu only when text box out

#11 Post by Coren »

nyaatrap wrote:what is your code and what the case your want to exclude exactly?
It can be done using if statement inside of the say screen.

All I want to do is to only have the quick menu appear when the message box appears. Which means no quick menu during nvl, centered text, etc. etc.

I tried looking at the earlier thread but I got very confused. Am I supposed to have the message box and the quick menu as one image, or separate images like I am doing now?

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Showing quick menu only when text box out

#12 Post by nyaatrap »

The problem seems the nvl mode is using the same say screen definition to adv mode.
I never used the nvl mode but if you know what parameter the nvl character has, replacing that parameter with the "show_quick_menu" variable I present solves your problem. Maybe someone who used the nvl mode knows that parameter?

User avatar
Coren
Mindscrew Driver
Posts: 1691
Joined: Fri Sep 18, 2009 9:24 am
Completed: Dear Mariko, Six Rules, Ribbon of Green, RE: Prince of Nigeria, Doppelganger, Cole's Gate Demo, Crimson Rafflesia Demo, Mica: Apoptosis Demo
Projects: Crimson Rafflesia, Mica: Apoptosis, Fantasy Euthanasia
Organization: Soyasushi Productions
Tumblr: CorenBaili
Deviantart: CorenB
Skype: coren.baili
Contact:

Re: Showing quick menu only when text box out

#13 Post by Coren »

Hmm, so do I just put "show_quick_menu" behind the characters who speak through the text box? Would that work?

FatUnicorn is it possible to show me the code you used to piece the quick menu to the text box? :)

User avatar
Kuroneko_rg
Veteran
Posts: 294
Joined: Sat Oct 22, 2011 8:39 pm
Projects: Dark Pleasures, Kiss of Blood, Midnight Park
Organization: Black Cat Alleyway
Location: Yomi
Contact:

Re: Showing quick menu only when text box out

#14 Post by Kuroneko_rg »

I don't know if this still matters, but this is how I did it. Also, this is my first time posting code, so I'll try to make this right.

There is a file under the "common" folder of renpy named "00statements.rpy". If you open it with jedit, you will find several
functions defined there. Here is the one that matters:

Code: Select all

# "window show" and "window hide" statements.

    def parse_window(l):
        p = l.simple_expression()
        if not l.eol():
            renpy.error('expected end of line')

        return p
            
    def lint_window(p):
        if p is not None:
            _try_eval(p, 'window transition')

    def execute_window_show(p):
        if store._window:
            return

        if p is not None:
            trans = eval(p)
        else:
            trans = config.window_show_transition
            
        renpy.with_statement(None)
        store._window = True
        renpy.with_statement(trans)

        
    def execute_window_hide(p):
        if not _window:
            return
        
        if p is not None:
            trans = eval(p)
        else:
            trans = config.window_hide_transition

        renpy.with_statement(None)
        store._window = False
        renpy.with_statement(trans)

    renpy.statements.register('window show',
                              parse=parse_window,
                              execute=execute_window_show,
                              lint=lint_window)

    renpy.statements.register('window hide',
                              parse=parse_window,
                              execute=execute_window_hide,
                              lint=lint_window)

You can easily modify this, but it will break any other project that doesn't include a quick menu.
Instead, copy that code to make your own function below, or just use mine.

Code: Select all

# "window show" and "window hide" plus quick menu statements.

    def parse_windowm(l):
        p = l.simple_expression()
        if not l.eol():
            renpy.error('expected end of line')

        return p
            
    def lint_windowm(p):
        if p is not None:
            _try_eval(p, 'window transition')

    def execute_windowm_show(p): 
        if store._window:
            return

        if p is not None:
            trans = eval(p)
        else:
            trans = config.window_show_transition
            
        renpy.with_statement(None)
        store._window = True
        renpy.show_screen("quick_menu")  #Here you include your quick menu screen
        renpy.with_statement(trans)

        
    def execute_windowm_hide(p):
        if not _window:
            return
        
        if p is not None:
            trans = eval(p)
        else:
            trans = config.window_hide_transition

        renpy.with_statement(None)
        store._window = False
        renpy.hide_screen("quick_menu")   #Include your quick menu here as well
        renpy.with_statement(trans)

    renpy.statements.register('windowm show',
                              parse=parse_windowm,
                              execute=execute_windowm_show,
                              lint=lint_windowm)

    renpy.statements.register('windowm hide',
                              parse=parse_windowm,
                              execute=execute_windowm_hide,
                              lint=lint_windowm)    
Now you have two functions. "window show" and "window hide" remains as always. "windowm show" and windowm hide" will
show and hide the quick menu alongside the textbox.

A last thing, if your quick menu now appears behind the textbox, you can easily fix this by adding zorder 1 in your screens
file.

Code: Select all

screen quick_menu:

   zorder 1  #This works for me, but try higher values if it doesn't.

User avatar
Coren
Mindscrew Driver
Posts: 1691
Joined: Fri Sep 18, 2009 9:24 am
Completed: Dear Mariko, Six Rules, Ribbon of Green, RE: Prince of Nigeria, Doppelganger, Cole's Gate Demo, Crimson Rafflesia Demo, Mica: Apoptosis Demo
Projects: Crimson Rafflesia, Mica: Apoptosis, Fantasy Euthanasia
Organization: Soyasushi Productions
Tumblr: CorenBaili
Deviantart: CorenB
Skype: coren.baili
Contact:

Re: Showing quick menu only when text box out

#15 Post by Coren »

Oh, thanks. Where can I copypaste the code?

Post Reply

Who is online

Users browsing this forum: fufuffiero, Google [Bot], Semrush [Bot], W3C [Validator]