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

Reject shortcut click when using command #2731

Merged
merged 3 commits into from
Mar 16, 2024
Merged
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
25 changes: 16 additions & 9 deletions luaui/Widgets/dbg_unit_csv_export.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ local function round(num, numDecimalPlaces)
else return math.ceil(num * mult - 0.5) / mult end
end

local function buildTree(conDefID, tree)
local buildOptions = UnitDefs[conDefID].buildOptions
for _, option in ipairs(buildOptions) do
if not tree[option] then
tree[option] = true
if UnitDefs[option].buildOptions then
tree = buildTree(option, tree)
end
end
end

return tree
end

function widget:Initialize()
local file = assert(io.open(filename,'w'), "Unable to save file")

Expand Down Expand Up @@ -85,15 +99,8 @@ function widget:Initialize()
end
end

-- gather all units that any builder has in its buildoptions
local inBuildoptions = {}
for udid, unitDef in pairs(UnitDefs) do
if unitDef.buildOptions then
for id, optionDefID in pairs(unitDef.buildOptions) do
inBuildoptions[optionDefID] = true
end
end
end
local inBuildoptions = buildTree(UnitDefNames["armcom"].id, {})
inBuildoptions = buildTree(UnitDefNames["corcom"].id, inBuildoptions)

for udid, unitDef in pairs(UnitDefs) do
if inBuildoptions[udid] or unitDef.name == 'armcom' or unitDef.name == 'corcom' or unitDef.name == 'legcom' then
Expand Down
2 changes: 1 addition & 1 deletion luaui/Widgets/gui_chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ function widget:DrawScreen()
}
if math_isInRect(x, y, lineArea[1], lineArea[2], lineArea[3], lineArea[4]) then
UiSelectHighlight(lineArea[1]-translatedX, lineArea[2]-translatedY-(lineHeight*checkedLines), lineArea[3]-translatedX, lineArea[4]-translatedY-(lineHeight*checkedLines), nil, (b and 0.33 or 0.23))
if b then
if b and (Spring.GetActiveCommand() > 0) then
-- mapmark highlight
if chatLines[i].coords then
Spring.SetCameraTarget( chatLines[i].coords[1], chatLines[i].coords[2], chatLines[i].coords[3] )
Expand Down