reorder branches for better readability

develop
Myk Taylor 2023-09-03 07:12:41 -07:00
parent b8fc6e210f
commit a2b50a88a5
No known key found for this signature in database
1 changed files with 4 additions and 4 deletions

@ -775,7 +775,9 @@ function PlannerOverlay:onInput(keys)
local filters = get_cur_filters()
local num_filters = #filters
local choose = self.subviews.choose:getOptionValue()
if choose > 0 then
if choose == 0 then
self:place_building(get_placement_data())
else
local bounds = get_selected_bounds()
self:save_placement()
local autoselect = choose == 2
@ -806,7 +808,7 @@ function PlannerOverlay:onInput(keys)
end
end,
on_cancel=function()
for i,scr in pairs(active_screens) do
for _,scr in pairs(active_screens) do
scr:dismiss()
end
df.global.game.main_interface.bottom_mode_selected = df.main_bottom_mode_type.BUILDING_PLACEMENT
@ -820,8 +822,6 @@ function PlannerOverlay:onInput(keys)
active_screens[idx] = selection_screen:show()
end
end
else
self:place_building(get_placement_data())
end
return true
elseif not is_choosing_area() then