def setTextFields(own): '''Party Text''' partyText = objectControl.getFromScene('text_party', 'partyCreate') partyText.text = own['party'] '''Name Text''' nameText = objectControl.getFromScene('text_name', 'partyCreate') nameText.text = own['units'][0]['name'] '''Class Text''' classText = objectControl.getFromScene('text_class', 'partyCreate') # TODO(kgeffen) Change 'model' to 'class' everywhere classText.text = own['units'][0]['model'].capitalize() '''Add Skill Text''' addSkillText = objectControl.getFromScene('text_addSkill', 'partyCreate') command = own['addSkill'][0] addSkillText.text = commandControl.name(command) # Add skill removeSkillText = objectControl.getFromScene('text_removeSkill', 'partyCreate') commands = own['units'][0]['commands'][0] if len(commands) != 0: removeSkillText.text = commandControl.name(commands[0]) else: removeSkillText.text = ''
def listText(): # Get the first list of commands commands = getCommandsList()[0] # Form list of all commands in first list seperated by newlines text = "" for command in commands: text += commandControl.name(command) + "\n" # Set the text of the object object = objectControl.getFromScene(LIST_OBJECT_NAME, SCENE_NAME) object["Text"] = text