Extending Easy Feedback

Although Easy Feedback comes with many options to start getting feedback as quickly as possible, every project is different, and custom integrations may be neccessary to collect game-specific metadata like player position or score. Luckily, Easy Feedback makes it easy to write your own custom fields to add additional behaviour to your feedback form.

This section serves as the scripting reference for Easy Feedback. FeedbackForm, Report, ReportSection, EFConfig, and FeedbackBoard contains information about their respective classes.

See Writing Custom Form Fields for a quick guide to getting started writing our own custom fields.

FeedbackForm

Namespace

EasyFeedback

Description

Controls the feedback form in the scene, and handles submission of the report.

Variables

Config: EFConfig object. (EFConfig)

FeedbackKey: Key to toggle feedback form. (KeyCode)

IncludeScreenshot: Whether or not to include a screenshot with reports. (bool)

Form: The transform of the feedback form. (Transform)

Alert: The transform of the alert pane. (Transform)

CurrentReport: The current Report. (Report)

IsOpen: Whether or not the form is currently being displayed. (bool)

Public Functions

public void Show(): Takes a screenshot (if IncludeScreenshot is true), then opens the form.

public void Hide(): Hides the form.

public void Submit(): Submits the form.

public void EnableForm(): Enables all of the Selectable elements on the form.

public void DisableForm(): Disables all of the Selectable elements on the form.

public void HideAlert(): Hides the currently displayed alert.

Callbacks

OnFormOpened: Called when the form is first opened, right before it is shown on screen.

OnFormSubmitted: Called right before the report is sent to Trello. This is where last-minute information should be added to the current Report.

OnFormClosed: Called when the form is closed, whether or not it was submitted.

Report

Namespace

EasyFeedback

Description

The report to be sent to Trello, or stored locally.

Reports contain a collection of ReportSection. Each section appears on Trello with a bold header and text underneath. Sections are ordered by sort order, with the lowest sort order value appearing higher on the report.

Variables

MAX_ATTACHMENTS: The maximum number of attachments allowed on a card by Trello. Because the screenshot is also an attachment, this number is one less than the true maximum. (int)

List: The list on Trello this report will be added to. (EasyFeedback.APIs.List)

Labels: Labels to add to the card on Trello. Use AddLabel(EasyFeedback.APIs.Label) to add a label to the report. (List<EasyFeedback.APIs.Label>)

Title: The title of the card on Trello. (string)

Screenshot: Byte data for the screenshot to be included with this report. (byte[])

Attachments: Files attached to this report. (List<EasyFeedback.FileAttachment>)

Public Functions

public void AddSection(string title, [int sortOrder = 0]): Adds a new empty section to the report. Takes the title of the section (string), and optionally the sort order of the section (int) as parameters. If not specified, the default sort order for the section will be 0.

public void RemoveSection(string title): Removes a section from the report. Takes the title of the section (string) to be removed as a parameter.

public void HasSection(string title): Returns whether or not the report has a section. Takes the title of the section (string) as a parameter. Returns a boolean value.

public string ToString(): Returns the contents of the report, formatted in Markdown, for Trello.

public string GetLocalFileText(): Returns the contents of the report, formatted for storing as a local text file.

public void AttachFile(string name, string filePath): Attaches the file located at filePath to the report. The name of the file on Trello is specified by the name parameter.

public void AttachFile(string name, byte[] data): Attaches a file to the report by byte array of data. The name of the file on Trello is specified by the name parameter.

public void AddLabel(EasyFeedback.APIs.Label label): Adds a label to the report. Logs a warning if the provided label is already on the rerpot.

public bool HasLabel(EasyFeedback.APIs.Label label): Checks if a report already has the provided label.

ReportSection

Namespace

EasyFeedback

Description

A section of information on the report. Appears on Trello as a header (Title) with text underneath.

Variables

Title: The title of the section. (string)

SortOrder: The order of this element in the report (lowest first). (int)

Public Functions

public ReportSection(string title, [int sortOrder = 0]): Constructor. Takes the title and sort order of the section as parameters.

public ReportSection(string title, string text): Constructor. Takes the title and initial text contents of the section as parameters.

public void Append(string text): Appends text to the section’s contents.

public void AppendLine(string line): Appends a line of text to the section’s contents.

public void SetText(string text): Replaces the existing section text with specified text.

public string ToString(): Returns the section formatted in Markdown for Trello.

EFConfig

Namespace

EasyFeedback

Description

Configuration information for Easy Feedback.

Variables

StoreLocal: Save feedback locally, instead of sending it to Trello. (bool)

Token: Trello API token. (string)

Board: The selected FeedbackBoard. (EasyFeedback.FeedbackBoard)

Public Functions

EFConfig(): Constructor. This generally should not be called, as the EFConfig is created and managed as an asset in your project, and will be loaded by Easy Feedback.

FeedbackBoard

Namespace

EasyFeedback

Description

Information about the selected Feedback Board.

Variables

Id: The id of the board on Trello. (string)

ListNames: The names of all of the lists on the board. (string[])

ListIds: The ids of all of the lists on the board. (string[])

CategoryNames: The names of all of the category lists on the board. Defaults to “Feedback” and “Bug” if no feedback board is selected. (string[])

CategoryIds: The ids of all of the category lists on the board. Defaults to null and null if no feedback board is selected. (string[])

Labels: All of the labels on the board. Defaults to “Low Priority,” “Medium Priority,” and “High Priority” if no feedback board is selected. (EasyFeedback.APIs.Label[])

FormElement

Namespace

EasyFeedback

Description

Abstract class to be inherited by any components that are a part of the feedback form. Handles finding the FeedbackForm component in the parent object(s), and registers listeners for form callbacks.

Variables

Form: The FeedbackForm this object is a child of. (protected) (EasyFeedback.FeedbackForm)

Public Functions

public abstract void FormOpened(): Called by FeedbackForm.OnFormOpened.

public abstract void FormSubmitted(): Called by FeedbackForm.OnFormSubmitted.

public abstract void FormClosed(): Called by FeedbackForm.OnFormClosed.

FormField

Namespace

EasyFeedback

Description

Child of FormElement. To be inherited by any components that add a section to the report.

Variables

Form: The FeedbackForm this object is a child of. Inherited from FormElement. (protected) (EasyFeedback.FeedbackForm)

SectionTitle: The title of this field’s section on the report. (string)

SortOrder: Order of the section in the report (lowest first). (int)

Public Functions

public abstract void FormOpened(): Called by FeedbackForm.OnFormOpened. Inherited from FormElement.

public abstract void FormSubmitted(): Called by FeedbackForm.OnFormSubmitted. Inherited from FormElement.

public abstract void FormClosed(): Called by FeedbackForm.OnFormClosed. Inherited from FormElement.

Markdown

Namespace

EasyFeedback

Description

Static class provided with EF in order to help you add Markdown formatting to your reports, without having to learn the `Markdown`_ format.

Variables

HR: String denoting a horzontal rule or line. (public) (const string)

LINE_BREAK: String denoting a new paragraph. (public) (const string)

Public Functions

public static string Header(string text, Markdown.HeaderLevel level = Markdown.HeaderLevel.H1): Creates a header from the provided text, with the provided level.

public static string H1(string text): Creates a first-level header from the provided text.

public static string H2(string text): Creates a second-level header from the provided text.

public static string H3(string text): Creates a third-level header from the provided text.

public static string H4(string text): Creates a fourth-level header from the provided text.

public static string H5(string text): Creates a fifth-level header from the provided text.

public static string H6(string text): Creates a sixth-level header from the provided text.

public static string Em(string text): Formats the text with emphasis/italics.

public static string Strong(string text): Emboldens the text.

public static string Strike(string text): Strikes through the text.

public static string UnorderedList(string[] items): Creates an unordered (bulleted) list from the array of items.

public static string OrderedList(string[] items): Creates an ordered (numbered) list from the array of items.

public static string Hyperlink(string text, string url): Creates an inline hyperlink.

public static string Image(string url, string alt=””): Creates an inline image.

public static string Code(string text): Creates an inline span of preformatted text.

public static string CodeBlock(string text, string language=””): Creates a block of preformatted text. You may optionally provide a langugage for syntax highlighting, where supported.

public static string Blockquote(string text): Creates a block of quoted text.