midgethetree wrote: ↑Thu Feb 04, 2021 7:24 pm
If you want it to be centered and look like the default choice GUI, keeping the vbox would've been better:
Code: Select all
screen choice(items):
style_prefix "choice"
vbox:
for i in items:
if " (disabled)" in i.caption:
$ caption = i.caption.replace(" (disabled)", "")
textbutton caption action None
else:
textbutton caption action i.action
The error looks like you tried to do something like
but never defined "description". Make sure all the variables you're showing are defined beforehand.
So trying that I get on the 1st choice:
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 24, in script
menu choiceb:
File "game/screens.rpy", line 206, in execute
screen choice(items):
File "game/screens.rpy", line 206, in execute
screen choice(items):
File "game/screens.rpy", line 209, in execute
vbox:
File "game/screens.rpy", line 210, in execute
for i in items:
File "game/screens.rpy", line 211, in execute
if " (disabled)" in i.caption:
File "game/screens.rpy", line 215, in execute
textbutton caption action i.action
File "game/screens.rpy", line 215, in <module>
textbutton caption action i.action
NameError: name 'caption' is not defined
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 24, in script
menu choiceb:
File "renpy/ast.py", line 1642, in execute
choice = renpy.exports.menu(choices, self.set, args, kwargs, item_arguments)
File "renpy/exports.py", line 1029, in menu
rv = renpy.store.menu(new_items)
File "renpy/exports.py", line 1265, in display_menu
rv = renpy.ui.interact(mouse='menu', type=type, roll_forward=roll_forward)
File "renpy/ui.py", line 298, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "renpy/display/core.py", line 3007, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, **kwargs)
File "renpy/display/core.py", line 3418, in interact_core
root_widget.visit_all(lambda i : i.per_interact())
File "renpy/display/core.py", line 566, in visit_all
d.visit_all(callback, seen)
File "renpy/display/core.py", line 566, in visit_all
d.visit_all(callback, seen)
File "renpy/display/core.py", line 566, in visit_all
d.visit_all(callback, seen)
File "renpy/display/screen.py", line 432, in visit_all
callback(self)
File "renpy/display/core.py", line 3418, in <lambda>
root_widget.visit_all(lambda i : i.per_interact())
File "renpy/display/screen.py", line 443, in per_interact
self.update()
File "renpy/display/screen.py", line 631, in update
self.screen.function(**self.scope)
File "game/screens.rpy", line 206, in execute
screen choice(items):
File "game/screens.rpy", line 206, in execute
screen choice(items):
File "game/screens.rpy", line 209, in execute
vbox:
File "game/screens.rpy", line 210, in execute
for i in items:
File "game/screens.rpy", line 211, in execute
if " (disabled)" in i.caption:
File "game/screens.rpy", line 215, in execute
textbutton caption action i.action
File "game/screens.rpy", line 215, in <module>
textbutton caption action i.action
NameError: name 'caption' is not defined
Windows-10-10.0.19041
Ren'Py 7.4.2.1292
test 1.0
Thu Feb 4 16:47:16 2021
then changing to:
Code: Select all
screen choice:
style_prefix "choice"
vbox:
for i in items:
if i.action:
if " (disabled)" in i.caption:
textbutton i.caption.replace(" (disabled)", "")
else:
textbutton i.caption action i.action
else:
textbutton i.caption
works till I get to display info which results in:
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 75, in script
menu final:
File "game/screens.rpy", line 206, in execute
screen choice:
File "game/screens.rpy", line 206, in execute
screen choice:
File "game/screens.rpy", line 209, in execute
vbox:
File "game/screens.rpy", line 210, in execute
for i in items:
File "game/screens.rpy", line 211, in execute
if i.action:
File "game/screens.rpy", line 212, in execute
if " (disabled)" in i.caption:
File "game/screens.rpy", line 213, in execute
textbutton i.caption.replace(" (disabled)", "")
NameError: Name 'description' is not defined.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 75, in script
menu final:
File "renpy/ast.py", line 1642, in execute
choice = renpy.exports.menu(choices, self.set, args, kwargs, item_arguments)
File "renpy/exports.py", line 1029, in menu
rv = renpy.store.menu(new_items)
File "renpy/exports.py", line 1265, in display_menu
rv = renpy.ui.interact(mouse='menu', type=type, roll_forward=roll_forward)
File "renpy/ui.py", line 298, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "renpy/display/core.py", line 3007, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, **kwargs)
File "renpy/display/core.py", line 3418, in interact_core
root_widget.visit_all(lambda i : i.per_interact())
File "renpy/display/core.py", line 566, in visit_all
d.visit_all(callback, seen)
File "renpy/display/core.py", line 566, in visit_all
d.visit_all(callback, seen)
File "renpy/display/core.py", line 566, in visit_all
d.visit_all(callback, seen)
File "renpy/display/screen.py", line 432, in visit_all
callback(self)
File "renpy/display/core.py", line 3418, in <lambda>
root_widget.visit_all(lambda i : i.per_interact())
File "renpy/display/screen.py", line 443, in per_interact
self.update()
File "renpy/display/screen.py", line 631, in update
self.screen.function(**self.scope)
File "game/screens.rpy", line 206, in execute
screen choice:
File "game/screens.rpy", line 206, in execute
screen choice:
File "game/screens.rpy", line 209, in execute
vbox:
File "game/screens.rpy", line 210, in execute
for i in items:
File "game/screens.rpy", line 211, in execute
if i.action:
File "game/screens.rpy", line 212, in execute
if " (disabled)" in i.caption:
File "game/screens.rpy", line 213, in execute
textbutton i.caption.replace(" (disabled)", "")
File "renpy/ui.py", line 992, in _textbutton
text = renpy.text.text.Text(label, style=text_style, substitute=substitute, scope=scope, **text_kwargs)
File "renpy/text/text.py", line 1525, in __init__
self.set_text(text, scope, substitute)
File "renpy/text/text.py", line 1644, in set_text
i, did_sub = renpy.substitutions.substitute(i, scope, substitute)
File "renpy/substitutions.py", line 270, in substitute
s = formatter.vformat(s, (), kwargs)
File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/string.py", line 563, in vformat
File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/string.py", line 585, in _vformat
File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/string.py", line 646, in get_field
File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/string.py", line 605, in get_value
File "renpy/substitutions.py", line 228, in __getitem__
raise NameError("Name '{}' is not defined.".format(key))
NameError: Name 'description' is not defined.
Windows-10-10.0.19041
Ren'Py 7.4.2.1292
test 1.0
Thu Feb 4 16:49:02 2021
But not quite sure what to define it as.