Skip to content

Commit

Permalink
Search Engine: Clear text search results when searching
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomis committed Oct 14, 2020
1 parent b180a75 commit 06b365a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
19 changes: 11 additions & 8 deletions factorio-search-engine_0.0.1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,26 @@ Use Async to perform the search in many cases. Use a somewhat good filter for th

## TODO Next steps

- Design API for pluggability
- Make a single end-to-end search
- Search for "iron"
- Search for "iron ore"
- Search for containers
- Apply filter: Within 50m
- Send ALL in chat message to self
- Progress bar (especially important for Signals search)
- Fluid search
- Entity search
- Possibility to search for multiple items/signals/fluids at the same time (such as all "Induction Furnace") - selection is possible with flib styles
- Producer/Consumer search (for items and fluids)
- Improve view of results

## Features

- Recent searches
- Favorite searches - especially for "Find my car" and similar?
- Some kind of share feature... Add icon to other players GUI's? "Simon is sharing XYZ with you"
- Player specific config to allow sharing of stuff. Maybe even allow sharing from specific people?
- Aliases? Such as "LTN" -> logistics-train-stop (entity name in this case)
- Search selector: Select area, show options about what is in that area (transport belt, items on belt, inserters, machines, recipes in machines, inputs, outputs...)
- Add more results to existing search
- Filter existing search results, add/remove filters?

## Random thoughts not mentioned in GUI Flow

Print count of force entities: /c game.print(tonumber(table_size(game.player.surface.find_entities_filtered { force = game.player.force })))
Search recipe chains - "Nutrient Pulp and Plastics, how are those connected?" (Nutrient Pulp ingredient, Plastics result)
Search circuit network, search which thing provides signal in network? (combinators, containers, inserters, belts)
Search free text word-by-word multi search.
Expand All @@ -40,6 +41,8 @@ Search for prototypes - item consumers for example (such as science packs, espec
Search for prototypes - electric generators, electric distributors, logistics-related things... ("type")
Search as soon as you click the first search button, search for all possibilities and show the total results for each as time goes by
Search for train stop name - Where the hell are all those "Unused" stations anyway?
GROUP BY functionality? Such as "Find all assembling machines, group by product/recipe" (show grouped-by-thing, count, sum of count property?)
ORDER BY functionality? Such as "closest" or "highest count"
WiM integration - click on something in WiM (left/right-click like FNEI) to launch search for producers/consumers with extra filter not-enough-ingredients-of-that-kind
Handle special items, such as "item with inventory"

Expand Down
2 changes: 0 additions & 2 deletions factorio-search-engine_0.0.1/gui/step_1_enter_text.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@ local function open_small_gui(player)

local elems = gui.build(player.gui.screen, {
{type="frame", direction="vertical", handlers="small_search_window.window", save_as="window", children={
-- save_as - dot-deliminated path to save this element to in `inventory_elems`
{type="flow", save_as="titlebar.flow", children={
{type="label", style="frame_title", caption={"search_engine.header"}, elem_mods={ignored_by_interaction=true}},
{template="drag_handle"},
-- you can assign multiple elements to the same handler group
{template="frame_action_button", handlers="small_search_window.titlebar.close", caption="X"}
}},
{type="textfield", save_as="search_text", handlers="small_search_window.search_text"},
Expand Down
1 change: 1 addition & 0 deletions factorio-search-engine_0.0.1/gui/step_2_choose_things.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ gui.add_handlers {
}

local function add_matching_text_results(context, results, searcher)
context.parent.clear()
for result_type, v in pairs(results) do
local elems = gui.build(context.parent, {
{type="flow", direction="vertical", children={
Expand Down

0 comments on commit 06b365a

Please sign in to comment.