Skip to content

Commit

Permalink
Removed Player Path Function because it did more harm then good
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelvanHerwaarden committed Aug 16, 2022
1 parent 1ea6b34 commit 2e1e705
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 78 deletions.
18 changes: 0 additions & 18 deletions src/BeyondDynamo/BeyondDynamoConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public class BeyondDynamoConfig

public int[] customColors { get; set; }

public string playerPath { get; set; }

public bool hideNodePreview { get; set; }

public static BeyondDynamoConfig Current { get; set; }
Expand All @@ -37,22 +35,6 @@ public BeyondDynamoConfig(string configFilePath)
JToken config = JToken.Parse(content);
customColors = Newtonsoft.Json.JsonConvert.DeserializeObject<int[]>(config["customColors"].ToString());
try
{
if (config["playerPath"].ToString() != "null")
{
playerPath = config["playerPath"].ToString();
}
else
{
throw new Exception();
}
}
catch (Exception exception)
{
Utils.LogMessage("Error loading Player path: " + exception.Message);
playerPath = null;
}
try
{
string hidePreview = config["hideNodePreview"].ToString();
Utils.LogMessage(hidePreview);
Expand Down
60 changes: 0 additions & 60 deletions src/BeyondDynamo/BeyondDynamoExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ public class BeyondDynamoExtension : IViewExtension
/// </summary>
private MenuItem OrderPlayerInput;

/// <summary>
/// Player script menu item
/// </summary>
private MenuItem PlayerScripts;

/// <summary>
/// Open Player Folderpath Menu Item
Expand Down Expand Up @@ -343,63 +339,9 @@ public void Loaded(ViewLoadedParams p)
"\nOther nodes will show up in Refinery"
};

Utils.LogMessage("Loading Menu Items: Player Scripts Started...");
PlayerScripts = new MenuItem { Header = "Player Graphs" };
OpenPlayerPath = new MenuItem { Header = "Open Player Path" };
OpenPlayerPath.Click += (sender, args) =>
{
System.Diagnostics.Process.Start(this.config.playerPath);
};

SetPlayerPath = new MenuItem { Header = "Set Player Path" };
List<MenuItem> extraMenuItems = new List<MenuItem> { SetPlayerPath, OpenPlayerPath };
SetPlayerPath.Click += (sender, args) =>
{
Forms.FolderBrowserDialog browserDialog = new Forms.FolderBrowserDialog();
if (this.config.playerPath != null)
{
browserDialog.SelectedPath = this.config.playerPath;
}
if (browserDialog.ShowDialog() == Forms.DialogResult.OK)
{
if (browserDialog.SelectedPath != null)
{
PlayerScripts.Items.Clear();
BeyondDynamoFunctions.RetrievePlayerFiles(PlayerScripts, VM, browserDialog.SelectedPath, extraMenuItems);
this.config.playerPath = browserDialog.SelectedPath;
}
}
};
Utils.LogMessage("Playerpath = " + this.config.playerPath);
if (this.config.playerPath != null | this.config.playerPath != string.Empty)
{
try
{
if (Directory.Exists(Path.GetDirectoryName(this.config.playerPath)))
{
BeyondDynamoFunctions.RetrievePlayerFiles(PlayerScripts, VM, this.config.playerPath, extraMenuItems);
}
}
catch (Exception e)
{
Utils.LogMessage("Loading Player Path Warning: " + e.Message);
PlayerScripts.Items.Add(SetPlayerPath);
}

}
else
{
PlayerScripts.Items.Add(SetPlayerPath);
}

//BDmenuItem.Items.Add(ChangeNodeColors);
//Utils.LogMessage("Loading Menu Items: Chang Node Colors Completed");
//BDmenuItem.Items.Add(BatchRemoveTraceData);
//Utils.LogMessage("Loading Menu Items: Batch Remove Trace Data Completed");
BDmenuItem.Items.Add(OrderPlayerInput);
Utils.LogMessage("Loading Menu Items: Order Player Nodes Completed");
BDmenuItem.Items.Add(PlayerScripts);
Utils.LogMessage("Loading Menu Items: Player Scripts Completed");

BDmenuItem.Items.Add(new Separator());
BDmenuItem.Items.Add(new Separator());
Expand Down Expand Up @@ -613,8 +555,6 @@ public void Loaded(ViewLoadedParams p)
BDmenuItem.Items.Add(GroupColor);
BDmenuItem.Items.Add(EditNotes);
BDmenuItem.Items.Add(AutomaticPreviewOff);
//BDmenuItem.Items.Add(EvaluateGroup);
//BDmenuItem.Items.Add(DeselectNodeLabels);

#endregion

Expand Down

0 comments on commit 2e1e705

Please sign in to comment.