private void OnDrawGizmos() { DockLocation inWorldDock = GetDockLocationInWorld(); Gizmos.color = Color.magenta; Gizmos.DrawLine(inWorldDock.LeftTop, inWorldDock.LeftBot); Gizmos.DrawLine(inWorldDock.LeftBot, inWorldDock.RightBot); Gizmos.DrawLine(inWorldDock.RightBot, inWorldDock.RightTop); Gizmos.DrawLine(inWorldDock.RightTop, inWorldDock.LeftTop); }
public Appbar(string name, int size, Font timeFont, Font menuFont, DockLocation dock, bool displayTime) { Name = name; _timeFont = timeFont; _font = menuFont; _dock = dock; _timeFormat = TimeFormat.Hour12; _displayTime = displayTime; Metrics(size); _bkg = ColorUtility.ColorFromRGB(30, 30, 30); _fore = Colors.White; _elli = new Bitmap(4, 4); _elliRect = new rect(Left, Top, 64, 64); UpdateEllipsis(); }
IEnumerator MoveResultsRoutine(UseableEntity[] useableEntities, Transform origin) { UIUseableEntityList listUI = Instantiate(useableEntityListPrefab, Game.UIHandler.InWorldCanvas.transform); listUI.Init(new SubscribableList <UseableEntity>(useableEntities)); float duration = lerpToDockCurve.keys[lerpToDockCurve.length - 1].time; float dockOffsetLerpAmount = Game.Dock.GetFilledFloat(); float t = 0; while ((t += Time.deltaTime) < duration) { DockLocation dockL = Game.Camera.GetDockLocationInWorld(); listUI.transform.position = Vector3.Lerp(origin.position + SpawnOffsetFromOrigin, Vector3.Lerp(dockL.LeftBot, dockL.RightBot, dockOffsetLerpAmount), lerpToDockCurve.Evaluate(t)); yield return(null); } Game.Dock.Add(useableEntities); Destroy(listUI.gameObject); }
protected override void onDockLocationChanged(DockLocation oldLocation, DockLocation newLocation) { if (newLocation == DockLocation.Floating) { float normalizedMouseWidthOffset = (float)captionMouseOffset.x / window.CaptionWidget.Width; window.MinSize = undockedMinSize; window.MaxSize = undockedMaxSize; window.setSize((int)desiredLocation.Width, (int)desiredLocation.Height); captionMouseOffset.x = (int)(normalizedMouseWidthOffset * window.CaptionWidget.Width); IgnorePositionChanges = false; window.setActionWidgetsEnabled(true); } else { updateUndockedMinMaxSize(); window.MinSize = DOCKED_MIN_SIZE; window.MaxSize = DOCKED_MAX_SIZE; switch (newLocation) { case DockLocation.Left: case DockLocation.Right: dockedSize.Width = window.Width; break; case DockLocation.Top: case DockLocation.Bottom: dockedSize.Height = window.Height; break; } Size = dockedSize; window.setActionWidgetsEnabled(false); } }
/// <summary> /// Shows the frame in a given location /// </summary> /// <param name="location"></param> public void Show( DockLocation location ) { switch ( location ) { case DockLocation.Left : m_Content.Show( m_Panel, DockState.DockLeft ); return; case DockLocation.Right : m_Content.Show( m_Panel, DockState.DockRight ); return; case DockLocation.Top: m_Content.Show( m_Panel, DockState.DockTop ); return; case DockLocation.Bottom: m_Content.Show( m_Panel, DockState.DockBottom ); return; case DockLocation.Floating: m_Content.Show( m_Panel, DockState.Float ); return; case DockLocation.Fill: m_Content.Show( m_Panel, DockState.Document ); return; } throw new NotSupportedException( "Unsupported docking location " + location ); }
public MDILayoutElementName(String name, DockLocation location) : base(name) { this.dockLocation = location; }
public MDIWindow(DockLocation currentLocation) : base(currentLocation) { AllowedDockLocations = DockLocation.All; }
protected virtual void onDockLocationChanged(DockLocation oldLocation, DockLocation newLocation) { }
public MDIContainerBase(DockLocation currentLocation) { currentDockLocation = currentLocation; Scale = 100.0f; }
/// <summary> /// Registers 'contextual' view type, with the type of views that are context sensitive to this view. /// </summary> /// <typeparam name="TViewModel">The type of the view model.</typeparam> /// <typeparam name="TContextSensitiveViewModel">The type of the context sensitive view model.</typeparam> /// <param name="title">The title.</param> /// <param name="dockLocation">The dock location.</param> public void RegisterContextualView <TViewModel, TContextSensitiveViewModel>(string title, DockLocation dockLocation) { RegisterContextualView <TViewModel, TContextSensitiveViewModel>(title, new DockingSettings { DockLocation = dockLocation }); }
/// <summary> /// Shows a view in a new docking frame /// </summary> /// <param name="title">Frame title</param> /// <param name="view">View to show</param> /// <param name="initialDockLocation">Initial docking state of the frame</param> /// <returns>Returns the docking frame created to host the view</returns> public IDockingFrame Show( string title, IView view, DockLocation initialDockLocation ) { Arguments.CheckNotNull( view, "view" ); IDockingFrame frame = CreateFrame( title ); frame.View = view; frame.Show( initialDockLocation ); return frame; }
protected override Composite CreateBehavior() { return(_root ?? (_root = new PrioritySelector( new Decorator(ret => Counter >= 1, new Action(ret => _isDone = true)), new PrioritySelector( new Decorator(ret => !MovedToTarget, new Action(delegate { // using Styx.Logic.BehaviorTree; TreeRoot.GoalText = "Ship Behavior: Running"; TreeRoot.StatusText = "Moving To Dock"; if (DockLocation.Distance(me.Location) > 3) { Navigator.MoveTo(DockLocation); } else { MovedToTarget = true; return RunStatus.Success; } return RunStatus.Running; }) ), new Decorator(ret => MovedToTarget, new Action(delegate { objectList = ObjectManager.GetObjectsOfType <WoWGameObject>() .Where(u => u.Entry == ObjectID) .OrderBy(u => u.Distance).ToList(); TreeRoot.StatusText = "Waiting For Ship"; foreach (WoWGameObject value in objectList) { Tripper.Tools.Math.Matrix m = value.GetWorldMatrix(); WoWPoint matrixLocation = new WoWPoint(m.M41, m.M42, m.M43); //Logging.Write("" + matrixLocation.X + " " + matrixLocation.Y + " " + matrixLocation.Z); if (GetOffLocation.Distance(me.Location) < 3) { _isDone = true; return RunStatus.Success; } if (matrixLocation.Distance(me.Location) < 20 && !MovedOnShip) { TreeRoot.StatusText = "Moving Onto Ship"; Thread.Sleep(3000); WoWMovement.ClickToMove(GetOnLocation); MovedOnShip = true; } else if (MovedOnShip) { TreeRoot.StatusText = "On Ship, Waiting"; if (ShipStandLocation.X > 0) { WoWMovement.ClickToMove(ShipStandLocation); } if (matrixLocation.Distance(EndLocation) < 20) { TreeRoot.StatusText = "Moving Off Ship"; Thread.Sleep(3000); WoWMovement.ClickToMove(GetOffLocation); MovedOnShip = true; } } return RunStatus.Success; } return RunStatus.Running; }) ), new Action(ret => Logging.Write("")) ) ))); }
public MDILayoutContainerScale(LayoutType layoutType, int padding, DockLocation dockLocation) : base(layoutType, padding, dockLocation) { setSeparatorWidgetManager(new SeparatorWidgetManagerScale(this)); }
/// <summary> /// Constructor. /// </summary> /// <param name="layoutType">The alignment of the container.</param> /// <param name="padding">The amount of padding between elements.</param> public MDILayoutContainer(LayoutType layoutType, int padding, DockLocation dockLocation) : base(dockLocation) { this.layoutType = layoutType; this.padding = padding; }
public MDIChildContainerBase(DockLocation currentLocation) : base(currentLocation) { }
private bool checkContainerWidget(Widget widget, MDIChildContainerBase targetContainer, MDIWindow window, DockLocation dockLocation, float x, float y) { if (widget.Visible) { float left = widget.AbsoluteLeft; float top = widget.AbsoluteTop; float right = left + widget.Width; float bottom = top + widget.Height; if (x > left && x < right && y > top && y < bottom) { dragTargetContainer = targetContainer; dragTargetWindow = null; windowTargetWidget.Visible = true; switch (dockLocation) { case DockLocation.Left: windowTargetWidget.setCoord((int)Location.x, (int)Location.y, (int)window.DesiredSize.Width, (int)WorkingSize.Height); break; case DockLocation.Right: float width = window.DesiredSize.Width; windowTargetWidget.setCoord((int)(WorkingSize.Width - width + Location.x), (int)Location.y, (int)width, (int)WorkingSize.Height); break; case DockLocation.Top: windowTargetWidget.setCoord((int)Location.x, (int)Location.y, (int)WorkingSize.Width, (int)window.DesiredSize.Height); break; case DockLocation.Bottom: float height = window.DesiredSize.Height; windowTargetWidget.setCoord((int)Location.x, (int)(WorkingSize.Height - height + Location.y), (int)WorkingSize.Width, (int)height); break; } return(true); } } return(false); }