示例#1
0
 internal FmodSound(PluginControl pc)
     : base(pc)
 {
     playing      = new AutoResetEvent(false);
     speechPlayer = new Speech();
     speechPlayer.OnSpeechDone += new Speech.SpeechDoneCallback(SpeechDoneHandler);
 }
示例#2
0
 public NotecardReadAction(RadegastInstance inst, PluginControl pc)
     : base(inst)
 {
     control     = pc;
     Label       = "Read";
     ContextType = typeof(InventoryNotecard);
 }
示例#3
0
 internal Surroundings(PluginControl pc)
     : base(pc)
 {
     Title    = "surroundings";
     Announce = false;
     obTab    = (ObjectsConsole)control.instance.TabConsole.Tabs["objects"].Control;
 }
        private IOrderedEnumerable <Entity> GetAllUsers(PluginControl pluginControl)
        {
            EntityCollection            users        = pluginControl.RetrieveMultiple(FetchQueries.GetUsers);
            IOrderedEnumerable <Entity> orderedUsers = users.Entities.OrderBy(selector => selector.Attributes[ModelSystemUser.Fields.FullName]);

            return(orderedUsers);
        }
        public override void PrepareData(ExcelPackage package, PluginControl pluginControl)
        {
            ExcelWorksheet worksheet = package.Workbook.Worksheets.Add("Users with Roles");

            this.PrepareHeader(worksheet);

            // Get all users
            IOrderedEnumerable <Entity> users = this.GetAllUsers(pluginControl);
            // Number of row from which to start adding user-role pairs
            int rowNumber = 2;

            // For each user get roles using fetchxml
            foreach (Entity user in users)
            {
                EntityCollection roles = pluginControl.RetrieveMultiple(FetchQueriesHelper.GetRolesForUser(user.Id));
                // For each role insert row to Excel
                foreach (Entity role in roles.Entities)
                {
                    this.InsertRow(worksheet, user, role, rowNumber);
                    rowNumber++;
                }
            }

            this.SignExcel(package);
        }
示例#6
0
 internal ConferenceIMSession(PluginControl pc, UUID session, string title)
     : base(pc, session)
 {
     AgentID = session;
     Title   = title;
     Talker.Say("New " + Title, Talk.BeepType.Comm);
 }
示例#7
0
 public AvatarSpeechAction(RadegastInstance inst, PluginControl pc)
     : base(inst)
 {
     control     = pc;
     Label       = "Speech...";
     ContextType = typeof(Avatar);
 }
示例#8
0
        public void Init()
        {
            using (var writer = new StreamWriter(LogPath, false, Encoding.UTF8))
            {
                SetOut(writer);
                try
                {
                    Config.Init();

                    if (File.Exists(ConfigPath))
                    {
                        Config.Load(ConfigPath);
                    }
                    else
                    {
                        Config.Save(ConfigPath);
                    }

                    PluginControl = new PluginControl(Config);
                    PluginControl.InitScriptEngineEvent += (sender, e) => InitScriptEngine();
                }
                catch (Exception e)
                {
                    using (var error_writer = new StreamWriter(ErrorLogPath, false, Encoding.UTF8))
                    {
                        try { error_writer.WriteLine(Executor.FormatException(e)); } catch { }
                        error_writer.WriteLine(e);
                    }
                    MessageBox.Show(File.ReadAllText(ErrorLogPath), "CurtainFireMakerPlugin", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                Console.Out.Flush();
                SetOut(new StreamWriter(Console.OpenStandardOutput()));
            }
        }
示例#9
0
        private void RunWorld(ProgressForm progress, PresetEditorControl preset)
        {
            var addWorlds  = new List <World>();
            int startFrame = preset.StartFrame;
            int endFrame   = preset.EndFrame;

            Func <string, World> CreateWorld = (string name) =>
            {
                var world = new World(ShotTypeProvider, Executor, startFrame, endFrame)
                {
                    FrameCount     = startFrame,
                    ExportFileName = name,
                };
                addWorlds.Add(world);

                return(world);
            };

            long time = Environment.TickCount;

            Executor.SetGlobalVariable(("SCENE", Scene), ("CreateWorld", CreateWorld), ("PRESET_FILENAME", preset.FileName), ("EXPORT_DIRECTORY", preset.ExportDirectory),
                                       ("STARTFRAME", startFrame), ("ENDFRAME", endFrame));
            PluginControl.RunScript(preset, Executor.Engine, Executor.CreateScope());

            var worlds = new List <World>(addWorlds);

            addWorlds.Clear();

            if (worlds.Count > 0)
            {
                for (int i = 0; i < progress.Maximum; i++)
                {
                    worlds.ForEach(w => w.Frame());

                    worlds.AddRange(addWorlds);
                    addWorlds.Clear();

                    progress.Value = i;

                    Console.Out.Flush();

                    if (progress.IsCanceled)
                    {
                        return;
                    }
                }
                progress.Text = "出力完了";

                worlds.ForEach(w => w.FinalizeWorld());
                worlds.ForEach(w => w.Export(ScriptDynamic, preset.ExportDirectory));
            }

            Console.WriteLine((Environment.TickCount - time) + "ms");
            Console.Out.Flush();

            foreach (var world in worlds)
            {
                try { world.DropFileToHandle(ApplicationForm.Handle, ScriptDynamic, preset.ExportDirectory); } catch { }
            }
        }
示例#10
0
        private static void RepaintNeighbours(UIDocument uiDoc, Transaction tx)
        {
            //! Инфраструктурный код
            var doc = uiDoc.Document;

            tx.Start("tName");
            var userControl = new PluginControl();

            userControl.InitializeComponent();
            if (userControl.ShowDialog() == true)
            {
                //! Берем элементы документа категории помещение
                var elems = new FilteredElementCollector(doc);
                elems.WherePasses(new ElementCategoryFilter(BuiltInCategory.OST_Rooms));

                //! Из них берем только помещения относящиеся к квартирам
                var apartmentRooms = elems.Where(x => x.GetParam("ROM_Зона").Contains("Квартира")).ToList();

                //! Группируем по необходимым параметрам
                var groupedRooms = apartmentRooms.GroupBy(x =>
                                                          x.GetParam("BS_Этаж") + x.GetParam("BS_Блок") + x.GetParam("ROM_Подзона"));

                //! Меняем цвет помещений, где это необходимо
                foreach (var room in groupedRooms.SelectMany(x => x.ToList().SelectRepaintRequired()))
                {
                    room.GetParameters("ROM_Подзона_Index").FirstOrDefault()
                    ?.Set(room.GetParam("ROM_Расчетная_подзона_ID") + ".Полутон");
                }
                tx.Commit();
            }
            else
            {
                tx.RollBack();
            }
        }
示例#11
0
        internal Chat(PluginControl pc) : base(pc)
        {
            // We want to process incoming chat
            control.instance.Client.Self.ChatFromSimulator +=
                new EventHandler <ChatEventArgs>(OnChat);
            control.instance.Client.Self.AlertMessage +=
                new EventHandler <AlertMessageEventArgs>(OnAlertMessage);
            Radegast.RadegastTab chatTab    = control.instance.TabConsole.Tabs["chat"];
            Radegast.ChatConsole chatscreen = (Radegast.ChatConsole)chatTab.Control;

            nearby = chatscreen.lvwObjects;
            nearby.SelectedIndexChanged += new EventHandler(nearby_SelectedIndexChanged);

            nearby.GotFocus += new EventHandler(nearby_GotFocus);
            chatscreen.ChatInputText.GotFocus += new EventHandler(cbxInput_GotFocus);

            Title = "chat";

            // Make a recognition grammar to improve accuracy.
            Listener.CreateGrammar("chat",
                                   new string[] {
                MUTE_OBJECTS,
                UNMUTE_OBJECTS
            });
        }
示例#12
0
 internal Surroundings(PluginControl pc)
     : base(pc)
 {
     Title = "surroundings";
     Announce = false;
     obTab = (ObjectsConsole)control.instance.TabConsole.Tabs["objects"].Control;
 }
示例#13
0
        public static ButtonContainer Button(MethodInfo method, PluginControl pluginControl)
        {
            // Get the first attribute
            var attribute = method.GetCustomAttribute <Button>();

            return(new ButtonContainer(attribute.text, method.Name, pluginControl));
        }
示例#14
0
        internal Synthesizer(PluginControl pc)
        {
            control = pc;

            // The following list must be in order of BeepType.
            BeepNames = new string[] {
                "ConfirmBeep.wav",
                "CommBeep.wav",
                "DialogBeep.wav",
                "BadBeep.wav",
                "GoodBeep.wav",
                "MoneyBeep.wav",
                "OpenBeep.wav",
                "CloseBeep.wav"
            };

            if (control.osLayer == null)
            {
                return;
            }

            control.osLayer.SpeechStart(
                control,
                BeepNames);
        }
示例#15
0
 public AvatarSpeechAction(RadegastInstance inst, PluginControl pc)
     : base(inst)
 {
     control = pc;
     Label = "Speech...";
     ContextType = typeof(Avatar);
 }
示例#16
0
 internal ConferenceIMSession(PluginControl pc, UUID session, string title)
     : base(pc, session)
 {
     AgentID = session;
     Title = title;
     Talker.Say("New " + Title, Talk.BeepType.Comm);
 }
示例#17
0
 internal Control(PluginControl pc)
     : base(pc)
 {
     // Initialize the index to conversations and the list of pending interruptions.
     interruptions = new LinkedList<Mode>();
     conversations = new Dictionary<string,Mode>();
 }
示例#18
0
 internal FmodSound(PluginControl pc)
     : base(pc)
 {
     playing = new AutoResetEvent(false);
     speechPlayer = new Radegast.Media.Speech();
     speechPlayer.OnSpeechDone += new Speech.SpeechDoneCallback(SpeechDoneHandler);
 }
示例#19
0
文件: Chat.cs 项目: Booser/radegast
        internal Chat(PluginControl pc)
            : base(pc)
        {
            // We want to process incoming chat
            control.instance.Client.Self.ChatFromSimulator +=
                new EventHandler<ChatEventArgs>(OnChat);
            control.instance.Client.Self.AlertMessage +=
                new EventHandler<AlertMessageEventArgs>(OnAlertMessage);
            Radegast.RadegastTab chatTab = control.instance.TabConsole.Tabs["chat"];
            Radegast.ChatConsole chatscreen = (Radegast.ChatConsole)chatTab.Control;

            nearby = chatscreen.lvwObjects;
            nearby.SelectedIndexChanged += new EventHandler(nearby_SelectedIndexChanged);

            nearby.GotFocus += new EventHandler(nearby_GotFocus);
            chatscreen.ChatInputText.GotFocus += new EventHandler(cbxInput_GotFocus);

            Title = "chat";

            // Make a recognition grammar to improve accuracy.
            Listener.CreateGrammar("chat",
                new string[] {
                    MUTE_OBJECTS,
                    UNMUTE_OBJECTS });
        }
示例#20
0
 internal Control(PluginControl pc)
     : base(pc)
 {
     // Initialize the index to conversations and the list of pending interruptions.
     interruptions = new LinkedList <Mode>();
     conversations = new Dictionary <string, Mode>();
 }
示例#21
0
 public NotecardReadAction(RadegastInstance inst, PluginControl pc)
     : base(inst)
 {
     control = pc;
     Label = "Read";
     ContextType = typeof(InventoryNotecard);
 }
示例#22
0
文件: Voice.cs 项目: Booser/radegast
        internal Voice(PluginControl pc)
            : base(pc)
        {
            Title = "voice";

            vTab = (VoiceConsole)control.instance.TabConsole.Tabs["voice"].Control;
            participants = vTab.participants;
        }
示例#23
0
        internal Voice(PluginControl pc)
            : base(pc)
        {
            Title = "voice";

            vTab         = (VoiceConsole)control.instance.TabConsole.Tabs["voice"].Control;
            participants = vTab.participants;
        }
示例#24
0
 internal TalkingContextMenu(PluginControl pc)
 {
     control = pc;
     RadegastContextMenuStrip.OnContentMenuOpened += OnContentMenuOpened;
     RadegastContextMenuStrip.OnContentMenuItemSelected += OnContentMenuItemSelected;
     RadegastContextMenuStrip.OnContentMenuItemClicked += OnContentMenuItemClicked;
     RadegastContextMenuStrip.OnContentMenuClosing += OnContentMenuClosing;
 }
示例#25
0
        internal SingleIMSession(PluginControl pc, string label, UUID agent, UUID session) :
            base(pc, session)
        {
            AgentID = agent;
            Title   = label;

            Talker.Say("New I.M. from " + Title, Talk.BeepType.Comm);
        }
示例#26
0
 internal TalkingContextMenu(PluginControl pc)
 {
     control = pc;
     RadegastContextMenuStrip.OnContentMenuOpened       += OnContentMenuOpened;
     RadegastContextMenuStrip.OnContentMenuItemSelected += OnContentMenuItemSelected;
     RadegastContextMenuStrip.OnContentMenuItemClicked  += OnContentMenuItemClicked;
     RadegastContextMenuStrip.OnContentMenuClosing      += OnContentMenuClosing;
 }
示例#27
0
        internal SingleIMSession(PluginControl pc, string label, UUID agent, UUID session)
            : base(pc, session)
        {
            AgentID = agent;
            Title = label;

            Talker.Say("New I.M. from "+Title, Talk.BeepType.Comm );
        }
示例#28
0
        public PluginListView(PluginControl pControl)
        {
            PluginCtrl = pControl;

            InitializeComponent();

            lblDesc.Text = pControl.Description;
            lbMain.Items.Clear();
        }
示例#29
0
        internal Voices(PluginControl pc)
        {
            control            = pc;
            configVoices       = control.config["voices"] as OSDMap;
            maleVoiceLibrary   = new Dictionary <string, AvailableVoice>();
            femaleVoiceLibrary = new Dictionary <string, AvailableVoice>();

            assignedVoices = new Dictionary <UUID, AssignedVoice>();
        }
示例#30
0
文件: Voices.cs 项目: Booser/radegast
        internal Voices( PluginControl pc)
        {
            control = pc;
            configVoices = control.config["voices"] as OSDMap;
            maleVoiceLibrary = new Dictionary<string, AvailableVoice>();
            femaleVoiceLibrary = new Dictionary<string, AvailableVoice>();

            assignedVoices = new Dictionary<UUID, AssignedVoice>();
        }
示例#31
0
        internal GroupIMSession(PluginControl pc, UUID session)
            : base(pc, session)
        {
            AgentID        = session;
            group          = control.instance.Groups[session];
            Title          = group.Name;
            shortGroupName = Title.Split(' ')[0];

            Talker.Say("New group I.M. from " + Title, Talk.BeepType.Comm);
        }
示例#32
0
        public PluginCheckbox(PluginControl pControl)
        {
            PluginCtrl = pControl;

            InitializeComponent();

            chkMain.Text = pControl.Description;

            LoadSettings();
        }
示例#33
0
        internal BlueMenu(PluginControl pc, NotificationEventArgs arg) : base(pc)
        {
            note = arg;

            // Watch for being closed by keyboard before we get to talk about it.
            note.OnNotificationClicked +=
                new Notification.NotificationClickedCallback(note_OnNotificationClicked);
            note.OnNotificationClosed +=
                new Notification.NotificationCallback(note_OnNotificationClosed);
        }
示例#34
0
        public static OutputPanel DisplayControl(Control c, string panelTitle)
        {
            PluginControl control = PluginServer.AddControl(c, panelTitle);

            if (control == null)
            {
                return(null);
            }
            return(control.OutputPanel);
        }
示例#35
0
        internal GroupIMSession(PluginControl pc, UUID session)
            : base(pc, session)
        {
            AgentID = session;
            group = control.instance.Groups[session];
            Title = group.Name;
            shortGroupName = Title.Split(' ')[0];

            Talker.Say("New group I.M. from " + Title, Talk.BeepType.Comm);
        }
示例#36
0
        /// <summary>
        /// The draw controls recursive.
        /// </summary>
        /// <param name="s">The s.</param>
        /// <param name="reflex">The reflex.</param>
        /// <remarks></remarks>
        private void DrawControlsRecursive(ref SplitContainer s, ref ReflexiveContainer reflex)
        {
            foreach (object o in reflex.Controls)
            {
                PluginControl tempbase = (PluginControl)o;
                bool          nospacer = true;
                switch (tempbase.type)
                {
                case ContainerType.Reflexive:
                    ReflexiveContainer r = (ReflexiveContainer)tempbase;

                    DrawControlsRecursive(ref r.Container, ref r);
                    reflex.height += 25;

                    s.Panel2.Controls.Add(r.Container);
                    s.Panel2.Controls[s.Panel2.Controls.Count - 1].BringToFront();
                    s.Panel2.Controls[s.Panel2.Controls.Count - 1].Update();
                    break;

                case ContainerType.Ident:
                    IdentContainer id = (IdentContainer)tempbase;
                    s.Panel2.Controls.Add(id.panel);
                    reflex.height += id.panel.Height;
                    s.Panel2.Controls[s.Panel2.Controls.Count - 1].BringToFront();
                    s.Panel2.Controls[s.Panel2.Controls.Count - 1].Update();
                    break;

                case ContainerType.Int32:
                    Int32Container int32 = (Int32Container)tempbase;
                    s.Panel2.Controls.Add(int32.panel);
                    reflex.height += int32.panel.Height;
                    s.Panel2.Controls[s.Panel2.Controls.Count - 1].BringToFront();
                    s.Panel2.Controls[s.Panel2.Controls.Count - 1].Update();
                    break;

                default:
                    nospacer = true;
                    break;
                }

                if (nospacer)
                {
                    continue;
                }

                Panel Spacerx = new Panel();
                Spacerx.Height    = 10;
                Spacerx.BackColor = Color.Transparent;
                Spacerx.Dock      = DockStyle.Top;
                s.Panel2.Controls.Add(Spacerx);
                s.Panel2.Controls[s.Panel2.Controls.Count - 1].BringToFront();
                s.Panel2.Controls[s.Panel2.Controls.Count - 1].Update();
                reflex.height += 10;
            }
        }
示例#37
0
 public Paint(Canvas canvaToDraw)
 {
     pluginControl  = new PluginControl(this);
     CurrentFactory = new LineFactory();
     Canva          = canvaToDraw;
     PrevPos        = new Point()
     {
         X = -1, Y = -1
     };
     rewind = new RedoUndoClass(Canva);
 }
示例#38
0
        internal BlueMenu(PluginControl pc, NotificationEventArgs arg)
            : base(pc)
        {
            note = arg;

            // Watch for being closed by keyboard before we get to talk about it.
            note.OnNotificationClicked +=
                new Notification.NotificationClickedCallback(note_OnNotificationClicked);
            note.OnNotificationClosed +=
                new Notification.NotificationCallback(note_OnNotificationClosed);
        }
        public PluginTextBox(PluginControl pControl)
        {
            PluginCtrl = pControl;

            InitializeComponent();

            lblDesc.Text = pControl.Description;
            txtMain.Clear();

            LoadSettings();
        }
示例#40
0
        internal Friends(PluginControl pc)
            : base(pc)
        {
            Title = "friends";
            Announce = false;
            frTab = (FriendsConsole)control.instance.TabConsole.Tabs["friends"].Control;
            friends = frTab.listFriends;

            control.instance.Client.Friends.FriendOffline +=
                new EventHandler<FriendInfoEventArgs>(Friends_OnFriendOffline);
            control.instance.Client.Friends.FriendOnline +=
                new EventHandler<FriendInfoEventArgs>(Friends_OnFriendOnline);
        }
示例#41
0
        internal Friends(PluginControl pc)
            : base(pc)
        {
            Title    = "friends";
            Announce = false;
            frTab    = (FriendsConsole)control.instance.TabConsole.Tabs["friends"].Control;
            friends  = frTab.listFriends;

            control.instance.Client.Friends.FriendOffline +=
                new EventHandler <FriendInfoEventArgs>(Friends_OnFriendOffline);
            control.instance.Client.Friends.FriendOnline +=
                new EventHandler <FriendInfoEventArgs>(Friends_OnFriendOnline);
        }
示例#42
0
        internal People(PluginControl pc)
        {
            control     = pc;
            information = new Dictionary <UUID, AvatarInfo>();
            genders     = new string[] { "female", "male" };

            // Directions are in a few equal-sized sectors
            directions = new string[]
            { "to your right",
              "in front of you",
              "to your left",
              "behind you" };
            sectorsize = Math.PI * 2.0 / (double)directions.Length;
        }
示例#43
0
        internal People(PluginControl pc)
        {
            control = pc;
            information = new Dictionary<UUID,AvatarInfo>();
            genders = new string[]{"female","male"};

            // Directions are in a few equal-sized sectors
            directions = new string[]
            {   "to your right",
                "in front of you",
                "to your left",
                "behind you" };
            sectorsize = Math.PI * 2.0 / (double)directions.Length;
        }
示例#44
0
文件: Closet.cs 项目: Booser/radegast
        internal Closet(PluginControl pc)
            : base(pc)
        {
            Title = "inventory";
            inv = control.instance.Client.Inventory.Store;
            selected = inv.RootNode.Data;

            control.listener.CreateGrammar(
                INVNAME,
                new string[] {
                    "read it",
                    "go there",
                    "close the closet",
                    "describe it" });
        }
示例#45
0
        internal Control(PluginControl pc)
            : base(pc)
        {
            AUDIOFILE = Path.Combine(control.instance.UserDir, "ChatTemp");

            // Substitutions from chat-ese to English.
            subs = new Substitutions(control);
            syn  = new Synthesizer(control);
            if (syn == null)
            {
                return;
            }

            voices = new Voices(control);
        }
        /// <summary>
        /// Get the stored control that matches the supplied if it exists
        /// </summary>
        /// <param name="ctrl">The control to match against</param>
        /// <returns>If no match is found it simply returns the original control</returns>
        public static PluginControl Load(PluginControl ctrl)
        {
            try
            {
                if (pSettings == null)
                {
                    pSettings = new PluginControlSettings();

                    if (pSettings.UpgradeRequired)
                    {
                        pSettings.Reload();
                    }
                    else
                    {
                        pSettings.Upgrade();
                        pSettings.Reload();
                        pSettings.UpgradeRequired = true;
                        pSettings.Save();
                    }
                }



                if (pSettings.PluginControls == null)
                {
                    return(ctrl);
                }
                if (pSettings.PluginControls.Count == 0)
                {
                    return(ctrl);
                }

                foreach (PluginControl savedCtrl in pSettings.PluginControls)
                {
                    if (savedCtrl == ctrl)
                    {
                        return(savedCtrl);
                    }
                }

                // None found
                return(ctrl);
            }
            catch (Exception ex)
            {
                return(ctrl);
            }
        }
示例#47
0
文件: Mode.cs 项目: Booser/radegast
        internal Mode(PluginControl pc)
        {
            // One copy of the context menu manager is shared by all conversations.
            if (menu==null)
            {
                menu = new TalkingContextMenu(pc);
            }

            control = pc;

            // Default position right rear
            SessionPosition = new Vector3(-2.0f, -2.0f, 0.0f);
            Title = "Un-named conversation";

            if (BadNameChars == null)
                BadNameChars = new Regex(@"[0-9]+", RegexOptions.IgnoreCase);
        }
示例#48
0
        public VoiceAssignment( PluginControl pc, string name, UUID id )
        {
            control = pc;
            avatarName = name;
            avatarId = id;
            InitializeComponent();

            control.talker.SayMore("Assign a voice for " + avatarName, BeepType.Open);

            // Inhibit demonstrations until constructore is done.
            doDemo = false;

            // Populate the fixed fields
            avName.Text = avatarName;
            library = control.talker.voices.voiceLibrary;
            foreach (string vname in library.Keys)
            {
                AvailableVoice v = library[vname];
                voiceList.Items.Add(v.Name);
            }

            // Set the current name, if any.
            voiceList.ClearSelected();
            voiceName = null;

            AssignedVoice av = null;

            // First check the assigned voices.
            av = control.talker.voices.VoiceFor( id, false );

            // A voice has been assigned, so indicate that.
            if (av != null)
            {
                voiceName = av.root.Name;
                voice = library[voiceName];
                rateSelector.SelectedIndex = av.rateModification + 1;
                pitchSelector.SelectedIndex = av.pitchModification + 1;
                SelectByName(voiceName);
            }

            doDemo = true;

            Radegast.GUI.GuiHelpers.ApplyGuiFixes(this);
        }
示例#49
0
        internal IMSession(PluginControl pc, UUID sess)
            : base(pc)
        {
            SessionID = sess;
            Title = "IM";

            // Each conversation a predictable different location.
            AssignSlot();

            if (firstTime)
            {
                firstTime = false;
                // Make a recognition grammar to improve accuracy.
                Listener.CreateGrammar("im",
                    new string[] {
                    MUTE_IM,
                    UNMUTE_IM });
            }
        }
示例#50
0
        public Substitutions( PluginControl pc)
        {
            // TODO read this from the config file.
            patterns = new List<Tuple>();

            // Load standard substitutions
                Add("wb", "welcome back");
                Add(@"\^\^", "ha ha");
                Add(@"\^\s\^", "ha ha");
                Add(@"\^_\^", "ha ha");
                Add(@":\)", "ha ha");
                Add(@":-\)", "ha ha");
                Add("O.O", "wow");
                Add("afk", "away from keyboard");
                Add("lol", "ha ha");
                Add(@":\(", "frowns.");
                Add(@"\.\.+", ",");
                Add("lmao", "ha ha ha!");
                Add("w00t", "woot");
                Add("np", "no problem");
                Add("btw", "by the way");
                Add(":D", "ha ha");
                Add("brb", "Be right back.");
                Add("omg", "oh my god.");
                Add(@"http(s)*://[a-z0-9\./=%&?+-]+", ", a URL,");

            // Load custom substitutions
            OSDMap subs = pc.config["substitutions"] as OSDMap;
            if (subs != null)
            {
                foreach (string key in subs.Keys)
                {
                    Add( key, subs[key].AsString() );
                }
            }

            // Strip out non-pronouncable characters for now.
            // TODO more language support.
            // For some reason \P{IsBasicLatin} matches the letter "i"
               Add(@"\p{IsHiragana}|p\{IsKatakana}");
               Add(@"[*<>-]");
        }
示例#51
0
        internal Synthesizer(PluginControl pc)
        {
            control = pc;

            // The following list must be in order of BeepType.
            BeepNames = new string[] {
                "ConfirmBeep.wav",
                "CommBeep.wav",
                "DialogBeep.wav",
                "BadBeep.wav",
                "GoodBeep.wav",
                "MoneyBeep.wav",
                "OpenBeep.wav",
                "CloseBeep.wav"};

            if (control.osLayer == null) return;

            control.osLayer.SpeechStart(
                control,
                BeepNames);
        }
示例#52
0
 internal Control(PluginControl pc)
     : base(pc)
 {
     recog = new Recognizer(control);
 }
示例#53
0
        internal Control(PluginControl pc)
            : base(pc)
        {
            AUDIOFILE = Path.Combine(control.instance.UserDir, "ChatTemp");

            // Substitutions from chat-ese to English.
            subs = new Substitutions( control );
            syn = new Synthesizer(control);
            if (syn == null)
                return;

            voices = new Voices(control);
        }
示例#54
0
 internal Control(PluginControl pc)
     : base(pc)
 {
     people = new People(control);
 }
示例#55
0
 internal InvLandmark(PluginControl pc, InventoryLandmark a)
     : base(pc)
 {
     asset = a;
 }
示例#56
0
文件: Max.cs 项目: Booser/radegast
 internal Max(PluginControl pc)
     : base(pc)
 {
 }
示例#57
0
 internal InvNotecard(PluginControl pc, InventoryNotecard a)
     : base(pc)
 {
     asset = a;
 }
示例#58
0
 internal Control(PluginControl pc)
     : base(pc)
 {
 }
示例#59
0
 internal Movement(PluginControl pc)
     : base(pc)
 {
 }
示例#60
0
 internal Friendship(PluginControl pc, string name, UUID session)
     : base(pc)
 {
     who = name;
 }