示例#1
0
        public static async Task <Dictionary <TargetService.ActorTableActor, SceneFile.SceneActor> > GetActors(IEnumerable <TargetService.ActorTableActor> actors)
        {
            ActorNamer selector = new ActorNamer(actors);

            return(await ViewService.ShowDialog <ActorNamer, Dictionary <TargetService.ActorTableActor, SceneFile.SceneActor> >("Name Actors", selector));
        }
示例#2
0
        public async Task WriteToFile(Configuration config)
        {
            this.TerritoryId   = TerritoryService.Instance.CurrentTerritoryId;
            this.TerritoryName = TerritoryService.Instance.CurrentTerritoryName;

            if (config.IncludeTime)
            {
                this.TimeOfDay  = TimeService.Instance.TimeOfDay;
                this.DayOfMonth = TimeService.Instance.DayOfMonth;
            }

            if (config.IncludeWeather)
            {
                this.Weather = TerritoryService.Instance.CurrentWeatherId;
            }

            Dictionary <TargetService.ActorTableActor, SceneActor>?actors = null;

            if (config.IncludeActors)
            {
                actors = await ActorNamer.GetActors(TargetService.Instance.PinnedActors);

                foreach ((TargetService.ActorTableActor tableActor, SceneActor sceneActor) in actors)
                {
                    ActorViewModel?actor = tableActor.GetViewModel();

                    if (actor == null)
                    {
                        continue;
                    }

                    if (this.RootPosition == Vector.Zero && actor.ModelObject?.Transform != null)
                    {
                        this.RootPosition = actor.ModelObject.Transform.Position;
                    }
                }
            }

            if (config.IncludeCamera && CameraService.Instance.Camera != null)
            {
                this.UnlimitCamera     = CameraService.Instance.DelimitCamera;
                this.CameraAngle       = CameraService.Instance.Camera.Angle;
                this.CameraYMin        = CameraService.Instance.Camera.YMin;
                this.CameraYMax        = CameraService.Instance.Camera.YMax;
                this.CameraPan         = CameraService.Instance.Camera.Pan;
                this.CameraRotation    = CameraService.Instance.Camera.Rotation;
                this.CameraZoom        = CameraService.Instance.Camera.Zoom;
                this.CameraMinZoom     = CameraService.Instance.Camera.MinZoom;
                this.CameraMaxZoom     = CameraService.Instance.Camera.MaxZoom;
                this.CameraFieldOfView = CameraService.Instance.Camera.FieldOfView;
                this.CameraPosition    = CameraService.Instance.CameraPosition;
            }

            if (config.IncludeActors && actors != null)
            {
                this.Actors = new List <SceneActor>();

                foreach ((TargetService.ActorTableActor tableActor, SceneActor sceneActor) in actors)
                {
                    ActorViewModel?vm = tableActor.GetViewModel();

                    if (vm == null)
                    {
                        continue;
                    }

                    throw new NotImplementedException();

                    /*SkeletonVisual3d skeleton;
                     *
                     * sceneActor.FromActor(vm, this.RootPosition, config);
                     * this.Actors.Add(sceneActor);*/
                }
            }
        }