Внесены обновления комьюнити 66,68,70,71
Также внесены мои изменения в части стека руд и камня
This commit is contained in:
@@ -244,7 +244,7 @@ function infinity_filter_gui.cycle_filter_mode(gui_data)
|
||||
local state = gui_data.state
|
||||
|
||||
state.infinity_filter.mode = (
|
||||
next(constants.infinity_filter_modes, state.infinity_filter.mode) or next(constants.infinity_filter_modes)
|
||||
next(constants.infinity_filter_modes, state.infinity_filter.mode) or next(constants.infinity_filter_modes)
|
||||
)
|
||||
|
||||
refs.filter_setter.dropdown.selected_index = constants.infinity_filter_mode_to_index[state.infinity_filter.mode]
|
||||
@@ -271,7 +271,7 @@ function infinity_filter_gui.handle_action(e, msg)
|
||||
filter_data.count = count
|
||||
refs.filter_setter.textfield.text = tostring(count)
|
||||
else
|
||||
local count = tonumber(e.element.text) or 0
|
||||
local count = math.clamp(tonumber(e.element.text) or 0, 0, math.max_uint)
|
||||
filter_data.count = count
|
||||
refs.filter_setter.slider.slider_value = math.round(count, item_data.stack_size)
|
||||
end
|
||||
|
||||
@@ -227,7 +227,7 @@ function logistic_request_gui.open(player, player_table, item_data)
|
||||
local elems = logistic_setter[type]
|
||||
local count = request_data[type]
|
||||
elems.textfield.enabled = true
|
||||
if count == math.max_uint then
|
||||
if count >= math.max_uint then
|
||||
elems.textfield.text = constants.infinity_rep
|
||||
else
|
||||
elems.textfield.text = tostring(count)
|
||||
@@ -309,7 +309,9 @@ function logistic_request_gui.update_request(refs, state, element)
|
||||
local count
|
||||
if element.type == "textfield" then
|
||||
count = tonumber(element.text)
|
||||
if not count then
|
||||
if count then
|
||||
count = math.clamp(count, 0, math.max_uint)
|
||||
else
|
||||
count = bound == "min" and 0 or math.max_uint
|
||||
end
|
||||
elems.slider.slider_value = math.round(count / item_data.stack_size) * item_data.stack_size
|
||||
|
||||
@@ -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