Page 1 of 1

Changing confirm prompt messages?

Posted: Wed Apr 03, 2019 11:04 pm
by pumpkin spike
Hi, I'm having trouble changing the default confirm prompt messages? I used the syntax from here: https://www.renpy.org/doc/html/screen_s ... ml#confirm

and tried adding the following to both the GUI and script files:

Code: Select all

define gui.LOADING = "Loading will lose unsaved progress. Is this OK?"
define gui.MAIN_MENU = "Returning to the Main Menu will lose unsaved progress. Is this OK?"
I only need these two messages changed, by the way, cause they're too big in the font + size I want to use for my confirm screen. I didn't touch the other messages.

When I restart the game, they still use the default messages.

I've also tried using 'default' instead of 'define' to no avail. What am I doing wrong?

Re: Changing confirm prompt messages?

Posted: Sun Apr 07, 2019 11:23 pm
by XxrenxX
Not sure what your'd doing wrong. My prompts are mostly text and text buttons so maybe this will help?

Code: Select all

    if message == layout.OVERWRITE_SAVE:
        text "{b}Overwrite Data?{/b}" #title (delete if not needed)
        text "Previous data will be lost." #subtext
        textbutton "Yes" action yes_action
        textbutton "No" action no_action
I think you would just add it into already existing code. Since it's an if statement it should override the previous if you are using the command indicated such as saving or loading. I use this code for all my messages as they all have different text so I haven't tested it with the original yes/no prompt code.

If you want to edit the text (idk how to edit textbutton without effecting all) you can create a style for them.

Code: Select all

    if message == layout.MAIN_MENU:
        text "{b}Return to Title?{/b}" xpos 450 ypos 218 style "ynp_title"

init python:
     style.ynp_title = Style(style.default)
     style.ynp_title.color = "#000"
     style.ynp_title.size = 33

Re: Changing confirm prompt messages?

Posted: Wed Apr 10, 2019 8:35 pm
by pumpkin spike
Sadly, that didn't work for me... I ended up brute forcing it with conditionals ;w;"

Code: Select all

label _(message):
    if (message == "Loading will lose unsaved progress.\nAre you sure you want to do this?") or (message == "Are you sure you want to return to the main menu?\nThis will lose unsaved progress."): 
        style "confirm_prompta" 
    else: 
        style "confirm_prompt"
I just copy-pasted the confirm_prompt style and relabeled it as confirm_prompta, but I changed the size for the font.
I did try setting the message within that if to what I want, but I was getting errors.

If someone has a more elegant solution, please let me know, I'd love to try it ;w;