public void Startup(INWN2PluginHost cHost)
{
m_cMenuItem = cHost.GetMenuForPlugin(this);
m_cMenuItem.Items.Add("Validate Module", ValidateModule);
// Get common views, forms, and controls.
NWN2BlueprintView blueprintView = (NWN2BlueprintView)ToolsetHelper.GetControlOfFieldType(typeof(NWN2BlueprintView));
// Create our toolbar.
toolBar = ToolsetHelper.GenerateToolBar("acrToolBar");
ToolsetHelper.GetControl(typeof(ToolBarContainer), "topSandBarDock").Controls.Add(toolBar);
// Populate it with some buttons.
toolBar.Items.Add(ToolsetHelper.GenerateButtonItem("Creature", OpenCreatureEditor));
toolBar.Items.Add(ToolsetHelper.GenerateButtonItem("Trigger", OpenTriggerEditor));
toolBar.Items.Add(ToolsetHelper.GenerateButtonItem("Waypoint", OpenWaypointEditor));
// Handle blueprint view selection changes.
blueprintView.SelectionChanged += delegate(object sender, BlueprintSelectionChangedEventArgs e)
{
if (e.Selection.Length > 0 && e.Selection != e.OldSelection)
{
INWN2Blueprint blueprint = (INWN2Blueprint)e.Selection[0];
switch ( blueprint.ObjectType )
{
case NWN2ObjectType.Creature:
creatureEditor.setFocus((NWN2CreatureBlueprint)blueprint);
break;
case NWN2ObjectType.Waypoint:
waypointEditor.setFocus((NWN2WaypointBlueprint)blueprint);
break;
case NWN2ObjectType.Trigger:
triggerEditor.setFocus((NWN2TriggerBlueprint)blueprint);
break;
}
}
};
}