gLua syntax highlighting plugin - Updated (17/12/09)

This probably wouldn’t have gotten enough attention as a single post, so I decided to make a new thread instead.

Long story short, I just updated the old plugin with newer functions, and some old missing ones. I added every function from the newest update, and some missing gamemode functions.

Download: http://www.2shared.com/file/10092929/7e72c9b8/gLua_highlighting.html
Fretta Download: http://www.2shared.com/file/10094482/3efc3435/fretta_highlight.html <-- This is basically everything + the fretta hooks, untested though (could care less about fretta)

http://content.screencast.com/users/Ikkah/folders/Jing/media/cefd9f39-4d4e-40ff-a681-16c8c30c4614/2009-12-17_1709.png

Install: Unzip the .rar file in Notepad++/plugins

I will update this thing as much as I can, and if you have any requests for functions that are included in Garry’s Mod, but not in the plugin, post them in this thread. Full credits still go to Garthex.

I absolutely suck at release threads.

Update: 19/12/09

Now should contain ALL of the functions that gLua offers, including the newest enumerations, global functions and whatnot.

Nice.

I was wondering, will you add derma functions as well? Or is that just stupid to do?

Maybe next time. I’m thinking about adding VGUI functions, but it would require everyone to use a single table name (PANEL)

Can’t you automate adding all global and library functions?

I tried outputting all functions in the global table to a usable file, but srcds didn’t really like that.

I did a bunch of functions that way (Place them in a file -> Set file to use gLua syntax -> Add non highlighted functions -> Repeat)

Cool.

Direct Download Mirror: http://garrysload.org/dl/gmod_lua_packed.rar
Nice release, thanks.

Probably wasn’t clear enough on install notes:

You need to install the full plugin (http://code.google.com/p/npp-gmod-lua/) then overwrite the xml file. Also, I didn’t create it, Garthex did, I just modified it.

Tis very nice.

Hmm, it’s a bit slow for me.

I didn’t notice that, but I can’t get the source to the plugin so I wouldn’t know how to optimize it.

[editline]d[/editline]

Oh wait, I can.



                                if (keywords0.InList(s)) {
                                        sc.ChangeState(sID::WORD0);
                                } else if (keywords1.InList(s)) {
                                        sc.ChangeState(sID::WORD1);
                                } else if (keywords2.InList(s)) {
                                        sc.ChangeState(sID::WORD2);
                                } else if (keywords5.InList(s)) {
                                        sc.ChangeState(sID::WORD5);
                                } else if (keywords8.InList(s)) {
                                        sc.ChangeState(sID::WORD8);
                                }


Seems to be the way he does it. Now I’m not that proficient in C++, but I don’t think there’s any possibility of optimization there.

I started a greasemonkey script which adds gmod lua highlighting to [lua] tags.
Never bothered to finish it though.

I’ll probably get round to it one day.

I think you should add all of the Fretta stuff too, like team.SetClass and GM.RoundBased

Gmod Lua needs his own file extension so badly :stuck_out_tongue: (.glua - lol.)

I strongly disagree, considering it’s not a completely different language.

Ageed would be nice also add druma(? Spelling :l) and VGUI Please!

Derma :stuck_out_tongue:

I’ll work on an extended version later.

Thanks for this.

Turns out dear old Garthex had a Lua file that does this, but automatically. Going to do that later (already have the serverside functions, but srcds bitched about quite a few errors. Had to do some hacky shit, still need to mix it with clientside)

[editline]02:19PM[/editline]

Updated again. Check OP.

Seems like none of the highlighting works now, only numbers strings and basic operators get highlighted. I looked at the xml file in config and everything is listed, I tried changing the style but nothing happened.