Tracks loot with overlay, total coin value via ask prices, improved UI/CSS, and fixed display logic.
< 脚本Milkyway Idle - Current Loot Tracker的反馈
Added the scripts from the first two posts here: https://github.com/palinorz/temporary_trash/blob/main/milkyidleway_scripts_loottrack_modifytemp01.js
great work!
I dont know how to write script like this, but I made some attempts to change item name to chinese.
我不知道如何写这样的插件, 但是还是做了一些尝试, 试着让loot tracker显示中文物品名.
step1.
copy:
const itemNames = {
"/items/coin": "\u91d1\u5e01",
"/items/task_token": "\u4efb\u52a1\u4ee3\u5e01"
...
};
from script: https://greasyfork.org/zh-CN/scripts/530217-mwi-price-history-viewer-modified-%E9%93%B6%E6%B2%B3%E7%89%9B%E7%89%9B%E5%95%86%E5%9F%8E%E4%B8%AD%E7%89%A9%E5%93%81%E4%BB%B7%E6%A0%BC%E8%B5%B0%E5%8A%BF%E5%B0%8F%E5%8A%A9%E6%89%8B
and add to this script line28.
第1步.
复制:
const itemNames = {
"/items/coin": "\u91d1\u5e01",
"/items/task_token": "\u4efb\u52a1\u4ee3\u5e01"
...
};
这个中英对照表从另一个脚本: https://greasyfork.org/zh-CN/scripts/530217-mwi-price-history-viewer-modified-%E9%93%B6%E6%B2%B3%E7%89%9B%E7%89%9B%E5%95%86%E5%9F%8E%E4%B8%AD%E7%89%A9%E5%93%81%E4%BB%B7%E6%A0%BC%E8%B5%B0%E5%8A%BF%E5%B0%8F%E5%8A%A9%E6%89%8B
并且把它加到lootTracker脚本的第28行左右.
step2.
find code:
function updateLootDisplay(playerName) {
add this gpt-worte-function before function updateLootDisplay(playerName):
function translateItemHrid(itemHrid) {
const chinese = itemNames[itemHrid];
const baseHrid = itemHrid.replace(/s$/, '');
const baseChinese = itemNames[baseHrid];
return chinese ||
(baseChinese ? `${baseChinese}(复数)` :
itemHrid.split('/').pop().replace(/_/g, ' '));
}
第2步.
找到代码:
function updateLootDisplay(playerName) {
在这行代码之前加一整个函数:
// 翻译函数优化
function translateItemHrid(itemHrid) {
// 直接匹配完整hrid路径
const chinese = itemNames[itemHrid];
// 处理特殊情况:带复数形式的物品
const baseHrid = itemHrid.replace(/s$/, '');
const baseChinese = itemNames[baseHrid];
// 组合最终显示名称
return chinese ||
(baseChinese ? `${baseChinese}(复数)` :
itemHrid.split('/').pop().replace(/_/g, ' '));
}
step3.
find code:
const name = itemHrid.replace("/items/", "").replace(/_/g, " ");
and replace it to:
// const name = itemHrid.replace("/items/", "").replace(/_/g, " ");
const name = translateItemHrid(itemHrid);
第3步.
找到代码
const name = itemHrid.replace("/items/", "").replace(/_/g, " ");
把它注释掉并替换成
const name = translateItemHrid(itemHrid);
-----------------------------------------------------------------
Additionally,
1.I was thinking it might be nicer to show icons instead of item names.
2.Would be nice if there was a button to show everyone's item drops in the team at the same time.
However, I'm not sure how to implement these features. I would really appreciate it if you could take a look when you have time.
额外的,
1.希望使用物品图标替换物品名字, 或者在物品名字前加入物品图标, 这样可能会更直观.
2.如果可以同时显示所有人的掉落, 或者加个按钮可以切换单人掉落和全体掉落就更好了
但是我不知道怎么才能完成这样的功能, 如果作者大佬或者各位大佬们能有空帮忙看看就太感谢了.