public void InitialiseFromGeneration(ModalWindowController modalWindowController, ISelectionBar <SeedGeneration> selectionBar, Tooltip tooltip, SeedGeneration seedGeneration) { // Set the seed generation. this.seedGeneration = seedGeneration; // Bind the main button to select this generation. selectionButton.onClick.AddListener(() => selectionBar.OnButtonSelected(seedGeneration)); // Bind the filter button to create a new filter window. filterButton.onClick.AddListener(() => { FilterWindowController filterWindowController = modalWindowController.CreateModalWindow <FilterWindowController>(filterWindowPrefab.gameObject); filterWindowController.CreateFrom(modalWindowController, this.seedGeneration); }); // Hide the filter button if the generation is 0, as that's the infinite pool of seeds. if (this.seedGeneration.Generation == 0) { filterButton.gameObject.SetActive(false); } // Set the tooltip object of anything that needs it. foreach (TooltipActivator tooltipActivator in GetComponentsInChildren <TooltipActivator>()) { tooltipActivator.Tooltip = tooltip; } // Refresh the display. Refresh(); }
public async Task <string> GetAuthorizationUriAsync(string authorizeUri, string redirectUriRoot) { var controller = new ModalWindowController(authorizeUri, redirectUriRoot); NSApplication.SharedApplication.RunModalForWindow(controller.Window); await Task.Delay(100); return(controller.Result); }
public void InitialiseFromCrop(ModalWindowController modalWindowController, ISelectionBar <SeedGeneration> selectionBar, Tooltip tooltip, CropTile cropTile) { // Set dependencies. this.modalWindowController = modalWindowController; seedListController = selectionBar; this.tooltip = tooltip; // NOTE: You may think that it would be easier to use GetComponentInParent, however, this returns the vertical layout group that's part of this object instead. parentList = transform.parent.GetComponent <VerticalLayoutGroup>(); // Set label and icon. generationName.text = cropTile.Name; cropIcon.sprite = cropTile.Icon; }
/// <summary> Initialises the window from the given <paramref name="seedGeneration"/>. </summary> /// <param name="modalWindowController"> The modal window controller used to close this window. </param> /// <param name="seedGeneration"> The generation to manage. </param> public void CreateFrom(ModalWindowController modalWindowController, SeedGeneration seedGeneration) { // Ensure this window is not being set up twice. if (SeedGeneration != null) { Debug.LogError("Cannot initialise window twice."); return; } // Set the window controller. this.modalWindowController = modalWindowController; // Set the seed generation. SeedGeneration = seedGeneration; // Set the title. titleText.text = $"{seedGeneration.CropTileName} seed generation {seedGeneration.Generation} filter options"; // Populate the stat lists. availableStatsPane.Populate(); statValuePane.Populate(); }