Fix SCUM gift catalog visibility
This commit is contained in:
@@ -40,7 +40,6 @@ const scumMapBaseLayers: ReadonlyArray<readonly [ScumMapLayer, string]> = [["ter
|
||||
const scumMapVehicleFilters: ReadonlyArray<readonly [MapVehicleFilter, string]> = [["all", "全部载具"], ["land", "陆地载具"], ["water", "水上载具"], ["air", "飞行类载具"], ["other", "其他载具"]];
|
||||
const scumFlightVehicleKeys = new Set(["kinglet_duster", "kinglet_mariner", "kinglet_scout"]);
|
||||
const scumGiftCatalogCategories: ReadonlyArray<readonly [string, string]> = [["all", "全部目录"], ["hunting", "狩猎"], ["food", "食物"], ["metabolism", "代谢"], ["medical", "医疗"], ["weapons", "武器"], ["crafting", "制作"], ["gear", "装备"], ["fishing", "钓鱼"], ["building", "建筑"], ["tools", "工具"], ["farming", "农业"], ["misc", "其他"], ["vehicle", "载具"], ["animal", "动物"], ["zombie", "丧尸"], ["armed-npc", "NPC"]];
|
||||
const scumCatalogPickLimit = 48;
|
||||
const scumMapSize = 4096;
|
||||
const scumSurfaceRefreshMs = 15000;
|
||||
const scumMapZoomMin = 1;
|
||||
@@ -1430,7 +1429,7 @@ function catalogMatches(query: string, kind: string, target: CatalogPickTarget):
|
||||
return scumCatalogEntries.filter((entry) => {
|
||||
const matchesKind = kind === "all" || scumGiftCatalogFilterKey(entry) === kind;
|
||||
return matchesKind && (!search || scumCatalogSearchText(entry).includes(search));
|
||||
}).slice(0, scumCatalogPickLimit);
|
||||
});
|
||||
}
|
||||
|
||||
function appendCatalogItem(items: GiftItemDraft[], code: string): GiftItemDraft[] {
|
||||
|
||||
@@ -57,7 +57,7 @@ const wordNames: Record<string, string> = {
|
||||
};
|
||||
|
||||
const additionalWordNames: Record<string, string> = {
|
||||
activated: "活性炭", alcohol: "酒精", alcoholic: "酒精类", anti: "抗", antibiotic: "抗生素", antimalaria: "抗疟疾", antiparasitic: "抗寄生虫", antipsychotic: "抗精神病", ammunition: "弹药", attachment: "配件", back: "后部", body: "身体", boots: "靴子", box: "盒", bucket: "桶", camp: "营地", charcoal: "木炭", clothes: "服装", component: "组件", crafted: "制作的", crafting: "制作", dirty: "脏污", door: "车门", electrodes: "电极", farming: "农业", feet: "脚部", front: "前部", gear: "装备", gloves: "手套", hiking: "徒步", hood: "引擎盖", inventory: "背包栏", item: "物品", legs: "腿部", light: "轻型", normal: "普通", other: "其他", parts: "零件", rear: "后部", rubber: "橡胶", security: "安全", seat: "座椅", side: "侧面", single: "单发", skin: "皮肤", spare: "备用", standing: "立式", steel: "钢制", tactical: "战术", top: "顶部", trap: "陷阱", underwear: "内衣", weapon: "武器", wheel: "车轮"
|
||||
activated: "活性炭", alcohol: "酒精", alcoholic: "酒精类", anti: "抗", antibiotic: "抗生素", antimalaria: "抗疟疾", antiparasitic: "抗寄生虫", antipsychotic: "抗精神病", ammunition: "弹药", attachment: "配件", back: "后部", big: "大", body: "身体", boots: "靴子", box: "盒", bucket: "桶", camp: "营地", charcoal: "木炭", clothes: "服装", component: "组件", crafted: "制作的", crafting: "制作", dirty: "脏污", door: "车门", electrodes: "电极", farming: "农业", feet: "脚部", front: "前部", gear: "装备", gloves: "手套", hiking: "徒步", hood: "引擎盖", inventory: "背包栏", item: "物品", legs: "腿部", light: "轻型", military: "军用", normal: "普通", other: "其他", parts: "零件", rear: "后部", rubber: "橡胶", security: "安全", seat: "座椅", side: "侧面", single: "单发", skin: "皮肤", spare: "备用", standing: "立式", steel: "钢制", tactical: "战术", top: "顶部", trap: "陷阱", underwear: "内衣", weapon: "武器", wheel: "车轮"
|
||||
};
|
||||
|
||||
const phraseNames: Array<readonly [RegExp, string]> = [
|
||||
@@ -94,7 +94,14 @@ export function scumCatalogNameZh(entry: ScumCatalogEntry): string {
|
||||
export function scumCatalogDisplayName(entry: ScumCatalogEntry): string { return scumCatalogNameZh(entry); }
|
||||
|
||||
export function scumCatalogSearchText(entry: ScumCatalogEntry): string {
|
||||
return [scumCatalogNameZh(entry), entry.name, entry.code, entry.command].join(" ").toLowerCase();
|
||||
const codeWords = entry.code.replace(/[_-]+/g, " ");
|
||||
const aliases = [
|
||||
/(?:big|large).*backpack|backpack.*(?:big|large)/i.test(codeWords) ? "大背包" : "",
|
||||
/military.*backpack|backpack.*military/i.test(codeWords) ? "军用背包" : "",
|
||||
/military.*helmet|helmet.*military/i.test(codeWords) ? "军用头盔" : ""
|
||||
].filter(Boolean);
|
||||
const source = [scumCatalogNameZh(entry), entry.name, entry.code, codeWords, entry.command, ...aliases].join(" ").toLowerCase();
|
||||
return source + " " + source.replace(/[\s._-]+/g, "");
|
||||
}
|
||||
|
||||
function usableName(entry: ScumCatalogEntry): string {
|
||||
|
||||
Reference in New Issue
Block a user