MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / Target_OnResourceRemoved

Method Target_OnResourceRemoved

PerformanceMonitor/MainForm.cs:237–264  ·  view source on GitHub ↗
(TargetProgram.ResourceType type, TargetProgram.ResourcePoolType pool, string name)

Source from the content-addressed store, hash-verified

235 }
236
237 void Target_OnResourceRemoved(TargetProgram.ResourceType type, TargetProgram.ResourcePoolType pool, string name)
238 {
239 if ((int)type < 1 || (int)type > _ResourceStatusListView.Count())
240 return;
241
242 string tPoolName = pool == TargetProgram.ResourcePoolType.Global ? "全局" : "关卡";
243 List<ListViewItem> tItemsToRemove = new List<ListViewItem>();
244 foreach (ListViewItem item in _ResourceStatusListView[(int)type - 1].Items)
245 {
246 if (item.SubItems[0].Text == tPoolName && item.SubItems[1].Text == name)
247 tItemsToRemove.Add(item);
248 }
249
250 ListViewItem tCounter = listView_resourceCounter.Items[(int)type - 1];
251 double tTotalTime = 0;
252 int tTotalCount = 0;
253 foreach (ListViewItem item in tItemsToRemove)
254 {
255 tTotalTime += Convert.ToDouble(item.SubItems[3].Text);
256 ++tTotalCount;
257 _ResourceStatusListView[(int)type - 1].Items.Remove(item);
258 }
259 double tNewTime = Math.Max(0, Convert.ToDouble(tCounter.SubItems[1].Text) - tTotalTime);
260 if (tNewTime < 0.00001)
261 tNewTime = 0;
262 tCounter.SubItems[1].Text = tNewTime.ToString();
263 tCounter.SubItems[2].Text = (Convert.ToInt32(tCounter.SubItems[2].Text) - tTotalCount).ToString();
264 }
265
266 void Target_OnResourceLoaded(TargetProgram.ResourceType type, TargetProgram.ResourcePoolType pool, string name, string path, float time)
267 {

Callers

nothing calls this directly

Calls 1

MaxMethod · 0.80

Tested by

no test coverage detected