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

Add selfaware functions for E2 extensions #2823

Merged
merged 3 commits into from
Nov 12, 2023

Conversation

Denneisk
Copy link
Member

@Denneisk Denneisk commented Nov 3, 2023

Allows users to see the status of extensions on the server. This is like a dynamic form of #ifdef.

This idea came to me because I am trying to write a dependency checker that communicates to the player whether a chip with multiple dependencies will function properly or not.

@Denneisk
Copy link
Member Author

Denneisk commented Nov 3, 2023

If you feel this sort of functionality would be better handled by the preprocessor/directives (not including current #ifdef; that's needlessly complicated for checking if entire extensions are enabled), feel free to defer this as it's a small PR.

@Vurv78
Copy link
Contributor

Vurv78 commented Nov 9, 2023

I mean, I don't see a use for them but I don't see any harm in them existing either. Just a little concerned about it being futureproof in case the way E2 extensions work is changed, but I guess we can just deprecate them at that point.

end

local getExtensionStatus = E2Lib.GetExtensionStatus
__e2setcost(10)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should cost a lot more than getExtensionStatus(s) which just indexes a table, as this has to clone a table which is still a lot of work. Either way you shouldn't be calling it often. I'd say 60 ops would be quite generous considering a lambda call is 15 ops, function call is 10 ops

@Vurv78 Vurv78 merged commit 10731c4 into wiremod:master Nov 12, 2023
1 check passed
@Denneisk Denneisk deleted the selfaware-ext branch November 8, 2024 18:17
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.

2 participants