Skip to content

Commit

Permalink
Fix multiple signal slots marked as active
Browse files Browse the repository at this point in the history
Fixes #30
  • Loading branch information
Sharparam committed Aug 6, 2023
1 parent 4aa3a4e commit 9357f52
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 0.6.1
Date: 2023-08-06
Bugfixes:
- Fix multiple signal slots being marked as active under certain conditions.
---------------------------------------------------------------------------------------------------
Version: 0.6.0
Date: 2023-08-05
Features:
Expand Down
6 changes: 6 additions & 0 deletions src/scripts/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,9 @@ local function handle_signal_changed(event)
return
end
log:debug("elem changed, slot ", slot, ": ", element.elem_value)
if state.selected_slot_button then
state.selected_slot_button.style = "flib_slot_button_default"
end
state.selected_slot = slot
state.selected_slot_button = element
state.combinator:set_item_slot(slot, signal)
Expand Down Expand Up @@ -477,6 +480,9 @@ local function handle_signal_click(event)
state.signal_value_confirm.enabled = false
end
elseif event.button == defines.mouse_button_type.left and element.elem_value then
if state.selected_slot_button then
state.selected_slot_button.style = "flib_slot_button_default"
end
state.selected_slot = slot
state.selected_slot_button = element
element.style = "flib_selected_slot_button_default"
Expand Down

0 comments on commit 9357f52

Please sign in to comment.