def cmd_text(args, context): if len(args) != 0: return False contents = sf.text_edit(sf.get_scene_by_id(context[2])[2]) if not contents: body = "Error processing tempfile." return {"body": body} sf.set_scene(context[2], "contents", contents) body = "Scene content updated." return {"body": body}
def cmd_name(args, context): if context[1] == "STORY": if len(args) == 0: # Show story name. body = "Story Name: " + sf.data[-1]["info"]["name"] else: # Change story name. sf.new_revision() sf.set_info("name", " ".join(args)) body = "Story name updated." c = "" elif context[1] == "SCENE": if len(args) == 0: # Show scene name. body = "Scene Name: " + sf.get_scene_by_id(context[2])[1] else: # Change scene name. sf.new_revision() sf.set_scene(context[2], "name", " ".join(args)) body = "Scene name updated." c = "Scene: " if len(args) != 0: return {"body": body, "name": '{0}"{1}"'.format(c, " ".join(args))} else: return {"body": body}
def cmd_name(args, context): if context[1] == "STORY": if len(args) == 0: # Show story name. body = "Story Name: " + sf.data[-1]["info"]["name"] else: # Change story name. sf.new_revision() sf.set_info("name", ' '.join(args)) body = "Story name updated." c = "" elif context[1] == "SCENE": if len(args) == 0: # Show scene name. body = "Scene Name: " + sf.get_scene_by_id(context[2])[1] else: # Change scene name. sf.new_revision() sf.set_scene(context[2], "name", ' '.join(args)) body = "Scene name updated." c = "Scene: " if len(args) != 0: return {"body": body, "name": "{0}\"{1}\"".format(c, ' '.join(args))} else: return {"body": body}