Skip to content

Commit

Permalink
Move the button to open the devlog to the DevLog panel (from the Entr…
Browse files Browse the repository at this point in the history
…ypanel), we'll use this button to initially load the file into an external editor, but later we will open a markdown viewer (#3). Part of #5.
  • Loading branch information
rgardler-msft committed Jul 30, 2020
1 parent 6ccfc0a commit ff6f5bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
7 changes: 7 additions & 0 deletions Assets/Editor/DevLogPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,19 @@ public void OnGUI()
Debug.LogWarning("Tweet failed. Not currently handling this gracefully. Response " + response);
}
}

if (GUILayout.Button("Post to Discord", GUILayout.Height(50)))
{
Discord.PostEntry(entries.GetEntry(logList.index));
entries.GetEntry(logList.index).discordPost = true;
entries.GetEntry(logList.index).lastDiscordPostFileTime = DateTime.Now.ToFileTimeUtc();
}

if (GUILayout.Button("View Devlog", GUILayout.Height(50)))
{
string filepath = DevLogMarkdown.GetAbsoluteProjectDirectory() + DevLogMarkdown.GetRelativeCurrentFilePath();
System.Diagnostics.Process.Start(filepath);
}
}
listScrollPosition = EditorGUILayout.BeginScrollView(listScrollPosition);
logList.DoLayoutList();
Expand Down
14 changes: 0 additions & 14 deletions Assets/Editor/EntryPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ public void OnGUI()
PostingGUI();
Skin.EndSection();

Skin.StartSection("Data");
FoldersGUI();
Skin.EndSection();

EditorGUILayout.EndScrollView();
}

Expand Down Expand Up @@ -188,16 +184,6 @@ private void PostingGUI() {
}
}

private void FoldersGUI() {
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Open Devlog"))
{
string filepath = DevLogMarkdown.GetAbsoluteProjectDirectory() + DevLogMarkdown.GetRelativeCurrentFilePath();
System.Diagnostics.Process.Start(filepath);
}
EditorGUILayout.EndHorizontal();
}

public void AppendDevlog(bool withImage, bool withTweet)
{
DevLogEntry entry = ScriptableObject.CreateInstance<DevLogEntry>();
Expand Down

0 comments on commit ff6f5bf

Please sign in to comment.