|
From: <dsh...@us...> - 2007-04-01 11:24:26
|
Revision: 1168
http://svn.sourceforge.net/crawl-ref/?rev=1168&view=rev
Author: dshaligram
Date: 2007-04-01 04:24:15 -0700 (Sun, 01 Apr 2007)
Log Message:
-----------
Added DGL_NAMED_MACRO_FILE option to make life easier for dgamelaunch to keep
user macro files distinct (paxed).
Modified Paths:
--------------
trunk/crawl-ref/source/AppHdr.h
trunk/crawl-ref/source/acr.cc
trunk/crawl-ref/source/macro.cc
Modified: trunk/crawl-ref/source/AppHdr.h
===================================================================
--- trunk/crawl-ref/source/AppHdr.h 2007-04-01 09:43:54 UTC (rev 1167)
+++ trunk/crawl-ref/source/AppHdr.h 2007-04-01 11:24:15 UTC (rev 1168)
@@ -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
// =========================================================================
Modified: trunk/crawl-ref/source/acr.cc
===================================================================
--- trunk/crawl-ref/source/acr.cc 2007-04-01 09:43:54 UTC (rev 1167)
+++ trunk/crawl-ref/source/acr.cc 2007-04-01 11:24:15 UTC (rev 1168)
@@ -2873,9 +2873,6 @@
cio_init();
- // Load macros
- macro_init();
-
// system initialisation stuff:
textbackground(0);
@@ -2891,6 +2888,9 @@
if (!newc)
restore_game();
+
+ // Load macros
+ macro_init();
game_has_started = true;
Modified: trunk/crawl-ref/source/macro.cc
===================================================================
--- trunk/crawl-ref/source/macro.cc 2007-04-01 09:43:54 UTC (rev 1167)
+++ trunk/crawl-ref/source/macro.cc 2007-04-01 11:24:15 UTC (rev 1168)
@@ -178,8 +178,12 @@
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)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|