Ejemplo n.º 1
0
        void objecttracker_NewObjectDetected(Logic.ObjectTrackerObject newobj)
        {
            IListRow newrow = lstObjects.AddRow();

            newrow[0][1] = newobj.Icon;
            newrow[1][0] = newobj.Name;
        }
        private int CompareListRows(IListRow First, IListRow Second)
        {
            int FirstChar, SecondChar;

            for (int i = 0; i < First.Text.Length; i++)
            {
                if (i >= Second.Text.Length)
                {
                    return(0);
                }
                else
                {
                    FirstChar  = (int)First.Text[i];
                    SecondChar = (int)Second.Text[i];

                    if (FirstChar > SecondChar)
                    {
                        return(1);
                    }
                    else if (FirstChar < SecondChar)
                    {
                        return(-1);
                    }
                }
            }

            return(0);
        }
Ejemplo n.º 3
0
        static void txtTeleTownSearchText_Change(object sender, MVTextBoxChangeEventArgs e)
        {
            var searchText = txtTeleTownSearchText.Text;

            if (searchText.Length == 0)
            {
                addAll();
                return;
            }

            try
            {
                lstTeleTownSearchList.Clear();

                foreach (string name in PluginCore.towns)
                {
                    if (!(name.ToLowerInvariant().Contains(searchText.ToLowerInvariant())))
                    {
                        continue;
                    }

                    IListRow row = lstTeleTownSearchList.Add();

                    row[0][0] = name;
                }
            }
            catch (Exception ex)
            {
                PluginCore.LogError(ex);
            }
        }
Ejemplo n.º 4
0
        static void addAll()
        {
            try
            {
                // Models
                lstSpawnModelSearchList.Clear();

                foreach (KeyValuePair <int, string> model in PluginCore.models)
                {
                    IListRow row = lstSpawnModelSearchList.Add();

                    row[0][0] = model.Key.ToString("X4");
                    row[1][0] = model.Value.ToString();
                }

                // Towns
                lstTeleTownSearchList.Clear();

                foreach (string town in PluginCore.towns)
                {
                    IListRow row = lstTeleTownSearchList.Add();

                    row[0][0] = town;
                }
            }
            catch (Exception ex)
            {
                PluginCore.LogError(ex);
            }
        }
Ejemplo n.º 5
0
        static void txtSpawnModelSearchText_Change(object sender, MVTextBoxChangeEventArgs e)
        {
            var searchText = txtSpawnModelSearchText.Text;

            if (searchText.Length == 0)
            {
                addAll();
                return;
            }

            try
            {
                lstSpawnModelSearchList.Clear();

                foreach (KeyValuePair <int, string> model in PluginCore.models)
                {
                    if (!(model.Value.ToLowerInvariant().Contains(searchText.ToLowerInvariant())))
                    {
                        continue;
                    }

                    IListRow row = lstSpawnModelSearchList.Add();

                    row[0][0] = model.Key.ToString("X4");
                    row[1][0] = model.Value.ToString();
                }
            }
            catch (Exception ex)
            {
                PluginCore.LogError(ex);
            }
        }
 private void CheckControl(IListRow ToCheck)
 {
     if (!ElementsPanel.Controls.Contains((Control)ToCheck))
     {
         ElementsPanel.Controls.Add((Control)ToCheck);
         ((Control)ToCheck).Visible = true;
     }
 }
Ejemplo n.º 7
0
    private void b()
    {
        this.a();
        this.d.Clear();
        eSettingCategories categories = 0;

        for (int i = 0; i < this.g.Count; i++)
        {
            if ((bool)this.e[i][0][0])
            {
                categories |= (eSettingCategories)this.g[i];
            }
        }
        foreach (string str in er.a(categories))
        {
            switch (er.b(str))
            {
            case eSettingValueType.tBool:
            {
                bool     flag = er.j(str);
                IListRow row  = this.d.AddRow();
                row[0][0] = str;
                row[1][0] = flag.ToString();
                break;
            }

            case eSettingValueType.tDouble:
            {
                double   num4 = er.h(str);
                IListRow row4 = this.d.AddRow();
                row4[0][0] = str;
                row4[1][0] = num4.ToString();
                break;
            }

            case eSettingValueType.tInt:
            {
                int      num3 = er.i(str);
                IListRow row3 = this.d.AddRow();
                row3[0][0] = str;
                row3[1][0] = num3.ToString();
                break;
            }

            case eSettingValueType.tEnum:
            {
                int      num2 = er.e(str);
                IListRow row2 = this.d.AddRow();
                row2[0][0] = str;
                row2[1][0] = er.b(str, num2);
                break;
            }
            }
        }
    }
        public void Add(IListRow NewItem)
        {
            Items.Add(NewItem);

            Attach(NewItem);

            if (EntryAdded != null)
            {
                EntryAdded(this, EventArgs.Empty);
            }
        }
Ejemplo n.º 9
0
        private void PlayerListAdd(string playerName, int playerMonarch, int playerID, string detectorName, string coordinates)
        {
            int    MonarchID = playerMonarch;
            string str       = ConvertMonarch(MonarchID);

            IListRow listRow = PlayerList.Add();

            listRow[0][0] = playerName;
            listRow[1][0] = str;
            listRow[2][0] = playerID.ToString();

            string filename = MyAppPath.Trim() + "pklog.txt";

            using (StreamWriter sw = new StreamWriter(@filename, true))
                sw.WriteLine(detectorName + " detected: [" + playerName + " : " + playerID.ToString() + "] - [Monarch : " + playerMonarch.ToString() + "] - [Location: " + coordinates + "] - " + DateTime.Now.ToString());
        }
Ejemplo n.º 10
0
        protected override void RowEntryChanged(int ChangedIndex, string OldValue)
        {
            if (!m_bUpdating)
            {
                IListRow lrCurRow = (IListRow)ControlAtIndex(ChangedIndex);
                int      iIndex   = TranslateChar(lrCurRow.Text[0]);

                //change only if text has changed
                if (!m_lrGroups[iIndex].Items.Contains(lrCurRow))
                {
                    m_lrGroups[TranslateChar(OldValue[0])].Items.Remove(lrCurRow);
                    PlaceControl((Control)lrCurRow);
                }

                base.RowEntryChanged(ChangedIndex, OldValue);
            }
        }
Ejemplo n.º 11
0
        private void InitSampleList()
        {
            foreach (WorldObject worldObject in Globals.Core.WorldFilter.GetByContainer(Globals.Core.CharacterFilter.Id))
            {
                IListRow row = SampleList.Add();

                row[0][1] = worldObject.Icon + 0x6000000;                 // Notice we're using an index of 1 for the second parameter. That's because this is a DecalControls.IconColumn column.
                row[1][0] = worldObject.Name;

                // Also note that you can create an empty column. In our mainView.xml we have:
                // <column progid="DecalControls.TextColumn" name="colF" />
                // It is column index 5 and has no size associated with it. You can use this column to store an id of an item, or other misc data that you can use
                // later to grab info about the row, or maybe its sort order, etc..

                // To clear the list you can do:
                // SampleList.Clear();


                // If we want to check if this item is equipped, we could do the following
                if (worldObject.Values(LongValueKey.EquippedSlots) > 0)
                {
                }

                // This check will pass if the object is wielded
                // Take note that someone else might be wielding this object. If you want to know if its wielded by YOU, you need to add another check.
                if (worldObject.Values(LongValueKey.Slot, -1) == -1)
                {
                }

                // You can get an items current mana, but only if the item has been id'd, otherwise it will just return 0.
                if (worldObject.HasIdData)
                {
                    int currentMana = worldObject.Values(LongValueKey.CurrentMana);
                }

                // But also note that we don't know how long ago this item has been id'd. Maybe it was id'd an hour ago? The mana data would be erroneous.
                // So, we could get fresh id data for the object with the following:
                // Globals.Host.Actions.RequestId(worldObject.Id);

                // But now note that it may take a second or so to get that id data. So if we did the following:
                // Globals.Host.Actions.RequestId(worldObject.Id);
                // worldObject.Values(LongValueKey.CurrentMana) <-- This would still be the OLD information and not the new because the above statement hasn't finished.
            }
        }
Ejemplo n.º 12
0
 public void a(bool A_0)
 {
     if (this.h != A_0)
     {
         this.h = A_0;
         if (A_0)
         {
             this.i = eSettingValueType.tEnum;
             this.j = false;
             this.k = -1;
             this.f = ff.f(PluginCore.cq.ax, "uTank2.ViewXML.AdvancedOptionsView.xml");
             this.d = (IList)this.f["lOptionList"];
             this.c = (IStaticText)this.f["txtInfo"];
             this.b = (ITextBox)this.f["txtEditbox"];
             this.e = (IList)this.f["lFilterList"];
             this.g.Clear();
             foreach (string str in Enum.GetNames(typeof(eSettingCategories)))
             {
                 IListRow row = this.e.Add();
                 row[0][0] = false;
                 row[1][0] = str;
                 this.g.Add((eSettingCategories)Enum.Parse(typeof(eSettingCategories), str));
             }
             this.b();
             this.e.Click      += new dClickedList(this.b);
             this.d.Click      += new dClickedList(this.a);
             this.b.Change_Old += new EventHandler(this.a);
             this.f.Visible     = true;
         }
         else
         {
             this.e.Click      -= new dClickedList(this.b);
             this.d.Click      -= new dClickedList(this.a);
             this.b.Change_Old -= new EventHandler(this.a);
             this.d             = null;
             this.c             = null;
             this.b             = null;
             this.e             = null;
             this.f.Dispose();
             this.f = null;
         }
     }
 }
Ejemplo n.º 13
0
        private void RefreshChatTriggerList()
        {
            try
            {
                lstChatTriggers.Clear();

                foreach (var trigger in ChatTriggers)
                {
                    IListRow row = lstChatTriggers.Add();

                    row[ChatTriggersList.Enabled][0] = trigger.Enabled;
                    row[ChatTriggersList.Pattern][0] = trigger.Pattern.ToString();
                    row[ChatTriggersList.Webhook][0] = trigger.Webhook.Name;
                    row[ChatTriggersList.Message][0] = trigger.MessageFormat;
                    row[ChatTriggersList.Delete][1]  = Icons.Delete;
                }
            }
            catch (Exception ex)
            {
                Util.LogError(ex);
            }
        }
Ejemplo n.º 14
0
        private void RefreshTimedTriggerList()
        {
            try
            {
                lstTimedTriggers.Clear();

                foreach (var timer in TimedTriggers)
                {
                    IListRow row = lstTimedTriggers.Add();

                    row[TimedTriggersList.Enabled][0] = timer.Enabled;
                    row[TimedTriggersList.Minutes][0] = timer.Minute.ToString();
                    row[TimedTriggersList.Webhook][0] = timer.Webhook.Name;
                    row[TimedTriggersList.Message][0] = timer.Message;
                    row[TimedTriggersList.Delete][1]  = Icons.Delete;
                }
            }
            catch (Exception ex)
            {
                Util.LogError(ex);
            }
        }
Ejemplo n.º 15
0
        private void RefreshWebhooksList()
        {
            try
            {
                lstWebhooks.Clear();

                foreach (var webhook in Webhooks)
                {
                    IListRow row = lstWebhooks.Add();

                    row[WebhooksList.Name][0]    = webhook.Name;
                    row[WebhooksList.URL][0]     = webhook.URLFormatString.ToString();
                    row[WebhooksList.Method][0]  = webhook.Method;
                    row[WebhooksList.Payload][0] = webhook.PayloadFormatString;
                    row[WebhooksList.Test][0]    = "Test";
                    row[WebhooksList.Delete][1]  = Icons.Delete;
                }
            }
            catch (Exception ex)
            {
                Util.LogError(ex);
            }
        }
 public int IndexOf(IListRow RowToFind)
 {
     return(Items.IndexOf(RowToFind));
 }
 public void AddAgain(IListRow NewItem)
 {
     Items.Add(NewItem);
 }
 public void Remove(IListRow ToRemove)
 {
     Detach(ToRemove);
     Items.Remove(ToRemove);
 }
 private void Attach(IListRow ToAttach)
 {
     ToAttach.Click         += new EventHandler(Entry_Click);
     ToAttach.CmdKeyPressed += new CmdKeyPressedHandler(Entry_CmdKeyPressed);
 }
 public bool Contains(IListRow RowToFind)
 {
     return(Items.Contains(RowToFind));
 }
 private void Detach(IListRow ToDetach)
 {
     ToDetach.CmdKeyPressed -= new CmdKeyPressedHandler(Entry_CmdKeyPressed);
     ToDetach.Click         -= new EventHandler(Entry_Click);
 }