Skip to content

Commit

Permalink
search case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyoko-Jeremie committed May 13, 2024
1 parent 9724258 commit 341bb0c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/GreasemonkeyScript/CreateGui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,13 +926,14 @@ export class CreateGui {
nn.reload();
return;
}
const searchKeySearch = searchKey.toLowerCase();
nn.settings.options =
thisRef.winRef.KinkyDungeonMod_EnchantedRestraints.Cheats.ChoiceGetAllValidChoiceData()
.map(T => `${T.count}. ${T.name}[${T.keyName}]:${T.selected ? '██' : '_'}`)
.filter(T =>
T.includes(searchKey)
T.toLowerCase().includes(searchKeySearch)
)/*.concat(['None'])*/;
thisRef.lastSearch.set('ChoiceAddOneFilter', searchKey);
thisRef.lastSearch.set('ChoiceAddOneFilter', searchKeySearch);
nn.reload();

},
Expand All @@ -956,9 +957,7 @@ export class CreateGui {
value: '',
options: thisRef.winRef.KinkyDungeonMod_EnchantedRestraints.Cheats.ChoiceGetAllValidChoiceData()
.map(T => `${T.count}. ${T.name}[${T.keyName}]:${T.selected ? '██' : '_'}`)
.filter(T =>
T.includes(thisRef.lastSearch.get('ChoiceAddOneFilter'))
),
.filter(T => T.toLowerCase().includes(thisRef.lastSearch.get('ChoiceAddOneFilter'))),
cssClassName: 'd-inline',
},
'ChoiceFilterAddOne': {
Expand Down Expand Up @@ -1342,15 +1341,16 @@ export class CreateGui {
nn.reload();
return;
}
const searchKeySearch = searchKey.toLowerCase();
nn.settings.options =
thisRef.winRef.KinkyDungeonMod_EnchantedRestraints.Cheats.listAllRestraintItem()
.map(T => {
return `${T.name}|[${TextGet(`Restraint${T.name}`)}]`;
})
.filter(T =>
T.includes(searchKey)
T.toLowerCase().includes(searchKeySearch)
)/*.concat(['None'])*/;
thisRef.lastSearch.set('AllRestraintItemFilter', searchKey);
thisRef.lastSearch.set('AllRestraintItemFilter', searchKeySearch);
nn.reload();

},
Expand All @@ -1374,7 +1374,7 @@ export class CreateGui {
value: 'None',
options: thisRef.winRef.KinkyDungeonMod_EnchantedRestraints.Cheats.listAllRestraintItem().map(T => {
return `${T.name}|[${TextGet(`Restraint${T.name}`)}]`;
}).filter(T => T.includes(thisRef.lastSearch.get('AllRestraintItemFilter'))).concat(['None']),
}).filter(T => T.toLowerCase().includes(thisRef.lastSearch.get('AllRestraintItemFilter'))).concat(['None']),
eventCallbacks: {
click(e) {
console.warn('AllRestraintItemFilterSelect click', e);
Expand Down

0 comments on commit 341bb0c

Please sign in to comment.