From f57bcca85ffa6385c04856d1d601ef6551f9e226 Mon Sep 17 00:00:00 2001 From: Map Date: Sat, 7 Jun 2025 22:31:19 -0500 Subject: [PATCH] change ok prompt to be akin to Wani --- game/screens.rpy | 33 ++++++++++++++++++++++ game/src/mod_menu.rpy | 6 ++-- game/src/translation.rpy | 60 ++-------------------------------------- 3 files changed, 39 insertions(+), 60 deletions(-) diff --git a/game/screens.rpy b/game/screens.rpy index 0fe4494..124ff21 100644 --- a/game/screens.rpy +++ b/game/screens.rpy @@ -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 diff --git a/game/src/mod_menu.rpy b/game/src/mod_menu.rpy index 115848d..303fa63 100644 --- a/game/src/mod_menu.rpy +++ b/game/src/mod_menu.rpy @@ -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 diff --git a/game/src/translation.rpy b/game/src/translation.rpy index 8afabba..4c5e10e 100644 --- a/game/src/translation.rpy +++ b/game/src/translation.rpy @@ -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 \ No newline at end of file