My original English code (shows the first part (before the |) in the button, and shows the second as a tooltip)
Code: Select all
menu:
"Sure.":
pass
"I'm okay for now. | NOT recommended for players on their first run.":
pass
My "custom" screen choice inside screen.rpy
Code: Select all
screen choice(items):
default choice_context=None
style_prefix "choice"
add "gui/overlay/confirm.png" at basicfade
vbox:
for i in items:
if '|' in i.caption:
textbutton i.caption.split('|')[0] action i.action hovered SetScreenVariable("choice_context", i.caption.split('|')[1]) unhovered SetScreenVariable("choice_context", None)
else:
textbutton i.caption action i.action hovered SetScreenVariable("choice_context", None)
hbox:
xalign 0.5
ypos -25
if choice_context is not None:
text choice_context
else:
text ""
Removing the " | " fixes this problem, but now the game won't acknowledge the " | " in the translated file, showing all the text and not splitting at all.
My altered English code and translation file (the text is translated but the game doesn't acknowledge the split in the custom screen choice.)
Code: Select all
menu:
"Sure.":
pass
"I'm okay for now.":
pass
Code: Select all
# game/scripts/game/scripts_game_chapter_1.rpy:1197
old "I'm okay for now."
new "Estou de boa no momento. | NÃO recomendado para aqueles jogando pela primeira vez."