| 205 | } |
| 206 | |
| 207 | void Target_OnResourceCleared(TargetProgram.ResourcePoolType pool) |
| 208 | { |
| 209 | string tPoolName = pool == TargetProgram.ResourcePoolType.Global ? "全局" : "关卡"; |
| 210 | |
| 211 | for (int i = 0; i < _ResourceStatusListView.Count(); ++i) |
| 212 | { |
| 213 | List<ListViewItem> tItemsToRemove = new List<ListViewItem>(); |
| 214 | foreach (ListViewItem item in _ResourceStatusListView[i].Items) |
| 215 | { |
| 216 | if (item.SubItems[0].Text == tPoolName) |
| 217 | tItemsToRemove.Add(item); |
| 218 | } |
| 219 | |
| 220 | ListViewItem tCounter = listView_resourceCounter.Items[i]; |
| 221 | double tTotalTime = 0; |
| 222 | int tTotalCount = 0; |
| 223 | foreach (ListViewItem item in tItemsToRemove) |
| 224 | { |
| 225 | tTotalTime += Convert.ToDouble(item.SubItems[3].Text); |
| 226 | ++tTotalCount; |
| 227 | _ResourceStatusListView[i].Items.Remove(item); |
| 228 | } |
| 229 | double tNewTime = Math.Max(0, Convert.ToDouble(tCounter.SubItems[1].Text) - tTotalTime); |
| 230 | if (tNewTime < 0.00001) |
| 231 | tNewTime = 0; |
| 232 | tCounter.SubItems[1].Text = tNewTime.ToString(); |
| 233 | tCounter.SubItems[2].Text = (Convert.ToInt32(tCounter.SubItems[2].Text) - tTotalCount).ToString(); |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | void Target_OnResourceRemoved(TargetProgram.ResourceType type, TargetProgram.ResourcePoolType pool, string name) |
| 238 | { |