Skip to content

Commit

Permalink
Merge pull request #34 from GanstaKingofSA/3.0.1-update
Browse files Browse the repository at this point in the history
3.0.1 Additional Work
  • Loading branch information
Bronya-Rand authored Mar 25, 2022
2 parents 9824ef3 + a32b3b9 commit 953aba3
Showing 1 changed file with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
## pronoun_example.rpy
# This file asks the user for their pronoun input.

init:
default pronoun_temp = ""
default pronoun_temp = ""

init python:
def SetPronoun(type):
global pronoun_temp
if not pronoun_temp: return
if type == "he":
persistent.he = pronoun_temp.lower()
Expand All @@ -26,19 +26,15 @@ init python:
him = pronoun_temp.lower()
him_capital = pronoun_temp.lower().capitalize()
pronoun_temp = ""
renpy.hide_screen("pronoun_input")

label pronoun:
while not persistent.he:
$ renpy.show_screen("pronoun_input", message="Enter your first pronoun (He/She/They)", ok_action=Function(SetPronoun, "he"))
while not persistent.him:
$ renpy.show_screen("pronoun_input", message="Enter your second pronoun (Him/Her/Them)", ok_action=Function(SetPronoun, "him"))
while not persistent.hes:
$ renpy.show_screen("pronoun_input", message="Enter your third pronoun (He's/She's/They're)", ok_action=Function(SetPronoun, "he's"))
while not persistent.are:
$ renpy.show_screen("pronoun_input", message="Enter your fourth pronoun (Is/Are)", ok_action=Function(SetPronoun, "are"))
label pronoun_screen:
$ renpy.call_screen("pronoun_input", message="Enter your first pronoun (He/She/They)", ok_action=Function(SetPronoun, type="he"))
$ renpy.call_screen("pronoun_input", message="Enter your second pronoun (He's/She's/They're)", ok_action=Function(SetPronoun, type="he's"), hes=True)
$ renpy.call_screen("pronoun_input", message="Enter your third pronoun (Him/Her/Them)", ok_action=Function(SetPronoun, type="him"))
$ renpy.call_screen("pronoun_input", message="Enter your fourth pronoun (Is/Are)", ok_action=Function(SetPronoun, type="are"))
return

screen pronoun_input(message, ok_action):
screen pronoun_input(message, ok_action, hes=False):

## Ensure other screens do not get input while this screen is displayed.
modal True
Expand All @@ -60,11 +56,16 @@ screen pronoun_input(message, ok_action):
label _(message):
style "confirm_prompt"
xalign 0.5

python:
allowList = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
if hes:
allowList = allowList + "'"

input default "" value VariableInputValue("pronoun_temp") length 12 allow "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
input default "" value VariableInputValue("pronoun_temp") length 12 allow allowList

hbox:
xalign 0.5
spacing 100

textbutton _("OK") action ok_action
textbutton _("OK") action [ok_action, Return(0)]

0 comments on commit 953aba3

Please sign in to comment.