Exemple #1
0
        public ObjectsConsole(RadegastInstance instance)
        {
            InitializeComponent();
            Disposed += new EventHandler(frmObjects_Disposed);

            this.instance = instance;

            propRequester = new PropertiesQueue(instance);
            propRequester.OnTick += new PropertiesQueue.TickCallback(propRequester_OnTick);

            btnPointAt.Text = (this.instance.State.IsPointing ? "Unpoint" : "Point At");
            State_SitStateChanged(this, new SitEventArgs(instance.State.IsSitting));

            nudRadius.Value = (decimal)searchRadius;
            nudRadius.ValueChanged += nudRadius_ValueChanged;

            lstPrims.ListViewItemSorter = new ObjectSorter(client.Self);

            lstContents.LargeImageList = frmMain.ResourceImages;
            lstContents.SmallImageList = frmMain.ResourceImages;

            filter = (ObjectConsoleFilter)instance.GlobalSettings["object_console_filter"].AsInteger();
            comboFilter.SelectedIndex = 0;
            try
            {
                comboFilter.SelectedIndex = (int)filter;
            }
            catch { }
            comboFilter.SelectedIndexChanged += (ssender, se) =>
            {
                instance.GlobalSettings["object_console_filter"] = comboFilter.SelectedIndex;
                filter = (ObjectConsoleFilter)comboFilter.SelectedIndex;
                btnRefresh_Click(null, null);
            };

            //if (instance.MonoRuntime)
            //{
            //    btnView.Visible = false;
            //}

            // Callbacks
            instance.Netcom.ClientDisconnected += new EventHandler<DisconnectedEventArgs>(Netcom_ClientDisconnected);
            instance.State.SitStateChanged += new EventHandler<SitEventArgs>(State_SitStateChanged);
            client.Objects.ObjectUpdate += new EventHandler<PrimEventArgs>(Objects_ObjectUpdate);
            client.Objects.KillObject += new EventHandler<KillObjectEventArgs>(Objects_KillObject);
            client.Objects.ObjectProperties += new EventHandler<ObjectPropertiesEventArgs>(Objects_ObjectProperties);
            client.Objects.ObjectPropertiesFamily += new EventHandler<ObjectPropertiesFamilyEventArgs>(Objects_ObjectPropertiesFamily);
            client.Network.SimChanged += new EventHandler<SimChangedEventArgs>(Network_SimChanged);
            client.Self.MuteListUpdated += new EventHandler<EventArgs>(Self_MuteListUpdated);
            instance.Names.NameUpdated += new EventHandler<UUIDNameReplyEventArgs>(Avatars_UUIDNameReply);
            instance.State.OnWalkStateCanged += new StateManager.WalkStateCanged(State_OnWalkStateCanged);
        }
        /// <summary>
        /// Plugin loader calls this at the time plugin gets created
        /// We add a button to the Plugins menu on the main window
        /// for this tab
        /// </summary>
        /// <param name="inst">Main RadegastInstance</param>
        public void StartPlugin(RadegastInstance inst)
        {
            this.instance = inst;

            propRequester = new PropertiesQueue(instance);
            propRequester.OnTick += new PropertiesQueue.TickCallback(propRequester_OnTick);

            ActivateTabButton = new ToolStripMenuItem(tabLabel, null, MenuButtonClicked);
            instance.MainForm.PluginsMenu.DropDownItems.Add(ActivateTabButton);
        }