Skip to content

Conversation

@bhbghghbgb
Copy link
Contributor

english

feat: Auto Artifact Salvage function recognizes and marks an unactivated affix

Currently, when using JavaScript matching rules, there is no way to detect if the fourth affix is unactivated (a feature introduced after the Version 6.0 update).

This PR implements a quick but inefficient fix: it calculates a histogram of each line's ROI to determine if the grayed-out foreground text color of the unactivated affix exists and is one of the top colors in the histogram. The ArtifactAffix class will have a new field, IsUnactivated.

Background:
Artifact affix lines can now span two lines in some Latin-based languages because the "unactivated" note is appended. This complicates text segmentation. Fortunately, this only occurs on five-star artifacts, there is only one unactivated affix per artifact, and it is always the last affix. There are more efficient ways to implement this, so this PR is a workaround at best.

Chinese AI translation:

功能:自动圣遗物转化功能可识别并标记未激活副词条

目前,在使用 JavaScript 匹配规则时,无法检测第四个副词条是否为未激活状态(这是 6.0 版本更新后引入的特性)。

本 PR 实现了一个快速但低效的修复方法:计算每行 ROI 的直方图,以判断未激活副词条的灰色前景文本颜色是否存在,并且是否为直方图中的主要颜色之一。ArtifactAffix 类将新增一个字段 IsUnactivated

背景:
在某些拉丁语系的语言中,由于附加了“未激活”的注释,圣遗物副词条的文字现在可能会显示为两行。这使文本分割变得复杂。幸运的是,这种情况只出现在五星圣遗物上,每个圣遗物只有一个未激活副词条,并且它总是最后一个词条。存在更高效的实现方法,因此本 PR 充其量只是一个临时解决方案。

sample images

Untitled6 Untitled7

@huiyadanli
Copy link
Member

@FishmanTheMurloc 看下?

@FishmanTheMurloc
Copy link
Contributor

@huiyadanli 相信bhb老哥,直接合并啦

@huiyadanli huiyadanli merged commit 0aef3ec into babalae:main Sep 26, 2025
1 check passed
ShiroRikka pushed a commit to ShiroRikka/ShiroRikka-better-genshin-impact that referenced this pull request Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants