Skip to content

Commit

Permalink
Fixed more 2.0 breaking changes, implemented search for many new enti…
Browse files Browse the repository at this point in the history
…ties (not sure if all)

- also marked couple of TODOs for later
  • Loading branch information
Atria1234 committed Oct 16, 2024
1 parent e93fc3e commit bfa1349
Show file tree
Hide file tree
Showing 4 changed files with 272 additions and 186 deletions.
2 changes: 1 addition & 1 deletion control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ local function generate_item_to_entity_table()
end

-- Hardcode some Pyanodons associations
if game.active_mods["pypetroleumhandling"] then
if script.active_mods["pypetroleumhandling"] then
-- or {} in case something removed those items or playing an older version of Py
table.insert(item_to_entities["raw-gas"] or {}, "bitumen-seep")
table.insert(item_to_entities["tar"] or {}, "bitumen-seep")
Expand Down
12 changes: 7 additions & 5 deletions scripts/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ function Gui.build_surface_results(surface_name, surface_data)
extra_info = {"", "\n[font=default-semibold][color=255, 230, 192]", {"search-gui.signal-count-tooltip"}, ":[/color][/font] ", util.format_number(math.floor(group.signal_count), true)}
end
local sprite = "item/" .. entity_name
if not game.is_valid_sprite_path(sprite) then
if not helpers.is_valid_sprite_path(sprite) then
sprite = "fluid/" .. entity_name
if not game.is_valid_sprite_path(sprite) then
if not helpers.is_valid_sprite_path(sprite) then
sprite = "entity/" .. entity_name
if not game.is_valid_sprite_path(sprite) then
if not helpers.is_valid_sprite_path(sprite) then
sprite = "recipe/" .. entity_name
if not game.is_valid_sprite_path(sprite) then
if not helpers.is_valid_sprite_path(sprite) then
sprite = "virtual-signal/" .. entity_name
if not game.is_valid_sprite_path(sprite) then
if not helpers.is_valid_sprite_path(sprite) then
sprite = "utility/questionmark"
end
end
Expand Down Expand Up @@ -218,6 +218,8 @@ function Gui.build_results(data, frame, check_result_found, include_surface_name
if not surface_contains_results then
goto continue
end

-- TODO sort somewhere before showing storage, modules, requesters, ...
gui.build(frame, {
Gui.build_surface_name(include_surface_name, surface_name),
Gui.build_surface_count(surface_data.surface_info, include_surface_name),
Expand Down
2 changes: 1 addition & 1 deletion scripts/result-location.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function ResultLocation.open(player, data)
position = position,
surface = surface_name,
}
player.zoom = zoom_level
player.zoom = zoom_level -- TODO zoom out when showing map tags

local player_data = storage.players[player.index]
local refs = player_data.refs
Expand Down
Loading

0 comments on commit bfa1349

Please sign in to comment.