コード例 #1
0
        public PresentationGuiCommands(Lazy <IViewService> viewServiceLazy,
                                       IToolService toolService, IToolFactory toolFactory, IUndoRedoService undoRedoService, IAmDiBasedObjectFactory objectFactory)
        {
            this.toolService     = toolService;
            this.toolFactory     = toolFactory;
            this.undoRedoService = undoRedoService;
            this.objectFactory   = objectFactory;
            this.viewServiceLazy = viewServiceLazy;

            //LayoutHere = GuiCommandsHelper.Create("Layout Here", ExecLayoutHere);
            Move                 = new GuiCommand("Move", KeyModifiers.Control, Key.T, ExecMove);
            Move3D               = new GuiCommand("Move3D", KeyModifiers.Control | KeyModifiers.Shift, Key.T, ExecMove3D);
            Rotate               = new GuiCommand("Rotate", KeyModifiers.Control, Key.R, ExecRotate);
            Scale                = new GuiCommand("Scale", KeyModifiers.Control, Key.E, ExecScale);
            Cut                  = new GuiCommand("Cut", KeyModifiers.Control, Key.X, ExecCut);
            Copy                 = new GuiCommand("Copy", KeyModifiers.Control, Key.C, ExecCopy);
            Paste                = new GuiCommand("Paste", KeyModifiers.Control, Key.V, ExecPaste);
            Duplicate            = new GuiCommand("Duplicate", KeyModifiers.Control, Key.D, ExecDuplicate);
            Delete               = new GuiCommand("Delete", Key.Delete, ExecDelete);
            FocusView            = new GuiCommand("Focus View", KeyModifiers.Control, Key.Enter, ExecFocusView);
            AddNewAdaptiveLayout = new GuiCommand("Adaptive Layout", ExecNewAdaptiveLayout);
            MoveUp               = new GuiCommand("Move Up", KeyModifiers.Control, Key.Up, ExecMoveUp);
            MoveDown             = new GuiCommand("Move Down", KeyModifiers.Control, Key.Down, ExecMoveDown);
            SetBorderCurve       = new GuiCommand("Set Border Curve", ExecSetBorderCurve);
            MakeScenePortal      = new GuiCommand("Make Scene Portal", ExecMakeScenePortal);
        }
コード例 #2
0
 void RegisterTools(IToolFactory factory)
 {
     TextEditor_DependencyInjectionContainer.RegisterTools(factory);
     KitbasherEditor_DependencyInjectionContainer.RegisterTools(factory);
     View3D_DependencyInjectionContainer.RegisterTools(factory);
     AnimMetaEditor_DependencyInjectionContainer.RegisterTools(factory);
     AnimationEditors_DependencyInjectionContainer.RegisterTools(factory);
     AnimationFragment_DependencyInjectionContainer.RegisterTools(factory);
     AnimationPack_DependencyInjectionContainer.RegisterTools(factory);
 }
コード例 #3
0
        private void Hand_Click(object sender, EventArgs e)
        {
            textBox1.Visible      = false;
            numericUpDown.Visible = false;
            Button Btn = sender as Button;

            if (Btn != null)
            {
                setColor(this, Btn);
            }
            toolController = new HandController();
            toolFactory    = new HandFactory();
            tool           = toolFactory.CreateTool(tool.Selector);
            PaintMode      = false;
        }
        public static void CreateKarlAndSquigEditor(IEditorCreator creator, IToolFactory toolFactory, PackFileService packfileService)
        {
            var editorView = toolFactory.CreateEditorViewModel <MountAnimationCreatorViewModel>();

            editorView.MainInput = new AnimationToolInput()
            {
                Mesh = packfileService.FindFile(@"variantmeshes\variantmeshdefinitions\emp_ch_karl.variantmeshdefinition")
            };

            editorView.RefInput = new AnimationToolInput()
            {
                Mesh = packfileService.FindFile(@"variantmeshes\variantmeshdefinitions\grn_great_cave_squig.variantmeshdefinition")
            };

            creator.CreateEmptyEditor(editorView);
        }
        public static void CreateDamselAndGrymgoreEditor(IEditorCreator creator, IToolFactory toolFactory, PackFileService packfileService)
        {
            var editorView = toolFactory.CreateEditorViewModel <MountAnimationCreatorViewModel>();

            editorView.MainInput = new AnimationToolInput()
            {
                Mesh = packfileService.FindFile(@"variantmeshes\variantmeshdefinitions\brt_damsel_campaign_01.variantmeshdefinition")
            };

            editorView.RefInput = new AnimationToolInput()
            {
                Mesh = packfileService.FindFile(@"variantmeshes\variantmeshdefinitions\lzd_carnosaur_grymloq.variantmeshdefinition")
            };

            creator.CreateEmptyEditor(editorView);
        }
        public static void CreateRaptorAndHu02(IEditorCreator creator, IToolFactory toolFactory, PackFileService packfileService)
        {
            var editorView = toolFactory.CreateEditorViewModel <MountAnimationCreatorViewModel>();

            editorView.MainInput = new AnimationToolInput()
            {
                Mesh = packfileService.FindFile(@"variantmeshes\variantmeshdefinitions\grn_savage_orc_base.variantmeshdefinition") as PackFile,
            };

            editorView.RefInput = new AnimationToolInput()
            {
                Mesh = packfileService.FindFile(@"variantmeshes\variantmeshdefinitions\def_cold_one.variantmeshdefinition") as PackFile,
            };

            creator.CreateEmptyEditor(editorView);
        }
        public static void CreateLionAndHu01b(IEditorCreator creator, IToolFactory toolFactory, PackFileService packfileService)
        {
            var editorView = toolFactory.CreateEditorViewModel <MountAnimationCreatorViewModel>();

            editorView.MainInput = new AnimationToolInput()
            {
                Mesh = packfileService.FindFile(@"variantmeshes\variantmeshdefinitions\hef_princess_campaign_01.variantmeshdefinition")
            };

            editorView.RefInput = new AnimationToolInput()
            {
                Mesh = packfileService.FindFile(@"variantmeshes\variantmeshdefinitions\hef_war_lion.variantmeshdefinition")
            };

            creator.CreateEmptyEditor(editorView);
        }
        public static void CreateBroodHorrorEditor(IEditorCreator creator, IToolFactory toolFactory, PackFileService packfileService)
        {
            var editorView = toolFactory.CreateEditorViewModel <MountAnimationCreatorViewModel>();

            editorView.MainInput = new AnimationToolInput()
            {
                Mesh = packfileService.FindFile(@"variantmeshes\variantmeshdefinitions\skv_plague_priest.variantmeshdefinition")
            };

            editorView.RefInput = new AnimationToolInput()
            {
                Mesh = packfileService.FindFile(@"variantmeshes\variantmeshdefinitions\skv_brood_horror.variantmeshdefinition")
            };

            creator.CreateEmptyEditor(editorView);
        }
コード例 #9
0
        public static void CreateDamselAndSkavenEditor(IEditorCreator creator, IToolFactory toolFactory, PackFileService packfileService)
        {
            var editorView = toolFactory.CreateEditorViewModel <PropCreatorViewModel>();

            editorView.MainInput = new AnimationToolInput()
            {
                Mesh      = packfileService.FindFile(@"variantmeshes\variantmeshdefinitions\skv_assassin.variantmeshdefinition") as PackFile,
                Animation = packfileService.FindFile(@"animations\battle\humanoid17\halberd\stand\hu17_hb_stand_01.anim") as PackFile,
            };

            editorView.RefInput = new AnimationToolInput()
            {
                Mesh      = packfileService.FindFile(@"variantmeshes\variantmeshdefinitions\brt_damsel_campaign_01.variantmeshdefinition") as PackFile,
                Animation = packfileService.FindFile(@"animations\battle\humanoid01b\staff_and_sword\celebrate\hu1b_sfsw_celebrate_01.anim") as PackFile,
            };
            creator.CreateEmptyEditor(editorView);
        }
コード例 #10
0
 protected StoryComponent(IViewService viewService, ICommonNodeFactory commonNodeFactory, IToolService toolService,
                          IToolFactory toolFactory, IRenderService renderService, Lazy <IStoryService> storyGraphServiceLazy,
                          INavigationService navigationService, Lazy <IAppModeService> appModeServiceLazy)
 {
     this.viewService           = viewService;
     this.commonNodeFactory     = commonNodeFactory;
     this.toolService           = toolService;
     this.toolFactory           = toolFactory;
     this.renderService         = renderService;
     this.storyGraphServiceLazy = storyGraphServiceLazy;
     this.navigationService     = navigationService;
     this.appModeServiceLazy    = appModeServiceLazy;
     ShowAux1 = true;
     ShowAux2 = true;
     selectInteractionElement   = new SelectOnClickInteractionElement(this, viewService);
     focusInteractionElement    = new FocusOnDoubleClickInteractionElement(this);
     navigateInteractionElement = new NavigateOnDoubleClickInteractionElement(this, navigationService);
 }
コード例 #11
0
        public void Register(IToolFactory factory)
        {
            factory.LinkedRegistry = this;
            factory.LinkedProvider = this;
            string s = SimPe.Localization.GetString("Unknown");

#if !DEBUG
            try
#endif
            {
                s = factory.FileName;
                Register(factory.KnownTools);
            }
#if !DEBUG
            catch (Exception ex)
            {
                Helper.ExceptionMessage("Unable to load Tool \"" + s + "\". You Probaly have a Plugin/Tool installed, that is not compatible with the current SimPE Release.", ex);
            }
#endif

            AddUpdatablePlugin(factory);
        }
コード例 #12
0
        public DefaultMainForm(IUndoRedoService undoRedoService, IToolFactory toolFactory, IToolService toolService,
                               RenderControl renderControl, IAppModesCommands appModesCommands,
                               ISaveLoadGuiCommands saveLoadGuiCommands, ISceneTreeGui sceneTreeGui, /*IPropsGui propsGui,*/ IFluentGuiService fluentGuiService,
                               IAmDiBasedObjectFactory objectFactory, IAssetService assetService, IEmbeddedResources embeddedResources,
                               IResourceExplorerGui resourceExplorerGui, IReadOnlyList <IToolMenuItem> toolMenuItems, IStoryGraphGui storyGraphGui,
                               IReadOnlyList <IAssetLoader> assetLoaders, IViewService viewService, ICommonGuiObjects commonGuiObjects,
                               ISceneNodeContextMenuBuilder sceneNodeContextMenuBuilder)
        {
            this.storyGraphGui = storyGraphGui;
            ClientSize         = new Size(1280, 720);
            Title = "Clarity Worlds";

            var assetOpenFileDialog = new OpenFileDialog();

            assetOpenFileDialog.Filters.Add(new FileDialogFilter("All Assets", assetLoaders.SelectMany(x => x.FileExtensions).Distinct().ToArray()));
            foreach (var assetLoader in assetLoaders)
            {
                assetOpenFileDialog.Filters.Add(new FileDialogFilter(assetLoader.AssetTypeString,
                                                                     assetLoader.FileExtensions.ToArray()));
            }

            var toolCommands = new Command[]
            {
                new ToolCommand("Cube", toolService, () =>
                {
                    var entity  = objectFactory.Create <SceneNode>();
                    entity.Name = "NewCube";
                    entity.Components.Add(PresentationComponent.Create());
                    var modelComponent   = objectFactory.Create <ModelComponent>();
                    modelComponent.Model = embeddedResources.CubeModel();
                    modelComponent.Color = GetRandomSaturatedColor();
                    entity.Components.Add(modelComponent);
                    return(toolFactory.MoveEntity(entity, true));
                }),
                new ToolCommand("Sphere", toolService, () =>
                {
                    var entity  = objectFactory.Create <SceneNode>();
                    entity.Name = "NewSphere";
                    entity.Components.Add(PresentationComponent.Create());
                    var modelComponent   = objectFactory.Create <ModelComponent>();
                    modelComponent.Model = embeddedResources.SphereModel(64);
                    modelComponent.Color = GetRandomSaturatedColor();
                    entity.Components.Add(modelComponent);
                    return(toolFactory.MoveEntity(entity, true));
                }),
                new ToolCommand("Rectangle", toolService, toolFactory.AddRectangle),
                new ToolCommand("Text", toolService, toolFactory.AddText),
                new ToolCommand("Asset", toolService, () =>
                {
                    assetOpenFileDialog.ShowDialog(this);
                    var loadPath = assetOpenFileDialog.FileName;
                    if (loadPath == null)
                    {
                        return(null);
                    }
                    var loadInfo = new AssetLoadInfo
                    {
                        FileSystem    = ActualFileSystem.Singleton,
                        LoadPath      = loadPath,
                        ReferencePath = loadPath,
                        StorageType   = AssetStorageType.CopyLocal
                    };
                    var assetLoadResult = assetService.Load(loadInfo);
                    if (!assetLoadResult.Successful)
                    {
                        MessageBox.Show(assetLoadResult.Message);
                        return(null);
                    }

                    var asset = assetLoadResult.Asset;
                    IResource resource;
                    if (asset.Resource == null)
                    {
                        MessageBox.Show($"The asset contains no resource.");
                        return(null);
                    }
                    if (asset.Resource is ResourcePack pack)
                    {
                        resource = pack.MainSubresource;
                        if (resource == null)
                        {
                            MessageBox.Show($"The asset is a pack with no main subresource.");
                            return(null);
                        }
                    }
                    else
                    {
                        resource = asset.Resource;
                    }

                    switch (resource)
                    {
                    case IImage image:
                        return(toolFactory.AddImage(image));

                    case IMovie movie:
                        return(toolFactory.AddMovie(movie));

                    case IFlexibleModel fModel:
                        {
                            var entity  = AmFactory.Create <SceneNode>();
                            entity.Name = "NewModel";
                            entity.Components.Add(PresentationComponent.Create());
                            var modelComponent   = AmFactory.Create <ModelComponent>();
                            modelComponent.Model = fModel;
                            modelComponent.Color = GetRandomSaturatedColor();
                            entity.Components.Add(modelComponent);
                            return(toolFactory.MoveEntity(entity, true));
                        }

                    case SpherePackingResult spherePackingResult:
                        {
                            var entity  = AmFactory.Create <SceneNode>();
                            entity.Name = "NewModel";
                            entity.Components.Add(PresentationComponent.Create());
                            var modelComponent = AmFactory.Create <SpherePackingComponent>();
                            modelComponent.SpherePackingResult = spherePackingResult;
                            modelComponent.Color = GetRandomSaturatedColor();
                            entity.Components.Add(modelComponent);
                            return(toolFactory.MoveEntity(entity, true));
                        }

                    default:
                        MessageBox.Show($"Unable to instantiate an asset of type '{resource.GetType().Name}'.");
                        return(null);
                    }
                })
            }
コード例 #13
0
 public static void RegisterTools(IToolFactory factory)
 {
     factory.RegisterTool <MainEditorViewModel, MainEditorView>(".anm.meta", ".meta");
     factory.RegisterTool <MainDecoderViewModel, MetaDataMainView>();
 }
コード例 #14
0
 public static void RegisterTools(IToolFactory factory)
 {
     factory.RegisterTool <TextEditorViewModel, TextEditorView>(".json", ".xml", ".txt", ".wsmodel", ".variantmeshdefinition");
 }
コード例 #15
0
        public static void CreatePrincessBody(IEditorCreator creator, IToolFactory toolFactory, PackFileService packfileService)
        {
            var packFile = packfileService.FindFile(@"variantmeshes/wh_variantmodels/hu1b/hef/hef_princess/hef_princess_body_01.rigid_model_v2");

            creator.OpenFile(packFile);
        }
コード例 #16
0
 public static void RegisterTools(IToolFactory factory)
 {
     factory.RegisterTool <AnimPackViewModel, AnimationPackView>(".animpack");
 }
コード例 #17
0
        public static void Load(IEditorCreator creator, IToolFactory toolFactory, PackFileService packfileService)
        {
            var packFile = packfileService.FindFile(@"animations\animation_tables\animation_tables.animpack");

            creator.OpenFile(packFile);
        }
コード例 #18
0
 public static void RegisterTools(IToolFactory factory)
 {
     factory.RegisterTool <PropCreatorViewModel, BaseAnimationView>();
     factory.RegisterTool <MountAnimationCreatorViewModel, BaseAnimationView>();
 }
 public static void RegisterTools(IToolFactory factory)
 {
     //factory.RegisterTool<AnimationFragmentViewModel, TableView>(".frg");
 }
コード例 #20
0
 public Tool(FrameworkElement view, IToolFactory factory)
 {
     Factory = factory ?? throw new ArgumentNullException(nameof(factory));
     View    = view ?? throw new ArgumentNullException(nameof(view));
 }
コード例 #21
0
 public static void RegisterTools(IToolFactory factory)
 {
     factory.RegisterTool <KitbasherViewModel, KitbasherView>(".rigid_model_v2");
 }
コード例 #22
0
        public static void CreateSlayerBody(IEditorCreator creator, IToolFactory toolFactory, PackFileService packfileService)
        {
            var packFile = packfileService.FindFile(@"variantmeshes\wh_variantmodels\hu3\dwf\dwf_slayers\body\dwf_slayers_body_01.rigid_model_v2");

            creator.OpenFile(packFile);
        }
コード例 #23
0
 public static void RegisterTools(IToolFactory factory)
 {
     //factory.RegisterTool<SceneViewModel, SceneView3D>();
 }
コード例 #24
0
        public static void CreateLoremasterHead(IEditorCreator creator, IToolFactory toolFactory, PackFileService packfileService)
        {
            var packFile = packfileService.FindFile(@"variantmeshes\wh_variantmodels\hu1d\hef\hef_loremaster_of_hoeth\hef_loremaster_of_hoeth_head_01.rigid_model_v2");

            creator.OpenFile(packFile);
        }
コード例 #25
0
 public DefaultContextMenuHandler(PackFileService service, IToolFactory toolFactory, IEditorCreator editorCreator) : base(service, toolFactory, editorCreator)
 {
 }
コード例 #26
0
        public static void CreateSkavenSlaveHead(IEditorCreator creator, IToolFactory toolFactory, PackFileService packfileService)
        {
            var packFile = packfileService.FindFile(@"variantmeshes\wh_variantmodels\hu17\skv\skv_clan_rats\head\skv_clan_rats_head_04.rigid_model_v2");

            creator.OpenFile(packFile);
        }
コード例 #27
0
 public ToolController(IToolFactory toolFactory)
 {
     this.toolFactory = toolFactory;
 }
コード例 #28
0
 public ToolCreationContext(IToolFactory factory)
 {
     Factory = factory;
 }