public CreateTopologyControl(IKeyTableFactory tableFactory, IAsynchQueueFactory queueFactory, IPrimFactory primFactory, IModel model, IConfigSource config)
            : base(tableFactory, queueFactory, primFactory, model, config)
        {
            /*
             * //Touch Button
             * IButton floor = Factory.MakeButton("Floor", Permissions, HostPrim.ID);
             * floor.OnTouched += (source, args) =>  AddRouter(args.AvatarName, args.AvatarID, args.TouchPosition);
             */
            IConfig controlConfig = config.Configs["Control"];

            string god             = controlConfig.Get(GOD_KEY, GOD);
            string topologyDefault = controlConfig.Get(TOPOLOGY_KEY, GOD);

            _listener = (name, id, text, channel) => {
                string[] args = text.Split(' ');
                if (id.Equals(HostPrim.Owner) && args[0].ToUpper().Equals("SAVE"))
                {
                    if (args.Length > 1)
                    {
                        HostPrim.Say("Saving topology as " + args[1]);
                        Topology.SaveTopology(name, id, args[1]);
                    }
                    else
                    {
                        HostPrim.Say("Showing Dialog");
                        SaveDialog save = new SaveDialog(HostPrim, primFactory, "Topology", topologyDefault, user => Topology.GetUserFolder(god));
                        save.OnSave += (userName, userID, file) => Topology.SaveTopology(name, id, file);
                        save.Show(name, id);
                    }
                }
            };

            primFactory.OnChat += _listener;
        }
Пример #2
0
        public CreateSequenceControl(IKeyTableFactory tableFactory, IAsynchQueueFactory queueFactory, IPrimFactory primFactory, IModel model, IConfigSource config)
            : base(tableFactory, queueFactory, primFactory, model, config)
        {
            IConfig controlConfig = config.Configs["Control"];

            string god             = controlConfig.Get(GOD_KEY, GOD);
            string topology        = controlConfig.Get(TOPOLOGY_KEY, null);
            string sequenceDefault = controlConfig.Get(SEQUENCE_KEY, SEQUENCE);

            if (topology != null)
            {
                Topology.LoadTopology(god, Factory.Host.Owner, topology);
            }

            _listener = (name, id, text, channel) => {
                string[] args = text.Split(' ');
                if (id.Equals(HostPrim.Owner) && args[0].ToUpper().Equals("SAVE"))
                {
                    if (args.Length > 1)
                    {
                        HostPrim.Say("Saving sequence as " + args[1]);
                        if (topology != null)
                        {
                            Record.SaveRecording(god, args[1], topology);
                        }
                        else
                        {
                            Record.SaveRecording(god, args[1]);
                        }
                    }
                    else
                    {
                        HostPrim.Say("Showing Dialog");
                        SaveDialog save = new SaveDialog(HostPrim, primFactory, "Sequence", sequenceDefault, user => Record.GetUserFolder(god));
                        save.OnSave += (user, userID, file) => {
                            if (topology == null)
                            {
                                Record.SaveRecording(god, file);
                            }
                            else
                            {
                                Record.SaveRecording(god, file, topology);
                            }
                        };
                        save.Show(name, id);
                    }
                }
            };

            primFactory.OnChat += _listener;

            Record.StartRecording();
        }
 /// <summary>
 /// Opens up the Save Dialog or Stops Recording
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void OpenSaveDialog(Object sender, EventArgs e)
 {
     if (!save)
     {
         form1.Enabled            = false;
         saveDialog               = new SaveDialog();
         saveDialog.StartPosition = FormStartPosition.CenterScreen;
         saveDialog.Show();
         saveDialog.Focus();
         saveDialog.setController(this);
     }
     else
     {
         if (ShowDialog("Möchten Sie die Aufnahmne wirklich beenden?", "Aufnahmen beenden") == DialogResult.OK)
         {
             //Finalize EDF-File and end save process
             EndSave();
         }
     }
 }
Пример #4
0
 protected override void Touched(UUID entity, TouchEventArgs args)
 {
     _save.Show(args.AvatarName, args.AvatarID);
 }
Пример #5
0
 protected override void ToggledOff(object sender, ToggleEventArgs args)
 {
     _control.Record.StopRecording();
     _save.Show(args.Name, args.ID);
 }
 /// <summary>
 /// Opens up the Save Dialog or Stops Recording
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void OpenSaveDialog(Object sender, EventArgs e)
 {
     if (!save)
     {
         form1.Enabled = false;
         saveDialog = new SaveDialog();
         saveDialog.StartPosition = FormStartPosition.CenterScreen;
         saveDialog.Show();
         saveDialog.Focus();
         saveDialog.setController(this);
     }
     else
     {
         if (ShowDialog("Möchten Sie die Aufnahmne wirklich beenden?", "Aufnahmen beenden") == DialogResult.OK)
         //Finalize EDF-File and end save process
         EndSave();
     }
 }
Пример #7
0
 public void PromptCreatureSave()
 {
     saveDialog.Show(this);
     DidChangeValue(saveDialog, GetSuggestedName(saveDialog));
 }