Skip to content

Commit

Permalink
Fix a problem with menus and config.log.
Browse files Browse the repository at this point in the history
Fixes #3133.
  • Loading branch information
renpytom committed Nov 28, 2021
1 parent 91c730c commit ddd0d1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 7 additions & 6 deletions renpy/exports.py
Expand Up @@ -19,10 +19,8 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

# This file contains functions that are exported to the script namespace.
# Functions defined in this file can be updated by the user to change
# their behavior, while functions imported in are probably best left
# alone as part of the api.
# This file contains functions that are exported to the script namespace as
# the renpy namespace. (So renpy.say, renpy.pause, and so on.)

from __future__ import division, absolute_import, with_statement, print_function, unicode_literals
from renpy.compat import *
Expand Down Expand Up @@ -1298,8 +1296,12 @@ def display_menu(items,
rv = renpy.ui.interact(mouse='menu', type=type, roll_forward=roll_forward)

for label, val in items:

if isinstance(val, renpy.ui.ChoiceReturn):
val = val.value

if rv == val:
log("User chose: " + label)
log("Player chose: " + label)
break
else:
log("No choice chosen.")
Expand Down Expand Up @@ -4258,4 +4260,3 @@ def request_permission(permission):
return False

return get_sdl_dll().SDL_AndroidRequestPermission(permission.encode("utf-8"))

2 changes: 2 additions & 0 deletions sphinx/source/changelog.rst
Expand Up @@ -10,6 +10,8 @@ Changelog (Ren'Py 7.x-)
Fixes
-----

When :var:`config.log` is true, the selected choice is now logged properly.

The new :func:`gui.variant` function makes it possible to work around
an issue in the standard gui where the calling :func:`gui.rebuild` would cause
gui variants to reset.
Expand Down

0 comments on commit ddd0d1b

Please sign in to comment.