Пример #1
0
 void DecreaseToolSize_FirstFrameUpEvent(EventLayer eventLayer)
 {
     if (eventLayer.EventProcessingAllowed && (showMoveTools || showRotateTools) && visible && toolSize - ToolSizeIncrement >= ToolSizeMinimum)
     {
         ToolSize -= ToolSizeIncrement;
     }
 }
Пример #2
0
 void toggleAdMode_FirstFrameUpEvent(EventLayer eventLayer)
 {
     if (selectionOperators.Selection == SelectionOperator.Add)
     {
         selectionOperators.Selection = SelectionOperator.Select;
     }
 }
Пример #3
0
            internal Instruction(BinaryReaderEx br, GameType game, OffsetsContainer offsets)
            {
                Bank = br.ReadInt32();
                ID   = br.ReadInt32();

                long argsLength = ReadIntW(br, game != GameType.DS1);
                long argsOffset = br.ReadInt32();

                if (game != GameType.DS1)
                {
                    br.AssertInt32(0);
                }

                if (game != GameType.DS3)
                {
                    br.AssertInt32(0);
                }

                br.StepIn(offsets.ArgsBlockOffset + argsOffset);
                {
                    Args = br.ReadBytes((int)argsLength);
                }
                br.StepOut();

                long layerOffset = ReadIntW(br, game != GameType.DS1);

                if (layerOffset != -1)
                {
                    br.StepIn(offsets.EventLayersOffset + layerOffset);
                    {
                        Layer = new EventLayer(br, game);
                    }
                    br.StepOut();
                }
            }
Пример #4
0
 /// <summary>
 /// Creates a new Instruction with the specified bank, id, layer mask, and args.
 /// </summary>
 public Instruction(int bank, int id, uint layerMask, params object[] args)
 {
     Bank  = bank;
     ID    = id;
     Layer = new EventLayer(layerMask);
     PackArgs(args);
 }
Пример #5
0
 /// <summary>
 /// Creates a new Instruction with the specified bank, id, layer mask, and args.
 /// </summary>
 public Instruction(int bank, int id, uint layerMask, IEnumerable <object> args)
 {
     Bank  = bank;
     ID    = id;
     Layer = new EventLayer(layerMask);
     PackArgs(args);
 }
Пример #6
0
 /// <summary>
 /// Creates a new Instruction with the specified bank, id, layer mask, and args bytes.
 /// </summary>
 public Instruction(int bank, int id, uint layerMask, byte[] args)
 {
     Bank  = bank;
     ID    = id;
     Layer = new EventLayer(layerMask);
     Args  = args;
 }
Пример #7
0
        private bool ThemeIsCompatible(ITheme theme, EventLayer layer)
        {
            //var result = true;
            char[] charsToTrim = { '[', ']' };

            if (theme is GraduatedTheme)
            {
                var colName = ((GraduatedTheme)theme).FieldName;
                var first   = colName.IndexOf("gisEnd", StringComparison.Ordinal);
                var last    = colName.IndexOf("__", StringComparison.Ordinal);

                foreach (var column in ((EventDataProvider)layer.DataSource).EventTable.Columns)
                {
                    if (column.ToString().Contains(((GraduatedTheme)theme).FieldName.Substring(first, last - first)))
                    {
                        return(true);
                    }
                }

                return(false);

                //return
                //    ((EventDataProvider) layer.DataSource).EventTable.Columns.Contains(
                //        ((GraduatedTheme) theme).FieldName.Trim(charsToTrim));
            }
            if (theme is GradientTheme)
            {
                var colName = ((GradientTheme)theme).ColumnName;
                var first   = colName.IndexOf("gisEnd", StringComparison.Ordinal);
                var last    = colName.IndexOf("__", StringComparison.Ordinal);

                foreach (var column in ((EventDataProvider)layer.DataSource).EventTable.Columns)
                {
                    if (column.ToString().Contains(((GradientTheme)theme).ColumnName.Substring(first, last - first)))
                    {
                        return(true);
                    }
                }

                return(false);

                //return
                //    ((EventDataProvider)layer.DataSource).EventTable.Columns.Contains(((GradientTheme)theme).ColumnName.Substring(first, last - first));
                //((GradientTheme) theme).ColumnName.Trim(charsToTrim));
            }
            if (theme is BarChartTheme)
            {
                var lstItems = ((BarChartTheme)theme).BarChartItems;
                return
                    (lstItems.Select(
                         barChartItem =>
                         ((EventDataProvider)layer.DataSource).EventTable.Columns.Contains(barChartItem.ColumnName))
                     .All(boolContains => boolContains));
            }
            if (theme is RuleBasedTheme)
            {
            }

            return(true);
        }
Пример #8
0
 void IncreaseToolSize_FirstFrameUpEvent(EventLayer eventLayer)
 {
     if (eventLayer.EventProcessingAllowed && (showMoveTools || showRotateTools) && visible)
     {
         ToolSize += ToolSizeIncrement;
     }
 }
        void changeSelectionMode_FirstFrameUpEvent(EventLayer eventLayer)
        {
            if (!Gui.Instance.HandledKeyboardButtons)
            {
                switch (anatomyController.PickingMode)
                {
                case AnatomyPickingMode.Group:
                    if (anatomyController.ShowPremiumAnatomy)
                    {
                        anatomyController.PickingMode = AnatomyPickingMode.Individual;
                    }
                    else
                    {
                        anatomyController.PickingMode = AnatomyPickingMode.None;
                    }
                    break;

                case AnatomyPickingMode.Individual:
                    anatomyController.PickingMode = AnatomyPickingMode.None;
                    break;

                case AnatomyPickingMode.None:
                    anatomyController.PickingMode = AnatomyPickingMode.Group;
                    break;
                }
            }
        }
Пример #10
0
 void zoomGesture_GestureStarted(EventLayer eventLayer, TwoFingerZoom zoomGesture)
 {
     if (eventLayer.EventProcessingAllowed)
     {
         createTouchUndo();
     }
 }
Пример #11
0
        void rotateGesture_Dragged(EventLayer eventLayer, FingerDragGesture gesture)
        {
            if (eventLayer.EventProcessingAllowed && currentGesture <= Gesture.Rotate)
            {
                currentGesture = Gesture.Rotate;
                SceneViewWindow sceneView = sceneViewController.ActiveWindow;
                if (sceneView != null)
                {
                    switch (movementMode)
                    {
                    case CameraMovementMode.Rotate:
                        sceneView.CameraMover.rotateFromMotion((int)gesture.DeltaX, (int)gesture.DeltaY);
                        break;

                    case CameraMovementMode.Pan:
                        sceneView.CameraMover.panFromMotion((int)gesture.DeltaX, (int)gesture.DeltaY, eventLayer.Mouse.AreaWidth, eventLayer.Mouse.AreaHeight);
                        break;

                    case CameraMovementMode.Zoom:
                        sceneView.CameraMover.zoomFromMotion((int)gesture.DeltaY);
                        break;
                    }
                }
                travelTracker.traveled((int)gesture.DeltaX, (int)gesture.DeltaY);
                eventLayer.alertEventsHandled();
            }
        }
Пример #12
0
 void panGesture_GestureStarted(EventLayer eventLayer, FingerDragGesture gesture)
 {
     if (eventLayer.EventProcessingAllowed)
     {
         createTouchUndo();
     }
 }
Пример #13
0
    public void SetEventLayer(EventLayer layer)
    {
        cueEventLayer = layer;
        switch (layer)
        {
        case EventLayer.Nothing:
            UICamera.AssignRaycastLayerMask(0);
            break;

        case EventLayer.EveryThing:
            UICamera.AssignRaycastLayerMask(-1);
            break;

        case EventLayer.UI:
            UICamera.AssignRaycastLayerMask(1 << 5);
            break;

        case EventLayer.FirstDialog:
            UICamera.AssignRaycastLayerMask(1 << 8);
            break;

        case EventLayer.SecondDialog:
            UICamera.AssignRaycastLayerMask(1 << 9);
            break;

        case EventLayer.ThirdDialog:
            UICamera.AssignRaycastLayerMask(1 << 10);
            break;
        }
    }
Пример #14
0
 void togglePanMode_FirstFrameUpEvent(EventLayer eventLayer)
 {
     if (sceneViewController.MovementMode == CameraMovementMode.Pan)
     {
         sceneViewController.MovementMode = CameraMovementMode.Rotate;
     }
 }
Пример #15
0
 void toggleRemoveMode_FirstFrameUpEvent(EventLayer eventLayer)
 {
     if (selectionOperators.Selection == SelectionOperator.Remove)
     {
         selectionOperators.Selection = SelectionOperator.Select;
     }
 }
Пример #16
0
 void rotateCamera_FirstFrameUpEvent(EventLayer eventLayer)
 {
     if (travelTracker.TraveledOverLimit)
     {
         eventLayer.alertEventsHandled();
     }
 }
Пример #17
0
 void openAnatomyFinder_FirstFrameUpEvent(EventLayer eventLayer)
 {
     if (!Gui.Instance.HandledKeyboardButtons || InputManager.Instance.getKeyFocusWidget().RootWidget == window)
     {
         this.Visible = !this.Visible;
         InputManager.Instance.setKeyFocusWidget(searchBox);
     }
 }
Пример #18
0
 void rotateGesture_GestureStarted(EventLayer eventLayer, FingerDragGesture gesture)
 {
     if (eventLayer.EventProcessingAllowed && currentGesture <= Gesture.Rotate)
     {
         createTouchUndo();
         travelTracker.reset();
     }
 }
Пример #19
0
 public SampleEvent(string filepath, int startTime, int volume = 100, EventLayer layer = EventLayer.Background)
 {
     Type      = EventTypes.Sample;
     Layer     = layer;
     StartTime = startTime;
     FilePath  = filepath;
     Volume    = volume;
 }
Пример #20
0
 void zoomGesture_MomentumEnded(EventLayer eventLayer, TwoFingerZoom zoomGesture)
 {
     if (currentGesture <= Gesture.Zoom)
     {
         commitTouchUndo();
         currentGesture = Gesture.None;
     }
 }
Пример #21
0
 void panGesture_MomentumEnded(EventLayer eventLayer, FingerDragGesture gesture)
 {
     if (currentGesture <= Gesture.Pan)
     {
         commitTouchUndo();
         currentGesture = Gesture.None;
     }
 }
Пример #22
0
 public AnimationEvent(string filepath, int frameCount, int frameDuration, EventLayer layer = EventLayer.Background,
                       Origin origin = Origin.Centre, float x = 320, float y = 240, Looptypes looptype = Looptypes.LoopForever)
     : base(filepath, layer, origin, x, y)
 {
     Type          = EventTypes.Animation;
     Framecount    = frameCount;
     FrameDuration = frameDuration;
     Looptype      = looptype;
 }
Пример #23
0
 void moveAnatomyGesture_Dragged(EventLayer eventLayer, FingerDragGesture gesture)
 {
     if (eventLayer.EventProcessingAllowed)
     {
         travelTracker.traveled((int)gesture.DeltaX, (int)gesture.DeltaY);
         Ray3 cameraRay = getCameraRay(gesture.AbsoluteX, gesture.AbsoluteY);
         moveDragTarget(cameraRay);
         eventLayer.alertEventsHandled();
     }
 }
Пример #24
0
 void pickAnatomy_OnHeldDown(EventLayer eventLayer)
 {
     if (allowMousePosing && eventLayer.EventProcessingAllowed)
     {
         travelTracker.traveled(eventLayer.Mouse.RelativePosition);
         IntVector3 absMouse  = eventLayer.Mouse.AbsolutePosition;
         Ray3       cameraRay = getCameraRay(absMouse.x, absMouse.y);
         moveDragTarget(cameraRay);
         eventLayer.alertEventsHandled();
     }
 }
Пример #25
0
 void moveAnatomyGesture_MomentumEnded(EventLayer eventLayer, FingerDragGesture gesture)
 {
     allowMousePosing                  = true;
     moveAnatomyGesture.Dragged       -= moveAnatomyGesture_Dragged;
     moveAnatomyGesture.MomentumEnded -= moveAnatomyGesture_MomentumEnded;
     clearDragTarget();
     if (eventLayer.EventProcessingAllowed && travelTracker.TraveledOverLimit)
     {
         eventLayer.alertEventsHandled();
     }
 }
Пример #26
0
 void selectEvent(EventLayer eventLayer)
 {
     if (eventLayer.EventProcessingAllowed)
     {
         var absPos = eventLayer.Mouse.AbsolutePosition;
         if (containsPoint(absPos.x, absPos.y))
         {
             mdiWindow.Active = true;
         }
     }
 }
Пример #27
0
        public ContextUpdater(Context context, EventLayer eventLayer)
        {
            this.context    = context;
            this.eventLayer = eventLayer;

            eventLayer.Mouse.ButtonDown += Mouse_ButtonDown;
            eventLayer.Mouse.ButtonUp   += Mouse_ButtonUp;
            eventLayer.Mouse.Moved      += Mouse_Moved;

            eventLayer.Keyboard.KeyPressed  += Keyboard_KeyPressed;
            eventLayer.Keyboard.KeyReleased += Keyboard_KeyReleased;
        }
Пример #28
0
 private void ZoomGesture_Zoom(EventLayer eventLayer, TwoFingerZoom zoomGesture)
 {
     if (eventLayer.EventProcessingAllowed && currentGesture <= Gesture.Zoom)
     {
         currentGesture = Gesture.Zoom;
         SceneViewWindow sceneView = sceneViewController.ActiveWindow;
         if (sceneView != null)
         {
             sceneView.CameraMover.zoomFromMotion((int)(zoomGesture.ZoomDelta * 800));
         }
         eventLayer.alertEventsHandled();
     }
 }
Пример #29
0
 public SpriteEvent(string filepath, EventLayer layer = EventLayer.Background, Origin origin = Origin.Centre, float x = 320, float y = 240)
 {
     Type            = EventTypes.Sprite;
     Layer           = layer;
     Origin          = origin;
     Filepath        = filepath;
     StartPosition   = new Position(x, y);
     Transformations = new List <TransformationEvent>();
     Loopevents      = new List <LoopEvent>();
     Triggerevents   = new List <TriggerEvent>();
     StartTime       = int.MaxValue;
     EndTime         = int.MinValue;
 }
Пример #30
0
 void panGesture_Dragged(EventLayer eventLayer, FingerDragGesture gesture)
 {
     if (eventLayer.EventProcessingAllowed && currentGesture <= Gesture.Pan)
     {
         currentGesture = Gesture.Pan;
         SceneViewWindow sceneView = sceneViewController.ActiveWindow;
         if (sceneView != null)
         {
             sceneView.CameraMover.panFromMotion((int)gesture.DeltaX, (int)gesture.DeltaY, eventLayer.Mouse.AreaWidth, eventLayer.Mouse.AreaHeight);
         }
         eventLayer.alertEventsHandled();
     }
 }