<CustomBehavior File="RunCode" Type="Definition">
<![CDATA[
PluginContainer StudioCompanion = Styx.Plugins.PluginManager.Plugins.FirstOrDefault(p => p.Name == "Studio Companion");
System.Type studioCompanionHelper = System.AppDomain.CurrentDomain.GetAssemblies().Select(a => a.GetType("Studio60.StudioCompanionHelper", false, false)).FirstOrDefault(a => a != null);
private void StartJourney(uint mapId, uint zoneId, Vector3 location, string xml, string goalName) {
System.Reflection.MethodInfo startJourney = studioCompanionHelper.GetMethod("StartJourney", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
startJourney.Invoke(null, new object[] { mapId, zoneId, location, xml, goalName } );
}
]]>
</CustomBehavior>
<CustomBehavior File="RunCode">
<![CDATA[
if(StudioCompanion == null) {
var studioCompanionUrl = "https://store.buddyauth.com/Product?productId=3101";
System.Windows.MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("This profile requires the FREE Studio Companion plugin.\r\n\r\nDo you want to open the product page now to get it?\r\n\r\nURL: " + studioCompanionUrl, "Missing Plugin", System.Windows.MessageBoxButton.YesNo, System.Windows.MessageBoxImage.Asterisk);
if (messageBoxResult.ToString() == "Yes")
{
System.Diagnostics.Process.Start(studioCompanionUrl);
}
TreeRoot.Stop("The plugin 'Studio Companion' is required. Please get it for free from the Buddy Store.");
} else if(StudioCompanion.Enabled == false) {
Logging.Write(System.Windows.Media.Colors.Chocolate, "[Profile Message]: Enabling the Studio Companion plugin.");
StudioCompanion.Enabled = true;
}
await SetActiveProfile(ProfileManager.XmlLocation);
]]>
</CustomBehavior>