Page 1 of 2

Showing quick menu only when text box out

Posted: Thu Jul 12, 2012 9:08 pm
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?

Re: Showing quick menu only when text box out

Posted: Thu Jul 12, 2012 10:02 pm
by tuna_sushi
You could make the quick menu as a part of the textbox, then imagemap it.

Re: Showing quick menu only when text box out

Posted: Fri Jul 13, 2012 9:35 pm
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)...)

Re: Showing quick menu only when text box out

Posted: Fri Jul 13, 2012 10:02 pm
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?

Re: Showing quick menu only when text box out

Posted: Sat Jul 14, 2012 12:29 am
by nyaatrap

Code: Select all

screen say:
    ......
    use quick_menu

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

Re: Showing quick menu only when text box out

Posted: Sat Jul 14, 2012 1:00 am
by Coren
I tried that, but that makes the quickmenu visible even when you are showing centered text, which I do not want.

Re: Showing quick menu only when text box out

Posted: Sat Jul 14, 2012 1:14 am
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.

Re: Showing quick menu only when text box out

Posted: Sat Jul 14, 2012 1:18 am
by tuna_sushi
Edit : nevermind :oops: :oops: :oops:

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

Re: Showing quick menu only when text box out

Posted: Sat Jul 14, 2012 2:28 am
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

Re: Showing quick menu only when text box out

Posted: Sat Jul 14, 2012 2:31 am
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

Re: Showing quick menu only when text box out

Posted: Sat Jul 14, 2012 5:32 am
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?

Re: Showing quick menu only when text box out

Posted: Sat Jul 14, 2012 6:06 am
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?

Re: Showing quick menu only when text box out

Posted: Sat Jul 14, 2012 6:15 am
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? :)

Re: Showing quick menu only when text box out

Posted: Sun Jul 15, 2012 6:11 am
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.

Re: Showing quick menu only when text box out

Posted: Mon Jul 16, 2012 9:21 am
by Coren
Oh, thanks. Where can I copypaste the code?