Skip to content

Commit 1caec08

Browse files
committed
Fixed text input validation
1 parent 7b3ffa2 commit 1caec08

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Assets/Behaviours/GUI/Views/GUIMarketBrowser.cs

+12-2
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ public void BuyFilterBy() {
197197
}
198198
}
199199

200+
public void UpdateTextColor() {
201+
202+
itemInputField.textComponent.color = Color.white;
203+
}
204+
200205
/// <summary>
201206
///
202207
/// </summary>
@@ -210,11 +215,16 @@ public void UpdateItemName(string _name) {
210215
//_itemID = // cast from DB..
211216

212217
_itemID = DatabaseProvider.GetItemID(_itemNameStr);
213-
218+
214219
if (_itemID == -1) {
215-
itemInputField.text = "<color=red>" + itemInputField.text + "</color>";
220+
itemInputField.textComponent.color = Color.red;
216221
return;
217222
}
223+
else {
224+
itemInputField.textComponent.color = Color.white;
225+
}
226+
227+
//itemInputField.text = itemInputField.text;
218228

219229
StartCoroutine(DoRequestSellOrders());
220230
StartCoroutine(DoRequestBuyOrders());

Assets/Scenes/Main.unity

832 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)