/// <summary> /// Main draw loop for team tab /// </summary> public void DrawTeamTab() { switch (_controller.State) { case TeamState.VIEWLIST: DrawTeamPanels(); break; case TeamState.MANAGEROLES: case TeamState.EDITROLE: case TeamState.CREATEROLE: _rolesPanels.DrawTeamRolesPanel(_controller, _skin); break; case TeamState.CREATE: case TeamState.EDIT: _memberPanel.DrawTeamMemberPanel(_controller, _skin); break; case TeamState.INVITEUSER: _optionsPanel.DrawTeamOptionsPanel(_controller, _skin); _teamSearch.DrawTeamSearchPanel(_controller, _skin); _invitePanel.DrawInviteUserPanel(_controller, _skin); break; case TeamState.REFRESH: EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.REFRESHUSERROLES); _controller.SetTeamState(TeamState.VIEWLIST); DrawTeamTab(); break; } }
/// <summary> /// Creates a new team memeber /// </summary> public void CreateMember() { User result = null; if (UserObject.password == string.Empty) { result = new User(); Enjin.InviteUser(UserObject.email, UserObject.name); } else { result = Enjin.CreateUser(UserObject.name, UserObject.email, UserObject.password, RolesList[RoleDropDownSelection].name); } if (result != null && Enjin.ServerResponse == ResponseCodes.SUCCESS) { if (UserObject.password == string.Empty) { EnjinEditor.DisplayDialog("SUCCESS", "User " + UserObject.name + " successfully created and invite sent."); } else { EnjinEditor.DisplayDialog("SUCCESS", "User " + UserObject.name + " successfully created."); } EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADTEAM); EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADIDENTITIES); SetTeamState(TeamState.VIEWLIST); } else { EnjinEditor.DisplayDialog("FAILED", "Eamil address: " + UserObject.email + " has already been registered. Please enter a different email address"); } }
private void OnDestroy() { if (Enjin.IsLoggedIn) { EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.LOGOUT); } }
/// <summary> /// Main GUI Rendering Loop /// </summary> private void OnGUI() { if (EditorApplication.isCompiling && Enjin.IsLoggedIn) { EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.LOGOUT); } if (EditorApplication.isPlaying) { if (Enjin.IsLoggedIn) { EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.LOGOUT); } // Show blank window for now } else { EditorGUI.DrawRect(new Rect(0, 0, position.width, position.height), new Color(0.1f, 0.1f, 0.1f)); _toolbarIndex = GUI.Toolbar(new Rect(15, 5, 910, 40), _toolbarIndex, _toolbarHeaders); GUILayout.BeginArea(new Rect(10, 50, position.width, position.height)); _toolbarIndex = EnjinEditor.TabSelection(_toolbarIndex); GUILayout.EndArea(); } }
private void UnlinkedWallet() { GUILayout.BeginArea(new Rect(5, 10, 912, 606), _skin.GetStyle("TopBackground")); EditorGUILayout.LabelField(new GUIContent("LINK WALLET"), _skin.GetStyle("MainTitle")); GUILayout.Space(30); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); EditorGUILayout.LabelField(new GUIContent("Step 1:"), _skin.GetStyle("BoldTitle"), GUILayout.Width(50)); EditorGUILayout.LabelField(new GUIContent("Download the Enjin Wallet"), _skin.GetStyle("ContentLight")); EditorGUILayout.EndHorizontal(); GUILayout.Space(10); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); //if (GUILayout.Button(new GUIContent("Enjin Wallet iOS"), GUILayout.Width(140), GUILayout.Height(30))) // Application.OpenURL("https://itunes.apple.com/us/app/enjin-cryptocurrency-wallet/id1349078375?ls=1&mt=8"); if (GUILayout.Button(new GUIContent("Enjin Wallet"), GUILayout.Width(140), GUILayout.Height(30))) { Application.OpenURL("https://enjinwallet.io/"); } //Application.OpenURL("https://play.google.com/store/apps/details?id=com.enjin.mobile.wallet"); EditorGUILayout.EndHorizontal(); GUILayout.Space(20); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); EditorGUILayout.LabelField(new GUIContent("Step 2:"), _skin.GetStyle("BoldTitle"), GUILayout.Width(50)); EditorGUILayout.LabelField(new GUIContent("Open the Enjin Wallet, select LINK in settings and enter this\nunique code:"), _skin.GetStyle("ContentLight"), GUILayout.Height(30)); EditorGUILayout.EndHorizontal(); GUILayout.Space(10); EditorGUILayout.BeginHorizontal(); GUILayout.Space(66); EditorGUILayout.LabelField(new GUIContent(EnjinEditor.CurrentUserIdentity.linking_code), _skin.GetStyle("LargeNumbersGreen")); EditorGUILayout.EndHorizontal(); GUILayout.Space(20); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); EditorGUILayout.LabelField(new GUIContent("Step 3:"), _skin.GetStyle("BoldTitle"), GUILayout.Width(50)); EditorGUILayout.LabelField(new GUIContent("After you entered the code, click refresh button below to\nconfirm that your wallet and address is linked."), _skin.GetStyle("ContentLight"), GUILayout.Height(30)); EditorGUILayout.EndHorizontal(); GUILayout.Space(10); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); if (GUILayout.Button(new GUIContent("Refresh"), GUILayout.Width(140), GUILayout.Height(30))) { EnjinEditor.CurrentUser = Enjin.GetUserRaw(EnjinEditor.CurrentUser.id); EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADALL); } EditorGUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); GUILayout.EndArea(); }
/// <summary> /// Draws the logged in panel /// </summary> public void DrawPlatformLoggedInPanel(HomeController controller, GUISkin skin) { if (Enjin.AppID != -1 && controller.State == PlatformState.VIEW) { EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); EditorStyles.popup.fixedHeight = 30; EditorStyles.popup.fontSize = 12; EnjinEditor.SelectedAppIndex = EditorGUILayout.Popup(EnjinEditor.SelectedAppIndex, EnjinEditor.AppsNameList.ToArray(), GUILayout.Width(220), GUILayout.Height(30)); EditorStyles.popup.fixedHeight = 15; EditorStyles.popup.fontSize = 11; GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); } EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.CHECKAPPCHANGE); GUILayout.Space(30); if (controller.State == PlatformState.VIEW) { EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("ADD APP", GUILayout.Width(102), GUILayout.Height(30))) { controller.SetPlatformState(PlatformState.CREATE); } if (controller.HasPermission(UserPermission.manageApp)) { GUILayout.Space(10); if (GUILayout.Button("EDIT APP", GUILayout.Width(102), GUILayout.Height(30))) { controller.SetPlatformState(PlatformState.EDIT); } } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); } switch (controller.State) { case PlatformState.CREATE: case PlatformState.EDIT: _appManagePanel.DrawManageAppsPanel(controller, skin); break; case PlatformState.VIEW: _viewPanel.DrawViewPanel(controller, skin); break; } }
/// <summary> /// Main Method for the CI Tab. This method manages the state and is called repeatedly while the CI Tab is selected. /// </summary> public void DrawCryptoItemsTab() { // handle CI Tab state actions and panel display choices switch (_controller.State) { case CryptoItemsController.CryptoItemState.MAIN: _optionsPane.DrawPane(_controller, _skin); _searchPane.DrawPane(_controller, _skin); _mainPanel.DrawPane(_controller, _skin); break; case CryptoItemsController.CryptoItemState.CREATE: _walletPane.DrawPane(_controller, _skin); _mintCostPane.DrawPane(_controller, _skin); _createPanel.DrawPane(_controller, _skin); break; case CryptoItemsController.CryptoItemState.EDIT: _walletPane.DrawPane(_controller, _skin); _detailsPane.DrawPane(_controller, _skin); _editPanel.DrawPane(_controller, _skin); break; case CryptoItemsController.CryptoItemState.VIEW: _walletPane.DrawPane(_controller, _skin); _detailsPane.DrawPane(_controller, _skin); _editPanel.DrawPane(_controller, _skin); break; case CryptoItemsController.CryptoItemState.MINT: _walletPane.DrawPane(_controller, _skin); _detailsPane.DrawPane(_controller, _skin); _mintPanel.DrawPane(_controller, _skin); break; case CryptoItemsController.CryptoItemState.MELT: _walletPane.DrawPane(_controller, _skin); _detailsPane.DrawPane(_controller, _skin); _meltPanel.DrawPane(_controller, _skin); break; case CryptoItemsController.CryptoItemState.CREATEBUNDLE: // NOTE: Will be implemented post v1 release break; case CryptoItemsController.CryptoItemState.REFRESH: EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADITEMS); _controller.Reset(); break; } }
/// <summary> /// Updates an exsiting App /// </summary> public void UpdateAp() { App newApp = new App { name = AppInfo.name, image = AppInfo.image, description = AppInfo.description }; Enjin.UpdateApp(newApp); EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.REFRESHAPPLIST); State = PlatformState.VIEW; }
/// <summary> /// Updates an existing team member /// </summary> public void UpdateMember() { List <string> userRoles = new List <string>(UserRoles); string roles = "["; for (int i = 0; i < UpdateUserObject.roles.Length; i++) { if (userRoles.Contains(UpdateUserObject.roles[i].name)) { roles += "\"" + UpdateUserObject.roles[i].name + "\""; if (i != UpdateUserObject.roles.Length) { roles += ","; } } } if (RoleDropDownSelection != -1) { roles += "\"" + UserRoles[RoleDropDownSelection] + "\"]"; } else { roles += "]"; } if (UserObject.email == UpdateUserObject.email) { UpdateUserObject.email = string.Empty; } Enjin.UpdateUser(UserObject.id, UserObject.name, UpdateUserObject.email, roles); if (Enjin.ServerResponse == ResponseCodes.SUCCESS) { if (UnityEditor.EditorUtility.DisplayDialog("SUCCESS", "User updated successfully.", "OK")) { ResetTeamList(); } } SelectedRoleIndex = 0; EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADTEAM); EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADIDENTITIES); SetTeamState(TeamState.VIEWLIST); }
/// <summary> /// Deletes the user (soft delete) /// </summary> /// <returns>true if deleting the user was successful, otherwise false</returns> public bool DeleteUser() { if (UserList.Count == 1 && CurrentPage != 1) { CurrentPage--; } if (Enjin.DeleteUser(UserList[SelectedIndex].id)) { SelectedIndex = 0; CurrentPage = 1; ResetTeamList(); EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADIDENTITIES); return(true); } return(false); }
/// <summary> /// Checks the panel level and sets the state appropriately /// </summary> public void PanelLevelBack() { if (PanelLevelIndex == 0) { EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.REFRESHUSERROLES); SetTeamState(TeamState.VIEWLIST); } else { if (RolesList.Count != 0) { LastSelectedRoleIndex = -1; SelectedRoleIndex = 0; } PanelLevelIndex--; SetTeamState(TeamState.MANAGEROLES); } }
/// <summary> /// Removes a give role from the current user /// </summary> public void RemoveRole(string role) { string roles = "["; for (int i = 0; i < UpdateUserObject.roles.Length; i++) { if (UpdateUserObject.roles[i].name == role) { continue; } roles += "\"" + UpdateUserObject.roles[i].name + "\""; if (i != UpdateUserObject.roles.Length) { roles += ","; } } roles += "]"; if (UserObject.email == UpdateUserObject.email) { UpdateUserObject.email = string.Empty; } EnjinEditor.Log("Roles - " + roles); Enjin.UpdateUser(UserObject.id, UserObject.name, UpdateUserObject.email, roles); if (Enjin.ServerResponse == ResponseCodes.SUCCESS) { if (UnityEditor.EditorUtility.DisplayDialog("SUCCESS", "Removed role successfully.", "OK")) { ResetTeamList(); } } SelectedRoleIndex = 0; EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADTEAM); SetTeamState(TeamState.VIEWLIST); }
/// <summary> /// Placeholder for logic changes in the next pass -- adds pop-up notifications for completed requests /// </summary> public void CheckForPopUps() { #region Popup Notification Handler // handle pending requests on the controller monitoring for result updates List <string> requestsCompleted = new List <string>(); foreach (KeyValuePair <string, IdentitiesTabController.Result> entry in GetResults()) { switch (entry.Value.Status) { case Status.SUCCESS: if (EditorUtility.DisplayDialog("SUCCESS", "A pending request has posted successfully. Refresh now?\n\nNote, refreshing will return you to the index and clear any active data entry.", "Refresh", "Cancel")) { EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADITEMS); RefreshLists(); } requestsCompleted.Add(entry.Key); break; case Status.FAILURE: if (EditorUtility.DisplayDialog("FAILURE", "A pending request could not be processed due to a status of " + entry.Value.Status + ". Refresh now?\n\nNote, refreshing will return you to the index and clear any active data entry.", "Refresh", "Cancel")) { EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADITEMS); RefreshLists(); } requestsCompleted.Add(entry.Key); break; case Status.NONE: if (EditorUtility.DisplayDialog("FAILURE", "Something went wrong and the status of this request was not set.\n The request returned a status of " + entry.Value.Status + ". Refresh now?\n\n note: refreshing will return you to the index and clear any data entry.", "Refresh", "Cancel")) { EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADITEMS); RefreshLists(); } requestsCompleted.Add(entry.Key); break; } } #endregion }
/// <summary> /// Creates a new App /// </summary> public void CreateApp() { App newApp = new App { name = AppInfo.name, image = AppInfo.image, description = AppInfo.description }; if (newApp.image == "" || newApp.image == null) { newApp.image = "None"; } else { newApp.image = AppInfo.image; } if (newApp.description == "" || newApp.description == null) { newApp.description = "None"; } else { newApp.description = AppInfo.description; } Enjin.CreateApp(newApp); //EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.REFRESHAPPLIST); EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.LOGOUT); IsLoginSuccessful(); ProcessStartUp(); //Enjin.StartPlatform(Enjin.APIURL, LoginInfo.username, LoginInfo.password); //Enjin.Login(LoginInfo.username, LoginInfo.password); AppInfo = new AppData(); State = PlatformState.VIEW; }
/// <summary> /// Build and Draw Main Panel /// </summary> public void DrawPane(CryptoItemsController controller, GUISkin skin) { GUILayout.BeginArea(new Rect(5, 126, 912, 490), skin.GetStyle("TopBackground")); GUILayout.Space(10); EditorGUILayout.BeginHorizontal(); if (controller.HasListRefreshed) { EditorGUILayout.LabelField(new GUIContent(EnjinEditor.CurrentAppName.ToUpper()), skin.GetStyle("MainTitle")); GUILayout.FlexibleSpace(); //GUILayout.Space(16); //EditorStyles.popup.fixedHeight = 30; //EditorStyles.popup.fontSize = 12; //controller.ItemFilter = (CryptoItemsController.ItemFilterType)EditorGUILayout.EnumPopup(controller.ItemFilter, GUILayout.Width(180), GUILayout.Height(30)); //EditorStyles.popup.fixedHeight = 15; //EditorStyles.popup.fontSize = 11; } else { EditorGUILayout.LabelField(new GUIContent("SEARCH RESULTS"), skin.GetStyle("MainTitle")); } if (GUILayout.Button("REFRESH", GUILayout.Height(30), GUILayout.Width(80))) { EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADITEMS); } GUILayout.Space(10); EditorGUILayout.EndHorizontal(); if (controller.LastFilterSelected != controller.FilterSelection) { controller.LastFilterSelected = controller.FilterSelection; } GUILayout.Space(10); EditorGUILayout.BeginHorizontal(); GUILayout.Space(16); EditorGUILayout.LabelField(new GUIContent("Type"), skin.GetStyle("Subtitle"), GUILayout.Width(76)); EditorGUILayout.LabelField(new GUIContent("Name"), skin.GetStyle("Subtitle"), GUILayout.Width(100)); EditorGUILayout.LabelField(new GUIContent("Index"), skin.GetStyle("Subtitle"), GUILayout.Width(74)); EditorGUILayout.LabelField(new GUIContent("Balance"), skin.GetStyle("Subtitle"), GUILayout.Width(108)); EditorGUILayout.LabelField(new GUIContent("Total Supply"), skin.GetStyle("Subtitle"), GUILayout.Width(102)); EditorGUILayout.LabelField(new GUIContent("Total Reserve"), skin.GetStyle("Subtitle"), GUILayout.Width(98)); EditorGUILayout.LabelField(new GUIContent("Circulating"), skin.GetStyle("Subtitle"), GUILayout.Width(86)); EditorGUILayout.LabelField(new GUIContent("Transferable"), skin.GetStyle("Subtitle"), GUILayout.Width(114)); EditorGUILayout.LabelField(new GUIContent("Supply Type"), skin.GetStyle("Subtitle")); EditorGUILayout.EndHorizontal(); GUILayout.Space(10); EditorGUILayout.BeginHorizontal(); GUILayout.Space(16); _scrollPos = EditorGUILayout.BeginScrollView(_scrollPos, GUILayout.Width(890), GUILayout.Height(342)); if (EnjinEditor.CurrentUserIdentity.linking_code != string.Empty) { GUILayout.FlexibleSpace(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(new GUIContent("WARNING: You don't have a wallet linked. Select the wallet tab to link your wallet"), skin.GetStyle("MainTitle")); EditorGUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); } else if (controller.CryptoItemList != null && controller.CryptoItemList.Count != 0) { for (int i = 0; i < controller.CryptoItemList.Count; i++) { if (controller.SelectedIndex == i) { EditorGUILayout.BeginHorizontal(skin.box); } else { EditorGUILayout.BeginHorizontal(); } if (controller.CryptoItemList[i].nonFungible) { EditorGUILayout.LabelField(new GUIContent("Non-fungible"), skin.GetStyle("ContentDark"), GUILayout.Width(75)); } else { EditorGUILayout.LabelField(new GUIContent("Fungible"), skin.GetStyle("ContentDark"), GUILayout.Width(75)); } Rect lastRect = GUILayoutUtility.GetLastRect(); if (GUI.Button(new Rect(lastRect.x, lastRect.y, 890.0f, lastRect.height), GUIContent.none, skin.button)) { if (controller.SelectedIndex == i) { controller.State = CryptoItemsController.CryptoItemState.VIEW; controller.CurrentCryptoItem = controller.CryptoItemList[controller.SelectedIndex]; controller.CurrentCryptoItem.itemURI = Enjin.GetCryptoItemURI(controller.CurrentCryptoItem.token_id, controller.CurrentCryptoItem.index, false); } controller.SelectedIndex = i; } GUILayout.Space(10); if (controller.CryptoItemList[i].name.Length > 40) { EditorGUILayout.LabelField(new GUIContent(controller.CryptoItemList[i].name.Substring(0, 38) + ".."), skin.GetStyle("ContentDark"), GUILayout.Width(160)); } else { EditorGUILayout.LabelField(new GUIContent(controller.CryptoItemList[i].name), skin.GetStyle("ContentDark"), GUILayout.Width(100)); } GUILayout.Space(10); try { if (controller.CryptoItemList[i].index != null) { string indexList = ""; string[] indices = controller.CryptoItemList[i].index.Split(','); for (int indexIndex = 0; indexIndex < indices.Length; indexIndex++) { int subItemIndex = 0; if (System.Int32.TryParse(indices[indexIndex], out subItemIndex)) { if (indexIndex > 0 && indexIndex < indices.Length) { indexList += ", "; } indexList += subItemIndex; } } EditorGUILayout.LabelField(new GUIContent(indexList), skin.GetStyle("ContentDark"), GUILayout.Width(50)); } else { EditorGUILayout.LabelField(new GUIContent(""), skin.GetStyle("ContentDark"), GUILayout.Width(50)); } } catch (System.Exception) { EditorGUILayout.LabelField(new GUIContent(""), skin.GetStyle("ContentDark"), GUILayout.Width(50)); } GUILayout.Space(10); EditorGUILayout.LabelField(new GUIContent(controller.CryptoItemList[i].balance.ToString()), skin.GetStyle("ContentDark"), GUILayout.Width(90)); GUILayout.Space(10); if (controller.CryptoItemList[i].supplyModel != SupplyModel.INFINITE) { if (controller.CryptoItemList[i].totalSupply.Length > 12) { EditorGUILayout.LabelField(new GUIContent(System.String.Format("{0:N0}..", System.Int32.Parse(controller.CryptoItemList[i].totalSupply.Substring(0, 9)))), skin.GetStyle("ContentDark"), GUILayout.Width(90)); } else { EditorGUILayout.LabelField(new GUIContent(System.String.Format("{0:N0}", System.Int32.Parse(controller.CryptoItemList[i].totalSupply))), skin.GetStyle("ContentDark"), GUILayout.Width(90)); } } else { EditorGUILayout.LabelField(new GUIContent("INFINITE"), skin.GetStyle("ContentDark"), GUILayout.Width(90)); } GUILayout.Space(10); EditorGUILayout.LabelField(new GUIContent(System.String.Format("{0:N0}", System.Int32.Parse(controller.CryptoItemList[i].reserve))), skin.GetStyle("ContentDark"), GUILayout.Width(80)); GUILayout.Space(10); EditorGUILayout.LabelField(new GUIContent(System.String.Format("{0:N0}", System.Int32.Parse(controller.CryptoItemList[i].circulatingSupply))), skin.GetStyle("ContentDark"), GUILayout.Width(70)); GUILayout.Space(10); EditorGUILayout.LabelField(new GUIContent(controller.CryptoItemList[i].transferable.ToString()), skin.GetStyle("ContentDark"), GUILayout.Width(100)); GUILayout.Space(10); if (controller.CryptoItemList[i].supplyModel == SupplyModel.COLLAPSING) { EditorGUILayout.LabelField(new GUIContent("COLLAPSE"), skin.GetStyle("ContentDark"), GUILayout.Width(66)); } else if (controller.CryptoItemList[i].supplyModel == SupplyModel.ANNUAL_PERCENTAGE) { EditorGUILayout.LabelField(new GUIContent("ANNUAL %"), skin.GetStyle("ContentDark"), GUILayout.Width(66)); } else if (controller.CryptoItemList[i].supplyModel == SupplyModel.ANNUAL_VALUE) { EditorGUILayout.LabelField(new GUIContent("ANNUAL #"), skin.GetStyle("ContentDark"), GUILayout.Width(66)); } else { EditorGUILayout.LabelField(new GUIContent(controller.CryptoItemList[i].supplyModel.ToString()), skin.GetStyle("ContentDark"), GUILayout.Width(66)); } if (controller.CryptoItemList[i].markedForDelete) { EditorGUILayout.LabelField(new GUIContent(skin.GetStyle("Images").normal.scaledBackgrounds[2] as Texture2D, "Marked for Deletion"), GUILayout.Width(16), GUILayout.Height(16)); } else { EditorGUILayout.LabelField(new GUIContent(""), GUILayout.Width(16), GUILayout.Height(16)); } EditorGUILayout.EndHorizontal(); GUI.backgroundColor = _bgDefault; GUILayout.Space(8); } } EditorGUILayout.EndScrollView(); EditorGUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); EditorGUILayout.BeginHorizontal(); if (!controller.IsSearchMode && controller.CryptoItemList.Count != 0) { if (controller.CurrentPage != 1) { GUILayout.Space(10); if (GUILayout.Button(new GUIContent("<<"), GUILayout.Height(20))) { if (controller.CurrentPage != 1) { controller.CurrentPage--; controller.PageCheck(); } } } GUILayout.Space(5); for (int i = controller.FirstPage; i < controller.TotalPages + 1; i++) { if (i != controller.CurrentPage) { _numStyle = skin.GetStyle("PageNumberDark"); } else { _numStyle = skin.GetStyle("PageNumberLight"); } if (GUILayout.Button(new GUIContent(i.ToString()), _numStyle, GUILayout.Width(30))) { controller.CurrentPage = i; controller.PageCheck(); } if (i - controller.FirstPage == 9) { break; } } if (controller.CurrentPage != controller.TotalPages) { if (GUILayout.Button(new GUIContent(">>"), GUILayout.Height(20))) { if (controller.CurrentPage != controller.TotalPages) { controller.CurrentPage++; controller.PageCheck(); } } } } GUILayout.FlexibleSpace(); if (controller.CryptoItemList.Count > 0) { // =================== ADVANCED SEND TEST BUTTON ======================== //if (GUILayout.Button("A SEND", GUILayout.Width(100), GUILayout.Height(30))) //{ //CryptoItemBatch testItems = new CryptoItemBatch(EnjinEditor.CurrentUserIdentity.id); //for (int i = 0; i < controller.CryptoItemList.Count; i++) // testItems.Add(EnjinEditor.CurrentUserIdentity.ethereum_address, "0xeD7aA45fd86c4D58261B3B2Cce9f68009c76C7d1", controller.CryptoItemList[i], controller.CryptoItemList[i].balance); //testItems.Send(); //} // ====================================================================== if (GUILayout.Button("VIEW", GUILayout.Width(100), GUILayout.Height(30))) { controller.CurrentCryptoItem = controller.CryptoItemList[controller.SelectedIndex]; // On-demand loading of item URI to avoid performance issues-- this is a demanding call. if (controller.CurrentCryptoItem.itemURI == null) { controller.CurrentCryptoItem.itemURI = Enjin.GetCryptoItemURI(controller.CurrentCryptoItem.token_id, controller.CurrentCryptoItem.index, false); } controller.State = CryptoItemsController.CryptoItemState.VIEW; } if (controller.IsCreator(controller.CryptoItemList[controller.SelectedIndex].creator) && !controller.CryptoItemList[controller.SelectedIndex].markedForDelete) { if (GUILayout.Button("EDIT", GUILayout.Width(100), GUILayout.Height(30))) { controller.CurrentCryptoItem = controller.CryptoItemList[controller.SelectedIndex]; if (controller.CurrentCryptoItem.itemURI == null) { if (controller.CurrentCryptoItem.nonFungible) { controller.CurrentCryptoItem.itemURI = Enjin.GetCryptoItemURI(controller.CurrentCryptoItem.token_id, controller.CurrentCryptoItem.index, false); } else { controller.CurrentCryptoItem.itemURI = Enjin.GetCryptoItemURI(controller.CurrentCryptoItem.token_id, "0", false); } } controller.TransferFeeEnj = float.Parse((decimal.Parse(controller.CurrentCryptoItem.transferFeeSettings.value) / ((decimal)Mathf.Pow(10, 18))).ToString()); controller.NewCryptoItem.transferFeeSettings = controller.CurrentCryptoItem.transferFeeSettings; controller.EditItemName = controller.CurrentCryptoItem.name; controller.MetaDataURI = controller.CurrentCryptoItem.itemURI; controller.EditMetaDataURI = controller.MetaDataURI; controller.CurrentCryptoItem.isCreator = controller.IsCreator(controller.CurrentCryptoItem.creator); controller.MeltFee = controller.CurrentCryptoItem.meltFeeRatio * 0.01f; controller.State = CryptoItemsController.CryptoItemState.EDIT; } if (GUILayout.Button(new GUIContent("MINT"), GUILayout.Width(100), GUILayout.Height(30))) { controller.MintableCryptoItems = Enjin.GetMintableItems(controller.CryptoItemList[controller.SelectedIndex].token_id); controller.NumToMint = 1; controller.RecieverAddress = new string[1]; controller.RecieverAddress[0] = EnjinEditor.CurrentUserIdentity.ethereum_address; controller.Reserve = System.Convert.ToInt32(controller.CurrentCryptoItem.reserve); controller.MeltValue2 = (double)((float)System.Convert.ToDecimal(controller.CurrentCryptoItem.meltValue) / Mathf.Pow(10, 18)); controller.CurrentCryptoItem = controller.CryptoItemList[controller.SelectedIndex]; controller.State = CryptoItemsController.CryptoItemState.MINT; } } if (controller.CryptoItemList[controller.SelectedIndex].nonFungible == false) // || System.Int32.Parse(controller.CryptoItemList[controller.SelectedIndex].index) != 0 { if (controller.CryptoItemList[controller.SelectedIndex].balance != 0) { if (GUILayout.Button(new GUIContent("MELT"), GUILayout.Width(100), GUILayout.Height(30))) { controller.CurrentCryptoItem = controller.CryptoItemList[controller.SelectedIndex]; controller.Balance = controller.CurrentCryptoItem.balance; controller.State = CryptoItemsController.CryptoItemState.MELT; } } } } GUILayout.Space(8); EditorGUILayout.EndHorizontal(); GUILayout.Space(10); GUILayout.EndArea(); }
/// <summary> /// Handles executing logout process /// </summary> public void Logout() { _loginState = LoginState.NONE; LoginInfo = new LoginCredentials(); EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.LOGOUT); }
/// <summary> /// Starts up the platform /// </summary> public void ProcessStartUp() { Enjin.IsLoggedIn = true; EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.INITILAIZEPLATFORM); _loginState = LoginState.VALID; }
/// <summary> /// Build and Draw Melt CI Panel /// Embedded UI logic for field validation and initial request return status /// </summary> public void DrawPane(CryptoItemsController controller, GUISkin skin) { GUILayout.BeginArea(new Rect(5, 126, 912, 490), skin.GetStyle("TopBackground")); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(new GUIContent("MELT CRYPTOITEM"), skin.GetStyle("MainTitle")); EditorGUILayout.EndHorizontal(); GUILayout.Space(20); EditorGUILayout.BeginHorizontal(); GUILayout.Space(16); EditorGUILayout.BeginVertical(); EditorGUILayout.BeginHorizontal(GUILayout.Width(280)); EditorGUILayout.BeginVertical(); EditorGUILayout.LabelField(new GUIContent("CRYPTOITEM ID"), skin.GetStyle("Subtitle")); EditorGUILayout.LabelField(new GUIContent(controller.CurrentCryptoItem.token_id.Substring(0, 8) + "..", controller.CurrentCryptoItem.token_id), skin.GetStyle("LargeTextDark"), GUILayout.Height(30), GUILayout.Width(30)); EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical(); GUILayout.Label(controller.CurrentCryptoItem.iconTexture, GUILayout.Width(60), GUILayout.Height(60)); EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); EditorGUILayout.LabelField(new GUIContent("CRYPTOITEM NAME"), skin.GetStyle("Subtitle")); EditorGUILayout.LabelField(new GUIContent(controller.CurrentCryptoItem.name), skin.GetStyle("LargeTextDark"), GUILayout.Height(30)); GUILayout.Space(10); EditorGUILayout.LabelField(new GUIContent("AVAILABLE COUNT"), skin.GetStyle("Subtitle")); EditorGUILayout.LabelField(new GUIContent(controller.Balance.ToString()), skin.GetStyle("LargeTextDark"), GUILayout.Height(30)); GUILayout.Space(10); if (!controller.CurrentCryptoItem.nonFungible) { EditorGUILayout.LabelField(new GUIContent("NUMBER TO MELT"), skin.GetStyle("Subtitle")); controller.NumToMelt = EditorGUILayout.IntField(controller.NumToMelt, skin.textField, GUILayout.Width(260), GUILayout.Height(30)); if (controller.NumToMelt > controller.Balance) { controller.NumToMelt = controller.Balance; } } else { controller.NumToMelt = 1; EditorGUILayout.LabelField(new GUIContent("NUMBER TO MELT"), skin.GetStyle("Subtitle")); EditorGUILayout.LabelField(new GUIContent(controller.NumToMelt.ToString()), skin.GetStyle("LargeTextDark"), GUILayout.Width(260), GUILayout.Height(30)); } if (controller.NumToMelt == 0) { controller.NumToMelt = 1; } GUILayout.Space(10); EditorGUILayout.LabelField(new GUIContent("CREATOR MELT FEE"), skin.GetStyle("Subtitle")); EditorGUILayout.LabelField(new GUIContent(controller.EnjPerItem.ToString("N4") + " ENJ"), skin.GetStyle("LargeTextDark"), GUILayout.Height(30)); GUILayout.Space(10); EditorGUILayout.LabelField(new GUIContent("ENJ RETURNED"), skin.GetStyle("Subtitle")); controller.EnjReturned = (controller.NumToMelt * controller.EnjPerItem); EditorGUILayout.LabelField(new GUIContent(controller.EnjReturned.ToString("N4")), skin.GetStyle("LargeTextDark"), GUILayout.Height(30)); GUILayout.Space(10); EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("MELT", GUILayout.Width(100), GUILayout.Height(30))) { if (controller.NumToMelt == 0) { EditorUtility.DisplayDialog("INVALID MELT VALUE", "Melt value must be at least one.", "Ok"); } else { controller.Properties.Clear(); controller.Properties.Add("NumToMelt", controller.NumToMelt); Request request = controller.ProcessCryptoItem(ProcessTasks.MELT, controller.CurrentCryptoItem, controller.Properties); if (EnjinEditor.IsRequestSuccessfull(request.state)) { EditorUtility.DisplayDialog("SUCCESS", "The request has posted with a status of " + request.state + ". Please see your wallet to complete the transaction!", "Ok"); } else { EditorUtility.DisplayDialog("FAILURE", "The request could not be processed due to a status of " + request.state + ".", "Ok"); } EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADITEMS); controller.State = CryptoItemsController.CryptoItemState.MAIN; } } GUILayout.Space(16); if (GUILayout.Button("BACK", GUILayout.Width(100), GUILayout.Height(30))) { controller.State = CryptoItemsController.CryptoItemState.MAIN; } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); GUILayout.EndArea(); }
public void ProcessRequests() { if (Processing) { return; } // Start processing result queue Processing = true; // handle pending requests on the controller monitoring for result updates RequestsCompleted.Clear(); foreach (KeyValuePair <string, Result> entry in ResultsQueue) { if (entry.Value.Type == Result.Types.CRYPTOITEMS && CIController != null) { switch (entry.Value.Status) { case Status.SUCCESS: if (entry.Value.compoundQueries.Count > 0) { foreach (CompoundQuery query in entry.Value.compoundQueries) { Request request = CIController.ProcessCryptoItem(query.Task, query.CryptoItem, query.Properties); if (EnjinEditor.IsRequestSuccessfull(request.state)) { EditorUtility.DisplayDialog("SUCCESS", "Your previous request contained an additional request which has now posted with a status of " + request.state + ". Please see your wallet to complete the transaction!", "Ok"); } else { EditorUtility.DisplayDialog("FAILURE", "The request could not be processed due to a status of " + request.state + ".", "Ok"); } CIController.State = CryptoItemsController.CryptoItemState.MAIN; } RequestsCompleted.Add(entry.Key); } else { if (EditorUtility.DisplayDialog("SUCCESS", "A pending request has posted successfully. Refresh now?\n\nNote, refreshing will return you to the index and clear any active data entry.", "Refresh", "Cancel")) { EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADITEMS); CIController.Reset(); } RequestsCompleted.Add(entry.Key); } break; case Status.FAILURE: if (EditorUtility.DisplayDialog("FAILURE", "A pending request could not be processed due to a status of " + entry.Value.Status + ". Refresh now?\n\nNote, refreshing will return you to the index and clear any active data entry.", "Refresh", "Cancel")) { EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADITEMS); CIController.Reset(); } RequestsCompleted.Add(entry.Key); break; } } else if (entry.Value.Type == Result.Types.IDENTITIES) { // noop -- stub example for future notifications } else { // noop } } if (RequestsCompleted.Count > 0) { RequestsCompleted.ForEach(e => ResultsQueue.Remove(e)); } // Done processing result queue. Processing = false; }
private void LinkedWallet() { GUILayout.BeginArea(new Rect(5, 10, 912, 606), _skin.GetStyle("TopBackground")); EditorGUILayout.LabelField(new GUIContent("WALLET DETAILS"), _skin.GetStyle("MainTitle")); GUILayout.Space(30); EditorGUILayout.BeginHorizontal(); GUILayout.Space(16); EditorGUILayout.LabelField(new GUIContent("ENJ BALANCE"), _skin.GetStyle("Subtitle"), GUILayout.Width(140)); EditorGUILayout.LabelField(new GUIContent("ETH BALANCE"), _skin.GetStyle("Subtitle"), GUILayout.Width(140)); EditorGUILayout.LabelField(new GUIContent("ACTIVE TOKENS"), _skin.GetStyle("Subtitle"), GUILayout.Width(140)); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Space(16); EditorGUILayout.LabelField(new GUIContent(Enjin.GetEnjBalance.ToString("#,##0.###")), _skin.GetStyle("LargeNumbers"), GUILayout.Width(140)); EditorGUILayout.LabelField(new GUIContent(Enjin.GetEthBalance.ToString("#,##0.########")), _skin.GetStyle("LargeNumbers"), GUILayout.Width(140)); EditorGUILayout.LabelField(new GUIContent(_activeTokenBalance), _skin.GetStyle("LargeNumbers"), GUILayout.Width(140)); EditorGUILayout.EndHorizontal(); GUILayout.Space(20); EditorGUILayout.BeginHorizontal(); GUILayout.Space(16); EditorGUILayout.LabelField(new GUIContent("LINKED ADDRESS"), _skin.GetStyle("Subtitle"), GUILayout.Width(120)); GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); EditorGUILayout.LabelField(new GUIContent(EnjinEditor.CurrentUserIdentity.ethereum_address), _skin.GetStyle("ContentDark")); GUILayout.Space(14); if (GUILayout.Button(new GUIContent(ClipBoardIcon, "Copy Wallet Address to Clipboard"), GUILayout.Width(32), GUILayout.Height(32))) { EditorGUIUtility.systemCopyBuffer = EnjinEditor.CurrentUserIdentity.ethereum_address; } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); GUILayout.Space(20); //EditorGUILayout.BeginHorizontal(); //GUILayout.Space(14); //if (GUILayout.Button(new GUIContent("Download Wallet"), GUILayout.Width(120), GUILayout.Height(30))) // Application.OpenURL("https://enjinwallet.io/"); //EditorGUILayout.EndHorizontal(); GUILayout.Space(20); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); EditorGUILayout.LabelField(new GUIContent("To change your wallet addres you will need to unlink this wallet."), _skin.GetStyle("ContentLight")); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); if (GUILayout.Button(new GUIContent("Unlink Wallet"), GUILayout.Width(120), GUILayout.Height(30))) { if (EditorUtility.DisplayDialog("Unlink Wallet", "This will unlink this editor from your developer wallet. Do you want to proceed?", "Accept", "Cancel")) { Enjin.UnLinkIdentity(EnjinEditor.CurrentUserIdentity.id); EnjinEditor.CurrentUser = Enjin.GetUserRaw(EnjinEditor.CurrentUser.id); EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADALL); } } EditorGUILayout.EndHorizontal(); GUILayout.EndArea(); }
public void DrawCreateEditPane(IdentitiesTabController controller, GUISkin skin) { GUILayout.BeginArea(new Rect(5, 10, 912, 606), skin.GetStyle("TopBackground")); EditorGUILayout.BeginHorizontal(); if (controller.State == IdentitiesTabController.IdentityState.EDIT) { EditorGUILayout.LabelField(new GUIContent("VIEW IDENTITY"), skin.GetStyle("MainTitle")); } else { EditorGUILayout.LabelField(new GUIContent(controller.State.ToString() + " IDENTITY"), skin.GetStyle("MainTitle")); } EditorGUILayout.EndHorizontal(); GUILayout.Space(30); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); EditorGUILayout.LabelField(new GUIContent("CURRENT APPLICATION"), skin.GetStyle("Subtitle")); EditorGUILayout.EndHorizontal(); GUILayout.Space(10); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); EditorGUILayout.LabelField(new GUIContent("ID: " + Enjin.AppID.ToString() + " -> " + EnjinEditor.AppsNameList[EnjinEditor.SelectedAppIndex]), skin.GetStyle("LargeTextDark")); EditorGUILayout.EndHorizontal(); GUILayout.Space(20); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); EditorGUILayout.LabelField(new GUIContent("USER ID"), skin.GetStyle("Subtitle")); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); if (controller.State == IdentitiesTabController.IdentityState.CREATE) { EditorStyles.popup.fixedHeight = 30; EditorStyles.popup.fontSize = 12; controller.CurrentIdentity.user.id = System.Convert.ToInt32(EditorGUILayout.Popup(controller.CurrentIdentity.user.id, controller.UserIDs.ToArray(), GUILayout.Width(220), GUILayout.Height(30))); EditorStyles.popup.fixedHeight = 15; EditorStyles.popup.fontSize = 11; } else { EditorGUILayout.LabelField(new GUIContent(controller.CurrentIdentity.user.id.ToString()), skin.GetStyle("LargeText"), GUILayout.Width(320), GUILayout.Height(30)); } EditorGUILayout.EndHorizontal(); GUILayout.Space(10); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); if (controller.State == IdentitiesTabController.IdentityState.CREATE) { EditorGUILayout.LabelField(new GUIContent("ETHEREUM ADDRESS"), skin.GetStyle("Subtitle")); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); controller.CurrentIdentity.ethereum_address = EditorGUILayout.TextField(controller.CurrentIdentity.ethereum_address, skin.textField, GUILayout.Width(320), GUILayout.Height(30)); } else { if (controller.CurrentIdentity.linking_code == "") { EditorGUILayout.LabelField(new GUIContent("ETHEREUM ADDRESS"), skin.GetStyle("Subtitle")); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); EditorGUILayout.LabelField(new GUIContent(controller.CurrentIdentity.ethereum_address), skin.GetStyle("LargeText"), GUILayout.Width(320), GUILayout.Height(30)); } else { EditorGUILayout.LabelField(new GUIContent("LINKING CODE"), skin.GetStyle("Subtitle")); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); EditorGUILayout.LabelField(new GUIContent(controller.CurrentIdentity.linking_code), skin.GetStyle("LargeText"), GUILayout.Width(320), GUILayout.Height(30)); } } EditorGUILayout.EndHorizontal(); if (controller.State != IdentitiesTabController.IdentityState.CREATE && controller.CurrentIdentity.linking_code == "") { GUILayout.Space(20); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); EditorGUILayout.LabelField(new GUIContent("To change your wallet addres you will need to unlink this wallet."), skin.GetStyle("ContentDark")); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Space(14); if (GUILayout.Button(new GUIContent("Unlink Wallet"), GUILayout.Width(120), GUILayout.Height(30))) { if (EditorUtility.DisplayDialog("Unlink Wallet", "This will unlink this editor from your developer wallet. Do you want to proceed?", "Accept", "Cancel")) { Enjin.UnLinkIdentity(controller.CurrentIdentity.id); EnjinEditor.CurrentUser = Enjin.GetUserRaw(controller.CurrentIdentity.id); EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADALL); } } EditorGUILayout.EndHorizontal(); } /*** * Disabled for V1 */ //GUILayout.Space(20); //EditorGUILayout.BeginHorizontal(); //EditorGUILayout.LabelField(new GUIContent("FIELDS"), skin.GetStyle("MainTitle")); //EditorGUILayout.EndHorizontal(); //GUILayout.Space(20); //EditorGUILayout.BeginHorizontal(); //GUILayout.Space(14); ///* TODO POST V1 // * - Make fields additive so user can add fields as nessisary // */ //if (controller.CurrentIdentity.fields == null || controller.CurrentIdentity.fields.Length == 0) //{ // controller.CurrentIdentity.fields = new Fields[2]; // controller.CurrentIdentity.fields = Enjin.DefaultFields; //} //_scrollPos = EditorGUILayout.BeginScrollView(_scrollPos, GUILayout.Width(320), GUILayout.Height(140)); //for (int i = 0; i < controller.CurrentIdentity.fields.Length; i++) //{ // EditorGUILayout.BeginVertical("helpBox"); // EditorGUILayout.BeginHorizontal(); // GUILayout.Space(14); // EditorGUILayout.LabelField(new GUIContent("KEY"), skin.GetStyle("Subtitle"), GUILayout.Width(140)); // EditorGUILayout.LabelField(new GUIContent("VALUE"), skin.GetStyle("Subtitle"), GUILayout.Width(140)); // EditorGUILayout.EndHorizontal(); // EditorGUILayout.BeginHorizontal(); // GUILayout.Space(14); // EditorGUILayout.LabelField(new GUIContent(controller.CurrentIdentity.fields[i].key), GUILayout.Width(140), GUILayout.Height(30)); // controller.CurrentIdentity.fields[i].value = EditorGUILayout.TextField(controller.CurrentIdentity.fields[i].value, skin.textField, GUILayout.Width(140), GUILayout.Height(30)); // EditorGUILayout.EndHorizontal(); // GUILayout.Space(8); // EditorGUILayout.EndVertical(); //} //EditorGUILayout.EndScrollView(); //EditorGUILayout.EndHorizontal(); GUILayout.Space(10); GUILayout.FlexibleSpace(); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (controller.State == IdentitiesTabController.IdentityState.CREATE) { if (GUILayout.Button(new GUIContent("CREATE"), GUILayout.Width(100), GUILayout.Height(30))) { controller.ProcessRequest(ProcessTasks.CREATE, controller.CurrentIdentity, _properties); //if (!Enjin.ValidateAddress(controller.CurrentIdentity.ethereum_address)) // EditorUtility.DisplayDialog("INVALID ADDRESS", "The address you entered is not valid. Please enter a valid address", "Ok"); //else //{ // controller.ProcessRequest(ProcessTasks.CREATE, controller.CurrentIdentity, _properties); //} } } if (GUILayout.Button(new GUIContent("BACK"), GUILayout.Width(100), GUILayout.Height(30))) { controller.CurrentIdentity.fields = new Fields[0]; controller.State = IdentitiesTabController.IdentityState.VIEW; } GUILayout.Space(10); EditorGUILayout.EndHorizontal(); GUILayout.Space(10); GUILayout.EndArea(); }