I am using FlashDevelop to code in AS3. It’s stable, quite feature complete and very lightweight – using it to develop Ninja Cat was pleasure. During that time I learned that it’s possible to create conditional compilation constants, so you can selectively include some pieces of code. Sounds complicated, but it’s just a simplified version of #ifdef macrodefinitions from C language. It’s a simple way of creating traditional debug/release versions of game, but you can also extend it to editor/stats/ads/portal specific versions.
Problem
Unfortunately editing those constants in FlashDevelop is time and labour intensive. If you want to change the value of some of your project compiler constants, you have to:
- click mouse on Project->Properties, or better press ctrl+P
- click mouse on the last tab Compiler options
- click again on the small plus next to Compiler constants
- click on the chosen CONFIG, backspace a few times, write the new value
- because enter doesn’t close the dialog, grab the mouse again and click OK
Now if you forgot to change also some other constant, you have to do the same again. And it’s pretty much the same if you want to check what’s the value of one of those constants.
Seems like a lot of time? It is, especially if you’ve based the configuration of your project on those CONFIGs, you’re using them all day long, testing different builds. And in my case (probably not only in mine) that’s what’s happening – because they’re incredibly useful, allow to quickly change the build of the app in a fundamental way, in an mutually independent way.
Solution
It was so irritating to me, that I’ve developed a plugin! By using it, instead of doing all of this clicking, you can see and modify all the constants readily in a panel next to code. You can easily toggle the value of all compiler constants which have true or false after comma. It strips namespace (part before ::) for more readable display.
As I learned by doing this and releasing this plugin in the wild, quite a lot of people like and say it’s very useful. There were also feature requests to allow editing constants as in text file, or allow editing of configs with numbers, but I’m not using such functionality and don’t have so much time to play with that.
However, this plugin is open source and you can mold it to your liking. Source is very simple and you can get it through GitHub. I created (my first) GitHub repo: https://github.com/Koshmaar/ConfigToggle
License is MIT. If anyone wants to fork/extend this plugin with new features to do that – you’re welcome!
Support is available here in comments or (more preferably) at FlashDevelop forums: http://www.flashdevelop.org/community/viewtopic.php?f=4&t=10943