public void PostSuccess(MatryxSubmission submission, Async.EventDelegate onReturn = null) { SetStatus("Successfully Submitted to \n" + submission.tournament.title); severalMinutesText.gameObject.SetActive(false); mayReturn.gameObject.SetActive(true); StartCoroutine(ReturnToCalcflowAfterSeconds(3f, onReturn)); }
public void SetSubmission(MatryxSubmission submission) { if (this.submission == null || this.submission.hash != submission.hash) { titleText.text = submission.title; bodyText.text = "Loading..."; ClearPreview(); DisableImport(); this.submission = submission; MatryxCortex.GetSubmission(submission, (result) => { Submission = (MatryxSubmission)result; if (Submission.calcflowCompatible) { EnableImport("View"); } else { DisableImport("Incompatible"); } }, (err) => { bodyText.text = "Something went wrong. :("; DisableImport("Uh oh"); }); } }
private void HandleInput(GameObject source) { if (source.name == "Load_Button") { LoadMoreMySubmissions(); } else if (source.GetComponent <SubmissionContainer>()) { string name = source.name; MatryxSubmission submission = source.GetComponent <SubmissionContainer>().submission; // TODO: Navigate the user to the corresponding tournament through the menus submissionMenu.gameObject.GetComponent <AnimationHandler>().OpenMenu((obj) => { submissionMenu.SetSubmission(submission); }); } }
public void PostFailure(MatryxSubmission submission, string message = null, Async.EventDelegate onReturn = null) { if (message != null) { SetStatus(message); } else { SetStatus("Failed to submit to " + submission.tournament.address); } severalMinutesText.gameObject.SetActive(false); mayReturn.gameObject.SetActive(true); tryAgainButton.gameObject.SetActive(true); StartCoroutine(ReturnToCalcflowAfterSeconds(3f, onReturn)); }
public void MakeSubmission() { var title = TitleField.text; if (!TitleField.gameObject.GetComponent <InputValidator>().isValid) { InvalidLabel.gameObject.SetActive(true); return; } this.gameObject.SetActive(false); InvalidLabel.gameObject.SetActive(false); var submission = new MatryxSubmission(tournament, title, "", DescriptionField.text, SerializeSurface(), Convert.ToInt32(ValueField.text)); clearInputs(); resultsCanvasObject.SetActive(true); gameObject.SetActive(false); Async.runInCoroutine(delegate(Async thread, object param) { return(submission.submit(delegate(object result) { // Debug Debug.Log("Submission uploaded"); Debug.Log(result); // Check success if ((bool)result) { StatisticsTracking.EndEvent("Matryx", "Submission Creation"); ResultsMenu.Instance.PostSuccess(submission, (nothin) => { TournamentMenu.Instance.ReloadSubmissions(3f); } ); } else { ResultsMenu.Instance.PostFailure(submission); } })); }); }
private GameObject createButton(MatryxSubmission submission) { GameObject button = Instantiate(Resources.Load("Submission_Cell", typeof(GameObject))) as GameObject; button.transform.SetParent(submissionsPanel.transform); button.transform.localScale = Vector3.one; button.transform.position = new Vector3(-500f, -500f, -500f); button.GetComponent <SubmissionContainer>().submission = submission; var text = button.transform.Find("Text").GetComponent <TMPro.TextMeshPro>(); button.name = submission.title; text.text = submission.title; scroll.addObject(button.transform); joyStickAggregator.AddForwarder(button.GetComponentInChildren <JoyStickForwarder>()); return(button); }
public void DisplaySubmissionUI(MatryxSubmission submission) { submissionMenu.gameObject.GetComponent <AnimationHandler>().OpenMenu(); submissionMenu.SetSubmission(submission); }