changing translation hides navigation bar [solved]

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
User avatar
saguaro
Miko-Class Veteran
Posts: 560
Joined: Sun Feb 12, 2012 9:17 am
Completed: Locked-In, Sunrise, The Censor
Organization: Lucky Special Games
itch: saguarofoo
Location: USA
Contact:

changing translation hides navigation bar [solved]

#1 Post by saguaro »

When toggling languages the navigation bar on my preference screen disappears. "menu_bg_screen" that is part of the navigation screen remains, but the nav bar itself vanishes. I am a bit rusty so I may be missing something obvious. Screenshot 1 before, 2 after.

Code: Select all

screen preferences():
    tag menu
    use navigation    

    ...

            vbox:
                frame:
                    has vbox
                    label _("Language")
                    textbutton "English" action Language(None)
                    textbutton "Deutsch" action Language("german")

Code: Select all

screen navigation():
    frame:
        style_group "mmenu"
        at drop_down(2.0)
        hbox:       
            spacing 75
            null width 50
            if not renpy.get_screen("main_menu"):
                textbutton _("Return") action Return()
            else:
                textbutton _("Start") action Start() xysize(112, 28)
            if main_menu:           
                textbutton _("Scenes") action [If(renpy.get_screen("scenes"), NullAction(), ShowMenu("scenes")), SelectedIf(renpy.get_screen("scenes"))]
            textbutton _("Options") action [If(renpy.get_screen("preferences"), NullAction(), ShowMenu("preferences")), SelectedIf(renpy.get_screen("preferences"))] 
            if not main_menu:
                textbutton _("Save") action [If(renpy.get_screen("save"), NullAction(), ShowMenu("save")), SelectedIf(renpy.get_screen("save"))]
            textbutton _("Load") action [If(renpy.get_screen("load"), NullAction(), ShowMenu("load")), SelectedIf(renpy.get_screen("load"))]             
            if not main_menu:
                textbutton _("Main") action MainMenu()
                textbutton _("Quit") action Quit(confirm=True)
            else:
                textbutton _("Quit") action Quit(confirm=False)
            null width 50    
            
    on "show" action Show("menu_bg_screen")  
Attachments
screenshot0002.png
screenshot0001.png
Last edited by saguaro on Mon Jul 06, 2015 2:48 pm, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: changing translation hides navigation bar

#2 Post by PyTom »

Can you shift+I style-inspect where it should be, to see if it's there and just hidden?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
saguaro
Miko-Class Veteran
Posts: 560
Joined: Sun Feb 12, 2012 9:17 am
Completed: Locked-In, Sunrise, The Censor
Organization: Lucky Special Games
itch: saguarofoo
Location: USA
Contact:

Re: changing translation hides navigation bar

#3 Post by saguaro »

It appears to be gone, I cannot locate it.

User avatar
saguaro
Miko-Class Veteran
Posts: 560
Joined: Sun Feb 12, 2012 9:17 am
Completed: Locked-In, Sunrise, The Censor
Organization: Lucky Special Games
itch: saguarofoo
Location: USA
Contact:

Re: changing translation hides navigation bar

#4 Post by saguaro »

Well, the workaround on this is kinda obvious I guess... simply have the button show the navigation screen. Should I make a replication for this?

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: changing translation hides navigation bar [solved]

#5 Post by PyTom »

Yes please.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: changing translation hides navigation bar [solved]

#6 Post by PyTom »

So, it turns out the problem was code of the form:

Code: Select all

transform drop_down(e):
    yalign -0.1
    on show:
        easein e yalign 0.1
    on hide:        
        linear 0.5 alpha 0.0
    on replace:
        yalign 0.1 alpha 1.0
    on replaced:        
        yalign 0.1 alpha 1.0  
The problem turned out to be that there are rare cases where a screen can show up without being shown. These include when the screen is first shown, and when the screen is recompiled after a style or language change. When that happens, the screen stays at yalign -0.1 and hence off the screen. I've added a new ATL event - update - to 6.99.5 to account for this case.

Until then (or even forever) you can work around this with code like:

Code: Select all

transform drop_down(e):
    yalign 0.1 alpha 1.0

    on show:
        yalign -0.1
        easein e yalign 0.1
    on hide:
        linear 0.5 alpha 0.0
Basically, don't do the show behavior unless you see the show event.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
saguaro
Miko-Class Veteran
Posts: 560
Joined: Sun Feb 12, 2012 9:17 am
Completed: Locked-In, Sunrise, The Censor
Organization: Lucky Special Games
itch: saguarofoo
Location: USA
Contact:

Re: changing translation hides navigation bar [solved]

#7 Post by saguaro »

Thank you very much!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]