Ejemplo n.º 1
0
        void periodicCommandList_Click(object sender, int row, int col)
        {
            try
            {
                if (col == 3)
                {
                    periodicCommandList.RemoveRow(row);
                }
                else
                {
                    return;
                }

                var commands = new List <Settings.SettingsManager.PeriodicCommand>();

                for (int i = 0; i < periodicCommandList.RowCount; i++)
                {
                    int interval;
                    int offset;

                    int.TryParse(((HudStaticText)periodicCommandList[i][1]).Text, out interval);
                    int.TryParse(((HudStaticText)periodicCommandList[i][2]).Text, out offset);

                    commands.Add(new Settings.SettingsManager.PeriodicCommand(((HudStaticText)periodicCommandList[i][0]).Text, TimeSpan.FromMinutes(interval), TimeSpan.FromMinutes(offset)));
                }

                Settings.SettingsManager.Server.SetPeriodicCommands(CoreManager.Current.CharacterFilter.Server, commands);
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Ejemplo n.º 2
0
        void RemoveCorpse(TrackedCorpse item)
        {
            for (int row = 1; row <= hudList.RowCount; row++)
            {
                if (((HudStaticText)hudList[row - 1][3]).Text == item.Id.ToString(CultureInfo.InvariantCulture))
                {
                    hudList.RemoveRow(row - 1);

                    row--;
                }
            }
        }
Ejemplo n.º 3
0
        void playerTracker_ItemRemoved(TrackedPlayer item)
        {
            try
            {
                for (int row = 1; row <= hudList.RowCount; row++)
                {
                    if (((HudStaticText)hudList[row - 1][1]).Text == item.Name)
                    {
                        hudList.RemoveRow(row - 1);

                        row--;
                    }
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Ejemplo n.º 4
0
 private void RemoveWorldObject(int id, HudList hl)
 {
     try
     {
         for (int i = hl.RowCount - 1; i >= 0; i--)
         {
             HudList.HudListRowAccessor hudListRowAccessor = hl[i];
             HudStaticText hudStaticText = (HudStaticText)hudListRowAccessor[5];
             if (Convert.ToInt32(hudStaticText.Text) == id)
             {
                 hl.RemoveRow(i);
             }
         }
     }
     catch (Exception ex) { Repo.RecordException(ex); }
 }
Ejemplo n.º 5
0
        void combatTracker_InfoCleared(bool obj)
        {
            combatTrackerGUIInfo.Clear();

            for (int row = monsterList.RowCount - 1; row >= 2; row--)
            {
                monsterList.RemoveRow(row);
            }

            selectedRow = 1;

            ((HudStaticText)monsterList[selectedRow][0]).Text = "*";

            ((HudStaticText)monsterList[selectedRow][2]).Text = "";
            ((HudStaticText)monsterList[selectedRow][3]).Text = "";
            ((HudStaticText)monsterList[selectedRow][4]).Text = "";
        }
Ejemplo n.º 6
0
        public void AddItem(LoggedChat item)
        {
            Util.ChatChannels chatChannels = Util.ChatChannels.None;

            if (settings.Area.Value)
            {
                chatChannels |= Util.ChatChannels.Area;
            }
            if (settings.Tells.Value)
            {
                chatChannels |= Util.ChatChannels.Tells;
            }
            if (settings.Fellowship.Value)
            {
                chatChannels |= Util.ChatChannels.Fellowship;
            }
            if (settings.General.Value)
            {
                chatChannels |= Util.ChatChannels.General;
            }
            if (settings.Trade.Value)
            {
                chatChannels |= Util.ChatChannels.Trade;
            }
            if (settings.Allegiance.Value)
            {
                chatChannels |= Util.ChatChannels.Allegiance;
            }

            if ((chatChannels & item.ChatType) != 0)
            {
                // Limit the list to no more than 10,000 rows
                if (hudList.RowCount >= 10000)
                {
                    for (int i = hudList.RowCount - 1; i > 9000; i--)
                    {
                        hudList.RemoveRow(i);
                    }
                }

                HudList.HudListRowAccessor newRow = hudList.InsertRow(1);

                ((HudStaticText)newRow[0]).Text = item.TimeStamp.ToString("yy/MM/dd HH:mm");
                ((HudStaticText)newRow[1]).Text = Util.CleanMessage(item.Message);
            }
        }
Ejemplo n.º 7
0
        void consumableTracker_ItemRemoved(TrackedInventory item)
        {
            try
            {
                for (int row = 7; row <= hudList.RowCount; row++)
                {
                    if (((HudStaticText)hudList[row - 1][1]).Text == item.Name)
                    {
                        hudList.RemoveRow(row - 1);

                        row--;
                    }
                }

                cachedInventory.Remove(item);
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Ejemplo n.º 8
0
        void TinkeringList_Click(object sender, int row, int col)
        {
            try
            {
                if (col == 5)
                {
                    tinkeringList.RemoveRow(row);
                }
                else
                {
                    int id;

                    if (int.TryParse(((HudStaticText)tinkeringList[row][6]).Text, out id))
                    {
                        CoreManager.Current.Actions.SelectItem(id);
                    }
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Ejemplo n.º 9
0
        void loginCompleteList_Click(object sender, int row, int col)
        {
            try
            {
                if ((row == 0 && col == 1) || (row == loginCompleteList.RowCount - 1 && col == 2))
                {
                    return;
                }

                if (col == 1)
                {
                    string temp = ((HudStaticText)loginCompleteList[row][0]).Text;
                    ((HudStaticText)loginCompleteList[row][0]).Text     = ((HudStaticText)loginCompleteList[row - 1][0]).Text;
                    ((HudStaticText)loginCompleteList[row - 1][0]).Text = temp;
                }
                else if (col == 2)
                {
                    string temp = ((HudStaticText)loginCompleteList[row][0]).Text;
                    ((HudStaticText)loginCompleteList[row][0]).Text     = ((HudStaticText)loginCompleteList[row + 1][0]).Text;
                    ((HudStaticText)loginCompleteList[row + 1][0]).Text = temp;
                }
                else if (col == 3)
                {
                    loginCompleteList.RemoveRow(row);
                }
                else
                {
                    return;
                }

                var commands = new List <string>();

                for (int i = 0; i < loginCompleteList.RowCount; i++)
                {
                    commands.Add(((HudStaticText)loginCompleteList[i][0]).Text);
                }

                Settings.SettingsManager.Server.SetOnLoginCompleteCommands(CoreManager.Current.CharacterFilter.Server, commands);
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Ejemplo n.º 10
0
        private void _processPlayerRemove(Player player)
        {
            PlayerIcon playerIcon = _playerIcons.Find(icon => icon.Id == player.Id);

            if (playerIcon != null)
            {
                playerIcon.Icon.Dispose();
            }

            _playerIcons.Remove(playerIcon);
            HudList playersView = player.Enemy ? _enemyListView : _friendlyListView;

            for (int i = 0; i < playersView.RowCount; i++)
            {
                HudStaticText name = (HudStaticText)playersView[i][1];
                if (name.Text == player.Name)
                {
                    playersView.RemoveRow(i);
                }
            }
        }