Esempio n. 1
0
        private void Awake()
        {
            m_DevLogEntries = AssetDatabase.LoadAssetAtPath(Settings.DevLogScriptableObjectPath, typeof(DevLogEntries)) as DevLogEntries;
            m_DevLogPanel   = new DevLogPanel(m_DevLogEntries);

            //TODO this needs to be done in OnEnable to avoid edge case bugs on an upgrade
            m_ScreenCaptures = AssetDatabase.LoadAssetAtPath(Settings.ScreenCaptureScriptableObjectPath, typeof(DevLogScreenCaptureCollection)) as DevLogScreenCaptureCollection;

            mediaPanel = new MediaPanel(m_ScreenCaptures);

            m_EntryPanel      = new EntryPanel(m_DevLogEntries);
            m_TwitterPanel    = new TwitterPanel();
            m_DiscordPanel    = new DiscordPanel();
            m_SchedulingPanel = new SchedulingPanel(m_DevLogEntries);
            m_GitPanel        = new GitPanel(m_EntryPanel);
        }
Esempio n. 2
0
        /// <summary>
        /// Create a new Discord message.
        /// </summary>
        /// <param name="username">The unsername to use when posting.</param>
        /// <param name="introText">The intro text that will appear before the first image, if there is one.</param>
        /// <param name="screenCaptures">The set of available and selected screen captures that may be shared as part of the message.</param>
        internal Message(string username, string introText, DevLogScreenCaptureCollection screenCaptures)
        {
            this.username  = username;
            this.introText = introText;

            for (int i = 0; i < screenCaptures.Count; i++)
            {
                DevLogScreenCapture capture = screenCaptures.captures[i];
                if (!capture.IsSelected)
                {
                    continue;
                }

                ImageContent image = new ImageContent("File" + i, capture);
                files.Add(image);
            }
        }
Esempio n. 3
0
        [SerializeField] int quality              = 15;   // Quality of color quantization, lower = better but slower (min 1, max 100)

        public MediaPanel(DevLogScreenCaptureCollection captures, Camera camera)
        {
            ScreenCaptures = captures;
            CaptureCamera  = camera;
        }
Esempio n. 4
0
        /// <summary>
        /// Display the settings UI.
        /// </summary>
        public void SettingsTabUI()
        {
            string newPath;

            Skin.StartSection("Capture Storage", false);

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Captures Save Folder");
            string originalPath = Settings.CaptureFileFolderPath;

            Settings.CaptureFileFolderPath = EditorGUILayout.TextField(Settings.CaptureFileFolderPath, GUILayout.Height(40));
            if (GUILayout.Button("Browse"))
            {
                newPath = EditorUtility.OpenFolderPanel("Select a folder in which to save captures", Settings.CaptureFileFolderPath, "");
                if (!string.IsNullOrEmpty(newPath))
                {
                    Settings.CaptureFileFolderPath = newPath;
                }
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("File Organizaton");
            EditorGUILayout.BeginVertical();
            Settings.OrganizeCapturesByProject = EditorGUILayout.ToggleLeft("Organize in Project sub folders (e.g. 'root/Project')", Settings.OrganizeCapturesByProject);
            Settings.OrganizeCapturesByScene   = EditorGUILayout.ToggleLeft("Organize in Scene sub folders (e.g. 'root/Project/Scene')", Settings.OrganizeCapturesByScene);
            EditorGUILayout.EndVertical();
            EditorGUILayout.EndHorizontal();

            Skin.EndSection();

            Skin.StartSection("Capturing", false);

            Settings.TrimTabsWhenMaximized = EditorGUILayout.ToggleLeft("Trim tabs from the window when it is maximized", Settings.TrimTabsWhenMaximized);
            Settings.TrimSceneViewToolbar  = EditorGUILayout.ToggleLeft("Trim the Toolbar from Scene View", Settings.TrimSceneViewToolbar);
            Settings.TrimGameViewToolbar   = EditorGUILayout.ToggleLeft("Trim the Toolbar from Game View", Settings.TrimGameViewToolbar);

            Skin.EndSection();

            Skin.StartSection("Dev Log Objects", false);
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Dev Log Storage");
            string existingPath = AssetDatabase.GetAssetPath(m_DevLogEntries);

            m_DevLogEntries = EditorGUILayout.ObjectField(m_DevLogEntries, typeof(DevLogEntries), true) as DevLogEntries;
            if (m_DevLogEntries == null)
            {
                if (GUILayout.Button("Create"))
                {
                    string filename = "Assets/Dev Log " + Application.version + ".asset";
                    m_DevLogEntries = ScriptableObject.CreateInstance <DevLogEntries>();
                    AssetDatabase.CreateAsset(m_DevLogEntries, filename);
                    AssetDatabase.SaveAssets();
                }
            }
            newPath = AssetDatabase.GetAssetPath(m_DevLogEntries);
            if (existingPath != newPath)
            {
                Settings.DevLogScriptableObjectPath = newPath;
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Screen Capture Storage");
            existingPath     = AssetDatabase.GetAssetPath(m_ScreenCaptures);
            m_ScreenCaptures = EditorGUILayout.ObjectField(m_ScreenCaptures, typeof(DevLogScreenCaptureCollection), true) as DevLogScreenCaptureCollection;
            if (m_ScreenCaptures == null)
            {
                if (GUILayout.Button("Create"))
                {
                    string filename = "Assets/Screen Captures " + Application.version + ".asset";
                    m_ScreenCaptures = ScriptableObject.CreateInstance <DevLogScreenCaptureCollection>();
                    AssetDatabase.CreateAsset(m_ScreenCaptures, filename);
                    AssetDatabase.SaveAssets();
                    Settings.ScreenCaptureScriptableObjectPath = filename;
                }
            }
            newPath = AssetDatabase.GetAssetPath(m_ScreenCaptures);
            if (existingPath != newPath)
            {
                Settings.ScreenCaptureScriptableObjectPath = newPath;
            }
            EditorGUILayout.EndHorizontal();
            Skin.EndSection();

            m_DiscordPanel.OnSettingsGUI();

            m_TwitterPanel.OnSettingsGUI();

            DevHelpersGUI();

            EditorGUILayout.LabelField("Welcome to " + Application.productName + " v" + Application.version);

            Skin.EndSection();
        }
Esempio n. 5
0
 public MediaPanel(DevLogScreenCaptureCollection captures)
 {
     ScreenCaptures = captures;
 }
Esempio n. 6
0
 /// <summary>
 /// Create a new Discord message.
 /// </summary>
 /// <param name="username">The unsername to use when posting.</param>
 /// <param name="introText">The intro text that will appear before the first image, if there is one.</param>
 /// <param name="bodyText">The main body text.</param>
 /// <param name="screenCaptures">The set of available and selected screen captures that may be shared as part of the message.</param>
 internal Message(string username, string introText, string bodyText, DevLogScreenCaptureCollection screenCaptures) : this(username, introText, screenCaptures)
 {
     this.bodyText = bodyText;
 }