Closed rufio72 closed 3 years ago
Would be preferred to keep all the editor code in the one file
ok
It seems to work. The objects can be moved with the mouse. Please do some tests and tell me if you find any problems. The file editor/init.lua has been heavily modified, so at the time of merge you will probably encounter problems.
I would say to keep editor functions with use of the colon, eg; editor:draw()
so that editor related things can be called from within by self
.
Also it's my fault that there is no coding guidelines for this project yet, but i would ask try to avoid camelCasing in vars/functions; i did intend to remove all of those eventually (except the love related functions) for readability.
I would ask to try and avoid use of editor
within the editor code, and instead use self.var
or self:function()
. So it would also mean keeping the functions written as editor:mouseMoveEntity()
instead of editor.mouseMoveEntity()
.
Other than that, there are no code guidelines currently (which is my fault), but ideally i have planned on replacing any camelCasing naming. So those could be better named as editor:moveent
or editor:move_entity
etc
(edit; oops double posted, thought my last comment didn't go through)
ok I modified the file to the new rules. I think the drag and drop is finished. Let me know if there are any further changes or suggestions. I tested it and it seems to work.
See you next
Looks good, great improvement for moving entities about. There's a small bug with the last selected entity getting stuck to the mouse, but i already know what's causing it, i'll fix shortly after merging :+1:
I have separated some files and the drag and drop starts to work. I don't like that the movement is in the file editorMouse.lua, also I would like to separate the various menus and features in different files.
Also I have seen that very often a for loop is run to find the selected entity. I thought to solve this by copying the entity in a variable of the editor. I tested it in keypressed and it works.
It's not finished yet, if you have any suggestions or improvements, write me.