diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-01 11:24:15 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-01 11:24:15 +0000 |
commit | 0f4b2b185f31ebaf18f9d1bb0de8d8fd364cdaa8 (patch) | |
tree | 395e025414af3b23d74ed2b90ef433326c97f19c | |
parent | d758cad3c69be5d4235119153a592018dbedfbd4 (diff) | |
download | crawl-ref-0f4b2b185f31ebaf18f9d1bb0de8d8fd364cdaa8.tar.gz crawl-ref-0f4b2b185f31ebaf18f9d1bb0de8d8fd364cdaa8.zip |
Added DGL_NAMED_MACRO_FILE option to make life easier for dgamelaunch to keep
user macro files distinct (paxed).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1168 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/AppHdr.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/acr.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/macro.cc | 6 |
3 files changed, 10 insertions, 4 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h index e7d4529dbb..3de9c17a70 100644 --- a/crawl-ref/source/AppHdr.h +++ b/crawl-ref/source/AppHdr.h @@ -225,6 +225,8 @@ // Record where players are currently. #define DGL_WHEREIS + // Uses <playername>-macro.txt as the macro file if uncommented. + // #define DGL_NAMED_MACRO_FILE #endif // ========================================================================= diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index d293ea9066..d083f087c8 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -2873,9 +2873,6 @@ static bool initialise(void) cio_init(); - // Load macros - macro_init(); - // system initialisation stuff: textbackground(0); @@ -2891,6 +2888,9 @@ static bool initialise(void) if (!newc) restore_game(); + + // Load macros + macro_init(); game_has_started = true; diff --git a/crawl-ref/source/macro.cc b/crawl-ref/source/macro.cc index 6a4783519f..3a14a0c4ef 100644 --- a/crawl-ref/source/macro.cc +++ b/crawl-ref/source/macro.cc @@ -178,8 +178,12 @@ static std::string get_macro_file() if (dir[dir.length() - 1] != FILE_SEPARATOR) dir += FILE_SEPARATOR; } - + +#ifdef DGL_NAMED_MACRO_FILE + return (dir + strip_filename_unsafe_chars(you.your_name) + "-macro.txt"); +#else return (dir + "macro.txt"); +#endif } static void buf2keyseq(const char *buff, keyseq &k) |