View unanswered posts | View active topics It is currently Thu Mar 28, 2024 9:16 pm



Reply to topic  [ 6 posts ] 
 CC Gedit Extension Version 1.0 
Author Message
User avatar

Joined: Wed Sep 09, 2009 3:16 am
Posts: 3032
Location: Somewhere in the universe
Reply with quote
Post CC Gedit Extension Version 1.0
Gedit CC Extension

What is gedit?
Gedit is a simple but useful text editor usually found in GNOME-based linux systems.
It allows you choose from a multitude of different coding styles so it is very useful for all sorts of applications!
It also has variable tab widths and gives you the line number.
More information can be found here: https://projects.gnome.org/gedit/

The most important aspect of gedit is that it runs using gtksourceview.
Thus, you can create extensions for gedit to read new languages or add new functionality.
I haven't added any true cc functionality yet, at this point it's simply an extension to highlight definitions inside of cc .ini files

Generally this extension should help you against any things that are misspelled etc...
You can download the extension here:

Attachment:
File comment: Version 1.0
CCGedit.rar [3.03 KiB]
Downloaded 354 times


Installation:
1. Download gedit for windows here
2. Extract the CCGEditv1.rar into ~/gedit/share/gtksourceview-2.0/language-specs/
3. It will ask you if you want to replace the ini.lang that is present, simply overwrite it
4. You should be able to open any cc .ini and it should automatically recognize the file format and set the set language to .ini

If you're having trouble locating the actual executable, it's in ~/gedit/bin/gedit.exe

Here's a screenshot:
Image

Here's what the colours generally mean:
Defining New Objects Eg: AddActor, AddEmission, Etc
A numerical value, coordinate definitions, None, True, False
Object Classes Eg: MOSRotating, MOpixel, Head
Definitions with an object/class as input
Definitions using numbers or boolean values (the bulk of CC coding)
Anything Referencing external resources
Comments

Known issues:
-----------------------------------------------------
- Anytime any of the variables are used in the name or whatnot they get highlighted as well. This is incredibly annoying but I am not sure how to fix them since in other major programming languages there's usually a " " enclosure or something to that effect which could define is a name or something. CC however does not have anything of the sort.

Version History:
-----------------------------------------------------
Version 1.0: Release

Hopefully you guys find this useful.
Let me know if there's anything I missed and feedback/suggestions are appreciated!


Sun Nov 10, 2013 11:29 am
Profile
User avatar

Joined: Wed Feb 17, 2010 12:07 am
Posts: 1545
Location: That small peaceful place called Hell.
Reply with quote
Post Re: CC Gedit Extension Version 1.0
Very nice but some of the colors for the color code seem dangerously similar.


Mon Nov 11, 2013 1:38 am
Profile
User avatar

Joined: Sun Jan 15, 2012 10:12 pm
Posts: 207
Location: Burrowed, waiting for you to come by.
Reply with quote
Post Re: CC Gedit Extension Version 1.0
Coops wrote:
Very nice but some of the colors for the color code seem dangerously similar.

Yes but the ones that are similar are colored similar and the ones that are in a different category are colored in a different category of similars categories. That said you will most like never see 2 of the same looking colors on one line.


Mon Nov 11, 2013 3:19 am
Profile
User avatar

Joined: Wed Sep 09, 2009 3:16 am
Posts: 3032
Location: Somewhere in the universe
Reply with quote
Post Re: CC Gedit Extension Version 1.0
Coops wrote:
Very nice but some of the colors for the color code seem dangerously similar.


I considered creating a new colour set but that would require me to add an additional step in setting up gedit.
Gedit uses .xml files with the style schemes within and all of my code is based on default ways of defining a colour that is normally associated with said variable.
This means using "def:comment" will look for the "def:comment" style in whichever style file you are currently using in Gedit, thus, universally compatible.

However, if a lot of people think the colours are much too similar I'll write up a style sheet for specific use with this extension.


Mon Nov 11, 2013 4:50 am
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post Re: CC Gedit Extension Version 1.0
This is clever and very thorough, good job putting it together.
dragonxp wrote:
Anytime any of the variables are used in the name or whatnot they get highlighted as well. This is incredibly annoying but I am not sure how to fix them since in other major programming languages there's usually a " " enclosure or something to that effect which could define is a name or something. CC however does not have anything of the sort.
Can you treat = as an escape character or something? I've little knowledge of CC ini but I imagine there would be few or no times when you actually use one of the functions after an equals sign right? And even if you did, it'd probably be fine not to highlight it.


Mon Nov 11, 2013 3:44 pm
Profile
User avatar

Joined: Wed Sep 09, 2009 3:16 am
Posts: 3032
Location: Somewhere in the universe
Reply with quote
Post Re: CC Gedit Extension Version 1.0
The problem with using = as an escape character is that using lines such as AddEmission = MOPixel would not highlight 'MOPIxel'.

Potentially, I could make it so that = after CopyOf, FilePath, PresetName, Description, Etc.. would be an escape character checking CopyOf, etc... before the =.
Not quite sure how I'd go about that though.


Mon Nov 11, 2013 11:01 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.058s | 17 Queries | GZIP : Off ]