Harden test '@spawn/edit <valid-prototype>' by asserting that olc_menu has been loaded with valid-prototype.UX Enhancement to OLC menu. Underneath the title, display 'Editing: key(prototype_key)' of the prototype being edited. If none, show blank line

This commit is contained in:
Henddher Pedroza 2018-10-21 13:43:36 -05:00
parent f70fa467f5
commit 1cbbdf5410
2 changed files with 25 additions and 7 deletions

View file

@ -562,6 +562,7 @@ def node_index(caller):
text = """
|c --- Prototype wizard --- |n
%s
A |cprototype|n is a 'template' for |wspawning|n an in-game entity. A field of the prototype
can either be hard-coded, left empty or scripted using |w$protfuncs|n - for example to
@ -599,6 +600,17 @@ def node_index(caller):
{pfuncs}
""".format(pfuncs=_format_protfuncs())
# If a prototype is being edited, show its key and
# prototype_key under the title
loaded_prototype = ''
if 'prototype_key' in prototype \
or 'key' in prototype:
loaded_prototype = ' --- Editing: |y{}({})|n --- '.format(
prototype.get('key', ''),
prototype.get('prototype_key', '')
)
text = text % (loaded_prototype)
text = (text, helptxt)
options = []