0 of 0

File information

Last updated

Original upload

Created by

nexusmodhuang

Uploaded by

nexusmodhuang

Virus scan

Safe to use

About this mod

Modified the favoritesmenu.swf file of Updated Categorized Favorites Menu to support Chinese matching.

Requirements
Permissions and credits
安装

无需原版,直接用 MOD 管理器安装本 MOD 即可。

我没有更改原版的 favoritesmenu.cfg 文件,你需要把里面的内容改成中文才能使这个 MOD 正常运作,切记,需要将文件编码保存为 UTF-16 LE。具体怎么改,你需要阅读原版的说明,在 Updated Categorized Favorites Menu at Skyrim Special Edition Nexus - Mods and Community 的 Adding your own spells/items/abilities 段落,以及参照 favoritesmenu.cfg 的内容学习怎么设置界面布局。


说明

原版的代码中,作者只考虑里英文和类英文语言的关键词匹配,因为英文中单词之间是以空格来隔开的,而中文的词语间则没有空格。我更改了这部分代码,使得它支持中文,但如果你把我修改后的这个 MOD 用到英文版游戏中,你不会得到想要的效果(我想也没人会这么做,因为你可以直接使用原版MOD Updated Categorized Favorites Menu at Skyrim Special Edition Nexus - Mods and Community)。

原版的匹配关键词代码:

function matchesKeyword(text, keyword) {
    if (keyword.charAt(0) == '"' &&
        keyword.charAt(keyword.length - 1) == '"') {
       
        keyword = keyword.substring(1, keyword.length - 1);
        return text == keyword;
       
    } else {
        var index = text.indexOf(keyword);
        if (index < 0) {
            return false;
        }

        var charBefore = text.charAt(index - 1);
        var charAfter = text.charAt(index + keyword.length);
        var matches = ((charBefore == " " || charBefore == "") &&
                        (charAfter  == " " || charAfter  == ""));
        return matches;
    }
}

我修改后的代码:

function matchesKeyword(text, keyword) {
    if (keyword.charAt(0) == '"' &&
        keyword.charAt(keyword.length - 1) == '"') {
       
        keyword = keyword.substring(1, keyword.length - 1);
        return text == keyword;
       
    } else {
        return text.indexOf(keyword) >= 0;
    }
}