WIth the patch you don't need to enter exact string. For example for units ptol hlr a the first result in the list can be units/ptol_support_healer_a.
The algorithm is pretty simple, can be improved after some feedback.
Differential D2542
Adds smart search to the Atlas entity list vladislavbelov on Jan 7 2020, 2:29 AM. Authored by
Details
WIth the patch you don't need to enter exact string. For example for units ptol hlr a the first result in the list can be units/ptol_support_healer_a. The algorithm is pretty simple, can be improved after some feedback.
Diff Detail
Event TimelineComment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/968/display/redirect Comment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/macos-differential/64/display/redirect Comment Actions Successful build - Chance fights ever on the side of the prudent. Linter detected issues: Executing section Source... source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp | 433| BEGIN_EVENT_TABLE(PlayerComboBox,·wxComboBox) | | [MAJOR] CPPCheckBear (unknownMacro): | | There is an unknown macro here somewhere. Configuration is required. If BEGIN_EVENT_TABLE is a macro then please configure it. Executing section JS... Executing section cli... Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1486/display/redirect Comment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/969/display/redirect Comment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/macos-differential/65/display/redirect Comment Actions Successful build - Chance fights ever on the side of the prudent. Linter detected issues: Executing section Source... source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp | 428| BEGIN_EVENT_TABLE(PlayerComboBox,·wxComboBox) | | [MAJOR] CPPCheckBear (unknownMacro): | | There is an unknown macro here somewhere. Configuration is required. If BEGIN_EVENT_TABLE is a macro then please configure it. Executing section JS... Executing section cli... Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1487/display/redirect Comment Actions Searching in Atlas has been quite frustrating for years so this would be a significant improvement. svn up arc patch D2542 cd build/workspaces/ ./update-workspaces.sh -j7 cd gcc/ make -j7 and I get this: It seems Atlas fails to find anything when a space is entered in the search field, as was already the case without this patch. Any ideas what I did wrong? Comment Actions
Thanks. Toggling the checkbox and then entering the string works. Entering the string first and then clicking the checkbox does not. Comment Actions That inf _b returns all basic infantry templates is simply great, I don't think I would ever want inf _b to return nothing. Comment Actions Yeah, it's possible. What do you mean? Both hlr and h l r should return the same (for example return healer). Comment Actions Isn't the space a separator that functions as AND? To me hlr means hlr but h l r means h and l and r. At least that's how search works in programs such as Gnome Nautilus/Files: Comment Actions Nope, space is just a character. The search is more near to the sublime`s one, but simpler. Comment Actions But then I don't understand why you gave units ptol hlr a and not unitsptolhlra or ahillnoprsttu. Besides, there are no entities or actors with a space in their file name. Comment Actions For easier reading, because usually it's easier to find a mistype when characters are grouped. Comment Actions You print any characters you want/need. And the algorithm tries to find something most suitable for it. In more technical words it tries to find a word with a longest common subsequence with the search text. Comment Actions So it will give an ordered list of everything that has at least a single matching character? Comment Actions That's a bit unexpected. Comment Actions That might happen.
It's sublime-like behaviour. Else there might be a lot of different algorithms that may be complex and contradict with each other a bit. For example what if someone entered healer_, what does it mean, do we need to find a word with _ on the end. Comment Actions healer_ returns healer_b, healer_a, healer_e times 13 civs in the old function, i.e. 39 units; in the new function the first item is units/kush_support_healer_a, but units/athen_infantry_slinger_b is number seven and skirmish/structures/default_sentry_tower is listed above units/athen_support_healer_a; the item listed last is units/viking_longship. Comment Actions So, your suggestion is to put longer matches higher, right?
Yeah, text/code editor. Comment Actions Ideally I'd like a search function that can handle substrings; e.g. ptol healer searches for ptol and healer, thus returning: units/ptol_support_healer_a units/ptol_support_healer_b units/ptol_support_healer_e The old function returns too little (no matches) for my taste and the new one too much: (and hundreds of matches more). Comment Actions A bit unrelated to the patch, but I see the problem with the quarter of screen. Could you provide the system information (system_info.txt might be good)? Also do you have a system scale? Comment Actions
wxWidget version is wxGTK3-devel-3.0.4-10.fc31.x86_64 I've also reported it to you on the forums last year: https://wildfiregames.com/forum/index.php?/topic/25347-help-with-atlas-map-editor/&tab=comments#comment-368872 Comment Actions @Nescio I've tweaked the algorithm. Now it's a bit closer to your understanding. Now words separated by any non-letter characters should present in a name (it doesn't account underscores, so healer_ a equals to healer a because of possible performance). Comment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1021/display/redirect Comment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/macos-differential/117/display/redirect Comment Actions Successful build - Chance fights ever on the side of the prudent. Linter detected issues: Executing section Source... source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.h | 23| class·ObjectSidebar·:·public·Sidebar | | [MAJOR] CPPCheckBear (syntaxError): | | Code 'classSidebar:' is invalid C code. Use --std or --language to configure the language. source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp | 506| BEGIN_EVENT_TABLE(PlayerComboBox,·wxComboBox) | | [MAJOR] CPPCheckBear (unknownMacro): | | There is an unknown macro here somewhere. Configuration is required. If BEGIN_EVENT_TABLE is a macro then please configure it. Executing section JS... Executing section cli... Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1539/display/redirect Comment Actions Thank you. The new search is much better. However, my opinion is just one. More people should try it out and comment. Comment Actions Comment Actions From blackbox testing, search is acceptable to me, I'd prefer exact as a default too (I dont expect to ever use fuzzy search, but nani implemented it for his mapbrowser and other features too, so perhaps there are users for that). Comment Actions These warnings seem unrelated (they're mostly about many methods of wxListCtrl).
Comment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1043/display/redirect Comment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/macos-differential/139/display/redirect Comment Actions Successful build - Chance fights ever on the side of the prudent. Linter detected issues: Executing section Source... source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp | 506| BEGIN_EVENT_TABLE(PlayerComboBox,·wxComboBox) | | [MAJOR] CPPCheckBear (unknownMacro): | | There is an unknown macro here somewhere. Configuration is required. If BEGIN_EVENT_TABLE is a macro then please configure it. source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.h | 23| class·ObjectSidebar·:·public·Sidebar | | [MAJOR] CPPCheckBear (syntaxError): | | Code 'classSidebar:' is invalid C code. Use --std or --language to configure the language. Executing section JS... Executing section cli... Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1561/display/redirect |