YOLOL copy/paste chip's formatted code

Joined
Aug 24, 2019
Messages
1
#1
Greetings!
I propose to create 2 buttons on the HUD of the code editor interface for copying/pasting code from the clipboard for more convenient reading and editing of code.
We all know, that in the game for each chip will be used up to 20 lines of code, each of which can be edited only individually by user.

Code:
if someVar1 == 1 then :DoorStatus = 1 end // Some comment example
Code:
if :ButtonPressed==1 then :DoorStatus=1 else :DoorStatus= 0 if someVar2 == 3 then :EngineActive= 0 end end
... (other lines of YOLOL chip's code)

The first button, that I propose to add, will copy the code (formatted) from all YOLOL editor lines to the clipboard.
As a result, in the clipboard we get something like:

Code:
// [LINE 1]
if someVar1 == 1 then
    :DoorStatus = 1
end // Some comment example

// [LINE 2]
if :ButtonPressed == 1 then
    :DoorStatus = 1
else
    :DoorStatus = 0
    if someVar2 == 3 then
        :EngineActive = 0
    end
end
As it was written on the wiki, in this form it is much more convenient to work with the code.
After making some changes in any text editor, the user can copy the result to the clipboard
and click in game on the second button, which I propose to add and which will make a reverse convertation
the formatted code and write it to the corresponding lines (comments with "[LINE line_num]" labels are useful for this)
Also, in results, the code will have a more compressed look due to the removing of extra spaces (optional feature)

Code:
if someVar1==1 then :DoorStatus=1 end//Some comment example
Code:
if :ButtonPressed==1 then :DoorStatus=1 else :DoorStatus=0 if someVar2==3 then :EngineActive=0 end end
Alternatively would be ideal , if it is possible to create a button, when clicked on which, a large window of the code editor will appear right in the game
(area of half a screen size or more).
In order to make it more clear, this window can be divided into 20 areas, in each of which there will be a code that corresponds to its line in the chip.
In this case, there will be no need for "[LINE line_num]" labels, etc.
Also, when you try to apply changes, a warning will be issued, if in some field as a result there are too many characters (more than 70).
If there are no problems, then a window will pop up asking user to agree to the changes.

I hope I have not written too much. Thank you for attention.
 
Top