/// <summary> /// Display GUI for posting to DevLog and Discord. /// </summary> /// <returns>True if it is possible to post to Discord.</returns> private bool DiscordPostingGUI() { if (!DiscordSettings.IsConfigured || !m_EntryPanel.isNewEntry) { return(false); } bool canPost = !string.IsNullOrEmpty(m_EntryPanel.shortText) && mediaPanel.hasSelectedImages; GUI.enabled = canPost; if (GUILayout.Button("Post to DevLog and Discord")) { Message message; if (string.IsNullOrEmpty(m_EntryPanel.detailText)) { message = new Message(DiscordSettings.Username, m_EntryPanel.shortText + m_EntryPanel.GetSelectedMetaData(false), m_ScreenCaptures); } else { message = new Message(DiscordSettings.Username, m_EntryPanel.shortText + m_EntryPanel.GetSelectedMetaData(false), m_EntryPanel.detailText, mediaPanel.ScreenCaptures); } currentEntry = m_EntryPanel.AppendDevlogEntry(false, true); Discord.PostEntry(currentEntry); } GUI.enabled = true; return(canPost); }
/// <summary> /// Display GUI for posting to DevLog and Discord. /// </summary> /// <returns>True if it is possible to post to Discord.</returns> private bool DiscordPostingGUI() { if (!DiscordSettings.IsConfigured) { return(false); } if (!string.IsNullOrEmpty(m_EntryPanel.shortText)) { if (GUILayout.Button("Post to Devlog and Discord")) { Message message; if (string.IsNullOrEmpty(m_EntryPanel.detailText)) { message = new Message(DiscordSettings.Username, m_EntryPanel.shortText + m_EntryPanel.GetSelectedMetaData(false), m_ScreenCaptures); } else { message = new Message(DiscordSettings.Username, m_EntryPanel.shortText + m_EntryPanel.GetSelectedMetaData(false), m_EntryPanel.detailText, m_MediaPanel.ScreenCaptures); } DevLogEntry entry = m_EntryPanel.AppendDevlog(false, true); Discord.PostEntry(entry); } return(true); } else { return(false); } }