Внесены обновления комьюнити 66,68,70,71

Также внесены мои изменения в части стека руд и камня
This commit is contained in:
2024-05-26 17:10:02 +03:00
parent de9cea6cbf
commit ab57094041
25 changed files with 83 additions and 48 deletions

View File

@@ -1,3 +1,17 @@
Version: 2.1.11
Date: ????
Changes:
---------------------------------------------------------------------------------------------------
Version: 2.1.10
Date: 2024-05-08
Bugfixes:
- Fixed somehow orphaned windows not being destroyed before a new window is created. (#38)
---------------------------------------------------------------------------------------------------
Version: 2.1.9
Date: 2024-05-07
Bugfixes:
- Fixed a crash in certain cases when translations complete after a mod migration. (#35)
- Fixed a crash when inputting a value greater than 4,294,967,295. (#37)
---------------------------------------------------------------------------------------------------
Version: 2.1.8
Date: 2023-05-06

View File

@@ -1,6 +1,6 @@
{
"name": "QuickItemSearch",
"version": "2.1.8",
"version": "2.1.11",
"title": "Quick Item Search",
"description": "Quickly and easily search for items in your inventory or connected logistic network. Set temporary requests and quickly trash any items above your minimum requests.",
"author": "raiguard",
@@ -13,6 +13,7 @@
"(?) space-exploration"
],
"package": {
"git_publish_branch": "master",
"ignore": [ "stylua.toml", "screenshots" ]
}
}

View File

@@ -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

View File

@@ -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

View File

@@ -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