Search variables using multiple words#168
Search variables using multiple words#168robalni wants to merge 2 commits intoblue-nebula:masterfrom robalni:search-words
Conversation
This makes is possible to search using multiple words in the vars menu. When you do that you will find all variables that contain all of the specified words in any order. Examples: If you search for "weap rifle" you will find: - riflefragweap1 - riflefragweap2 - weapidxrifle If you search for "plasma 1" you will find all variables that modify plasma 1.
|
This is the only bug I have found so far: Search for "s s" and you will see that some results will have too many 's'. Similar thing also happens with 'y'. This is probably because 's' and 'y' are used for formatting and then it finds them in the format codes the next time it replaces text. |
|
I like the idea |
config/menus/vars.cfg
Outdated
There was a problem hiding this comment.
please add a comment that states exactly what this line does, it is not obvious
| { | ||
| ids[1].setsize(0); | ||
| loopv(ids[0]) if(rigcasestr(ids[0][i]->name, str)) ids[1].add(ids[0][i]); | ||
| loopv(ids[0]) |
There was a problem hiding this comment.
please do not use loop macros, instead use for (int i = 0; i < ids[0].length(); i++)
There was a problem hiding this comment.
I didn't add that loop macro. I think getting rid of the loop macros is a separate issue for another PR.
There was a problem hiding this comment.
I general we usually just remove them from code we rework/work at. It doesn't hurt anybody
This command helps with the multi word var search highlighting.
|
The bug I mentioned about too many 's' is fixed by this last commit d315585 |
This makes is possible to search using multiple words in the vars menu.
When you do that you will find all variables that contain all of the
specified words in any order.
Examples:
If you search for "weap rifle" you will find:
If you search for "plasma 1" you will find all variables that modify
plasma 1.