public LeftMenuHandler(IBuilderProjectsPanelView view, ISectionsController sectionsController) { this.view = view; this.sectionsController = sectionsController; view.OnBackToMainMenuPressed += OnSceneSettingsBackPressed; sectionsController.OnOpenSectionId += OnOpenSectionId; LeftMenuButtonToggleView.OnToggleOn += OnToggleOn; }
public SectionsHandler(ISectionsController sectionsController, IScenesViewController scenesViewController, ILandController landController, SearchBarView searchBarView) { this.sectionsController = sectionsController; this.scenesViewController = scenesViewController; this.searchBarView = searchBarView; this.landController = landController; sectionsController.OnSectionShow += OnSectionShow; sectionsController.OnSectionHide += OnSectionHide; scenesViewController.OnSceneSelected += OnSelectScene; }
public SceneContextMenuHandler(SceneCardViewContextMenu contextMenu, ISectionsController sectionsController, IScenesViewController scenesViewController, UnpublishPopupController unpublishPopupController) { this.contextMenu = contextMenu; this.sectionsController = sectionsController; this.scenesViewController = scenesViewController; this.unpublishPopupController = unpublishPopupController; sectionsController.OnRequestContextMenuHide += OnRequestContextMenuHide; scenesViewController.OnContextMenuPressed += OnContextMenuOpen; contextMenu.OnSettingsPressed += OnContextMenuSettingsPressed; contextMenu.OnDuplicatePressed += OnContextMenuDuplicatePressed; contextMenu.OnDownloadPressed += OnContextMenuDownloadPressed; contextMenu.OnSharePressed += OnContextMenuSharePressed; contextMenu.OnUnpublishPressed += OnContextMenuUnpublishPressed; contextMenu.OnDeletePressed += OnContextMenuDeletePressed; contextMenu.OnQuitContributorPressed += OnContextMenuQuitContributorPressed; }
internal void Initialize(ISectionsController sectionsController, IScenesViewController scenesViewController, ILandController landController, ITheGraph theGraph, ICatalyst catalyst) { if (isInitialized) { return; } isInitialized = true; this.sectionsController = sectionsController; this.scenesViewController = scenesViewController; this.landsController = landController; this.theGraph = theGraph; this.catalyst = catalyst; this.unpublishPopupController = new UnpublishPopupController(view.GetUnpublishPopup()); // set listeners for sections, setup searchbar for section, handle request for opening a new section sectionsHandler = new SectionsHandler(sectionsController, scenesViewController, landsController, view.GetSearchBar()); // handle if main panel or settings panel should be shown in current section leftMenuHandler = new LeftMenuHandler(view, sectionsController); // handle project scene info on the left menu panel leftMenuSettingsViewHandler = new LeftMenuSettingsViewHandler(view.GetSettingsViewReferences(), scenesViewController); // handle scene's context menu options sceneContextMenuHandler = new SceneContextMenuHandler(view.GetSceneCardViewContextMenu(), sectionsController, scenesViewController, unpublishPopupController); SetView(); sectionsController.OnRequestOpenUrl += OpenUrl; sectionsController.OnRequestGoToCoords += GoToCoords; sectionsController.OnRequestEditSceneAtCoords += OnGoToEditScene; scenesViewController.OnJumpInPressed += GoToCoords; scenesViewController.OnRequestOpenUrl += OpenUrl; scenesViewController.OnEditorPressed += OnGoToEditScene; DataStore.i.HUDs.builderProjectsPanelVisible.OnChange += OnVisibilityChanged; DataStore.i.dataStoreBuilderInWorld.unpublishSceneResult.OnChange += OnSceneUnpublished; }
public void SetUp() { controller = new BuilderProjectsPanelController(); sectionsController = Substitute.For <ISectionsController>(); scenesViewController = Substitute.For <IScenesViewController>(); landsController = Substitute.For <ILandController>(); ITheGraph theGraph = Substitute.For <ITheGraph>(); theGraph.Query(Arg.Any <string>(), Arg.Any <string>()).Returns(new Promise <string>()); theGraph.Query(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <QueryVariablesBase>()).Returns(new Promise <string>()); theGraph.QueryLands(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <float>()).Returns(new Promise <List <Land> >()); ICatalyst catalyst = Substitute.For <ICatalyst>(); catalyst.contentUrl.Returns(string.Empty); catalyst.Get(Arg.Any <string>()).Returns(new Promise <string>()); catalyst.GetEntities(Arg.Any <string>(), Arg.Any <string[]>()).Returns(new Promise <string>()); catalyst.GetDeployedScenes(Arg.Any <string[]>()).Returns(new Promise <CatalystSceneEntityPayload[]>()); controller.Initialize(sectionsController, scenesViewController, landsController, theGraph, catalyst); }