From f1d7098b69ae7e2f1d9fdc1ddb43c9ac747b754c Mon Sep 17 00:00:00 2001 From: CensoredUsername Date: Mon, 24 Feb 2020 20:09:58 +0100 Subject: [PATCH] Decompile menu item arguments --- decompiler/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/decompiler/__init__.py b/decompiler/__init__.py index 0ef6db63..84372903 100644 --- a/decompiler/__init__.py +++ b/decompiler/__init__.py @@ -633,7 +633,12 @@ def print_menu(self, ast): self.indent() self.write("set %s" % ast.set) - for label, condition, block in ast.items: + if hasattr(ast, "item_arguments"): + item_arguments = ast.item_arguments + else: + item_arguments = [None] * len(ast.items) + + for (label, condition, block), arguments in zip(ast.items, item_arguments): if self.translator: label = self.translator.strings.get(label, label) @@ -642,6 +647,9 @@ def print_menu(self, ast): self.indent() self.write('"%s"' % string_escape(label)) + if arguments is not None: + self.write(reconstruct_arginfo(arguments)) + if block is not None: if isinstance(condition, unicode): self.write(" if %s" % condition)