change ok prompt to be akin to Wani

This commit is contained in:
2025-06-07 22:31:19 -05:00
parent 07be7f07f5
commit f57bcca85f
3 changed files with 39 additions and 60 deletions

View File

@ -1459,6 +1459,39 @@ style confirm_button_text:
properties gui.text_properties("confirm_button")
## OK Prompt ##############################################################
##
## Apes from the confirm screen to give a similar screen, but only having an OK button
##
## https://www.renpy.org/doc/html/screen_special.html#confirm
screen OkPrompt(message, action=Hide()):
modal True
zorder 200
style_prefix "confirm"
add "gui/overlay/confirm.png"
frame:
vbox:
xalign .5
yalign .5
spacing 30
label _(message):
style "confirm_prompt"
xalign 0.5
hbox:
xalign 0.5
spacing 100
textbutton _("OK") activate_sound "audio/ui/snd_ui_click.wav" action action
## Skip indicator screen #######################################################
##
## The skip_indicator screen is displayed to indicate that skipping is in

View File

@ -1057,10 +1057,10 @@ screen mod_menu():
action Start(mod_metadata["Label"])
activate_sound "audio/ui/uiClick.wav"
showif not persistent.seenModWarning:
use OkPrompt(_("Installing mods is dangerous since you are running unknown code in your computer. Only install mods from sources that you trust.\n\nIf you have problems with installed mods, check the README.md in the root of the mods folder."), \
ToggleVariable("persistent.seenModWarning"))
if not persistent.seenModWarning:
$ persistent.seenModWarning = True
use OkPrompt(_("Installing mods is dangerous since you are running unknown code in your computer. Only install mods from sources that you trust.\n\nIf you have problems with installed mods, check the README.md in the root of the mods folder."), False)
style mod_menu_text:
size 34

View File

@ -1,59 +1,5 @@
init offset = -1
screen OkPrompt(message, go_menu):
modal True
zorder 200
style_prefix "confirm"
add "gui/overlay/confirm.png"
frame:
vbox:
xalign .5
yalign .5
spacing 30
label _(message):
style "confirm_prompt"
xalign 0.5
hbox:
xalign 0.5
spacing 100
textbutton _("OK") activate_sound "audio/ui/snd_ui_click.wav" action If(go_menu, true=MainMenu(False,False), false=[Hide(),Return()])
screen hiddenOkPrompt(message, go_menu):
modal True
zorder 200
style_prefix "confirm"
add "gui/overlay/confirm.png"
frame:
vbox:
xalign .5
yalign .5
spacing 30
label _(message):
style "confirm_prompt"
xalign 0.5
hbox:
xalign 0.5
spacing 100
textbutton _("OK") activate_sound "audio/ui/snd_ui_click.wav" action If(go_menu, true=MainMenu(False,False), false=Hide())
default persistent.seenWarning = []
default persistent.languaged_up = None
@ -139,7 +85,7 @@ screen lang_sel():
action If(languages[i]["value"] in persistent.seenWarning or languages[i]["value"] == 'en',
true = [Language(languages[i]["value"]), SetVariable("persistent.languaged_up", True), Return()],
# Important to change the language before calling notice. Otherwise it will be in english.
false = [Language(languages[i]["value"]), AddToSet(set=persistent.seenWarning, value=languages[i]["value"]), SetVariable("persistent.languaged_up", True), Show(screen="OkPrompt", message=notice, go_menu=False)]
false = [Language(languages[i]["value"]), AddToSet(set=persistent.seenWarning, value=languages[i]["value"]), SetVariable("persistent.languaged_up", True), Show(screen="OkPrompt", message=notice, action=[ Hide(), Return() ])]
)
at renpysdumb # Scales the imagebutton down. No, you can't just specify the zoom here. It has to be a defined transform.
else:
@ -154,9 +100,9 @@ screen lang_button(lang):
activate_sound "audio/ui/uiRollover.wav"
action If(lang["value"] in persistent.seenWarning or lang["value"] == 'en',
true = [Language(lang["value"])],
false = [Language(lang["value"]), AddToSet(set=persistent.seenWarning, value=lang["value"]), Show(screen="hiddenOkPrompt", message=notice, go_menu=False)]
false = [Language(lang["value"]), AddToSet(set=persistent.seenWarning, value=lang["value"]), Show(screen="OkPrompt", message=notice)]
)
if _preferences.language == lang["value"]:
add glowie(lang["image"]) at icon
else:
add darkie(lang["image"]) at icon
add darkie(lang["image"]) at icon