ACR_BuilderPlugin.WaypointEditor.setFocus C# (CSharp) Méthode

setFocus() public méthode

public setFocus ( NWN2WaypointTemplate wp ) : void
wp NWN2WaypointTemplate
Résultat void
        public void setFocus(NWN2WaypointTemplate wp)
        {
            if (wp == null)
            {
                Text = "ACR Waypoint Editor";
                propBasic.SelectedObject = null;
                ACRSpawnWP.SetSelection(null);
                propBasic.Refresh();
                propSpawn.Refresh();
            }

            // Update main property sheet.
            if (wp.GetType() == typeof(NWN2WaypointBlueprint))
            {
                Text = "ACR Waypoint Editor: " + ((NWN2WaypointBlueprint)wp).ResourceName.Value;
                propBasic.SelectedObject = (NWN2WaypointBlueprint)wp;
            }
            else if (wp.GetType() == typeof(NWN2WaypointInstance))
            {
                Text = "ACR Creature Editor: " + ((NWN2WaypointInstance)wp).Template.ResRef.Value + " (instance)";
                propBasic.SelectedObject = (NWN2WaypointInstance)wp;
            }
            else
            {
                propBasic.SelectedObject = wp;
            }

            // Update ACR property sheet.
            ACRSpawnWP.SetSelection(wp);
            ACRQuestWP.SetSelection(wp);

            propBasic.Refresh();
            propSpawn.Refresh();
            propQuest.Refresh();
        }