Skip to content

Commit

Permalink
Add compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
heinwessels committed Jan 12, 2024
1 parent 9f3209d commit 2495000
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 2.1.10
Date: 2024-1-??
Changes:
- Add compatibility for Better Victory Screen.
---------------------------------------------------------------------------------------------------
Version: 2.1.9
Date: 2024-1-8
Changes:
Expand Down
29 changes: 19 additions & 10 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,28 @@ Event.register(Event.core_events.init, function()
debris_items['copper-plate'] = 50
remote.call('freeplay', 'set_debris_items', debris_items)
end

if remote.interfaces['silo_script'] then
remote.call('silo_script', 'set_no_victory', true)
end
end)

Event.register(defines.events.on_research_finished, function(event)
if global.finished then return end
local tech = event.research
if tech.name == 'pyrrhic' and game.tick ~= 0 then
local force = tech.force
for _, player in pairs(game.connected_players) do
if player.force == force then player.opened = nil end
end
game.set_game_state{
game_finished = true,
player_won = true,
can_continue = true,
victorious_force = force
}

global.finished = true
if remote.interfaces["better-victory-screen"] and remote.interfaces["better-victory-screen"]["trigger_victory"] then
remote.call("better-victory-screen", "trigger_victory", force)
else
game.set_game_state{
game_finished = true,
player_won = true,
can_continue = true,
victorious_force = force
}
end
end
end)

Expand Down Expand Up @@ -234,6 +237,12 @@ end)

Event.register(Event.core_events.init_and_config, function()
global.beacon_interference_icons = global.beacon_interference_icons or {}

for _, interface in pairs{"silo_script", "better-victory-screen"} do
if remote.interfaces[interface] and remote.interfaces[interface]["set_no_victory"] then
remote.call(interface, "set_no_victory", true)
end
end
end)

local function enable_beacon(beacon)
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": "pycoalprocessing",
"version": "2.1.9",
"version": "2.1.10",
"factorio_version": "1.1",
"title": "Pyanodons Coal Processing",
"author": "Pyanodon, Nexela, Kingarthur, notnotmelon, Mootykins, ShadowGlass, Archezekiel, Quintuple",
Expand Down

0 comments on commit 2495000

Please sign in to comment.