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;
        }
 public Record(IToggle toggle, SandboxControl control, IPrim hostPrim, IPrimFactory factory, IConfig controlConfig)
     : base(toggle)
 {
     _control = control;
     _save = new SaveDialog(hostPrim, factory, "sequence", control.DefaultRecordingName, name => control.Record.GetUserFolder(name));
     _save.OnSave += (name, id, file) => control.Record.SaveRecording(name, file);
 }
Exemple #3
0
 public Save(IButton button, SandboxControl control, IPrimFactory factory, IConfig controlConfig)
     : base(button)
 {
     _save = new SaveDialog(button.Prims.Count() > 0 ? button.Prims.First() : factory.Host, factory, "topology", control.DefaultTopologyName, name => control.Topology.GetUserFolder(name));
     _save.OnSave += (name, id, file) => control.Topology.SaveTopology(name, id, file);
 }
        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();
        }