Skip to content

Commit

Permalink
Fix issues with stack/item inputs
Browse files Browse the repository at this point in the history
The new enabling of the numeric mode when expressions are disabled
meant some default flags were taking effect preventing input of
negative numbers.
  • Loading branch information
Sharparam committed Nov 6, 2024
1 parent 6c0cede commit e14eab7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 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: 2.2.1
Date: 2024-11-06
Bugfixes:
- Fix negative inputs not possible when expressions are disabled.
---------------------------------------------------------------------------------------------------
Version: 2.2.0
Date: 2024-11-06
Features:
Expand Down
13 changes: 8 additions & 5 deletions src/scripts/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1798,7 +1798,10 @@ local function create_window(player, entity)
style_mods = { horizontal_align = "right", horizontally_stretchable = false, width = 100 },
lose_focus_on_confirm = true,
clear_and_focus_on_right_click = true,
elem_mods = { numeric = false, text = "0" },
text = "0",
numeric = not enable_expressions,
allow_decimal = false,
allow_negative = true,
handler = {
[defines.events.on_gui_text_changed] = handle_signal_value_changed,
[defines.events.on_gui_confirmed] = handle_signal_value_confirmed
Expand All @@ -1822,10 +1825,10 @@ local function create_window(player, entity)
style_mods = { horizontal_align = "right", horizontally_stretchable = false, width = 100 },
lose_focus_on_confirm = true,
clear_and_focus_on_right_click = true,
elem_mods = {
numeric = not enable_expressions,
text = "0"
},
text = "0",
numeric = not enable_expressions,
allow_decimal = false,
allow_negative = true,
handler = {
[defines.events.on_gui_text_changed] = handle_signal_value_changed,
[defines.events.on_gui_confirmed] = handle_signal_value_confirmed
Expand Down

0 comments on commit e14eab7

Please sign in to comment.