Skip to content

Commit 39115ae

Browse files
committed
Add optional message to faults, use in errors while setting participant details
1 parent e6f4a62 commit 39115ae

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Assets/UXF/Scripts/UI/Form/FormElementController.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ public void DisplayFault()
8585
Invoke("ResetTitle", 5);
8686
}
8787

88+
public void DisplayFault(string message)
89+
{
90+
title.text = string.Format("{0} <b><color=red>(!) Error: {1}</color></b>", originalTitle, message);
91+
Invoke("ResetTitle", 8);
92+
}
93+
8894
public void ResetTitle()
8995
{
9096
title.text = originalTitle;

Assets/UXF/Scripts/UI/ParticipantListSelection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public string Finish()
214214
// check if not empty
215215
if (ppid.Replace(" ", string.Empty) == string.Empty)
216216
{
217-
form.ppidElement.controller.DisplayFault();
217+
form.ppidElement.controller.DisplayFault("Invalid participant name!");
218218
throw new Exception("Invalid participant name!");
219219
}
220220

@@ -226,7 +226,7 @@ public string Finish()
226226
DataRow searchResultRow = ppList.AsEnumerable().FirstOrDefault(r => r.Field<string>("ppid") == ppid);
227227
if (searchResultRow != null)
228228
{
229-
form.ppidElement.controller.DisplayFault();
229+
form.ppidElement.controller.DisplayFault("Participant ID already exists!");
230230
throw new Exception("Participant ID already exists! Enter a new ID or select the existing participant from the dropdown.");
231231
}
232232
// else new id has been entered

0 commit comments

Comments
 (0)