增加映射后,本次添加的映射名称自动写入搜索栏

This commit is contained in:
GaLi 2025-08-31 21:18:17 +08:00
parent 5e88420108
commit afbb4b7e92

View File

@ -348,8 +348,15 @@ public class ProviderSelectScreen extends Screen {
boolean ok = com.extendedae_plus.util.ExtendedAEPatternUploadUtil.addOrUpdateAliasMapping(key, val);
if (ok) {
if (player != null) player.sendSystemMessage(Component.literal("已添加/更新映射: " + key + " -> " + val));
// 将刚添加的中文名写入搜索框作为当前查询
this.query = val;
if (this.searchBox != null) {
this.searchBox.setValue(val);
}
// 更新本地过滤显示若名称包含中文可被搜索
applyFilter();
// 回到第一页以展示最新筛选结果
page = 0;
needsRefresh = true;
} else {
if (player != null) player.sendSystemMessage(Component.literal("写入映射失败"));