Teaching monkey to use local config files

Monkey Forums/Monkey Programming/Teaching monkey to use local config files

AdamRedwoods(Posted 2011) [#1]
I think each app you create should check for a local configuration file.

For example, Android, if you have several different apps going on, the CONFIG.TXT would be useful to have in a local folder rather than in an obscure place. Makes sense right? Heres a mod below that will check for a local CONFIG, but if it doesn't find one, it will use the standard CONFIG.

FOR ANDROID:
Here's the mod to TARGETS/android.monkey you'll need to make, then rebuild trans.monkey and copy the resulting build into you BIN folder.


Not sure why this isn't the way it is now. Also I'm sure this could be applied to other targets that need to have their own settings local.

(ie. for flash it could copy over and overwrite monkeygame.html to the build folder if there was a file found locally.)


therevills(Posted 2011) [#2]
Why is it in an "obscure" place now? Its only in yourproject.build/android folder...


AdamRedwoods(Posted 2011) [#3]
Why couldn't it be where the other .monkey files are? Seems logical to me.

I tend to feel that .build folder is off limits, as it tends to get overwritten.

Sometimes if there are problems (especially when updating monkey), it's a good idea to delete the .build folder anyways and rebuild. This has happened to me often enough that I don't keep anything in the .build folder that can't be remade.


therevills(Posted 2011) [#4]
Nah build folder is not off limits, its where the fun is :)

When you develop for Android you are going to have to go in there to change your icons, your manifest and other bits and pieces.

BTW I'm not saying what you have done is bad or wrong in any way - I actually like it and I think I'm going to use it - Thanks! :)