internal override void HandleEvent(WorldEvent e) { if (!visible) { return; } base.HandleEvent(e); if (e.Handled) { return; } if (!selected) { return; } if (e is KeyDownEvent) { Keys k = (e as KeyDownEvent).Key; if (k == Keys.Back || k == Keys.Delete) { Input((char)8); } else if (CommonData.KeyCharMap.Keys.Contains(k)) { Input(CommonData.KeyCharMap[k][InputManager.IsKeyDown(Keys.LeftShift) || InputManager.IsKeyDown(Keys.RightShift) ? 1 : 0]); } } }
public void HandleEvent(WorldEvent e, bool forcehandle = false) { // Send to GUI // if not handled send to world if (gameover || won) main.HandleEvent(e); }
public void HandleEvent(WorldEvent e, bool forcehandle = false) { // Send to GUI // if not handled send to world if (gameover || won) { main.HandleEvent(e); } }
internal override void HandleEvent(WorldEvent e) { if (!visible) { return; } base.HandleEvent(e); foreach (UIObject obj in children) { obj.HandleEvent(e); } base.HandleEvent(e); }
internal static void HandleEvent(WorldEvent e) { if (!initd) return; // Debugging commands if (Debugger.IsAttached && e is KeyDownEvent) { if ((e as KeyDownEvent).Key == Keys.OemTilde) { // Could open a console here later } } stateManager.CurrentGameState.HandleEvent(e); }
internal static void HandleEvent(WorldEvent e) { if (!initd) { return; } // Debugging commands if (Debugger.IsAttached && e is KeyDownEvent) { if ((e as KeyDownEvent).Key == Keys.OemTilde) { // Could open a console here later } } stateManager.CurrentGameState.HandleEvent(e); }
internal override void HandleEvent(WorldEvent e) { if (!visible || e.Handled) { return; } foreach (UIObject obj in siblings) { obj.HandleEvent(e); } if (e.Handled) { return; } Vector2 pos; if (e is MouseUpEvent) { pos = (e as MouseUpEvent).Position; } else if (e is TouchTapEvent) { pos = (e as TouchTapEvent).Position; } else { return; } UIGrid p = parent as UIGrid; if (p != null) { pos = p.Camera.DeTransform(pos); } if (BoundingBox.ContainsPoint(pos)) { e.Handled = true; OnPressed(); //SoundManager.PlaySound(DataHandler.Sounds[SoundType.TapSound], SoundCategory.SFX); ; } base.HandleEvent(e); }
internal override void HandleEvent(WorldEvent e) { }
internal virtual void HandleEvent(WorldEvent e) { }
public void HandleEvent(WorldEvent e, bool forcehandle = false) { menu.HandleEvent(e); }
internal override void HandleEvent(WorldEvent e) { if (!visible) return; base.HandleEvent(e); foreach (UIObject obj in children) obj.HandleEvent(e); base.HandleEvent(e); }
internal override void HandleEvent(WorldEvent e) { if (!visible || e.Handled) { return; } if (e is MouseUpEvent && dragging) { e.Handled = true; dragging = false; if (SnapCameraToCells) { SnapCam(); } return; } foreach (UIVisibleObject b in cells) { b.HandleEvent(e); } if (e is TouchFreeDragEvent) { e.Handled = true; if (LockCamera) { return; } TouchFreeDragEvent ev = (e as TouchFreeDragEvent); if (!BoundingBox.ContainsPoint(ev.Postion)) { goto skip; } Vector2 delta = ev.Delta; cam.StepHorizontal(-delta.X); cam.StepVertical(-delta.Y); return; skip : e.Handled = false; return; } if (e is MouseMovedEvent) { if (InputManager.isMouseDown(InputManager.MouseKey.LeftKey)) { e.Handled = true; if (LockCamera) { return; } if (!dragging && !BoundingBox.ContainsPoint((e as MouseMovedEvent).Position)) { goto skip; } dragging = true; Vector2 offset = (e as MouseMovedEvent).Offset; cam.StepHorizontal(offset.X); cam.StepVertical(offset.Y); return; skip : e.Handled = false; return; } } if (e is TouchAllFingersOffEvent && SnapCameraToCells) { SnapCam(); } }
internal override void HandleEvent(WorldEvent e) { if (!visible || e.Handled) return; if (e is MouseUpEvent && dragging) { e.Handled = true; dragging = false; if (SnapCameraToCells) SnapCam(); return; } foreach (UIVisibleObject b in cells) b.HandleEvent(e); if (e is TouchFreeDragEvent) { e.Handled = true; if (LockCamera) return; TouchFreeDragEvent ev = (e as TouchFreeDragEvent); if (!BoundingBox.ContainsPoint(ev.Postion)) goto skip; Vector2 delta = ev.Delta; cam.StepHorizontal(-delta.X); cam.StepVertical(-delta.Y); return; skip: e.Handled = false; return; } if (e is MouseMovedEvent) { if (InputManager.isMouseDown(InputManager.MouseKey.LeftKey)) { e.Handled = true; if (LockCamera) return; if (!dragging && !BoundingBox.ContainsPoint((e as MouseMovedEvent).Position)) goto skip; dragging = true; Vector2 offset = (e as MouseMovedEvent).Offset; cam.StepHorizontal(offset.X); cam.StepVertical(offset.Y); return; skip: e.Handled = false; return; } } if (e is TouchAllFingersOffEvent && SnapCameraToCells) SnapCam(); }
internal override void HandleEvent(WorldEvent e) { if (!visible) return; base.HandleEvent(e); if (e.Handled) return; if (!selected) return; if (e is KeyDownEvent) { Keys k = (e as KeyDownEvent).Key; if (k == Keys.Back || k == Keys.Delete) Input((char)8); else if (CommonData.KeyCharMap.Keys.Contains(k)) Input(CommonData.KeyCharMap[k][InputManager.IsKeyDown(Keys.LeftShift) || InputManager.IsKeyDown(Keys.RightShift) ? 1 : 0]); } }