Esempio n. 1
0
        public frmTranslate(METAboltInstance instance)
        {
            InitializeComponent();

            this.instance = instance;
            AddLanguages();
        }
Esempio n. 2
0
 //ManualResetEvent CurrentlyWornEvent = new ManualResetEvent(false);
 public ActionCommandsIn(METAboltInstance instance)
 {
     this.instance = instance;
     client = this.instance.Client;
     netcom = this.instance.Netcom;
     tconsole = instance.TabConsole;
 }
Esempio n. 3
0
        public frmTeleport(METAboltInstance instance, string sSIM, float sX,float sY,float sZ, bool ismaps)
        {
            InitializeComponent();

            SetExceptionReporter();
            Application.ThreadException += new ThreadExceptionHandler().ApplicationThreadException;

            this.instance = instance;
            netcom = this.instance.Netcom;
            client = this.instance.Client;

            AddNetcomEvents();
            AddClientEvents();

            this.ismaps = ismaps;

            if (string.IsNullOrEmpty(sSIM))
            {
                SetDefaultValues();
            }
            else
            {
                decimal x = (decimal)sX;
                decimal y = (decimal)sY;
                decimal z = (decimal)sZ;

                txtSearchFor.Text = txtRegion.Text = sSIM;
                nudX.Value = x;
                nudY.Value = y;
                nudZ.Value = z;

                StartRegionSearch();
            }
        }
Esempio n. 4
0
        public PrefPlugin(METAboltInstance instance)
        {
            InitializeComponent();

            this.instance = instance;
            config = this.instance.Config;

            if (this.instance.EList != null)
            {
                foreach (IExtension extOn in this.instance.EList)
                {
                    listBox1.Items.Add(extOn.Title);
                }
            }

            plugins = config.CurrentConfig.PluginsToLoad;

            if (!string.IsNullOrEmpty(plugins))
            {
                string[] lplugs = plugins.Split('|');

                foreach (string plug in lplugs)
                {
                    if (!string.IsNullOrEmpty(plug))
                    {
                        listBox2.Items.Add(plug);
                    }
                }
            }
        }
Esempio n. 5
0
        public PrefChairAnn(METAboltInstance instance)
        {
            InitializeComponent();

            this.instance = instance;
            config = this.instance.Config;

            string msg2 = "Send messages to the Group UUIDs entered below, blank for no group. You can copy the UUID for a group you belong to from the Group window.";
            toolTip1 = new Popup(customToolTip = new CustomToolTip(instance, msg2));
            toolTip1.AutoClose = false;
            toolTip1.FocusOnOpen = false;
            toolTip1.ShowingAnimation = toolTip1.HidingAnimation = PopupAnimations.Blend;

            textBox1.Text = config.CurrentConfig.ChairAnnouncerUUID.ToString();
            textBox2.Text = config.CurrentConfig.ChairAnnouncerInterval.ToString(CultureInfo.CurrentCulture);

            checkBox1.Enabled = true;
            checkBox1.Checked = config.CurrentConfig.ChairAnnouncerEnabled;
            checkBox2.Checked = config.CurrentConfig.ChairAnnouncerChat;

            textBox3.Text = config.CurrentConfig.ChairAnnouncerGroup1.ToString();
            textBox4.Text = config.CurrentConfig.ChairAnnouncerGroup2.ToString();
            textBox5.Text = config.CurrentConfig.ChairAnnouncerGroup3.ToString();
            textBox6.Text = config.CurrentConfig.ChairAnnouncerGroup4.ToString();
            textBox7.Text = config.CurrentConfig.ChairAnnouncerGroup5.ToString();
            textBox8.Text = config.CurrentConfig.ChairAnnouncerGroup6.ToString();
            //added by GM on 1-APR-2010
            textBox9.Text = config.CurrentConfig.ChairAnnouncerAdvert;
        }
Esempio n. 6
0
        public InventoryConsole(METAboltInstance instance)
        {
            InitializeComponent();

            this.instance = instance;
            client = this.instance.Client;
            clip = new InventoryClipboard(client);
            netcom = this.instance.Netcom;
            netcom.NetcomSync = this;

            //mainForm = new frmMain(this.instance);
            //tconsole = mainForm.TabConsole;
            //tconsole = new TabsConsole(this.instance);

            //ShowAuto = false;

            InitializeTree();

            textfile = client.Self.FirstName + "_" + client.Self.LastName + "_" + "Outfit.mtb";
            path = Path.Combine(Environment.CurrentDirectory, textfile);

            ReadTextFile();

            netcom.ClientLoggedOut += new EventHandler(netcom_ClientLoggedOut);
            netcom.ClientDisconnected += new EventHandler<ClientDisconnectEventArgs>(netcom_ClientDisconnected);
            //client.Objects.OnNewAttachment += new ObjectManager.NewAttachmentCallback(Inventory_NewAttachment);
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (args.Length > 0)
            {
                if (args.Length != 3)
                {
                    MessageBox.Show("Command line usage: metabolt.exe [firstname] [lastname] [password]","METAbolt",MessageBoxButtons.OK,MessageBoxIcon.Information);
                    return;
                }
                else
                {
                    METAboltInstance instance = new METAboltInstance(true, args);
                    Application.Run(instance.MainForm);
                    instance = null;
                }
            }
            else
            {
                try
                {
                    METAboltInstance instance = new METAboltInstance(true);
                    Application.Run(instance.MainForm);
                    instance = null;
                }
                catch (Exception ex)
                {
                    //messagebox of last resort
                    DialogResult res = MessageBox.Show(String.Format(CultureInfo.CurrentCulture, "Message: {0}, From: {1}, Stack: {2}", ex.Message, ex.Source, ex.StackTrace), "METABolt has encountered an unrecovarable error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);
                    if (res != DialogResult.Retry) { throw ex; }
                }
            }
        }
Esempio n. 8
0
        public PrefTextConsole(METAboltInstance instance)
        {
            InitializeComponent();

            this.instance = instance;
            config = this.instance.Config;

            string msg1 = "Use this setting to limit the amount (lines) of text stored on your chat screen. Especially in busy areas we recommend using this feature so that your machine does not run out of memory. The recommended setting is 250.";
            toolTip = new Popup(customToolTip = new CustomToolTip(instance, msg1));
            toolTip.AutoClose = false;
            toolTip.FocusOnOpen = false;
            toolTip.ShowingAnimation = toolTip.HidingAnimation = PopupAnimations.Blend;

            chkChatTimestamps.Checked = config.CurrentConfig.ChatTimestamps;
            chkIMTimestamps.Checked = config.CurrentConfig.IMTimestamps;
            chkSmileys.Checked = config.CurrentConfig.ChatSmileys;
            nud.Value = config.CurrentConfig.lineMax;
            chkIMs.Checked = config.CurrentConfig.SaveIMs;
            chkChat.Checked = config.CurrentConfig.SaveChat;
            txtDir.Text = config.CurrentConfig.LogDir;
            chkGroupNotices.Checked = config.CurrentConfig.DisableGroupNotices;
            chkGIMs.Checked = config.CurrentConfig.DisableGroupIMs;

            //if (config.CurrentConfig.BusyReply != string.Empty && config.CurrentConfig.BusyReply != null)
            //{
            textBox1.Text = config.CurrentConfig.BusyReply;
            //}

            // Initial IM feature thx to Elmo Clarity 20/12/2010
            textBox2.Text = config.CurrentConfig.InitialIMReply;

            chkSLT.Checked = config.CurrentConfig.UseSLT;
            chkSound.Checked = config.CurrentConfig.PlaySound;
        }
Esempio n. 9
0
        public MainConsole(METAboltInstance instance)
        {
            InitializeComponent();

            SetExceptionReporter();
            Application.ThreadException += new ThreadExceptionHandler().ApplicationThreadException;

            this.instance = instance;
            netcom = this.instance.Netcom;
            client = this.instance.Client;
            AddNetcomEvents();

            //while (!IsHandleCreated)
            //{
            //    // Force handle creation
            //    IntPtr temp = Handle;
            //}

            ////btnInfo_Click();
            //if (webBrowser == null)
            //    this.InitializeWebBrowser();

            this.InitializeWebBrowser();

            webBrowser1.Visible = true;
            //btnInfo.Text = "Hide Grid Status";
            label7.Text = "V " + Properties.Resources.METAboltVersion;

            Disposed += new EventHandler(MainConsole_Disposed);

            LoadGrids();
            InitGridCombo();
            cbxLocation.SelectedIndex = 0;
            InitializeConfig();
        }
Esempio n. 10
0
        public frmSpelling(METAboltInstance instance, string sentence, string[] swords, ChatType type)
        {
            InitializeComponent();

            this.instance = instance;

            afffile = this.instance.AffFile;   // "en_GB.aff";
            dicfile = this.instance.DictionaryFile;   // "en_GB.dic";

            string[] idic = dicfile.Split('.');
            dic = dir + idic[0];

            if (!System.IO.File.Exists(dic + ".csv"))
            {
                System.IO.File.Create(dic + ".csv");
            }

            try
            {
                hunspell.Load(dir + afffile, dir + dicfile);   //("en_us.aff", "en_us.dic");
                ReadWords();
            }
            catch
            {
                //string exp = ex.Message;
            }

            //words = sentence;
            richTextBox1.Text = sentence;
            this.swords = swords;
            this.ctype = type;

            ischat = true;
        }
Esempio n. 11
0
        public Form1(METAboltInstance instance)
        {
            this.instance = instance;
            client = this.instance.Client;

            InitializeComponent();
        }
Esempio n. 12
0
        public frmGive(METAboltInstance instance, InventoryItem item)
        {
            InitializeComponent();

            this.instance = instance;
            //netcom = this.instance.Netcom;
            client = this.instance.Client;
            this.item = item;

            textBox1.GotFocus += textBox1_GotFocus;
            textBox1.MouseUp += textBox1_MouseUp;
            textBox1.Leave += textBox1_Leave;

            client.Directory.DirPeopleReply += new EventHandler<DirPeopleReplyEventArgs>(Directory_OnDirPeopleReply);
            client.Groups.GroupMembersReply += new EventHandler<GroupMembersReplyEventArgs>(GroupMembersHandler);
            client.Avatars.UUIDNameReply += new EventHandler<UUIDNameReplyEventArgs>(AvatarNamesHandler);

            groupmode = false;

            client.Groups.RequestCurrentGroups();

            label2.Text = "Give item: " + item.Name;

            lvwColumnSorter = new NumericStringComparer();
            lvwFindFriends.ListViewItemSorter = lvwColumnSorter;
            lvwSelected.ListViewItemSorter = lvwColumnSorter;
        }
Esempio n. 13
0
        public frmPreferences(METAboltInstance instance)
        {
            InitializeComponent();

            string msg1 = "Click for help on how to use Application/Preferences";
            toolTip = new Popup(customToolTip = new CustomToolTip(instance, msg1));
            toolTip.AutoClose = false;
            toolTip.FocusOnOpen = false;
            toolTip.ShowingAnimation = toolTip.HidingAnimation = PopupAnimations.Blend;

            this.instance = instance;
            panes = new Dictionary<string, IPreferencePane>();
            //tcons = new PrefTextConsole(instance);

            AddPreferencePane(new PrefGeneralConsole(instance));
            AddPreferencePane(new PrefTextConsole(instance));
            AddPreferencePane(new PrefAI(instance));
            //AddPreferencePane(new PrefTwitter(instance));
            AddPreferencePane(new PrefChairAnn(instance));
            AddPreferencePane(new PrefProxy(instance));
            AddPreferencePane(new PrefPlugin(instance));
            AddPreferencePane(new PrefMETAgiver(instance));
            AddPreferencePane(new Pref3D(instance));
            AddPreferencePane(new PrefSpelling(instance));
            lbxPanes.SelectedIndex = 0;
        }
Esempio n. 14
0
        public PrefSpelling(METAboltInstance instance)
        {
            InitializeComponent();

            this.instance = instance;

            GetDictionaries();

            string msg = "Enables spell checking in public chat and IMs.\n\nClick for online help";
            toolTip3 = new Popup(customToolTip = new CustomToolTip(instance, msg));
            toolTip3.AutoClose = false;
            toolTip3.FocusOnOpen = false;
            toolTip3.ShowingAnimation = toolTip3.HidingAnimation = PopupAnimations.Blend;

            checkBox1.Checked = instance.Config.CurrentConfig.EnableSpelling;
            lang = instance.Config.CurrentConfig.SpellLanguage;

            label2.Text = "Selected language: " + lang;

            listBox1.SelectedItem = lang + ".dic";

            SetFlag();

            //this.instance.DictionaryFile = lang + ".dic";
            //this.instance.AffFile = lang + ".aff";
        }
Esempio n. 15
0
        public frmMapClient(METAboltInstance instance)
        {
            InitializeComponent();

            SetExceptionReporter();
            Application.ThreadException += new ThreadExceptionHandler().ApplicationThreadException;

            this.instance = instance;
            netcom = this.instance.Netcom;

            client = this.instance.Client;
            sim = client.Network.CurrentSim;

            client.Grid.CoarseLocationUpdate += new EventHandler<CoarseLocationUpdateEventArgs>(Grid_OnCoarseLocationUpdate);
            client.Network.SimChanged += new EventHandler<SimChangedEventArgs>(Network_OnCurrentSimChanged);

            client.Grid.GridRegion += new EventHandler<GridRegionEventArgs>(Grid_OnGridRegion);
            netcom.Teleporting += new EventHandler<TeleportingEventArgs>(netcom_Teleporting);
            netcom.TeleportStatusChanged += new EventHandler<TeleportEventArgs>(netcom_TeleportStatusChanged);

            string msg1 = "Yellow dot with red border = your avatar \nGreen dots = avs at your altitude\nRed squares = avs 20m+ below you\nBlue squares = avs 20m+ above you\n\n Click on map area to get TP position.";
            toolTip = new Popup(customToolTip = new CustomToolTip(instance, msg1));
            toolTip.AutoClose = false;
            toolTip.FocusOnOpen = false;
            toolTip.ShowingAnimation = toolTip.HidingAnimation = PopupAnimations.Blend;

            //List<AvLocation> avlocations = new List<AvLocation>();

            world.Cursor = Cursors.Cross;
            pictureBox2.Cursor = Cursors.Cross;
        }
Esempio n. 16
0
        public SLNetCom(GridClient client, METAboltInstance instance)
        {
            this.client = client;
            this.instance = instance;
            loginOptions = new LoginOptions();

            AddClientEvents();
        }
Esempio n. 17
0
        public ObjectInterface(METAboltInstance instance, frmMapClient testClient)
        {
            this.instance = instance;
            client = this.instance.Client;

            Name = "Objects";
            Description = "Objects around the bot";
        }
Esempio n. 18
0
        //private METAboltInstance instance;
        public CustomToolTip(METAboltInstance instance, string text)
        {
            InitializeComponent();

            //this.instance = instance;

            label1.Text = text;
        }
        public InventoryGestureConsol(METAboltInstance instance, InventoryItem item)
        {
            InitializeComponent();

            this.instance = instance;
            client = this.instance.Client;
            this.item = item;
        }
Esempio n. 20
0
        //private FriendsConsole fconsole;
        public FRTabWindow(METAboltInstance instance, InstantMessageEventArgs e)
        {
            InitializeComponent();

            this.instance = instance;
            //netcom = this.instance.Netcom;
            client = this.instance.Client;
            ProcessEventArgs(e);
        }
Esempio n. 21
0
        public PrefParcelMusic(METAboltInstance instance)
        {
            InitializeComponent();

            this.instance = instance;
            config = this.instance.Config;

            chkParcelMusic.Checked = config.CurrentConfig.ParcelMusic;
        }
Esempio n. 22
0
        //private int cnt = 0;
        public METAbrain(METAboltInstance instance, AIMLbot.Bot myBot)
        {
            this.instance = instance;
            //client = this.instance.Client;
            netcom = this.instance.Netcom;
            this.myBot = myBot;

            answer = new mBrain();
        }
        public InventoryObjectConsole(METAboltInstance instance, InventoryItem item)
        {
            InitializeComponent();

            this.instance = instance;
            //netcom = this.instance.Netcom;
            client = this.instance.Client;
            this.item = item;
        }
Esempio n. 24
0
        public frmDisconnected(METAboltInstance instance, string reason)
        {
            InitializeComponent();

            this.instance = instance;

            rea = reason;

            this.Text += "   " + "[ " + instance.Client.Self.Name + " ]";
        }
Esempio n. 25
0
        public frmNotecard(METAboltInstance instance, string file, string searchfor)
        {
            InitializeComponent();

            //this.instance = instance;
            this.Text = file + " - METAbolt";

            rtbNotecard.LoadFile(file, RichTextBoxStreamType.PlainText);
            this.searchfor = searchfor;
        }
        public InventoryAnimationConsole(METAboltInstance instance, InventoryItem item)
        {
            InitializeComponent();

            this.instance = instance;
            //netcom = this.instance.Netcom;
            client = this.instance.Client;
            this.item = item;

            this.Disposed += new EventHandler(InventoryAnimation_Disposed);
        }
Esempio n. 27
0
        public frmTPdialogue(METAboltInstance instance)
        {
            InitializeComponent();

            this.instance = instance;
            netcom = this.instance.Netcom;

            netcom.TeleportStatusChanged += new EventHandler<TeleportEventArgs>(netcom_TeleportStatusChanged);

            InitializeStatusTimer();
        }
Esempio n. 28
0
        public UploadImage(METAboltInstance instance, Bitmap img, string file, string ext)
        {
            InitializeComponent();

            this.instance = instance;
            client = this.instance.Client;

            this.img = img;
            //this.ext = ext;
            this.file = file;
        }
Esempio n. 29
0
        public frmPay(METAboltInstance instance, UUID target, string name, int sprice)
        {
            InitializeComponent();

            this.instance = instance;
            client = this.instance.Client;

            this.target = target;
            this.nudAmount.Value = (decimal)sprice;

            LoadCallBacks();
        }
Esempio n. 30
0
        public SearchConsole(METAboltInstance instance)
        {
            InitializeComponent();

            this.instance = instance;
            //netcom = this.instance.Netcom;
            client = this.instance.Client;
            AddClientEvents();

            tabConsole = this.instance.TabConsole;

            console = new FindPeopleConsole(instance, UUID.Random());
            console.Dock = DockStyle.Fill;
            console.SelectedIndexChanged += new EventHandler(console_SelectedIndexChanged);
            pnlFindPeople.Controls.Add(console);

            eventsconsole = new FindEvents(instance, UUID.Random());
            eventsconsole.Dock = DockStyle.Fill;
            eventsconsole.SelectedIndexChanged += new EventHandler(eventsconsole_SelectedIndexChanged);
            pnlFindEvents.Controls.Add(eventsconsole);

            placesconsole = new FindPlaces(instance, UUID.Random());
            placesconsole.Dock = DockStyle.Fill;
            placesconsole.SelectedIndexChanged += new EventHandler(placesconsole_SelectedIndexChanged);
            pnlFindPlaces.Controls.Add(placesconsole);

            groupsconsole = new FindGroups(instance, UUID.Random());
            groupsconsole.Dock = DockStyle.Fill;
            groupsconsole.SelectedIndexChanged += new EventHandler(groupsconsole_SelectedIndexChanged);
            pnlFindGroups.Controls.Add(groupsconsole);

            landconsole = new FindLand(instance, UUID.Random());
            landconsole.Dock = DockStyle.Fill;
            landconsole.SelectedIndexChanged += new EventHandler(landconsole_SelectedIndexChanged);
            pnlFindLand.Controls.Add(landconsole);

            webBrowser = new WebBrowser();
            webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted);
            webBrowser.Navigating += new WebBrowserNavigatingEventHandler(webBrowser_Navigating);
            webBrowser.Url = new Uri("http://www.metabolt.net/metasearch.php");
            webBrowser.AllowNavigation = true;
            //webBrowser.AllowWebBrowserDrop = false;
            webBrowser.Dock = DockStyle.Fill;
            webBrowser.IsWebBrowserContextMenuEnabled = false;
            webBrowser.ScriptErrorsSuppressed = true;
            webBrowser.ScrollBarsEnabled = true;
            webBrowser.NewWindow += new CancelEventHandler(webBrowser_NewWindow);
            panel4.Controls.Add(webBrowser);

            Disposed += new EventHandler(SearchConsole_Disposed);

            PopulateCbos();
        }
Esempio n. 31
0
 public frmKeyboardShortcuts(METAboltInstance instance)
 {
     InitializeComponent();
     this.instance = instance;
 }
Esempio n. 32
0
 /// <summary>
 /// Create new event args object
 /// </summary>
 /// <param name="instance">Instance of METAbolt notification is coming from</param>
 public NotificationEventArgs(METAboltInstance instance)
 {
     Instance = instance;
 }
Esempio n. 33
0
 /// <summary>
 /// Creates new PluginManager
 /// </summary>
 /// <param name="instance">METAbolt instance PluginManager is associated with</param>
 public PluginManager(METAboltInstance instance)
 {
     this.instance = instance;
 }
Esempio n. 34
0
 public ContextAction(METAboltInstance inst)
 {
     Enabled  = true;
     instance = inst;
 }
Esempio n. 35
0
 public AvatarProfileAction(METAboltInstance inst)
     : base(inst)
 {
     Label       = "Profile";
     ContextType = typeof(Avatar);
 }
Esempio n. 36
0
 public METAboltForm(METAboltInstance instance)
     : base()
 {
     this.instance = instance;
     instance.OnMETAboltFormCreated(this);
 }
Esempio n. 37
0
        public void LoadInventory(METAboltInstance instance, UUID folderID)
        {
            this.instance = instance;
            this.client   = this.instance.Client;
            InventoryFolder      rootFolder = this.client.Inventory.Store.RootFolder;
            List <InventoryBase> contents   = this.client.Inventory.Store.GetContents(folderID);

            if (folderID != this.client.Inventory.Store.RootFolder.UUID)
            {
                if (this.TreeView.Nodes != null)
                {
                    TreeNode[] array = this.TreeView.Nodes.Find(folderID.ToString(), true);
                    if (array.Length > 0)
                    {
                        TreeNodeCollection nodes = array[0].Nodes;
                        nodes.Clear();
                        if (contents.Count == 0)
                        {
                            nodes.Add(UUID.Zero.ToString(), "(empty)");
                            nodes[UUID.Zero.ToString()].Tag       = "empty";
                            nodes[UUID.Zero.ToString()].ForeColor = Color.FromKnownColor(KnownColor.GrayText);
                        }
                        else
                        {
                            List <Primitive> list = this.client.Network.CurrentSim.ObjectsPrimitives.FindAll(delegate(Primitive prim)
                            {
                                bool result;
                                try
                                {
                                    result = (prim.ParentID == instance.Client.Self.LocalID);
                                }
                                catch
                                {
                                    result = false;
                                }
                                return(result);
                            });
                            foreach (InventoryBase current in contents)
                            {
                                string key  = current.UUID.ToString();
                                bool   flag = current is InventoryFolder;
                                try
                                {
                                    string text = string.Empty;
                                    if (!flag)
                                    {
                                        InventoryItem inventoryItem = (InventoryItem)current;
                                        WearableType  wearableType  = this.client.Appearance.IsItemWorn(inventoryItem);
                                        if (wearableType != WearableType.Invalid)
                                        {
                                            text = " (WORN)";
                                        }
                                        UUID lhs = UUID.Zero;
                                        foreach (Primitive current2 in list)
                                        {
                                            if (current2.NameValues != null)
                                            {
                                                for (int i = 0; i < current2.NameValues.Length; i++)
                                                {
                                                    if (current2.NameValues[i].Name == "AttachItemID")
                                                    {
                                                        lhs = (UUID)current2.NameValues[i].Value.ToString();
                                                        if (lhs == inventoryItem.UUID)
                                                        {
                                                            text = " (WORN)";
                                                            break;
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        nodes.Add(key, current.Name + text);
                                        nodes[key].Tag = current;
                                        if (text == " (WORN)")
                                        {
                                            nodes[key].ForeColor = Color.RoyalBlue;
                                        }
                                        string        empty         = string.Empty;
                                        InventoryType inventoryType = inventoryItem.InventoryType;
                                        switch (inventoryType)
                                        {
                                        case InventoryType.Texture:
                                            nodes[key].ImageKey = "Texture";
                                            continue;

                                        case InventoryType.Sound:
                                        case (InventoryType)4:
                                        case (InventoryType)5:
                                        case InventoryType.Category:
                                        case InventoryType.RootCategory:
                                            break;

                                        case InventoryType.CallingCard:
                                            nodes[key].ImageKey = "CallingCard";
                                            continue;

                                        case InventoryType.Landmark:
                                            nodes[key].ImageKey = "LM";
                                            continue;

                                        case InventoryType.Object:
                                            nodes[key].ImageKey = "Objects";
                                            continue;

                                        case InventoryType.Notecard:
                                            nodes[key].ImageKey = "Notecard";
                                            continue;

                                        case InventoryType.LSL:
                                            nodes[key].ImageKey = "Script";
                                            continue;

                                        default:
                                            if (inventoryType == InventoryType.Snapshot)
                                            {
                                                nodes[key].ImageKey = "Snapshots";
                                                continue;
                                            }
                                            if (inventoryType == InventoryType.Wearable)
                                            {
                                                nodes[key].ImageKey = "Wearable";
                                                continue;
                                            }
                                            break;
                                        }
                                        nodes[key].ImageKey = "Gear";
                                    }
                                    else
                                    {
                                        nodes.Add(key, current.Name);
                                        nodes[key].Tag      = current;
                                        nodes[key].ImageKey = "ClosedFolder";
                                        nodes[key].Nodes.Add(null, "(loading...)").ForeColor = Color.FromKnownColor(KnownColor.GrayText);
                                    }
                                }
                                catch (Exception var_16_4C6)
                                {
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                this.TreeView.Nodes.Clear();
                TreeNode treeNode = this.TreeView.Nodes.Add(rootFolder.UUID.ToString(), "My Inventory");
                treeNode.Tag      = rootFolder;
                treeNode.ImageKey = "OpenFolder";
                if (contents.Count == 0)
                {
                    treeNode.Nodes.Add(UUID.Zero.ToString(), "(empty)");
                    treeNode.Nodes[UUID.Zero.ToString()].Tag       = "empty";
                    treeNode.Nodes[UUID.Zero.ToString()].ForeColor = Color.FromKnownColor(KnownColor.GrayText);
                }
                else
                {
                    List <Primitive> list = this.client.Network.CurrentSim.ObjectsPrimitives.FindAll(delegate(Primitive prim)
                    {
                        bool result;
                        try
                        {
                            result = (prim.ParentID == instance.Client.Self.LocalID);
                        }
                        catch
                        {
                            result = false;
                        }
                        return(result);
                    });
                    foreach (InventoryBase current in contents)
                    {
                        string key  = current.UUID.ToString();
                        bool   flag = current is InventoryFolder;
                        try
                        {
                            string text = string.Empty;
                            if (!flag)
                            {
                                InventoryItem inventoryItem = (InventoryItem)current;
                                WearableType  wearableType  = this.client.Appearance.IsItemWorn(inventoryItem);
                                if (wearableType != WearableType.Invalid)
                                {
                                    text = " (WORN)";
                                }
                                UUID lhs = UUID.Zero;
                                foreach (Primitive current2 in list)
                                {
                                    if (current2.NameValues != null)
                                    {
                                        for (int i = 0; i < current2.NameValues.Length; i++)
                                        {
                                            if (current2.NameValues[i].Name == "AttachItemID")
                                            {
                                                lhs = (UUID)current2.NameValues[i].Value.ToString();
                                                if (lhs == inventoryItem.UUID)
                                                {
                                                    text = " (WORN)";
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                }
                                treeNode.Nodes.Add(key, current.Name + text);
                                treeNode.Nodes[key].Tag = current;
                                if (text == " (WORN)")
                                {
                                    treeNode.Nodes[key].ForeColor = Color.RoyalBlue;
                                }
                                string        empty         = string.Empty;
                                InventoryType inventoryType = inventoryItem.InventoryType;
                                switch (inventoryType)
                                {
                                case InventoryType.Texture:
                                    treeNode.Nodes[key].ImageKey = "Texture";
                                    continue;

                                case InventoryType.Sound:
                                case (InventoryType)4:
                                case (InventoryType)5:
                                case InventoryType.Category:
                                case InventoryType.RootCategory:
                                    break;

                                case InventoryType.CallingCard:
                                    treeNode.Nodes[key].ImageKey = "CallingCard";
                                    continue;

                                case InventoryType.Landmark:
                                    treeNode.Nodes[key].ImageKey = "LM";
                                    continue;

                                case InventoryType.Object:
                                    treeNode.Nodes[key].ImageKey = "Objects";
                                    continue;

                                case InventoryType.Notecard:
                                    treeNode.Nodes[key].ImageKey = "Notecard";
                                    continue;

                                case InventoryType.LSL:
                                    treeNode.Nodes[key].ImageKey = "Script";
                                    continue;

                                default:
                                    if (inventoryType == InventoryType.Snapshot)
                                    {
                                        treeNode.Nodes[key].ImageKey = "Snapshots";
                                        continue;
                                    }
                                    if (inventoryType == InventoryType.Wearable)
                                    {
                                        treeNode.Nodes[key].ImageKey = "Wearable";
                                        continue;
                                    }
                                    break;
                                }
                                treeNode.Nodes[key].ImageKey = "Gear";
                            }
                            else
                            {
                                treeNode.Nodes.Add(key, current.Name);
                                treeNode.Nodes[key].Tag      = current;
                                treeNode.Nodes[key].ImageKey = "ClosedFolder";
                                treeNode.Nodes[key].Nodes.Add(null, "(loading...)").ForeColor = Color.FromKnownColor(KnownColor.GrayText);
                            }
                        }
                        catch (Exception var_16_4C6)
                        {
                        }
                    }
                    treeNode.Expand();
                }
            }
        }
Esempio n. 38
0
 public RezInventoryObjectAction(METAboltInstance inst)
     : base(inst)
 {
     Label       = "Rez..";
     ContextType = typeof(InventoryObject);
 }
Esempio n. 39
0
 public TurnToAction(METAboltInstance inst)
     : base(inst)
 {
     Label       = "Turn To";
     ContextType = typeof(Primitive);
 }
Esempio n. 40
0
 public virtual void IContextAction(METAboltInstance instance)
 {
     Instance = instance;
 }