-
Notifications
You must be signed in to change notification settings - Fork 333
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
Objectify EGP #2646
Objectify EGP #2646
Conversation
Add egpobject:toString()
Remove unnecessary code.
Can't forget that I've yet to document every function. |
Genericized EGP object creation functions (will be used later for indexless functions) Add xwl:egpHasObject(xeo) Fixed removed EGP objects not equal to NULL
Method will be removed in a later PR
Would appreciate some eyes on this as I'd like to start refactoring the entirety of EGP after this. |
- Added wirelink:egpCreate, creates an EGP Object prototype that is not initialized - Added egpobject:initialize to initialize EGP Object prototypes - Added xeo:unload(), removes the object while keeping its object intact - Added xeo:isLoaded() to see if object is initialized - Added xeo:egpIndex(n) to set and replace indexes of EGP Objects - Added xeo:egpSize(nn), :egpPos(nn), :egpPos(nnn) to better facilitate moving operations - Added xeo:egpPosAng(), returns vector of x, y, angle - Added xeo:egpPos(nnnn), sets x, y, x2, and y2 for lines - Added xeo:egpSetVertices(...), sets vertices of EGP Object - Added xeo:egpCopy(xeo) to copy one EGP object to another - Added angle to EGP baseObj and baseObj:SetPos - Nodiscard a bunch of functions - Changed EGP.Objects to use lowercase name in most cases - Bug fix for xwl:egpParent(xeoxeo) - Deduplicated some E2Descriptions
I'm getting desperate here so enjoy this lovely content update. |
- Added auto-generated egp<Type>(index, table) constructors, replaces egpCreate - Added xeo:draw/:hide, replaces :initialize/:unload - Moved NULL_EGPOBJECT as a field of EGP - Made EGP:CreateObject() never return nil - Fixed some EGP functions erroneously returning nil - Changed xeo:egpOrderAbove/:egpOrderBelow to use EGP objects instead of index
I feel like all the xeo methods should have the :egp prefix removed / replaced with |
I agree. I was just worried that it would be a bit annoying when translating from indexed EGP to object EGP to have to learn new function names. I'll clean it up since you mentioned it and I already broke that rule. |
Add xeo:parent(), returns parent object Minor fixes and optimizations, chiefly with function returns Remove xeo:egpIndex(n), indexes should be irrelevant Removed redundant xeo:egpObjectType() that I swore I already removed
+Other miscellaneous fixes to make this work.
Fix getMaterial returning entity.
Okay I'll try to stop adding things now. |
Actually I still have one thing left to do but maybe I'll save that for the refactor (add parent object reference to objects). |
Simplify drawing for RoundedBoxOutline Lints
Just ping when its ready. I think we'll have to assume its been tested and will review the code only to make sure everything looks safe. |
No, trust me, I'll end up rewriting a quarter of EGP if I do start. The code is already working and passable. I want to do things slowly in hopes that it makes your job a little easier. |
Massively simplify global pos getting Split getting global vertices into different function Fixed bad egpo indexget Harden EGPObjects against bad inputs Change some small syntax things
+ minor change of local scope
This ready to be looked at again? |
Should be fine now. |
Makes EGP Objects a type,
xeo
oregpobject
.Copies nearly every EGP function to an
xeo:
version.Adds fields (EGP) and methods (
EditObject
,Set
,SetPos
) to EGP Objects to perform specific actions when needed.Polys, PolyOutlines, Lines, and LineStrips now have x, y, and angle and can be set accordingly. Internally this simply translates the vertices.
Simplified a bunch of things related to EGP object position.
EGP Object classes now inherit each other when applicable. Far more extensible and readable this way.
Unique functionality:
EGP Objects can now be created using tables to quickly initialize them.
You can modify EGP Objects in a single operation using
egpobject:modify(table)
.You can use array indexing on EGP Objects to get/set object fields.
With EGP Objects, you can use
egpCopy
between two different screens.You can remove (hide) EGP objects from the screen while still being able to use and update their values.
Test code:
Features (Regression)
Operators