custom preferences issues.

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
Wyndstryker
Newbie
Posts: 3
Joined: Thu Oct 25, 2007 2:10 am
Contact:

custom preferences issues.

#1 Post by Wyndstryker »

hello, I was wondering if someone can help me with this problem.

I'm trying to customize the main menu, preferences, save, etc.

while testing through, i stumbled upon a little problem. even though i can get into the main game and have the text window running smoothly and so forth. when i right click to enter the preferences, it just gives me a blank screen. however, if i try to enter the preferences through the main menu or save menu, it's fine.

the bit of code may be a bit...odd since i pretty much copy/pasted from whatever i can search for in the forums. i'm still quite unfamiliar with renpy so if anything doesn't make sense please bear with it.

Code: Select all

    # Edited Main Menu Below
label main_menu:
    
    $ ui.keymap(toggle_fullscreen = renpy.toggle_fullscreen)
    $ ui.window(style='mm_root')
    $ ui.null()

    $ ui.imagebutton("start_idle.png", "start_hover.png", clicked=ui.jumpsoutofcontext("start"), xpos=100, ypos=100)
    $ ui.imagebutton("continue_idle.png", "continue_hover.png", clicked=_intra_jumps("_load_screen", "main_game_transition"), xpos=200, ypos=200)
    $ ui.imagebutton("prefs_idle.png", "prefs_hover.png", clicked=_intra_jumps("_prefs_screen","main_game_transition"), xpos=300, ypos=300)
    $ ui.imagebutton("quit_idle.png", "quit_hover.png", clicked=ui.jumps("_quit"), xpos=400, ypos=400)
  
    $ ui.interact(suppress_overlay=True,
                         suppress_underlay=True,
                         mouse="mainmenu")
    
    #Edited Game Menu Below
label game_menu:
    
    $ ui.keymap(toggle_fullscreen = renpy.toggle_fullscreen)
    $ ui.window(style='gm_root')
    $ ui.null()
    
    $ ui.interact(suppress_overlay=True,
                         suppress_underlay=True,
                         mouse="gamemenu")
                         

    
init:
        #Game Menu Positions and Button Edits        
        
    $ config.game_menu_positions = {
        'Return' : dict(xpos=400, ypos=400, xanchor='left', yanchor='top'),
        'Begin Skipping' : dict(xpos=500, ypos=300, xanchor='left', yanchor='top'),
        'Preferences' : dict(xpos=450, ypos=430, xanchor='left', yanchor='top'),
        'Save Game' : dict(xpos=500, ypos=460, xanchor='left', yanchor='top'),
        'Load Game' : dict(xpos=550, ypos=490, xanchor='left', yanchor='top'),
        'Main Menu' : dict(xpos=600, ypos=520, xanchor='left', yanchor='top'),
        'Quit' : dict(xpos=650, ypos=550, xanchor='left', yanchor='top'),
        }
        
        #Return Buttons
    $ config.image_buttons["Return"]=(
    "return_idle.png",
    "return_hover.png",
    "return_sel_idle.png",
    "return_sel_hover.png",
    "return_disable.png",)

        #Begin Skip Buttons
    $ config.image_buttons["Begin Skipping"]=(
    "skip_idle.png",
    "skip_hover.png",
    "skip_sel_idle.png",
    "skip_sel_hover.png",
    "skip_disable.png",)

#the button code continues on but modified for each button in the game menu. cut it off here to save some space.

        

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: custom preferences issues.

#2 Post by JQuartz »

If you really want to use the codes, you can use this low quality fix until someone else who is actually a programmer comes along.

Put this code:

Code: Select all

$ ui.textbutton("",clicked=_intra_jumps("_load_screen", "main_game_transition"),hovered =_intra_jumps("_load_screen", "main_game_transition"),xminimum=800, yminimum=600)
in this part of your code

Code: Select all

    #Edited Game Menu Below
label game_menu:
    
    $ ui.keymap(toggle_fullscreen = renpy.toggle_fullscreen)
    $ ui.window(style='gm_root')
    <PASTE HERE>
    $ ui.null()
    
    $ ui.interact(suppress_overlay=True,
                         suppress_underlay=True,
                         mouse="gamemenu")
 
Hope it helps.
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

Wyndstryker
Newbie
Posts: 3
Joined: Thu Oct 25, 2007 2:10 am
Contact:

Re: custom preferences issues.

#3 Post by Wyndstryker »

thanks alot! it works and will work as a temporary fix as you said.

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: custom preferences issues.

#4 Post by JQuartz »

If you're actually okay with that then you might as well remove this part of the code

Code: Select all

 #Edited Game Menu Below
label game_menu:
    
    $ ui.keymap(toggle_fullscreen = renpy.toggle_fullscreen)
    $ ui.window(style='gm_root')
    <You might have pasted the code I posted here, so delete it as well>
    $ ui.null()
    
    $ ui.interact(suppress_overlay=True,
                         suppress_underlay=True,
                         mouse="gamemenu")
Doing this will get you straight into the save screen when you right click.

When you right-click, its seems the game will jump to the label game_menu which previously have only a window(blank screen). The ui.interact will then stop you from moving on so you end up stuck with the blank screen. I think you should only create the label game_menu if you actually want to jump to a custom screen (which is currently your blank screen)
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

Wyndstryker
Newbie
Posts: 3
Joined: Thu Oct 25, 2007 2:10 am
Contact:

Re: custom preferences issues.

#5 Post by Wyndstryker »

ok, that fixed the problem lol. thanks!

Post Reply

Who is online

Users browsing this forum: Adabelitoo