[Solved]Yes/No Prompt Customization
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.
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.
-
- Regular
- Posts: 179
- Joined: Wed Mar 13, 2013 9:55 pm
- Completed: MazeSite01, Ponderings of Time
- Contact:
[Solved]Yes/No Prompt Customization
Two questions about the yes/no prompt's customization--
1) Is it possible to add a gutter/buffer for the _message?
I'm getting something like- which, frankly, doesn't look nice.
2) Is it possible to add a black background to the "Are you sure that you want to quit?" screen, but only when the screen doesn't appear on top of any other screens/layer over them?
Honestly, looking at a checkerboard of grey squares-- isn't very interesting either.
Thanks in advance!
1) Is it possible to add a gutter/buffer for the _message?
I'm getting something like- which, frankly, doesn't look nice.
2) Is it possible to add a black background to the "Are you sure that you want to quit?" screen, but only when the screen doesn't appear on top of any other screens/layer over them?
Honestly, looking at a checkerboard of grey squares-- isn't very interesting either.
Thanks in advance!
Last edited by mjshi on Sat Jan 10, 2015 1:28 pm, edited 1 time in total.
-
- Lemma-Class Veteran
- Posts: 2299
- Joined: Mon Feb 06, 2012 9:50 pm
- Completed: Icebound, Selenon Rising Ep. 1-2
- Projects: Selenon Rising Ep. 3-4
- Organization: Fastermind Games
- Deviantart: sundownkid
- Location: NYC
- Contact:
Re: Yes/No Prompt Customization
First - yes, you will have to make the text have an xmaximum.
Second - that is not necessary. There is a way to make the yes/no prompt not have to erase the menu, as long as you remove "tag menu" (meaning it goes on top of the menu instead of replacing it) and add "modal True" (meaning you cannot press underlying buttons while it's active) it should work.
Second - that is not necessary. There is a way to make the yes/no prompt not have to erase the menu, as long as you remove "tag menu" (meaning it goes on top of the menu instead of replacing it) and add "modal True" (meaning you cannot press underlying buttons while it's active) it should work.
-
- Regular
- Posts: 179
- Joined: Wed Mar 13, 2013 9:55 pm
- Completed: MazeSite01, Ponderings of Time
- Contact:
Re: Yes/No Prompt Customization
First- thank you!
Second- Yes, this is the code I have, but whenever you click the windows x button it still replaces the currently occurring things--
and I'll attach the images--
Cases where the yes/no replaces whatever is below it--
- pressing the x button on the main menu
- pressing the x button ingame
- pressing the x button in any of the navigation's menus (save, load, prefs)
Cases where the yes/no doesn't replace whatever is below it--
- overwriting a save
- loading a save
- returning to the main menu
- clicking the quit button in game navigation-
- clicking the quit button in the main menu (when confirm is not set to false)
Second- Yes, this is the code I have, but whenever you click the windows x button it still replaces the currently occurring things--
Code: Select all
screen yesno_prompt(message, yes_action, no_action):
modal True
imagemap:
xalign 0.5
yalign 0.45
auto "yesno_%s.png"
hotspot (98, 145, 58, 36) action yes_action
hotspot (277, 143, 51, 32) action no_action
label _(message):
text_style "yesno_label_text"
xalign 0.5
yalign 0.45
# I'll add an xmaximum after dealing with the second problem.
init -2 python:
style.yesno_button.size_group = "yesno"
style.yesno_label_text.text_align = 0.5
style.yesno_label_text.color = "#000"
- pressing the x button on the main menu
- pressing the x button ingame
- pressing the x button in any of the navigation's menus (save, load, prefs)
Cases where the yes/no doesn't replace whatever is below it--
- overwriting a save
- loading a save
- returning to the main menu
- clicking the quit button in game navigation-
- clicking the quit button in the main menu (when confirm is not set to false)
Re: Yes/No Prompt Customization
Code: Select all
init python:
config.quit_action = Quit()
-
- Regular
- Posts: 179
- Joined: Wed Mar 13, 2013 9:55 pm
- Completed: MazeSite01, Ponderings of Time
- Contact:
Re: Yes/No Prompt Customization
I have no idea what you just did, but thank you xD
--Marked as solved.
--Marked as solved.
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: Yes/No Prompt Customization
I wonder why this isn't ren'py default behavior. Is there any side-effect, or just for compatibility reason?xela wrote:Fixes the second issue.Code: Select all
init python: config.quit_action = Quit()
Re: [Solved]Yes/No Prompt Customization
Only PyTom can tell... due to compatibility reasons, quitting logic is an intertwined mess of labels, functions and wrappers or at least it's what it looks like to me. I joined the Ren'Py world after SL was introduced so I have no idea how ui interface behaved in these cases in the past.
I do not however believe that there can be a sideeffect to this when used in modern Ren'Py as it still saves the game if setup to do so and quits the game. It's not like we require this class to do anything else![Very Happy :D](./images/smilies/icon_biggrin.gif)
I do not however believe that there can be a sideeffect to this when used in modern Ren'Py as it still saves the game if setup to do so and quits the game. It's not like we require this class to do anything else
![Very Happy :D](./images/smilies/icon_biggrin.gif)
- Donmai
- Eileen-Class Veteran
- Posts: 1962
- Joined: Sun Jun 10, 2012 1:45 am
- Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
- Projects: Slumberland
- Location: Brazil
- Contact:
Re: [Solved]Yes/No Prompt Customization
I see many people disliking the 'grey squares', for some reason. Maybe because few of them seem to notice that the checkerboard background is only visible whilemjshi wrote:Honestly, looking at a checkerboard of grey squares--
Code: Select all
config.developer = True
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)
TOIRE NO HANAKO (A Story About Fear)
Who is online
Users browsing this forum: No registered users