Внесены обновления комьюнити 66,68,70,71
Также внесены мои изменения в части стека руд и камня
This commit is contained in:
@@ -11,6 +11,17 @@ local logistic_request_gui = require("__QuickItemSearch__/scripts/gui/logistic-r
|
||||
local search_gui = {}
|
||||
|
||||
function search_gui.build(player, player_table)
|
||||
-- At some point it's possible for the player table to get out of sync... somehow.
|
||||
local orphaned_dimmer = player.gui.screen.qis_window_dimmer
|
||||
if orphaned_dimmer and orphaned_dimmer.valid then
|
||||
orphaned_dimmer.destroy()
|
||||
end
|
||||
local orphaned_window = player.gui.screen.qis_search_window
|
||||
if orphaned_window and orphaned_window.valid then
|
||||
orphaned_window.destroy()
|
||||
end
|
||||
search_gui.destroy(player_table)
|
||||
|
||||
local refs = gui.build(player.gui.screen, {
|
||||
{
|
||||
type = "frame",
|
||||
@@ -144,7 +155,14 @@ function search_gui.build(player, player_table)
|
||||
end
|
||||
|
||||
function search_gui.destroy(player_table)
|
||||
player_table.guis.search.refs.window.destroy()
|
||||
local gui_data = player_table.guis.search
|
||||
if not gui_data then
|
||||
return
|
||||
end
|
||||
if not gui_data.window or not gui_data.window.valid then
|
||||
return
|
||||
end
|
||||
gui_data.window.valid.destroy()
|
||||
player_table.guis.search = nil
|
||||
end
|
||||
|
||||
@@ -251,12 +269,8 @@ function search_gui.perform_search(player, player_table, updated_query, combined
|
||||
|
||||
if #state.raw_query > 1 then
|
||||
local i = 0
|
||||
local results, connected_to_network, logistic_requests_available = search.run(
|
||||
player,
|
||||
player_table,
|
||||
query,
|
||||
combined_contents
|
||||
)
|
||||
local results, connected_to_network, logistic_requests_available =
|
||||
search.run(player, player_table, query, combined_contents)
|
||||
for _, row in ipairs(results) do
|
||||
i = i + 1
|
||||
local i3 = i * 3
|
||||
@@ -286,13 +300,13 @@ function search_gui.perform_search(player, player_table, updated_query, combined
|
||||
-- item counts
|
||||
if player.controller_type == defines.controllers.character and connected_to_network then
|
||||
children[i3 + 2].caption = (
|
||||
(row.inventory or 0)
|
||||
.. " / [color="
|
||||
.. constants.colors.logistic_str
|
||||
.. "]"
|
||||
.. (row.logistic or 0)
|
||||
.. "[/color]"
|
||||
)
|
||||
(row.inventory or 0)
|
||||
.. " / [color="
|
||||
.. constants.colors.logistic_str
|
||||
.. "]"
|
||||
.. (row.logistic or 0)
|
||||
.. "[/color]"
|
||||
)
|
||||
else
|
||||
children[i3 + 2].caption = (row.inventory or 0)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user