Item Filtering:修订间差异

跳转到导航 跳转到搜索
无编辑摘要
第131行: 第131行:
文本和关键字可以一起使用来添加额外的信息,将名称的某些部分更改为不同的颜色,等等。 请参阅下面的 [[Item_Filtering#Output_Keywords | all keywords]].
文本和关键字可以一起使用来添加额外的信息,将名称的某些部分更改为不同的颜色,等等。 请参阅下面的 [[Item_Filtering#Output_Keywords | all keywords]].


<code>ItemDisplay[SOCKETS>0]: %NAME% %GRAY%[%SOCKETS%]</code> <span style="color:gray;">''displays socketed items with '''[X]''' appended in gray, where X is the number of sockets''</span>
<code>ItemDisplay[SOCKETS>0]: %NAME% %GRAY%[%SOCKETS%]</code> <span style="color:gray;">''在有凹槽物品的物品名称后面显示灰色的''[X]'',X为凹槽的数量''</span>




As with elsewhere, the double slash ('''//''') functions as an in-file way to write comments that will be ignored by the computer.
与其他地方一样,双斜杠(''//'')的功能是在文件中写入注释,这些注释将被计算机忽略。


<code>ItemDisplay[NMAG (aqv OR cqv)]: // hides regular arrows/bolts</code>
<code>ItemDisplay[NMAG (aqv OR cqv)]: // 隐藏普通的箭矢/弩矢</code>


<code>ItemDisplay[tsc]: //%NAME% // Scroll of Town Portal</code> <span style="color:gray;">''this rule hides TP scrolls, but can be changed to display them instead by deleting the first '''//'''''</span>
<code>ItemDisplay[tsc]: //%NAME% // Scroll of Town Portal</code> <span style="color:gray;">''这条规则隐藏了TP滚动。但可以通过删除%NAME%前面的"''//'''''"来将规则改为显示它们。</span>


<code>//ItemDisplay[MAG cm2]: // hides magic large charms</code> <span style="color:gray;">''this "rule" is ignored, but can be quickly re-enabled by deleting the first '''//'''''</span>
<code>//ItemDisplay[MAG cm2]: // hides magic large charms</code> <span style="color:gray;">''这条 "规则 "将被忽略,但可以通过删除ItemDisplay前的第一个"''//'''''"来实现重新启用。</span>




Items can be highlighted by adding spaces to either side of their name, so long as there is a keyword or non-space character between them and the edge of the name. Whitespace surrounding the '''''Output''''' of each rule gets removed prior to evaluation (spaces first, followed by tabs), so tabs are often the best non-space character to use.
Items can be highlighted by adding spaces to either side of their name, so long as there is a keyword or non-space character between them and the edge of the name. Whitespace surrounding the '''''Output''''' of each rule gets removed prior to evaluation (spaces first, followed by tabs), so tabs are often the best non-space character to use.
物品可以通过在其名称的两侧添加空格来突出显示,只要在它们和物品名称的边缘之间有一个关键词或非空格字符。每条规则的'''''Output''''',周围的空白会在评估前被移除(先是空格,后是制表符),所以制表符往往是最好的非空格字符。


<code>ItemDisplay[RUNE>9]: %ORANGE% %NAME% %ORANGE%</code> <span style="color:gray;">''adds 1 space of highlighting for runes above #9 (tabs don't display properly on the wiki, so '''%ORANGE%''' is used instead)''</span>
<code>ItemDisplay[RUNE>9]: %ORANGE% %NAME% %ORANGE%</code> <span style="color:gray;">''#9以上的符文增加了1个空格的高亮显示(标签在维基上不能正常显示,所以用'''%ORANGE%'''代替)。''</span>




The '''''%CONTINUE%''''' keyword replaces the contents of '''''%NAME%''''' with the current rule's '''''Output''''' (overwriting the default name or previously stored output) and makes the program continue checking rules. This allows multiple rules to modify an item's appearance based on different conditions.
'''''%CONTINUE%''''' 关键字将'''''%NAME%''''' 的内容替换为当前规则的'''''Output'''''(覆盖默认名称或先前存储的输出)并使程序继续检查规则。这允许多个规则根据不同的条件来修改一个物品的外观。


<code>ItemDisplay[SOCKETS>0]: %NAME% [%SOCKETS%]%CONTINUE%</code> <span style="color:gray;">''appends '''[X]''' to socketed items, where X is the number of sockets (continues)''</span>
<code>ItemDisplay[SOCKETS>0]: %NAME% [%SOCKETS%]%CONTINUE%</code> <span style="color:gray;">''在有凹槽物品的物品名称后面显示灰色的''[X]'',X为凹槽的数量(continues)''</span>


<code>ItemDisplay[ETH]: eth %NAME%%CONTINUE%</code> <span style="color:gray;">''prepends '''eth''' to ethereal items (continues)''</span>
<code>ItemDisplay[ETH]: eth %NAME%%CONTINUE%</code> <span style="color:gray;">''在无形物品的名称前面显示'''eth'''(continues)''</span>


<code>ItemDisplay[]: %NAME%</code> <span style="color:gray;">''displays all items (with modifications from previous rules)''</span>
<code>ItemDisplay[]: %NAME%</code> <span style="color:gray;">''显示所有的项目(根据这条规则前面的规则进行显示修正)''</span>


Without '''''%CONTINUE%''''', this would require a separate rule for every possible combination of different conditions, the number of rules growing exponentially with each additional condition:
如果没有'''''%CONTINUE%''''',这就需要为不同条件的每一个可能的组合制定单独的规则,每增加一个条件,规则的数量就会呈指数增长:


<code>ItemDisplay[ETH SOCKETS>0]: eth %NAME% [%SOCKETS%]</code>
<code>ItemDisplay[ETH SOCKETS>0]: eth %NAME% [%SOCKETS%]</code>
第168行: 第169行:




Item descriptions can be modified by using text and keywords within '''''{}''''' (braces). Anything outside the braces applies to the item name while anything inside the braces applies to the item description.
物品描述可以通过在'''''{}'''''(大括号)内使用文本和关键词进行修改。大括号外的内容适用于物品名称,大括号内的内容适用于物品描述


[[File:DescEx1.png|thumb|Item Description Example]]<code>ItemDisplay[]: %NAME%{$DARK_GREEN%$%PRICE%}</code> <span style="color:gray;">''item price is shown in the description like '''$35000''''' in dark green''</span>
[[File:DescEx1.png|thumb|Item Description Example]]<code>ItemDisplay[]: %NAME%{$DARK_GREEN%$%PRICE%}</code> <span style="color:gray;">''物品价格显示在描述中,如深绿色的''$35000'' ''</span>


Item descriptions aren't taken into account when hiding items, so descriptions can still be shown for hidden items if they have one.
隐藏物品时不考虑物品描述,所以如果隐藏的物品有描述,仍然可以显示。


<code>ItemDisplay[]: %NAME%{%NAME%}</code> <span style="color:gray;">''items displayed with their descriptions''</span>
<code>ItemDisplay[]: %NAME%{%NAME%}</code> <span style="color:gray;">''显示的物品名称和它们的描述''</span>


<code>ItemDisplay[]: {%NAME%}</code> <span style="color:gray;">''items hidden but their descriptions still shown''</span>
<code>ItemDisplay[]: {%NAME%}</code> <span style="color:gray;">''物品名称被隐藏,但其描述仍然显示''</span>


<code>ItemDisplay[]:</code> <span style="color:gray;">''items hidden and their descriptions hidden too''</span>
<code>ItemDisplay[]:</code> <span style="color:gray;">''物品名称和它们的描述都被隐藏''</span>




The '''''%CONTINUE%''''' keyword only functions when used ''outside'' the braces and applies to both the item name and the item description.
'''''%CONTINUE%''''' 关键字只有在大括号外使用时才起作用,并且同时适用于物品名称和物品描述。


<code>ItemDisplay[]: %NAME%{Item Level: %ILVL%}%CONTINUE%</code> <span style="color:gray;">''Shows item level in description (continues)''</span>
<code>ItemDisplay[]: %NAME%{Item Level: %ILVL%}%CONTINUE%</code> <span style="color:gray;">''在物品描述中显示物品等级 (continues)''</span>


<code>ItemDisplay[]: %NAME%{%NAME%, Affix Level: %ALVL%}</code> <span style="color:gray;">''Appends affix level in description with comma separator''</span>
<code>ItemDisplay[]: %NAME%{%NAME%, Affix Level: %ALVL%}</code> <span style="color:gray;">''在物品描述中添加显示带有逗号分隔符的词缀等级''</span>




The '''''%NL%''''' keyword adds a new line above the previous line and can only be used within item descriptions, or within item names of identified items whose rarity is magic or higher.
'''''%NL%''''' 关键字在前一行之上添加一个新行,只能在稀有度为魔法或更高的已识别物品的物品名称中使用。


<code>ItemDisplay[]: %NAME%{Affix Level: %ALVL%%NL%Item Level: %ILVL%}</code> <span style="color:gray;">''Shows item/affix levels on separate lines in description (same effect as '''Show Item Level''' setting)''</span>
<code>ItemDisplay[]: %NAME%{Affix Level: %ALVL%%NL%Item Level: %ILVL%}</code> <span style="color:gray;">''在物品描述中分行显示物品/词缀等级(与''Show Item Level''的设置效果相同)。''</span>


<!-- End of "Filter Syntax" category -->
<!-- End of "Filter Syntax" category -->