Ejemplo n.º 1
0
    public void AddIcon(int iconListIndex, int displayIndex)
    {
        if (icons[icons.Length - 1] != null)
        {
            icons[icons.Length - 1].Destroy();
        }
        for (int i = icons.Length - 1; i > iconListIndex; i -= 1)
        {
            icons[i] = icons[i - 1];
        }
        ProjectIcon activeIcon = null;
        int         projectInd = IconIndToProjectInd(displayIndex) - 3;

        if (projectInd < 0 || projectInd >= projectDirectories.Count)
        {
            icons[iconListIndex] = new ProjectIcon(null, Vector2.zero, displayIndex);
        }
        else
        {
            icons[iconListIndex] = new ProjectIcon(projectDirectories[projectInd], Vector2.zero, displayIndex);
            if (projectDirectories[projectInd] == VoezEditor.activeProjectFolder)
            {
                activeIcon = icons[iconListIndex];
            }
        }
        AddObject(icons[iconListIndex]);
        if (activeIcon != null)
        {
            SetSelectedProject(activeIcon);
        }
    }
        public void CreateProjectFolder(string fileName, ProjectIcon icon)
        {
            string pathString = System.IO.Path.Combine(rootPath, fileName);

            if (FileExists(pathString) == false)
            {
                System.IO.Directory.CreateDirectory(pathString);
                Directory.CreateDirectory(Path.Combine(pathString, "Assets"));
                uploadProjectIcon(Path.Combine(pathString, "Assets"), icon);
            }
        }
Ejemplo n.º 3
0
 public void SetSelectedProject(ProjectIcon project)
 {
     ui.selector.linkedIcon = project;
     if (project.index != ui.selector.linkedIndex)
     {
         ui.SetSongName(project.data.songName);
         ui.SetAuthorName(project.data.author);
         musicPlayer.CrossfadeIntoClip(project.data.songPVPath);
         ui.UpdateEditInterface();
         VoezEditor.activeProjectFolder = project.data.projectFolder;
     }
     ui.selector.linkedIndex = project.index;
 }
Ejemplo n.º 4
0
        public ActionResult <Project> PostProject([FromForm] Project project, [FromForm] ProjectIcon icon)
        {
            try{
                DatabaseOperation db = new DatabaseOperation();
                db.AddProject(project.ProjectName, project.BundleIdentifier);

                FileHierarchyCreation file = new FileHierarchyCreation();
                file.CreateProjectFolder(project.ProjectName, icon);
            }
            catch (System.Data.SqlClient.SqlException)
            {
                return(StatusCode(500, new { title = "Project addition error", status = 500, message = "Cannot have duplicate project name" }));
            }

            return(StatusCode(200, new { title = "Project added successfully.", status = 200 }));
        }
Ejemplo n.º 5
0
        public override void Update()
        {
            base.Update();
            sinTimer += 1f;

            if (linkedIcon != null)
            {
                if (linkedIcon.readyForDeletion)
                {
                    linkedIcon = null;
                    pos        = new Vector2(-1000, -1000);
                }
                else
                {
                    pos = linkedIcon.pos;
                }
            }
        }
 private bool uploadProjectIcon(string route, ProjectIcon icon)
 {
     if (icon.Icon.Length > 0)
     {
         try
         {
             using (FileStream filestream = System.IO.File.Create(route + "/" + "icon.png"))
             {
                 icon.Icon.CopyTo(filestream);
                 filestream.Flush();
                 return(true);
             }
         }
         catch (Exception e)
         {
             Console.WriteLine("Upload Icon File catch" + e);
         }
     }
     return(false);
 }
        void ReleaseDesignerOutlets()
        {
            if (ArrowLabel != null)
            {
                ArrowLabel.Dispose();
                ArrowLabel = null;
            }

            if (ProjectIcon != null)
            {
                ProjectIcon.Dispose();
                ProjectIcon = null;
            }

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }
        }
Ejemplo n.º 8
0
        public void Initialize()
        {
            MainFormRef = MainForm;             // Mika: added

            Icons.Initialize(MainForm);
            Settings.Initialize(MainForm);
            PluginData.Load();

            showProjectClasspaths = Settings.ShowProjectClasspaths;
            showGlobalClasspaths  = Settings.ShowGlobalClasspaths;

            MainForm.IgnoredKeys.Add(Keys.F5);
            MainForm.IgnoredKeys.Add(Keys.F8);

            #region Actions and Event Listeners

            menus                                 = new FDMenus(MainForm);
            menus.View.Click                     += new EventHandler(OpenPanel);
            menus.GlobalClasspaths.Click         += new EventHandler(OpenGlobalClasspaths);
            menus.ProjectMenu.NewProject.Click   += new EventHandler(NewProject);
            menus.ProjectMenu.OpenProject.Click  += new EventHandler(OpenProject);
            menus.ProjectMenu.CloseProject.Click += new EventHandler(CloseProject);
            menus.ProjectMenu.TestMovie.Click    += new EventHandler(TestMovie);
            menus.ProjectMenu.BuildProject.Click += new EventHandler(BuildProject);
            menus.ProjectMenu.Properties.Click   += new EventHandler(OpenProjectProperties);
            menus.RecentComboBox.RequestProject  += new ProjectRequestHandler(GetProject);
            menus.RecentComboBox.OpenProject     += new ProjectOpenHandler(OpenProjectSilent);

            buildActions = new BuildActions(MainForm);
            buildActions.BuildComplete     += new BuildCompleteHandler(BuildComplete);
            buildActions.ClasspathsChanged += new EventHandler(ProjectClasspathsChanged);

            flashDevelopActions = new FlashDevelopActions(MainForm);

            fileActions              = new FileActions(pluginUI);
            fileActions.OpenFile    += new FileNameHandler(OpenFile);
            fileActions.FileDeleted += new FileNameHandler(FileDeleted);
            fileActions.FileMoved   += new FileMovedHandler(FileMoved);

            projectActions = new ProjectActions(pluginUI);

            // create our UI surface and a docking panel for it
            pluginUI                             = new PluginUI(this, menus, fileActions, projectActions);
            pluginUI.NewProject                 += new EventHandler(NewProject);
            pluginUI.OpenProject                += new EventHandler(OpenProject);
            pluginUI.Rename                     += new RenameEventHandler(fileActions.Rename);
            pluginUI.Tree.MovePath              += new DragPathEventHandler(fileActions.Move);
            pluginUI.Tree.CopyPath              += new DragPathEventHandler(fileActions.Copy);
            pluginUI.Menu.Open.Click            += new EventHandler(TreeOpenItems);
            pluginUI.Menu.Execute.Click         += new EventHandler(TreeExecuteItems);
            pluginUI.Menu.Insert.Click          += new EventHandler(TreeInsertItem);
            pluginUI.Menu.AddLibrary.Click      += new EventHandler(TreeAddLibraryItems);
            pluginUI.Menu.AlwaysCompile.Click   += new EventHandler(TreeAlwaysCompileItems);
            pluginUI.Menu.Cut.Click             += new EventHandler(TreeCutItems);
            pluginUI.Menu.Copy.Click            += new EventHandler(TreeCopyItems);
            pluginUI.Menu.Paste.Click           += new EventHandler(TreePasteItems);
            pluginUI.Menu.Delete.Click          += new EventHandler(TreeDeleteItems);
            pluginUI.Menu.LibraryOptions.Click  += new EventHandler(TreeLibraryOptions);
            pluginUI.Menu.Hide.Click            += new EventHandler(TreeHideItems);
            pluginUI.Menu.ShowHidden.Click      += new EventHandler(ToggleShowHidden);
            pluginUI.Menu.AddNewClass.Click     += new EventHandler(TreeAddNewClass);
            pluginUI.Menu.AddNewXml.Click       += new EventHandler(TreeAddXml);
            pluginUI.Menu.AddNewFile.Click      += new EventHandler(TreeAddFile);
            pluginUI.Menu.AddNewFolder.Click    += new EventHandler(TreeAddFolder);
            pluginUI.Menu.AddLibraryAsset.Click += new EventHandler(TreeAddAsset);
            pluginUI.Menu.AddExistingFile.Click += new EventHandler(TreeAddExistingFile);
            pluginUI.TreeBar.Refresh.Click      += new EventHandler(TreeRefreshNode);

            menus.RecentComboBox.Rebuild();

            #endregion

            pluginPanel = MainForm.CreateDockingPanel(pluginUI, Guid,
                                                      Icons.Project.Img, DockState.DockRight);

            // try to open the last opened project
            string lastProject = Settings.LastProject;

            if (Settings.LastProject != "" && File.Exists(Settings.LastProject))
            {
                OpenProjectSilent(lastProject);
                // if we open the last project right away, we need to give ASCompletion
                // some time before we can trust that it received our classpaths ok
                startupTimer          = new Timer();
                startupTimer.Tick    += new EventHandler(ProjectClasspathsChanged);
                startupTimer.Interval = 1000;
                startupTimer.Start();
            }
            else
            {
                Project = null;
            }

            try
            {
                ProjectIcon.Associate();                 // make sure .fdp points to this instance of FD
            }
            catch (UnauthorizedAccessException)
            {
                // silent
            }
            catch (Exception)
            {
                // silent?
            }
        }
Ejemplo n.º 9
0
    public override void Update()
    {
        base.Update();

        // Post-Initialization
        if (!init)
        {
            init = true;
            AddObject(new SolidBackground(Color.white));
            ProjectIcon activeIcon = null;
            icons = new ProjectIcon[24];
            for (int i = 0; i < icons.Length; i += 1)
            {
                int projectInd = IconIndToProjectInd(i) - 3;
                if (projectInd < 0 || projectInd >= projectDirectories.Count)
                {
                    icons[i] = new ProjectIcon(null, Vector2.zero, i);
                }
                else
                {
                    icons[i] = new ProjectIcon(projectDirectories[projectInd], Vector2.zero, i);
                    if (projectDirectories[projectInd] == VoezEditor.activeProjectFolder)
                    {
                        activeIcon = icons[i];
                    }
                }
                AddObject(icons[i]);
            }
            ui                   = new ProjectsUI();
            musicPlayer          = new MusicPlayer();
            musicPlayer.loopMode = true;
            if (activeIcon != null)
            {
                SetSelectedProject(activeIcon);
            }
        }

        // Control of scrolling the list around
        float snap = (ProjectIcon.size + GRID_MARGIN) * 0.5f;

        VoezEditor.projectScrollOff = Mathf.Lerp(VoezEditor.projectScrollOff, targetScroll, 0.1f);
        if (!Input.GetMouseButton(0))
        {
            mouseDragInit = false;
        }
        if (InputManager.leftMousePushed && !ui.HoveringOverSubmenuItem())
        {
            lastScrollOffset = targetScroll;
            mouseDragInit    = true;
        }
        if (InputManager.leftMouseReleased)
        {
            if ((InputManager.screenPosOnLeftMousePush.x - Input.mousePosition.x) < 0)
            {
                targetScroll = Mathf.Floor(targetScroll / snap) * snap;
            }
            else
            {
                targetScroll = Mathf.Ceil(targetScroll / snap) * snap;
            }
        }
        if (Input.GetMouseButton(0) && Vector2.Distance(InputManager.screenPosOnLeftMousePush, Input.mousePosition) > 16 && mouseDragInit)
        {
            targetScroll = lastScrollOffset + (InputManager.screenPosOnLeftMousePush.x - Input.mousePosition.x);
        }
        else
        {
            float multi = 1;
            if (Util.ShiftDown())
            {
                multi = 4;
            }
            if (InputManager.UpTick() || InputManager.RightTick())
            {
                targetScroll += snap * multi;
            }
            if (InputManager.DownTick() || InputManager.LeftTick())
            {
                targetScroll -= snap * multi;
            }
        }
        float maxTargetScroll = Mathf.Max((projectDirectories.Count / 2) * snap, snap * 5);

        if (targetScroll < 0)
        {
            targetScroll = 0;
        }
        if (targetScroll > maxTargetScroll)
        {
            targetScroll = maxTargetScroll;
        }


        musicPlayer.Update();
        LayoutProjectIcons();

        // Update all active objects
        int updateIndex = updateList.Count - 1;

        while (updateIndex >= 0)
        {
            UpdatableObject obj = updateList[updateIndex];
            if (obj.readyForDeletion)
            {
                PurgeObject(obj);
            }
            else
            {
                obj.Update();
            }
            updateIndex--;
        }
        ui.Update();

        if (readyToShutDown)
        {
            ShutDownProcess();
            VoezEditor.activeProcess = new EditorProcess();
        }
    }