Skip to content

Commit

Permalink
Update 0.14.1 (#256)
Browse files Browse the repository at this point in the history
Summar in changelog
  • Loading branch information
LevFendi authored Sep 7, 2024
1 parent 15b2362 commit b5c8b83
Show file tree
Hide file tree
Showing 8 changed files with 283 additions and 117 deletions.
30 changes: 30 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# Version 0.14.1 BETA
Released on September 7th, 2024.

## Summary
- This small update adds, re-adds, or improves minor features, such as player and vehicle health and armor info, infinity pipe filter setting, basic game console access, and mining drill drop chute position info.

## Features
- Infinity pipe filters can now be set using fluid barrels.
* With a fluid barrel in hand, select the infinity pipe and press `ALT + LEFT BRACKET` to set the relevant fluid.
* As a special case, an empty barrel is used to set extra hot steam at 500 degrees.
* If you press with an empty hand, the filter is cleared and the pipe becomes an infinite drain.

- Added limited support for console reading.
* When you press `GRAVE` or the relevant key, the console being opened is now reported.
* When a player enters a chat message, all players are informed about it live.
* The same as above happens for command messages.
* There is not yet support for chat history or for non-player console messages.

## Changes
- Changed the keybind to set entity filters from `CONTROL + LEFT BRACKET` to `ALT + LEFT BRACKET`. This applies for chests, inserters, splitters, etc.

- Improved health and armor stats reporting with the `G` key to now include vehicles and to check the menu context.
* When no menus are open, the mod reports only health and shield level info for your character.
* For most open menus such as the inventory, the full set of stats about player armor is reported.
* If the character is in a vehicle, or the vehicle's menu is open, then the name and full info for it is read instead.

## Bugfixes
- Re-added the reporting of a mining drill's drop chute position.


# Version 0.14.0 BETA
Released on September 2nd, 2024.

Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,12 @@ Insert 1 stack of the item in hand where applicable: CONTROL + LEFT BRACKET. Wor

Insert half a stack of the item in hand where applicable: CONTROL + RIGHT BRACKET. Works for chests or for smartly feeding machines and vehicles.

Set as entity filter: ALT + LEFT BRACKET, for the item in hand.

Clear entity filter: ALT + LEFT BRACKET, with an empty hand.

Note: Entity filters include inserters, splitters, infinity chests, infinity pipes using relevant fluid barrels, and constant combinators.

## Building from the hand

Items in hand that can be placed will have their previews active
Expand Down Expand Up @@ -653,13 +659,11 @@ Set input priority side: ALT + SHIFT + LEFT ARROW, or ALT + SHIFT + RIGHT ARROW.

Set output priority side: ALT + CONTROL + LEFT ARROW, or ALT + CONTROL + RIGHT ARROW. Press the same side again to reset to equal priority.

Set an item filter: With the item in hand, CONTROL + LEFT BRACKET

Set item filter output side: ALT + CONTROL + LEFT ARROW, or ALT + CONTROL + RIGHT ARROW

Set an item filter: With the item in hand, CONTROL + LEFT BRACKET
Set an item filter: With the item in hand, ALT + LEFT BRACKET

Clear the item filter: With an empty hand, CONTROL + LEFT BRACKET
Clear the item filter: With an empty hand, ALT + LEFT BRACKET

Copy and paste splitter settings: SHIFT + RIGHT BRACKET and then SHIFT + LEFT BRACKET

Expand Down
36 changes: 36 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
---------------------------------------------------------------------------------------------------
Version: 0.14.1
Date: 2024.09.07

Summary:
- This small update adds, re-adds, or improves minor features, such as player and vehicle
health and armor info, infinity pipe filter setting, basic game console access,
and mining drill drop chute position info.

Features:
- Infinity pipe filters can now be set using fluid barrels.
* With a fluid barrel in hand, select the infinity pipe and press `ALT + LEFT BRACKET` to
set the relevant fluid.
* As a special case, an empty barrel is used to set extra hot steam at 500 degrees.
* If you press with an empty hand, the filter is cleared and the pipe becomes an infinite drain.

- Added limited support for console reading.
* When you press `GRAVE` or the relevant key, the console being opened is now reported.
* When a player enters a chat message, all players are informed about it live.
* The same as above happens for command messages.
* There is not yet support for chat history or for non-player console messages.

Changes:
- Changed the keybind to set entity filters from `CONTROL + LEFT BRACKET` to `ALT + LEFT BRACKET`.
This applies for chests, inserters, splitters, etc.

- Improved health and armor stats reporting with the `G` key to now include vehicles and
to check the menu context.
* When no menus are open, the mod reports only health and shield level info for your character.
* For most open menus such as the inventory, the full set of stats about player armor is reported.
* If the character is in a vehicle, or the vehicle's menu is open, then the name and full info
for it is read instead.

Bugfixes:
- Re-added the reporting of a mining drill's drop chute position.

---------------------------------------------------------------------------------------------------
Version: 0.14.0
Date: 2024.09.02
Expand Down
110 changes: 87 additions & 23 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6044,14 +6044,6 @@ script.on_event("read-entity-status", function(event)
if result ~= nil and result ~= "" then printout(result, pindex) end
end)

script.on_event("read-character-status", function(event)
pindex = event.player_index
if not check_for_player(pindex) then return end
local hand = game.get_player(pindex).cursor_stack
if hand and hand.valid_for_read and (hand.is_blueprint or hand.is_blueprint_book) then return end
fa_info.read_character_status(pindex)
end)

script.on_event("rotate-building", function(event)
fa_building_tools.rotate_building_info_read(event, true)
end)
Expand Down Expand Up @@ -7762,13 +7754,14 @@ script.on_event("set-entity-filter-from-hand", function(event)
--Remove the last signal
fa_circuits.constant_combinator_remove_last_signal(ent, pindex)
elseif ent.type == "inserter" then
--Call the filter setter
local result = set_inserter_filter_by_hand(pindex, ent)
printout(result, pindex)
elseif ent.type == "infinity-container" then
--Call the filter setter
local result = set_infinity_chest_filter_by_hand(pindex, ent)
printout(result, pindex)
elseif ent.type == "infinity-pipe" then
local result = set_infinity_pipe_filter_by_hand(pindex, ent)
printout(result, pindex)
end
else
if ent.type == "splitter" then
Expand All @@ -7779,13 +7772,14 @@ script.on_event("set-entity-filter-from-hand", function(event)
--Add a new signal
fa_circuits.constant_combinator_add_stack_signal(ent, stack, pindex)
elseif ent.type == "inserter" then
--Call the filter setter
local result = set_inserter_filter_by_hand(pindex, ent)
printout(result, pindex)
elseif ent.type == "infinity-container" then
--Call the filter setter
local result = set_infinity_chest_filter_by_hand(pindex, ent)
printout(result, pindex)
elseif ent.type == "infinity-pipe" then
local result = set_infinity_pipe_filter_by_hand(pindex, ent)
printout(result, pindex)
end
end
end
Expand Down Expand Up @@ -7961,18 +7955,36 @@ script.on_event("disconnect-rail-vehicles", function(event)
end
end)

script.on_event("inventory-read-armor-stats", function(event)
local pindex = event.player_index
local vehicle = nil
if not check_for_player(pindex) or not players[pindex].in_menu then return end
if
(players[pindex].in_menu and players[pindex].menu == "inventory")
or (players[pindex].menu == "vehicle" and game.get_player(pindex).opened.type == "spider-vehicle")
then
local result = fa_equipment.read_armor_stats(pindex)
--game.get_player(pindex).print(result)--
printout(result, pindex)
script.on_event("read-health-and-armor-stats", function(event)
pindex = event.player_index
if not check_for_player(pindex) then return end
local p = game.get_player(pindex)
local output = { "" }
--Skip blueprint flipping
local hand = game.get_player(pindex).cursor_stack
if hand and hand.valid_for_read and (hand.is_blueprint or hand.is_blueprint_book) then return end
if players[pindex].in_menu then
if players[pindex].menu == "vehicle" then
--Vehicle health and armor equipment stats
local result = fa_equipment.read_armor_stats(pindex, p.opened)
table.insert(output, result)
else
--Player health and armor equipment stats
local result = fa_equipment.read_armor_stats(pindex, nil)
table.insert(output, result)
end
else
if p.vehicle then
--Vehicle health and armor equipment stats
local result = fa_equipment.read_armor_stats(pindex, p.vehicle)
table.insert(output, result)
else
--Player health stats only
local result = fa_equipment.read_shield_and_health_level(pindex, nil)
table.insert(output, result)
end
end
printout(output, pindex)
end)

script.on_event("inventory-read-equipment-list", function(event)
Expand Down Expand Up @@ -8618,6 +8630,37 @@ function set_infinity_chest_filter_by_hand(pindex, ent)
end
end

function set_infinity_pipe_filter_by_hand(pindex, ent)
local stack = game.get_player(pindex).cursor_stack
if stack == nil or stack.valid_for_read == false or stack.valid == false then
--Delete filters
ent.set_infinity_pipe_filter(nil)
return "All filters cleared"
else
--Get the fluid from the barrel in hand
local name = stack.name
local first, last = string.find(name, "-barrel")
if first then
local fluid_name = string.sub(name, 1, first - 1)
local temp = 25
if fluid_name == "water" then
temp = 15
elseif fluid_name == "empty" then
--Special case: Empty barrel sets steam
fluid_name = "steam"
temp = 500
end
if game.fluid_prototypes[fluid_name] then
ent.set_infinity_pipe_filter({ name = fluid_name, temperature = temp, percentage = 1.00, mode = "exactly" })
return "Set filter to fluid in hand"
end
return "Error: Unknown fluid in hand " .. fluid_name
end
return "Error: Not a fluid barrel in hand"
end
return "Error setting fluid"
end

--Feature for typing in coordinates for moving the mod cursor.
function type_cursor_position(pindex)
printout("Enter new co-ordinates for the cursor, separated by a space", pindex)
Expand Down Expand Up @@ -9058,6 +9101,27 @@ function all_ents_are_walkable(pos)
return true
end

script.on_event("console", function(event)
printout("Opened console", pindex)
end)

script.on_event(defines.events.on_console_chat, function(event)
local speaker = game.get_player(event.player_index).name
if speaker == nil or speaker == "" then speaker = "Player" end
local message = event.message
for pindex, player in pairs(players) do
printout(speaker .. " says, " .. message, pindex)
end
end)

script.on_event(defines.events.on_console_command, function(event)
local speaker = game.get_player(event.player_index).name
if speaker == nil or speaker == "" then speaker = "Player" end
for pindex, player in pairs(players) do
printout(speaker .. " commands, " .. event.command .. " " .. event.parameters, pindex)
end
end)

--WIP. This function can be called via the console: /c __FactorioAccess__ regenerate_all_uncharted_spawners() --laterdo fix bugs?
function regenerate_all_uncharted_spawners(surface_in)
local surf = surface_in or game.surfaces["nauvis"]
Expand Down
18 changes: 9 additions & 9 deletions data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@ data:extend({

{
type = "custom-input",
name = "read-character-status",
name = "read-health-and-armor-stats",
key_sequence = "G",
consuming = "none",
},
Expand Down Expand Up @@ -1780,6 +1780,13 @@ data:extend({
consuming = "none",
},

{
type = "custom-input",
name = "console",
key_sequence = "GRAVE",
consuming = "none",
},

{
type = "custom-input",
name = "open-warnings-menu",
Expand Down Expand Up @@ -1902,7 +1909,7 @@ data:extend({
{
type = "custom-input",
name = "set-entity-filter-from-hand",
key_sequence = "CONTROL + LEFTBRACKET",
key_sequence = "ALT + LEFTBRACKET",
consuming = "none",
},

Expand All @@ -1920,13 +1927,6 @@ data:extend({
consuming = "none",
},

{
type = "custom-input",
name = "inventory-read-armor-stats",
key_sequence = "G",
consuming = "none",
},

{
type = "custom-input",
name = "inventory-read-equipment-list",
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "FactorioAccess",
"version": "0.14.0",
"version": "0.14.1",
"title": "Factorio Access Mod",
"author": "Crimso, SirFendi, Gweneph, Austin Hicks",
"homepage": "https://github.com/Factorio-Access/FactorioAccess",
Expand Down
Loading

0 comments on commit b5c8b83

Please sign in to comment.