@TDK
Very nice. Very cool idea! The only thing, and I don't know if you are aware of it or not, but DarkEDIT has a similar type of functionality already built in. If you use CTRL+J, a little menu will come up in DarkEDIT where you can choose from a series of predefined code blocks.
You can also add as many of your own blocks of code as you want in whatever way you want the text formatted (i.e. spaced and tabbed) to the menu selection.
I use it all the time. Here's a quick example of using CTRL+J to pull 3 blocks I previously added to the menu: the general program skeleton layout, a move_camera routine, and a modified version of Lee Bamber's matrix normal calculation
remstart
==============================================================
= Title :
= Author :
= Date :
= Update :
= Version:
==============================================================
Comments
==============================================================
remend
rem =============================================================
rem = SET UP DISPLAY
rem =============================================================
autocam off
set display mode 800,600,32
sync on
sync rate 60
rem =============================================================
rem = MAIN
rem =============================================================
do
sync
loop
end
rem =============================================================
rem = SUBROUTINES - PROCEDURES
rem =============================================================
`----------------------------------------------------------------
_move_camera:
move camera (upkey()-downkey())*5
yang#=wrapvalue(camera angle y()+mousemovex())
yrotate camera yang#
return
`----------------------------------------------------------------
rem =============================================================
rem = FUNCTIONS
rem =============================================================
`----------------------------------------------------------------
function calc_mat_normals(mat,tilex,tilez,sizex#,sizez#)
Rem By Lee Bamber From DB Example - Adds shaded areas to matrix to give depth
rem added tile and tile size factor for normal depth adjustment - latch
for z=1 to tilez
for x=1 to tilex
rem Get matrix heights
h8#=get matrix height(mat,x,z-1)
h4#=get matrix height(mat,x-1,z)
h#=get matrix height(mat,x,z)
h2#=get matrix height(mat,x-1,z-1)
rem Calculate projected angle X using heights
x1#=(x-1)*sizex# : y1#=h#
x2#=(x+0)*sizex# : y2#=h4#
dx#=x2#-x1#
dy#=y2#-y1#
ax#=atanfull(dx#,dy#)
ax#=wrapvalue(90-ax#)
rem Calculate projected angle Z using heights
z1#=(z-1)*sizez# : y1#=h2#
z2#=(z+0)*sizez# : y2#=h8#
dz#=z2#-z1#
dy#=y2#-y1#
az#=atanfull(dz#,dy#)
az#=wrapvalue(90-az#)
rem Make normal from projected angle
nx#=sin(ax#)
ny#=cos(ax#)
nz#=sin(az#)
rem Setting matrix normal for smoothness
set matrix normal mat,x,z,nx#,ny#,nz#
next x
next z
update matrix mat
EndFunction
rem =============================================================
rem = DATA STATEMENTS
rem =============================================================
I don't want you to end up wasting your time when the functionality is available in DarkEDIT - CodeKeeper also. But you could make all of the source snippets available so users could use them in DarkEDIT.
The user would have to create a folder in the DarkEDIT156 folder labeled TEMPLATES. Each block of source code would be saved inside TEMPLATES with it's own name. Once in there, restart DarkEDIT, press CTRL+J, and then choose the block of code you want to add where ever the cursor is located.
In the blocks of code stored in TEMPLATES, add a pipe character '|' somwhere in the code and that is where the cursor will jump to when you add that block to DarkEDIT. Useful for adding titles or for position the cursor so you can add or change values.
For example, maybe you want to add data statments. You code block saved in templates might look like:
rem *****************************************
rem * DATA STATEMENTS
rem *****************************************
Data |
Where that little line after Data is the pipe character and the cursor will automatically jump to that point when the block is added using CTRL+J.
Enjoy your day.