Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't initialize/alter objects during module loading in Construction.lua #6681

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions lua/ui/game/construction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,6 @@ function setUpgradeAndAllowing(upgradesTo_, allowOthers_)
allowOthers = allowOthers_
end

if options.gui_draggable_queue ~= 0 then
-- Add gameparent handleevent for if the drag ends outside the queue window
local gameParent = import("/lua/ui/game/gamemain.lua").GetGameParent()
local oldGameParentHandleEvent = gameParent.HandleEvent
gameParent.HandleEvent = function(self, event)
if event.Type == 'ButtonRelease' then
import("/lua/ui/game/construction.lua").ButtonReleaseCallback()
end
oldGameParentHandleEvent(self, event)
end
end

local cutA = 0
local cutB = 0
if options.gui_visible_template_names ~= 0 then
Expand Down
10 changes: 10 additions & 0 deletions lua/ui/game/gamemain.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,16 @@ function CreateUI(isReplay)

controls.gameParent = UIUtil.CreateScreenGroup(GetFrame(0), "GameMain ScreenGroup")
gameParent = controls.gameParent
if options.gui_draggable_queue ~= 0 then
-- Add gameparent handleevent for if the drag ends outside the queue window
local oldGameParentHandleEvent = gameParent.HandleEvent
gameParent.HandleEvent = function(self, event)
if event.Type == 'ButtonRelease' then
import("/lua/ui/game/construction.lua").ButtonReleaseCallback()
end
return oldGameParentHandleEvent(self, event)
end
end

controlClusterGroup, statusClusterGroup, mapGroup, windowGroup = import("/lua/ui/game/borders.lua").SetupBorderControl(gameParent)

Expand Down
Loading