Example #1
0
        public void RemoveFromList(ListDialogItem item)
        {
            int ndx;

            lock (m_listItemLock)
                ndx = m_listItems.FindIndex(_item => _item == item);
            if (ndx < 0)
            {
                return;
            }

            item.Close();

            lock (m_listItemLock)
            {
                m_listItems.RemoveAt(ndx);

                m_scrollBar.UpdateDimensions(m_listItems.Count);
                if (m_listItems.Count <= m_scrollBar.LinesToRender)
                {
                    m_scrollBar.ScrollToTop();
                }

                for (int i = 0; i < m_listItems.Count; ++i)
                {
                    //adjust indices (determines drawing position)
                    m_listItems[i].Index = i;
                }
            }
        }
Example #2
0
        public void RemoveMember(short memberID)
        {
            int memberIndex = m_members.FindIndex(_member => _member.ID == memberID);

            if (memberIndex < 0 || memberIndex >= m_members.Count)
            {
                return;
            }

            if (!((EOGame)Game).API.PartyRemovePlayer(m_members[memberIndex].ID))
            {
                ((EOGame)Game).DoShowLostConnectionDialogAndReturnToMainMenu();
            }

            string name = m_members[memberIndex].Name;

            m_members.RemoveAt(memberIndex);
            m_buttons[memberIndex].SetParent(null);
            m_buttons[memberIndex].Close();
            m_buttons.RemoveAt(memberIndex);

            m_numMembers.Text = "" + m_members.Count;
            m_scrollBar.UpdateDimensions(m_members.Count);
            if (m_members.Count <= m_scrollBar.LinesToRender)
            {
                m_scrollBar.ScrollToTop();
            }

            ((EOGame)Game).Hud.SetStatusLabel(EOResourceID.STATUS_LABEL_TYPE_INFORMATION, name, EOResourceID.STATUS_LABEL_PARTY_LEFT_YOUR);
            ((EOGame)Game).Hud.AddChat(ChatTab.System, "", name + " " + OldWorld.GetString(EOResourceID.STATUS_LABEL_PARTY_LEFT_YOUR), ChatIcon.PlayerPartyDark, ChatColor.PM);
        }