Skip to content

Commit 54f30a4

Browse files
authored
Revert "smart_selection: Decouple all modifier from append (#4675)" (#4821)
1 parent f0730a9 commit 54f30a4

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

luaui/Widgets/unit_smart_select.lua

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ local mods = {
3030
idle = false, -- whether to select only idle units
3131
same = false, -- whether to select only units that share type with current selection
3232
deselect = false, -- whether to select units not present in current selection
33-
all = false, -- whether to select without filters and append (backwards compatibility, it's like append+any)
33+
all = false, -- whether to select all units
3434
mobile = false, -- whether to select only mobile units
35-
append = false, -- whether to append units to current selection
36-
any = false, -- whether to select without filters
3735
}
3836
local customFilterDef = ""
3937
local lastMods = mods
@@ -262,19 +260,12 @@ function widget:Update(dt)
262260
and mods.deselect == lastMods[3]
263261
and mods.all == lastMods[4]
264262
and mods.mobile == lastMods[5]
265-
and mods.append == lastMods[6]
266-
and mods.any == lastMods[7]
267263
and customFilterDef == lastCustomFilterDef
268264
then
269265
return
270266
end
271267

272-
lastMods = { mods.idle, mods.same, mods.deselect, mods.all, mods.mobile, mods.append, mods.any }
273-
if mods.all then
274-
-- backwards compatibility
275-
mods.any = true
276-
mods.append = true
277-
end
268+
lastMods = { mods.idle, mods.same, mods.deselect, mods.all, mods.mobile }
278269
lastCustomFilterDef = customFilterDef
279270

280271
-- Fill dictionary for set comparison
@@ -349,7 +340,7 @@ function widget:Update(dt)
349340
end
350341
mouseSelection = tmp
351342

352-
elseif selectBuildingsWithMobile == false and mods.any == false and mods.deselect == false then
343+
elseif selectBuildingsWithMobile == false and mods.all == false and mods.deselect == false then
353344
-- only select mobile units, not buildings
354345
local mobiles = false
355346
for i = 1, #mouseSelection do
@@ -403,7 +394,7 @@ function widget:Update(dt)
403394
selectedUnits = newSelection
404395
spSelectUnitArray(selectedUnits)
405396

406-
elseif mods.append then -- append units inside selection rectangle to current selection
397+
elseif mods.all then -- append units inside selection rectangle to current selection
407398
spSelectUnitArray(newSelection)
408399
spSelectUnitArray(mouseSelection, true)
409400
selectedUnits = Spring.GetSelectedUnits()

luaui/configs/hotkeys/chat_and_ui_keys.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ bind Alt+backspace fullscreen
1515
// common selectbox keys
1616
bind Any+sc_z selectbox_same // select only units that share type with current selection modifier | Smart Select Widget
1717
bind Any+space selectbox_idle // select only idle units modifier | Smart Select Widget
18-
bind Any+shift selectbox_append // append to selection modifier | Smart Select Widget
19-
bind Any+shift selectbox_any // select all units modifier | Smart Select Widget
18+
bind Any+shift selectbox_all // select all units modifier | Smart Select Widget
2019
bind Any+ctrl selectbox_deselect // remove units from current selection modifier | Smart Select Widget
2120
bind Any+alt selectbox_mobile // select only mobile units modifier | Smart Select Widget
2221

0 commit comments

Comments
 (0)