AddObject() public method

public AddObject ( object SelectableObject ) : void
SelectableObject object
return void
Example #1
0
        private void btnSelectProto_Click(object sender, EventArgs e)
        {
            frmSelectObject sp = new frmSelectObject("Select critter proto for NPC.", "");

            foreach (CritterProto cr in CrProtos)
            {
                sp.AddObject((object)cr);
            }
            sp.ShowDialog();
            if (sp.Selected != 0)
            {
                numProto.Value = sp.Selected;
                if (CurrentNpc != null)
                {
                    CurrentNpc.Proto.Id = sp.Selected;
                }
            }
            RefreshNpcList();
        }
Example #2
0
        private void btnSelectFaction_Click(object sender, EventArgs e)
        {
            frmSelectObject sp = new frmSelectObject("Select faction for group.", "");

            foreach (Faction cr in Factions)
            {
                sp.AddObject((object)cr);
            }
            sp.ShowDialog();
            if (sp.Selected != 0)
            {
                numFactionId.Value = sp.Selected;
                if (CurrentGroup != null)
                {
                    CurrentGroup.FactionId = sp.Selected;
                }
            }
            RefreshGroupList();
        }
Example #3
0
        private void btnSelectDialog_Click(object sender, EventArgs e)
        {
            frmSelectObject sp = new frmSelectObject("Select dialog for NPC.", "Double-click on dialog to open it in dialog editor.");

            foreach (ListDialog dlg in DialogParser.GetDialogs(true))
            {
                sp.AddObject((object)dlg);
            }
            sp.ShowDialog();
            if (sp.Selected != 0)
            {
                numDialog.Value = sp.Selected;
                if (CurrentNpc != null)
                {
                    CurrentNpc.Dialog.Id = sp.Selected;
                }
            }
            RefreshNpcList();
        }
 private void btnSelectProto_Click(object sender, EventArgs e)
 {
     frmSelectObject sp = new frmSelectObject("Select critter proto for NPC.", "");
     foreach (CritterProto cr in CrProtos)
         sp.AddObject((object)cr);
     sp.ShowDialog();
     if (sp.Selected != 0)
     {
         numProto.Value = sp.Selected;
         if (CurrentNpc!=null)
             CurrentNpc.Proto.Id = sp.Selected;
     }
     RefreshNpcList();
 }
 private void btnSelectFaction_Click(object sender, EventArgs e)
 {
     frmSelectObject sp = new frmSelectObject("Select faction for group.", "");
     foreach (Faction cr in Factions)
         sp.AddObject((object)cr);
     sp.ShowDialog();
     if (sp.Selected != 0)
     {
         numFactionId.Value = sp.Selected;
         if (CurrentGroup != null)
             CurrentGroup.FactionId = sp.Selected;
     }
     RefreshGroupList();
 }
 private void btnSelectDialog_Click(object sender, EventArgs e)
 {
     frmSelectObject sp = new frmSelectObject("Select dialog for NPC.", "Double-click on dialog to open it in dialog editor.");
     foreach (ListDialog dlg in DialogParser.GetDialogs(true))
         sp.AddObject((object)dlg);
     sp.ShowDialog();
     if (sp.Selected != 0)
     {
         numDialog.Value = sp.Selected;
         if (CurrentNpc != null)
             CurrentNpc.Dialog.Id=sp.Selected;
     }
     RefreshNpcList();
 }