private void RefListViewSession() { int I; TBaseObject Monster; ListViewItem ListItem; List <TBaseObject> MonList; this.Text = "正在取得数据..."; PanelStatus.Text = "正在取得数据..."; ListView.Visible = false; ListView.Items.Clear(); if (ConfigMonGen.SelEnvirnoment != null) { MonList = new List <TBaseObject>(); M2Share.UserEngine.GetMapMonster(ConfigMonGen.SelEnvirnoment, MonList); for (I = 0; I < MonList.Count; I++) { Monster = ((TBaseObject)(MonList[I])); ListItem = new ListViewItem(); ListItem.Text = (I + 1).ToString(); ListItem.SubItems.Add(Monster.m_sCharName); ListItem.SubItems.Add((Monster.m_nCurrX).ToString() + ':' + (Monster.m_nCurrY).ToString()); ListItem.SubItems.Add((Monster.m_Abil.Level).ToString()); ListItem.SubItems.Add((Monster.m_Abil.HP).ToString() + '/' + (Monster.m_Abil.MaxHP).ToString()); ListItem.SubItems.Add((Monster.m_Abil.MP).ToString() + '/' + (Monster.m_Abil.MaxMP).ToString()); ListItem.SubItems.Add(HUtil32.BooleanToStr(Monster.m_boDeath)); ListView.Items.Add(ListItem); } this.Text = ConfigMonGen.SelEnvirnoment.sMapDesc + ' ' + "怪物数:" + (ListView.Items.Count).ToString(); } ListView.Visible = true; }
public void RefListViewSession() { if (!IsRefLoadData) { this.Text = "正在取得数据..."; ListView.Items.Clear(); IsRefLoadData = true;//正在刷新 foreach (var item in M2Share.g_MapManager.m_MapList) { Envirnoment = item; ListItem = new ListViewItem(); ListItem.Text = Envirnoment.sMapName; ListItem.SubItems.Add(Envirnoment.sMapDesc); ListItem.SubItems.Add(Envirnoment.m_nHumCount.ToString()); ListItem.SubItems.Add(Envirnoment.MonCount.ToString()); ListItem.SubItems.Add(Envirnoment.m_nNpcCount.ToString()); ListItem.SubItems.Add(Envirnoment.m_nItemCount.ToString()); ListItem.SubItems.Add(HUtil32.BooleanToStr(Envirnoment.m_boRUNHUMAN)); ListItem.SubItems.Add(HUtil32.BooleanToStr(Envirnoment.m_boRUNMON)); ListView.Items.Add(ListItem); } IsRefLoadData = false; this.Text = "系统管理"; } RefStatus(); }
public void TimerTimer(object obj) { if (!IsRefLoadData) { IsRefLoadData = true; foreach (ListViewItem item in ListView.Items) { ListItem = item; Envirnoment = M2Share.g_MapManager.FindMap((ListItem.SubItems[0].Text)); if (HUtil32.Str_ToInt(ListItem.SubItems[2].Text, 0) != Envirnoment.m_nHumCount) { ListItem.SubItems[2].Text = (Envirnoment.m_nHumCount).ToString(); } if (HUtil32.Str_ToInt(ListItem.SubItems[3].Text, 0) != Envirnoment.m_nMonCount) { ListItem.SubItems[3].Text = (Envirnoment.m_nMonCount).ToString(); } if (HUtil32.Str_ToInt(ListItem.SubItems[4].Text, 0) != Envirnoment.m_nNpcCount) { ListItem.SubItems[4].Text = (Envirnoment.m_nNpcCount).ToString(); } if (HUtil32.Str_ToInt(ListItem.SubItems[5].Text, 0) != Envirnoment.m_nItemCount) { ListItem.SubItems[5].Text = (Envirnoment.m_nItemCount).ToString(); } if (ListItem.SubItems[6].Text != HUtil32.BooleanToStr(Envirnoment.m_boRUNHUMAN)) { ListItem.SubItems[6].Text = HUtil32.BooleanToStr(Envirnoment.m_boRUNHUMAN); } if (ListItem.SubItems[7].Text != HUtil32.BooleanToStr(Envirnoment.m_boRUNMON)) { ListItem.SubItems[7].Text = HUtil32.BooleanToStr(Envirnoment.m_boRUNMON); } } IsRefLoadData = false; } RefStatus(); }
/**************************************************************** ** 函 数 名:RefGridSession ** 功能描述:刷新网格信息 ** 输入参数:无 ** 输出参数:无 ** 返 回 值:无 ** 创 建 人:陶志强 ** 日 期:2013-4-21 ** 修 改 人: ** 日 期: ****************************************************************/ private void RefGridSession() { PanelStatus.Text = "正在取得数据..."; GridHuman.Visible = false; GridHuman.Items.Clear(); int i = 1; foreach (TPlayObject PlayObject in ViewList) { if (PlayObject != null) { ListViewItem lvItem = GridHuman.Items.Add(i.ToString()); lvItem.SubItems.Add(PlayObject.m_sCharName); lvItem.SubItems.Add(HUtil32.IntToSex(PlayObject.m_btGender)); lvItem.SubItems.Add(HUtil32.IntToJob(PlayObject.m_btJob)); lvItem.SubItems.Add((PlayObject.m_Abil.Level).ToString()); lvItem.SubItems.Add((PlayObject.m_NGLevel).ToString()); lvItem.SubItems.Add(PlayObject.m_sMapName); lvItem.SubItems.Add((PlayObject.m_nCurrX).ToString() + ":" + (PlayObject.m_nCurrY).ToString()); lvItem.SubItems.Add(PlayObject.m_sUserID); lvItem.SubItems.Add(PlayObject.m_sIPaddr); lvItem.SubItems.Add((PlayObject.m_btPermission).ToString()); lvItem.SubItems.Add(PlayObject.m_sIPLocal); lvItem.SubItems.Add((PlayObject.m_nGameGold).ToString()); lvItem.SubItems.Add((PlayObject.m_nGamePoint).ToString()); lvItem.SubItems.Add((PlayObject.m_nPayMentPoint).ToString()); lvItem.SubItems.Add(HUtil32.BooleanToStr(PlayObject.m_boNotOnlineAddExp)); lvItem.SubItems.Add(PlayObject.m_sAutoSendMsg); lvItem.SubItems.Add((PlayObject.MessageCount()).ToString()); lvItem.SubItems.Add((PlayObject.m_nGAMEDIAMOND).ToString()); lvItem.SubItems.Add((PlayObject.m_nGAMEGIRD).ToString()); i++; } } GridHuman.Visible = true; }
private void RefListViewSession() { int I; int n01; TMerchant Merchant = null; TNormNpc NormNpc = null; ListViewItem ListItem = null; PanelStatus.Text = "正在取得数据..."; ListView.Visible = false; ListView.Items.Clear(); n01 = 0; lock (M2Share.UserEngine.m_MerchantList) { try { if (M2Share.UserEngine.m_MerchantList.Count > 0) { for (I = 0; I < M2Share.UserEngine.m_MerchantList.Count; I++) { Merchant = M2Share.UserEngine.m_MerchantList[I]; Merchant.ClearData(); } } } finally { } try { foreach (var item in M2Share.UserEngine.m_MerchantList) { Merchant = item; if (Merchant.m_PEnvir != SelEnvirnoment) { continue; } n01++; ListItem = new ListViewItem(); ListItem.Text = (n01).ToString(); ListItem.SubItems.Add(Merchant.m_sCharName); ListItem.SubItems.Add((Merchant.m_nCurrX).ToString() + ':' + (Merchant.m_nCurrY).ToString()); ListItem.SubItems.Add("是"); ListItem.SubItems.Add("否"); ListItem.SubItems.Add(HUtil32.BooleanToStr(Merchant.m_boIsHide)); ListView.Items.Add(ListItem); } } finally { } foreach (var item in M2Share.UserEngine.QuestNPCList) { NormNpc = item; if (NormNpc.m_PEnvir != SelEnvirnoment) //by John Add 只有管理类NPC才添加到列表 { continue; } if (NormNpc.m_NpcType == TNpcType.n_Merchant) { continue; } n01++; ListItem = new ListViewItem(); ListItem.Text = (n01).ToString(); ListItem.SubItems.Add(NormNpc.m_sCharName); ListItem.SubItems.Add((NormNpc.m_nCurrX).ToString() + ':' + (NormNpc.m_nCurrY).ToString()); ListItem.SubItems.Add("否"); ListItem.SubItems.Add("是"); ListItem.SubItems.Add(HUtil32.BooleanToStr(NormNpc.m_boIsHide)); ListView.Items.Add(ListItem); } } this.Text = SelEnvirnoment.sMapDesc + " " + "NPC数:" + ListView.Items.Count; ListView.Visible = true; Dispose(ListItem); Dispose(Merchant); Dispose(NormNpc); }