Maidens of the Kaleidoscope

~Hakurei Shrine~ => Rika and Nitori's Garage Experiments => Topic started by: Sakuya Izayoi on August 20, 2010, 02:04:41 PM

Title: Danmakufu Function Highlighting for Notepad++
Post by: Sakuya Izayoi on August 20, 2010, 02:04:41 PM
I recently went into a strange mood and created a custom Notepad++ language that highlights every function for Danmakufu, and includes some nice highlighting of numbers, strings, and comments.

Screenshot:

(http://lh3.ggpht.com/_DZDLSySN9Sk/TG6R3E-08FI/AAAAAAAAAGg/svIZ20vWxZs/s640/Capture.PNG)

Danmakufu initializations with # and comments are in green.

Basic functions are in purple.
Graphic and Sound related functions are in sea-green.
Basic loop and ifs, whiles, lets, are in blue, as well as math operations.
Get information functions and math functions like sin() are in maroon
Numbers are in orange and strings are highlighted, and you can escape strings using /.

Folders were implemented (and remain in the language) but I removed them because they disabled NPP's default bracket pointing.

And now for the download. Just open View -> User Defined Dialogue and Import the .xml.

http://www.mediafire.com/?86ywgd9zvuwarb3 (http://www.mediafire.com/?86ywgd9zvuwarb3)
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: Doll.S CUBE on August 20, 2010, 02:07:20 PM
I'd like that, I have a hard time remembering the code so that should be helpful.
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: Sakuya Izayoi on August 20, 2010, 02:36:36 PM
EDIT: Moved info and link to first post.
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: Kyaksa on August 20, 2010, 04:16:19 PM
if this makes it easier to learn danmakufu I will forever be in your debt
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: Sakuya Izayoi on August 20, 2010, 04:20:40 PM
if this makes it easier to learn danmakufu I will forever be in your debt

It should at least cut down the frustration caused by forgetting to capitalize some random letter in a function. I've had that happen to me so many times.
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: Mr. Blue on August 20, 2010, 09:17:29 PM
Yes! Please continue working on this program. Danmakufu needs something like this and it's a pain to have to keep going to danmakufu wiki just to work on something. Good Luck!
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: DarkOverord on August 20, 2010, 09:32:43 PM
Even though there's a new version, it's currently not usable, I..e. it's actually Alpha stage :V I'd love this personally!
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: Sakuya Izayoi on August 20, 2010, 11:28:34 PM
Now I only wish that Notepad++ would let you create custom syntaxes for each individual function. i.e. Typing in CreateShot01 and it would show you all the parameters necessary for the function. AFAIK this hasn't been implemented, even for officially supported languages.

If it was then it would take a while to enter each parameter in manually. They should implement an .XML importing system for parameters so I can download the wiki page and write a perl script to sort everything out.

AWESOME EDIT: I just checked SourceForge and found out that function AutoComplete does exist for User Defined Languages. It's an .XML file wil the title of the language (東方弾幕風.xml) put right in NPP's API folder. I will begin creating this file that will actually SHOW you what parameters you need as soon as you begin typing a function.

Code: [Select]
CreateShot01(
       [x,y,speed,angle,graphic,delay] <-A little tooltip to make you life easier.
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: DarkOverord on August 21, 2010, 04:01:12 PM
AWESOME EDIT: I just checked SourceForge and found out that function AutoComplete does exist for User Defined Languages. It's an .XML file wil the title of the language (東方弾幕風.xml) put right in NPP's API folder. I will begin creating this file that will actually SHOW you what parameters you need as soon as you begin typing a function.

Code: [Select]
CreateShot01(
       [x,y,speed,angle,graphic,delay] <-A little tooltip to make you life easier.
Oh man! That is the best thing ever, I regularly forget what order they go in O:
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: Doll.S CUBE on August 21, 2010, 05:07:11 PM
That definitely help :)
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: Sakuya Izayoi on August 21, 2010, 07:02:08 PM
(http://lh6.ggpht.com/_DZDLSySN9Sk/THAiPA41NMI/AAAAAAAAANY/9uvohBHvexU/s576/yay.png)

SUCCESS!

Now all I need to do is import EVERY single set of function prototypes from the wiki. For now I'm going to do the Bullet Control Functions by hand and maybe see if I can make a perl script to automate it.

OMGEdit: Wow Notepad++ wants everything sorted in alphabetical order. All 300 something functions.  :o
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: Doll.S CUBE on August 21, 2010, 07:49:22 PM
This makes me cry of happiness.
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: Sakuya Izayoi on August 21, 2010, 08:44:30 PM
Well now I imported every function into the XML file, but right now it doesn't seem to be working anymore. It might be because I haven't put the parameters for EVERYTHING yet, and Notepad++ want's it's XML made PERFECTLY.

I'm going to ask at the NPP Wiki forums and I'll pace myself with defining these functions. There are 334 in total, and I'll probably go 20 a day, but it will most likely be erratic because I'm currently on vacation in Italy. I return to the USA the 1st of September and school doesn't start until the 20th.
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: Drake on August 21, 2010, 09:18:20 PM
It should be easy enough to have a macro sort the functions in alphabetical order for you. But yeah, this is fucking amazing. Godspeed to you, good sir.
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: Schezo on August 22, 2010, 01:28:53 AM
This is so awesome and it really helps in my scripting!  Thank you!
Title: Notepad++ ~ Danmakufu Function Highlighter and Descriptors
Post by: Sakuya Izayoi on August 22, 2010, 06:13:08 PM
Status Update: I have confirmed with the NPP forums and with a small experiment that I am formatting this file correctly. I removed every function that I haven't described yet, closed off all XML tags, and everything is running smoothly.

The only little dings in this thing have to do with functions and their return values. You can input what values the function returns into the tooltip, but it looks a little awkward. I am generally only doing this for functions that only return values (e.g. GetPlayerX) and functions that return non-integer values.

Some other tooltips might look wierd as they require no parameters (GetAngleToPlayer), but I will give each and every function a description, so you don't need the wiki if you discover a function that you are not quite sure what does.
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: Elementoid on September 03, 2010, 01:18:21 AM
Bleghhh. This looks really useful and I want to use it, but I'm not sure what it means to import an XML files or how to go about doing it. I opened the "user-defined" dialog but it's not letting me interact with it at all.

Halp?  :ohdear:
Title: Re: Danmakufu Function Highlighting for Notepad++
Post by: Schezo on September 03, 2010, 01:28:05 AM
Assuming that you imported it correctly, go to the language button at the top.  Near the bottom should be the code for the Danmakufu highlighter.