public LeftMenuSettingsViewHandler(LeftMenuSettingsViewReferences viewReferences, IScenesViewController scenesViewController) { this.viewReferences = viewReferences; this.scenesViewController = scenesViewController; defaultThumbnail = viewReferences.thumbnail.texture; scenesViewController.OnSceneSelected += OnSelectScene; }
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 void SetUp() { const string sceneCardPrefabPath = "Assets/Scripts/MainScripts/DCL/Controllers/HUD/BuilderProjectsPanel/Prefabs/SceneCardView.prefab"; var sceneCardPrefab = AssetDatabase.LoadAssetAtPath <SceneCardView>(sceneCardPrefabPath); sectionController = new SectionScenesController(); scenesController = new ScenesViewController(sceneCardPrefab); scenesController.AddListener((IDeployedSceneListener)sectionController); scenesController.AddListener((IProjectSceneListener)sectionController); }
public void SetUp() { const string prefabAssetPath = "Assets/Scripts/MainScripts/DCL/Controllers/HUD/BuilderProjectsPanel/Prefabs/SceneCardView.prefab"; var prefab = AssetDatabase.LoadAssetAtPath <SceneCardView>(prefabAssetPath); scenesViewController = new ScenesViewController(prefab); listenerMock = new Listener_Mock(); scenesViewController.OnDeployedSceneRemoved += ((IDeployedSceneListener)listenerMock).OnSceneRemoved; scenesViewController.OnDeployedSceneAdded += ((IDeployedSceneListener)listenerMock).OnSceneAdded; scenesViewController.OnDeployedScenesSet += ((IDeployedSceneListener)listenerMock).OnSetScenes; scenesViewController.OnProjectSceneRemoved += ((IProjectSceneListener)listenerMock).OnSceneRemoved; scenesViewController.OnProjectSceneAdded += ((IProjectSceneListener)listenerMock).OnSceneAdded; scenesViewController.OnProjectScenesSet += ((IProjectSceneListener)listenerMock).OnSetScenes; }
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); }