Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow searching for multiple terms#1853

Open
wormingdead wants to merge 9 commits into
Openarl:dev from
wormingdead:multiple-search
Open

Allow searching for multiple terms #1853
wormingdead wants to merge 9 commits into
Openarl:dev from
wormingdead:multiple-search

Conversation

@wormingdead

@wormingdead wormingdead commented Jan 28, 2020
edited
Loading

Copy link
Copy Markdown

This series of commits allow the search bar to handle multiple search terms. When the user searches with the string, bleed|frenzy, nodes that contain text with either bleed or frenzy will be highlighted. In other words, this change allows searching the union of each term. This is a change from the previous functionality of PoB searching only for the entire search string, including any whitespace. For comparison, the game allows whitespace to separate search terms and performs a search of the intersection of each term.

There are three big changes that should be considered before accepting this pull request.


1. The search cache has been changed from a table of booleans to a table of bitmaps (integers)

I don't know how this will work with the current serialization method or how the program will handle loading an old table of booleans and treating it like it's a new table of bitmaps.


(削除) 2. I developed this patch on Linux and could not compile and test these changes (削除ここまで)

(削除) I'm mostly worried that the highlight circles are being drawn incorrectly (more on this below) or that I unknowingly clobbered some global variable, but I'm new to Lua, so anything's possible. (削除ここまで)


3. Users can no longer search for | (the pipe symbol)

I don't think this will affect anyone.


Some other comments:

  • 83b3c31 This commit may need to be reverted. I wasn't sure why the search term was case-sensitive for this comparison.
  • (削除) I tried to make the highlight circles be drawn concentrically, but I'm not entirely sure I changed the draw call correctly. Please check to make sure the SetDrawLayer() function and the size variable are used correctly. (削除ここまで)
  • The search is currently limited to just eight terms. Additional terms will be ignored. (削除) The search terms can also be empty. For example, the string bleed||freeze|| will have three empty terms in it (bleed|1|freeze|2|3), and the highlight circles will be offset accordingly. This is not the greatest from a useablility perspective, but it's what I could figure out. (削除ここまで) If I knew how, I would have instead added an Advanced Search button that opened a dialog window with eight text areas and associated color pickers.

Thank you for any feedback.

Copy link
Copy Markdown
Author

I managed to get my changes running on a different computer and was able to fix what issues I could find, (as shown in the many force-pushes). It's pretty neat to see frenzy, endurance, or power nodes highlighted.

(削除) The search terms can also be empty. For example, the string bleed||freeze|| will have three empty terms in it (bleed|1|freeze|2|3), and the highlight circles will be offset accordingly. (削除ここまで)

Responding to my comment about how the search term parsing works, it seems that the Lua string.gmatch() function will not match the empty string as I initially thought, so if someone were to search for bleed||freeze||, it will only be counted as two search terms, bleed and freeze.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /