示例#1
0
        public SceneTreeGui(IEventRoutingService eventRoutingService, IWorldTreeService worldTreeService, IViewService viewService,
                            IPresentationGuiCommands commands, ICommonGuiObjects commonGuiObjects)
        {
            itemIndex             = new Dictionary <ISceneNode, TreeItem>();
            this.worldTreeService = worldTreeService;
            this.viewService      = viewService;
            this.commands         = commands;

            eyeIcon    = Icon.FromResource("Clarity.Ext.Gui.EtoForms.Resources.eye_icon.ico");
            sceneIcon  = Icon.FromResource("Clarity.Ext.Gui.EtoForms.Resources.scene_icon.ico");
            viewIcon   = Icon.FromResource("Clarity.Ext.Gui.EtoForms.Resources.view_icon.ico");
            layoutIcon = Icon.FromResource("Clarity.Ext.Gui.EtoForms.Resources.layout_icon.ico");
            entityIcon = Icon.FromResource("Clarity.Ext.Gui.EtoForms.Resources.entity_icon.ico");
            whiteIcon  = Icon.FromResource("Clarity.Ext.Gui.EtoForms.Resources.white_icon.ico");

            rootItem = new TreeItem {
                Text = "GuiRoot", Expanded = true
            };
            treeView = new TreeView
            {
                Width       = 250,
                DataStore   = rootItem,
                ContextMenu = commonGuiObjects.SelectionContextMenu
            };
            //RebuildFromRoot();
            eventRoutingService.RegisterServiceDependency(typeof(ISceneTreeGui), typeof(IWorldTreeService));
            eventRoutingService.Subscribe <IWorldTreeUpdatedEvent>(typeof(ISceneTreeGui), nameof(OnWorldUpdated), OnWorldUpdated);
            eventRoutingService.Subscribe <IAppModeChangedEvent>(typeof(ISceneTreeGui), nameof(OnAppModeChanged), OnAppModeChanged);
            treeView.SelectionChanged += OnSelectionChanged;
            treeView.NodeMouseClick   += OnNodeMouseClick;
            treeView.MouseDoubleClick += OnNodeMouseDoubleClick;

            viewService.Update += OnViewServiceUpdate;
        }
 public AdvancedVrInputDispatcher(IMessagePopupService messagePopupService, IReadOnlyList <IVrNavigationMode> navigationModes,
                                  IEventRoutingService eventRoutingService, IUserQueryService userQueryService,
                                  IVrHeadPositionService headPositionService, IGlobalObjectService globalObjectService)
 {
     this.messagePopupService            = messagePopupService;
     this.userQueryService               = userQueryService;
     this.headPositionService            = headPositionService;
     this.globalObjectService            = globalObjectService;
     this.NavigationModes                = navigationModes.Where(x => !(x is IMinimapVrNavigationMode)).ToArray();
     this.minimapVrNavigationMode        = navigationModes.OfType <IMinimapVrNavigationMode>().Single();
     minimapVrNavigationMode.ZoomEnabled = true;
     eventRoutingService.Subscribe <INewFrameEvent>(typeof(IVrInputDispatcher), nameof(OnNewFrame), OnNewFrame);
     eventRoutingService.Subscribe <IFixedUpdateEvent>(typeof(IVrInputDispatcher), nameof(OnFixedUpdate), OnFixedUpdate);
     capabilities = VrInputDispatcherCapabilities.All;
 }
示例#3
0
 public OffScreenContainer(IGraphicsInfra infra, IEventRoutingService eventRoutingService)
 {
     this.infra = infra;
     dict       = new Dictionary <Pair <object>, DictItem>();
     deathNote  = new List <Pair <object> >();
     eventRoutingService.Subscribe <INewFrameEvent>(typeof(OffScreenContainer), nameof(Update), Update);
 }
 public VrHeadPositionService(IStoryService storyService, IGlobalObjectService globalObjectService, IEventRoutingService eventRoutingService)
 {
     this.storyService        = storyService;
     this.globalObjectService = globalObjectService;
     localPlayerTransform     = ca.Transform.Identity;
     eventRoutingService.Subscribe <INewFrameEvent>(typeof(IVrHeadPositionService), nameof(OnNewFrame), OnNewFrame);
 }
 public VrManipulationService(IEventRoutingService eventRoutingService, IViewService viewService, IGlobalObjectService globalObjectService)
 {
     this.viewService         = viewService;
     this.globalObjectService = globalObjectService;
     eventRoutingService.Subscribe <INewFrameEvent>(typeof(IVrManipulationService), nameof(OnNewFrame), OnNewFrame);
     eventRoutingService.RegisterServiceDependency(typeof(IRenderService), typeof(IVrManipulationService));
 }
示例#6
0
 public NoviceVrInputDispatcher(IMessagePopupService messagePopupService, IReadOnlyList <IVrNavigationMode> navigationModes,
                                IEventRoutingService eventRoutingService, IUserQueryService userQueryService,
                                IVrHeadPositionService headPositionService, IGlobalObjectService globalObjectService, IVrManipulationService vrManipulationService)
 {
     this.headPositionService            = headPositionService;
     this.globalObjectService            = globalObjectService;
     this.vrManipulationService          = vrManipulationService;
     minimapVrNavigationMode             = navigationModes.OfType <IMinimapVrNavigationMode>().Single();
     minimapVrNavigationMode.ZoomEnabled = false;
     freeTeleportMode = navigationModes.OfType <FreeTeleportVrNavigationMode>().Single();
     moveInPlaceMode  = navigationModes.OfType <MoveInPlaceVrNavigationMode>().Single();
     NavigationModes  = new IVrNavigationMode[] { freeTeleportMode, moveInPlaceMode };
     eventRoutingService.Subscribe <INewFrameEvent>(typeof(IVrInputDispatcher), nameof(OnNewFrame), OnNewFrame);
     eventRoutingService.Subscribe <IFixedUpdateEvent>(typeof(IVrInputDispatcher), nameof(OnFixedUpdate), OnFixedUpdate);
     capabilities = VrInputDispatcherCapabilities.All;
 }
示例#7
0
 public CoroutineService(IEventRoutingService eventRoutingService)
 {
     Runtime            = new AwcScriptRuntime();
     waitUpdatesQueue   = Runtime.GetQueue <AwcWaitUpdatesTask>();
     waitSecondsQueue   = Runtime.GetQueue <AwcWaitSecondsTask>();
     waitConditionQueue = Runtime.GetQueue <AwcWaitConditionTask>();
     eventRoutingService.Subscribe <INewFrameEvent>(typeof(ICoroutineService), nameof(OnNewFrameEvent), OnNewFrameEvent);
 }
示例#8
0
 public AppModesCommands(IEventRoutingService eventRoutingService, IAppModeService appModeService)
 {
     this.appModeService = appModeService;
     StartPresentation   = GuiCommandsHelper.Create("Start Presentation", ExecStartPresentation, Keys.F5);
     StopPresentation    = GuiCommandsHelper.Create("Stop Presentation", ExecStopPresentation, Keys.Escape);
     eventRoutingService.Subscribe <IAppModeChangedEvent>(typeof(IAppModesCommands), nameof(OnModeChanged), OnModeChanged);
     OnModeChanged(new AppModeChangedEvent(appModeService.Mode));
 }
示例#9
0
 public ViewService(IEventRoutingService eventRoutingService, IRenderLoopDispatcher renderLoopDispatcher, IStoryService storyService)
 {
     this.storyService = storyService;
     model             = AmFactory.Create <ViewServiceModel>();
     eventRoutingService.RegisterServiceDependency(typeof(IViewService), typeof(IWorldTreeService));
     eventRoutingService.Subscribe <IAppModeChangedEvent>(typeof(IViewService), nameof(OnAppModeChange), OnAppModeChange);
     renderLoopDispatcher.Update += OnUpdate;
 }
 public StandardMaterialCache(IUcRenderingInfra infra, IEventRoutingService eventRoutingService)
 {
     this.infra = infra;
     materials  = new Dictionary <StandardMaterialKey, MaterialWithUsageTracking>();
     deathNote  = new List <StandardMaterialKey>();
     eventRoutingService.Subscribe <INewFrameEvent>(typeof(IStandardMaterialCache), nameof(OnNewFrame), OnNewFrame);
     InvisibleMaterial = new Material(infra.ClarityInvisibleShader);
 }
示例#11
0
 public WindowManager(IMainForm mainForm, IEventRoutingService eventRoutingService, IWorldTreeService worldTreeService, IViewService viewService)
 {
     this.mainForm         = mainForm;
     this.worldTreeService = worldTreeService;
     this.viewService      = viewService;
     renderControls        = new IRenderGuiControl[] { mainForm.RenderControl };
     eventRoutingService.RegisterServiceDependency(typeof(IWindowManager), typeof(IWorldTreeService));
     eventRoutingService.Subscribe <IAppModeChangedEvent>(typeof(IWindowManager), nameof(OnAppModeChanged), OnAppModeChanged);
     eventRoutingService.SubscribeToAllAfter(typeof(IWindowManager).FullName, OnEveryEvent, true);
 }
示例#12
0
 public InputHandler(IEventRoutingService eventRoutingService, IToolService toolService,
                     INavigationService navigationService, Lazy <IDirtyHackService> dirtyHackServiceLazy, IRayHitIndex rayHitIndex, IViewService viewService)
 {
     this.toolService          = toolService;
     this.navigationService    = navigationService;
     this.dirtyHackServiceLazy = dirtyHackServiceLazy;
     this.rayHitIndex          = rayHitIndex;
     this.viewService          = viewService;
     inputLocks     = new HashSet <IInputLock>();
     locksToRelease = new List <IInputLock>();
     eventRoutingService.Subscribe <IInteractionEvent>(typeof(IInputHandler), nameof(OnEvent), OnEvent);
 }
示例#13
0
 public SaveLoadService(IEventRoutingService eventRoutingService, IWorldTreeService worldTreeService,
                        Lazy <IDefaultStateInitializer> defaultStateInitializerLazy, IAssetService assetService,
                        IEventRoutingService eventRoutingService1, IReadOnlyWorldBuilder readOnlyWorldBuilder, IMessageBoxService messageBoxService)
 {
     this.eventRoutingService         = eventRoutingService1;
     this.readOnlyWorldBuilder        = readOnlyWorldBuilder;
     this.messageBoxService           = messageBoxService;
     this.defaultStateInitializerLazy = defaultStateInitializerLazy;
     this.worldTreeService            = worldTreeService;
     this.assetService = assetService;
     eventRoutingService.Subscribe <IWorldTreeUpdatedEvent>(typeof(ISaveLoadService), nameof(OnWorldTreeUpdated), OnWorldTreeUpdated);
     // todo: on asset changes
 }
示例#14
0
 public StoryService(IEventRoutingService eventRoutingService, IWorldTreeService worldTreeService, IRenderLoopDispatcher renderLoopDispatcher, IReadOnlyList <IStoryLayout> allLayouts)
 {
     this.worldTreeService = worldTreeService;
     layoutsByType         = allLayouts.ToDictionary(x => x.Type, x => x);
     layouts      = new Dictionary <ISceneNode, IStoryLayout>();
     transactions = new List <object>();
     editingScene = Scene.Create(AmFactory.Create <SceneNode>());
     editingScene.BackgroundColor = Color4.Black;
     editSceneComponent           = AmFactory.Create <StoryFlowchartEditSceneComponent>();
     editingScene.Root.Components.Add(editSceneComponent);
     eventRoutingService.RegisterServiceDependency(typeof(IStoryService), typeof(IWorldTreeService));
     eventRoutingService.Subscribe <IWorldTreeUpdatedEvent>(typeof(IStoryService), nameof(OnWorldUpdated), OnWorldUpdated);
     renderLoopDispatcher.Update += editingScene.Root.Update;
 }
示例#15
0
 public UcRenderService(IDiContainer di,
                        IEventRoutingService eventRoutingService,
                        IGlobalObjectService globalObjectService,
                        IWindowingSystem windowingSystem,
                        IStandardMaterialCache standardMaterialCache)
 {
     this.di = di;
     this.globalObjectService   = globalObjectService;
     this.standardMaterialCache = standardMaterialCache;
     eventRoutingService.RegisterServiceDependency(typeof(IRenderService), typeof(IStandardMaterialCache));
     eventRoutingService.Subscribe <ILateUpdateEvent>(typeof(IRenderService), "OnLateUpdate", e =>
     {
         Render(windowingSystem.RenderControl, e.FrameTime.TotalSeconds);
     });
 }
示例#16
0
 // todo: swich order of name and delegate for better ReSharper support
 public static void Subscribe <TEvent>(this IEventRoutingService eventRoutingService, Type serviceType, string methodName, Action <TEvent> handlerAction)
     where TEvent : IRoutedEvent
 {
     eventRoutingService.Subscribe($"{serviceType.FullName}.{methodName}", handlerAction, new [] { serviceType });
 }
示例#17
0
 public UcMessagePopupService(IGlobalObjectService globalObjectService, IEventRoutingService eventRoutingService)
 {
     this.globalObjectService = globalObjectService;
     eventRoutingService.Subscribe <INewFrameEvent>(typeof(UcMessagePopupService), nameof(OnNewFrame), OnNewFrame);
 }