Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
notnotmelon committed Nov 26, 2023
1 parent f208be3 commit 594e434
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 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.9
Date: ?
Changes:
- Fixed a crash when configuring AMFM beacons (https://github.com/pyanodon/pybugreports/issues/349)
---------------------------------------------------------------------------------------------------
Version: 2.1.8
Date: 2023-11-21
Changes:
Expand Down
5 changes: 3 additions & 2 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Event.register(defines.events.on_gui_opened, function(event)
dial.add(
{
type = "button",
name = "radio_confirm",
name = "py_beacon_confirm",
caption = "CONFIRM"
}
)
Expand Down Expand Up @@ -298,10 +298,11 @@ local function beacon_check(beacon, reciver, killed)
end

Event.register(defines.events.on_gui_click, function(event)
if event.element.name ~= "radio_confirm" then return end
if event.element.name ~= "py_beacon_confirm" then return end

local GO = event.element
local beacon = game.players[event.player_index].opened
if not beacon then return end
local beacon_name_prefix = string.match(beacon.name, "diet") and "diet-beacon-AM" or "beacon-AM"
local beacon_name = beacon_name_prefix .. GO.parent.AM_flow.AM.slider_value .. "-FM" .. GO.parent.FM_flow.FM.slider_value
if beacon.name == beacon_name then return end
Expand Down

0 comments on commit 594e434

Please sign in to comment.