Пример #1
0
        private void DestroyControl()
        {
            if (this.currentBedMark is null)
            {
                return;
            }

            this.RemoveControl(this.currentBedMark);
            this.currentBedMark = null;
        }
Пример #2
0
        private void DestroyControl()
        {
            if (this.currentBedMark == null)
            {
                return;
            }

            this.worldMapController.RemoveControl(this.currentBedMark);
            this.currentBedMark = null;
        }
Пример #3
0
        private void Refresh()
        {
            var bedWorldPosition = this.playerCharacterPrivateState.CurrentBedObjectPosition;

            if (!bedWorldPosition.HasValue)
            {
                this.DestroyControl();
                return;
            }

            if (this.currentBedMark is null)
            {
                this.currentBedMark = new WorldMapMarkCurrentBed();
                Panel.SetZIndex(this.currentBedMark, 9);
                this.AddControl(this.currentBedMark);
            }

            var canvasPosition = this.WorldToCanvasPosition(
                bedWorldPosition.Value.ToVector2D());

            Canvas.SetLeft(this.currentBedMark, canvasPosition.X);
            Canvas.SetTop(this.currentBedMark, canvasPosition.Y);
        }