Skip to content

Conversation

@clyfordv
Copy link
Contributor

Description of the proposed changes

Annotates functions and squashes errors in orders.lua w/ small changes to related files.

Branched from: #6557

@Garanas
Copy link
Member

Garanas commented Nov 27, 2024

It appears that #6557 was merged in with an invalid snippet format. It states feature instead of features, my mistake for approving.

@clyfordv
Copy link
Contributor Author

Yoink. Not totally clean, but I'll fix it in this PR instead of making a new one?

@lL1l1
Copy link
Contributor

lL1l1 commented Dec 9, 2024

@clyfordv Is it okay with you if I rebase and force push this branch? It will make reviewing it easier for me since it will get rid of the commits you branched off from.

@lL1l1 lL1l1 force-pushed the OrdersLuaAnnotations branch from 23c6f7b to e30b8fa Compare March 1, 2025 08:04
Copy link
Contributor

@lL1l1 lL1l1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clyfordv I went through the PR and wrote suggestions for the PR in clyfordv#2 since they covered quite some details. If you could review the suggestions over there and merge it in then I can approve this one.

---@class UserUnit: InternalObject
---@field ThreadUnpause? thread
---@field ThreadUnpauseCandidates? table<EntityId, boolean>
---@field Dead boolean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value only exists for the Sim Unit. The references to it in orders.lua are from a large engine-call refactor in 63e81c4, which caught the User version of IsDead.

Suggested change
---@field Dead boolean

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the PR with the suggestions*


--- Creates a sim callback to set the priorities of the selected units
---@param prioritiesString string A string of categories
---@param prioritiesString string | number A string of categories
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I address this more extensively in #6680, but it suffices to fix the warnings in order.lua.

Comment on lines +189 to 191
---@param variable string
---@param value string
local function IsToggleMode(unitList, variable, value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too ambiguous so I fixed it.
The return value was also missing, and I fixed that too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the PR with the suggestions*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants