Closed alandoyle95 closed 8 years ago
Have you tried turning it off and on again?
Just to clarify, what would the purpose of having the ID be? Since after a computer/server restart the UI will need to be rebuilt, the ID doesn't provide any persistence.
Also, an aside, the correct place to report this issue is https://github.com/OpenMods/OpenPeripheral-Addons/.
Don't worry about moving the issue, I can cross reference it from the other project. But just for future. Cheers.
sorry about that... and the ID would be used to detect clicking events for an object so that you can just make buttons and not have to use the X and the Y to determine it. it does not even have to be a function per-say, just being able to get the ID when the component is created would be enough. it would add more possibility to terminal glasses programs, and also be able to simplify some code.
my example of the use would basically be scroll bar buttons. to scroll though a list of items on the screen. and the code would be super simple if you could get the component ID, since it gives you what component you clicked on from the event pulled.
Okay, it's been 2 years since I've touched OPA, can you tell me what values are given to you in a pullEvent?
https://gist.github.com/boq/9a098b89ee102cbf1b2b
there is a list :)
here is a list of all of the functions and there DOCS returned after you do addBox
Thanks, it looks like the Drawable object already exposes a getId() function, right next to the delete() function.
Have you tried this?
hmm.. its not in the list of objects returned.. i'll try that now and edit this post with the results..
It's not a property, it's a ScriptCallable function, it might not be visible in the metadata of the object. Please check it and let me know.
ok, im semi smart when it comes to computercraft.. but i still have no idea what you just said. or how i would go about testing that.
Just call getId() on the object returned by addBox (:
ok haha thats what i thought and it returns nil :(
You can call delete on the object?
nope
i should note that im on version 0.3.1 more than likely not the most updated one.
It was foolish of me not to ask for version information first. One moment I'll verify it works at my end.
yea its also my bad that i didnt check to see what the latest version was,
edit - found the change log..
Do you have a date? Because it needs to be newer than Feb 5th this year https://github.com/OpenMods/OpenPeripheral-Addons/commit/6c54fe360ff8e71bc684fcc2a2f7304e5c5030e2
Build 162 or newer
sadly i dont have a build number (using a pre made pack) but seems as though it all got added :D so thank you for your help, i'll just update the mods and then mess around with the new version!
Let me know if updating does not work for you, between now and such time I should be able to actually test OPA. I only started developing again yesterday so no test environment for OP(A/I) yet.
will do!
Yep methods are all there and work :D AWESOME thanks for the help, here is the updated list of methods from addBox if anyone wants it...
I feel like this function should be added.. its a simple one, but i feel its needed.. unless i am wrong.
after you add a component (addBox, addText, addIcon, etc.) it returns an OBJECT of functions related to that component it generates an ID and it is never the same (as far as i can tell after you restart the computer it gets a different one) so i feel like there should be a getID function included in the returned object.
i feel like its a simple function that should have been added in from the start, but im sure that there are reasons it is not in there, but i have not found anyone else that has thought about this or has came up with a way of doing this.. only reason i found it was because im trying to make a stupidly complex terminal glasses program.