private void CreateAsset_btn_Click(object sender, RoutedEventArgs e)
        {
            if (ProjectSelector.Validate() && EditorModuleSelector.Validate())
            {
                string ModuleDirectory = EditorModuleSelector.Directory;
                string InitFile        = File.ReadAllText(ModuleDirectory + "/Private/" + EditorModuleSelector.FileName.Substring(0, EditorModuleSelector.FileName.IndexOf(".")) + ".cpp");
                string BuildFile       = File.ReadAllText(EditorModuleSelector.FullPathAndFile);

                if (BuildFile.IndexOf("UnrealEd") != -1)
                {
                    if (GlobalFunction.ProjectBackupPrompt(ProjectSelector.Directory, ProjectSelector.FileName))
                    {
                        CreateNewCustomAsset();
                        if (UseAssetType_CB.IsChecked)
                        {
                            CreateAssetActions();
                        }

                        MessageBox.Show("Your new factory class and object have been created");
                        if (UseAssetType_CB.IsChecked)
                        {
                            MessageBox.Show("An FAssetTypeActions_Base class has been created. Remember to included the required dependencies and registered with the \"AssetTools\" module");
                        }

                        Tutorial Temp = new Tutorial();
                        Temp.Show();
                        Close();
                    }
                }
                else
                {
                    MessageBox.Show("Your selected module must be of type editor and include UnrealEd");
                }
            }
        }
Esempio n. 2
0
 public void BeforeEachTest()
 {
     _display    = new CharDisplaySpy();
     _config     = new Mock <IConfigurationService>();
     _projectOne = new ProjectModel("succ-1", "Project 1", "Subtitle 1", 1, BuildServiceProvider.Succeeding);
     _projectTwo = new ProjectModel("fail-1", "Project 2", "Subtitle 2", 2, BuildServiceProvider.Failing);
     _sut        = new ProjectSelector(_display, _config.Object);
 }
Esempio n. 3
0
    public ProjectsUI()
    {
        selector = new ProjectSelector();
        VoezEditor.ProjectsPage.AddObject(selector);
        infoView = new MidgroundInfo();
        VoezEditor.ProjectsPage.AddObject(infoView);

        // Song Name and Author Text
        GameObject canvas     = GameObject.Find("Canvas");
        GameObject songInfoPf = Resources.Load <GameObject>("Prefabs/SongInfoPrefab");

        songInfo = UnityEngine.Object.Instantiate(songInfoPf);
        songInfo.transform.SetParent(canvas.transform);
        songInfo.transform.position = new Vector2(VoezEditor.windowRes.x - 32f, VoezEditor.windowRes.y - 32f);
        GameObject songName   = songInfo.transform.Find("SongName").gameObject;
        GameObject authorName = songInfo.transform.Find("AuthorName").gameObject;

        songNameLabel   = songName.GetComponent <Text>();
        authorNameLabel = authorName.gameObject.GetComponent <Text>();

        // Edit and Difficulty Buttons
        float   editButtonSize = VoezEditor.windowRes.y / 2.4f;
        Vector2 editButtonPos  = new Vector2(VoezEditor.windowRes.x - 16f - editButtonSize / 2f, 16f + editButtonSize / 2f);

        editButton         = new Button("Raleway32", "Edit", editButtonPos, editButtonSize, true);
        editButton.myColor = EASY_COLOR;
        editButton.myAlpha = 0.95f;
        editButton.visible = false;
        VoezEditor.ProjectsPage.AddObject(editButton);
        easyButton            = new Button("Raleway24", "?" + Environment.NewLine + "Easy", new Vector2(editButtonPos.x - editButtonSize / 2f, editButtonPos.y + editButtonSize / 4f), editButtonSize / 2f, true);
        easyButton.myColor    = EASY_COLOR;
        easyButton.myAlpha    = 0.95f;
        easyButton.visible    = false;
        hardButton            = new Button("Raleway24", "?" + Environment.NewLine + "Hard", new Vector2(editButtonPos.x - editButtonSize / 2f, editButtonPos.y - editButtonSize / 4f), editButtonSize / 2f, true);
        hardButton.myColor    = HARD_COLOR;
        hardButton.myAlpha    = 0.95f;
        hardButton.visible    = false;
        specialButton         = new Button("Raleway24", "?" + Environment.NewLine + "Special", new Vector2(editButtonPos.x - editButtonSize * 0.75f, editButtonPos.y), editButtonSize / 2f, true);
        specialButton.myColor = SPECIAL_COLOR;
        specialButton.myAlpha = 0.95f;
        specialButton.visible = false;
        VoezEditor.ProjectsPage.AddObject(easyButton);
        VoezEditor.ProjectsPage.AddObject(hardButton);
        VoezEditor.ProjectsPage.AddObject(specialButton);

        if (VoezEditor.editType == "easy")
        {
            easyButton.clicked = true;
        }
        else if (VoezEditor.editType == "hard")
        {
            hardButton.clicked = true;
        }
        else
        {
            specialButton.clicked = true;
        }
    }
Esempio n. 4
0
        public ProjectPage(DiversityPage previous) : base(previous)
        {
            InitializeComponent();

            HasNext     = false;
            HasPrevious = true;

            RefreshLanguage();

            projectSelector  = new ProjectSelector();
            this.DataContext = projectSelector;
        }
Esempio n. 5
0
 public void PopulateSelectors()
 {
     SortProjects();
     foreach (Project project in projectList)
     {
         GameObject projectEntry = (GameObject)Instantiate(projectSelectorPrefab);
         projectSelectors.Add(projectEntry);
         projectEntry.transform.SetParent(projectSelectorsParent, false);
         ProjectSelector projectSelector = projectEntry.GetComponent <ProjectSelector> ();
         projectSelector.Initialize(project);
     }
 }
Esempio n. 6
0
 private void CreateModule_btn_Click(object sender, RoutedEventArgs e)
 {
     if (ProjectSelector.Validate() && NewModuleName.Validate())
     {
         if (GlobalFunction.ProjectBackupPrompt(ProjectSelector.Directory, ProjectSelector.FileName))
         {
             CreateNewModule();
             MessageBox.Show("Your new module has been created\nFollow steps on next pages to open your project for the first time");
             Tutorial Temp = new Tutorial();
             Temp.Show();
             Close();
         }
     }
 }
Esempio n. 7
0
 private void RenameClass_btn_Click(object sender, RoutedEventArgs e)
 {
     if (ProjectSelector.Validate() && ClassSelector.Validate() && NameSelector.Validate())
     {
         if (GlobalFunction.ProjectBackupPrompt(ProjectSelector.Directory, ProjectSelector.FileName))
         {
             RenameClassAndReferences();
             MessageBox.Show("Your class has been renamed\nFollow steps on next page to open your project for the first time");
             Tutorial Temp = new Tutorial();
             Temp.Show();
             Close();
         }
     }
 }
Esempio n. 8
0
        public void BeforeEachTest()
        {
            _display    = new CharDisplaySpy();
            _indicators = new Mock <IIndicators>();
            _config     = new Mock <IConfigurationService>();
            _net        = new Mock <INetwork>();
            _sound      = new Mock <ISound>();
            _time       = new TimeServiceFake(new DateTime(2010, 01, 01));
            _projSel    = new ProjectSelector(_display, _config.Object);
            _simKeys    = new SimultaneousKeys(false, false, _time);
            _webFactory = new Mock <IWebRequestFactory>();
            _garbage    = new Mock <IGarbage>();
            _netio      = new WebUtility(_garbage.Object);

            ConstructSut();
        }
Esempio n. 9
0
 private void RenameProject_btn_Click(object sender, RoutedEventArgs e)
 {
     if (ProjectSelector.Validate() && NameSelectorRef.Validate())
     {
         if (!ProjectSelector.FileName.Equals(NameSelectorRef.InputText))
         {
             if (GlobalFunction.ProjectBackupPrompt(ProjectSelector.Directory, ProjectSelector.FileName))
             {
                 RenameProjectFiles();
                 MessageBox.Show("Your project has been renamed\nFollow steps on next page to open your project for the first time");
                 Tutorial Temp = new Tutorial();
                 Temp.Show();
                 Close();
             }
         }
         else
         {
             MessageBox.Show("You must select a new name to continue");
         }
     }
 }
Esempio n. 10
0
        private void LoadData()
        {
            ProjectSelector.PopMaxWidth  = 0;
            ProjectSelector.KeyField     = "ProjectNo";
            ProjectSelector.DisplayField = "BidName";
            ProjectSelector.AddColumn("标段名称", "BidName");
            ProjectSelector.InnerControl.MainView.OptionsView.ShowDetailButtons = false;
            ProjectSelector.GetDataSource = () => {
                List <ProjectInfo> infoList = client.GetIProjectInfoService().GetList(AppConfig.GlBidRootNo);

                infoList = infoList.FindAll(m => m.Category == 4);
                return(infoList);
            };
            ProjectSelector.RefDataSource = () => { return(client.GetIProjectInfoService().GetList(AppConfig.GlBidRootNo).FindAll(m => m.Category == 4)); };
            ProjectSelector.Closed       += (sender, e) =>
            {
                bindingSource1.EndEdit();
            };
            ProjectSelector.ClearEvent += () =>
            {
                bindingSource1.EndEdit();
            };

            GpUserSelector.PopMaxWidth  = 0;
            GpUserSelector.KeyField     = "LoginName";
            GpUserSelector.DisplayField = "UserName";
            GpUserSelector.AddColumn("人员姓名", "UserName");
            GpUserSelector.AddColumn("OA名", "LoginName");
            GpUserSelector.InnerControl.MainView.OptionsView.ShowDetailButtons = false;
            GpUserSelector.GetDataSource = () => { return(client.GetIGpuserService().GetList(AppConfig.GlOrgCode)); };
            GpUserSelector.RefDataSource = () => { return(client.GetIGpuserService().GetList(AppConfig.GlOrgCode)); };
            GpUserSelector.Closed       += (sender, e) =>
            {
                bindingSource1.EndEdit();
            };
            GpUserSelector.ClearEvent += () =>
            {
                bindingSource1.EndEdit();
            };
        }
Esempio n. 11
0
        private void CreateAsset_btn_Click(object sender, RoutedEventArgs e)
        {
            string BuildFile = File.ReadAllText(EditorModuleSelector.FullPathAndFile);

            if (BuildFile.IndexOf("UnrealEd") != -1)
            {
                if (ProjectSelector.Validate() && NewAssetName.Validate())
                {
                    if (GlobalFunction.ProjectBackupPrompt(ProjectSelector.Directory, ProjectSelector.FileName))
                    {
                        CreateNewCustomAsset();
                        MessageBox.Show("Your new factory class and object have been created\nFollow the steps on next pages to open your project for the first time");
                        MessageBox.Show("Your asset can be found under the miscellaneous tab in the new asset window");
                        Tutorial Temp = new Tutorial();
                        Temp.Show();
                        Close();
                    }
                }
            }
            else
            {
                MessageBox.Show("Your selected module must be of type editor and include UnrealEd");
            }
        }
Esempio n. 12
0
 public void OnClick()
 {
     ProjectSelector.SelectProject(this);
 }
        /// <summary>
        /// This function is the callback used to execute the command when the menu item is clicked.
        /// See the constructor to see how the menu item is associated with this function using
        /// OleMenuCommandService service and MenuCommand class.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        private void MenuItemCallback(object sender, EventArgs e)
        {
            GetActiveIde().ExecuteCommand("File.SaveAll");

            var projects = GetProjects().Select(p => new ProjectDefinition()
            {
                Name = p.Name, Path = p.UniqueName
            }).ToList();

            var viewModel = new ProjectSelectorViewModel();

            viewModel.Projects = projects;

            DebugDefinition debugDefinition = null;

            using (ProjectSelector ps = new ProjectSelector(viewModel))
            {
                if (ps.ShowDialog().GetValueOrDefault(false))
                {
                    debugDefinition = ps.DebugDefinition;
                }
            }


            if (debugDefinition != null)
            {
                var solution = GetSolution();
                var tempFile = Path.Combine(Path.GetTempPath(), string.Format("{0}.zip", Path.GetFileName(solution.FileName)));

                if (File.Exists(tempFile))
                {
                    File.Delete(tempFile);
                }

                //Test Endpoint
                //Package Solution
                ZipFile.CreateFromDirectory(Path.GetDirectoryName(solution.FullName), tempFile);
                ExecutionParameters parameters = new ExecutionParameters();
                parameters.Command          = Command.DebugContent;
                parameters.ProjectPath      = debugDefinition.Project.Path;
                parameters.ExecutionCommand = debugDefinition.Command;
                parameters.Payload          = File.ReadAllBytes(tempFile);

                Shared.Client.Client client = new Shared.Client.Client(debugDefinition.Endpoint, Server.ServicePort);

                client.Send(parameters);
                client.WaitForAnswer();
                //Transmit Package

                var dte = (DTE)Package.GetGlobalService(typeof(DTE));

                IntPtr pInfo = GetDebugInfo(debugDefinition.Endpoint, debugDefinition.Project.Path, debugDefinition.Project.Path);
                var    sp    = new ServiceProvider((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)dte);
                try
                {
                    var dbg = (IVsDebugger)sp.GetService(typeof(SVsShellDebugger));
                    int hr  = dbg.LaunchDebugTargets(1, pInfo);
                    Marshal.ThrowExceptionForHR(hr);

                    DebuggedProcess.Instance.AssociateDebugSession(client);
                }
                catch (Exception ex)
                {
                    //logger.Error(ex);
                    string msg;
                    var    sh = (IVsUIShell)sp.GetService(typeof(SVsUIShell));
                    sh.GetErrorInfo(out msg);

                    if (!string.IsNullOrWhiteSpace(msg))
                    {
                        //logger.Error(msg);
                    }
                    throw;
                }
                finally
                {
                    if (pInfo != IntPtr.Zero)
                    {
                        Marshal.FreeCoTaskMem(pInfo);
                    }
                }
            }

            //string message = string.Format(CultureInfo.CurrentCulture, "Inside {0}.MenuItemCallback()", this.GetType().FullName);
            //string title = "AttachDebuggerCommand";

            //// Show a message box to prove we were here
            //VsShellUtilities.ShowMessageBox(
            //    this.ServiceProvider,
            //    message,
            //    title,
            //    OLEMSGICON.OLEMSGICON_INFO,
            //    OLEMSGBUTTON.OLEMSGBUTTON_OK,
            //    OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);
        }