|
|
@ -10,6 +10,7 @@ |
|
|
|
|
|
|
|
export let logs: LogResult[] = []; |
|
|
|
export let mode: GoalCompositionMode = "item"; |
|
|
|
export let ignoreZeroWeight: boolean = false; |
|
|
|
|
|
|
|
let list: CompositionItem[] = []; |
|
|
|
|
|
|
@ -20,15 +21,18 @@ |
|
|
|
for (const log of logs) { |
|
|
|
if (log.itemCounted !== false) { |
|
|
|
const item = log.item; |
|
|
|
if (!ignoreZeroWeight || item.groupWeight > 0) { |
|
|
|
if (!map[item.id]) { |
|
|
|
map[item.id] = {name: item.name, amount: log.itemAmount, link: `/items#${item.id}`}; |
|
|
|
} else { |
|
|
|
map[item.id].amount += log.itemAmount; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (log.secondaryItem && log.secondaryItemCounted !== false) { |
|
|
|
const item = log.secondaryItem; |
|
|
|
if (!ignoreZeroWeight || item.groupWeight > 0) { |
|
|
|
if (!map[item.id]) { |
|
|
|
map[item.id] = {name: item.name, amount: log.secondaryItemAmount, link: `/items#${item.id}`}; |
|
|
|
} else { |
|
|
@ -36,6 +40,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
for (const log of logs) { |
|
|
|
const task = log.task; |
|
|
|