diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 8bcb7b288..b4160c685 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -114,6 +114,7 @@ const char *mapster32_fullpath; char *testplay_addparam = 0; static char boardfilename[BMAX_PATH], selectedboardfilename[BMAX_PATH]; +extern char levelname[BMAX_PATH]; // in astub.c XXX: clean up this mess!!! static CACHE1D_FIND_REC *finddirs=NULL, *findfiles=NULL, *finddirshigh=NULL, *findfileshigh=NULL; static int32_t numdirs=0, numfiles=0; @@ -142,6 +143,7 @@ typedef struct static int32_t backup_highlighted_map(mapinfofull_t *mapinfo); static int32_t restore_highlighted_map(mapinfofull_t *mapinfo); +static const char *GetSaveBoardFilename(void); /* static char scantoasc[128] = @@ -6656,6 +6658,8 @@ CANCEL: #else _printmessage16("(N)ew, (L)oad, (S)ave, save (A)s, (T)est map, (Q)uit"); #endif + printext16(16*8, ydim-STATUS2DSIZ2-12, editorcolors[15], -1, GetSaveBoardFilename(), 0); + showframe(1); bflushchars(); bad = 1; @@ -6710,6 +6714,7 @@ CANCEL: reset_default_mapstate(); Bstrcpy(boardfilename,"newboard.map"); + ExtLoadMap(boardfilename); #if M32_UNDO map_undoredo_free(); #endif @@ -7054,6 +7059,27 @@ static int32_t ask_above_or_below(void) } #endif +// get the file name of the file that would be written if SaveBoard(NULL, 0) was called +static const char *GetSaveBoardFilename(void) +{ + const char *fn = boardfilename, *f; + + if (pathsearchmode) + f = fn; + else + { + // virtual filesystem mode can't save to directories so drop the file into + // the current directory + f = Bstrrchr(fn, '/'); + if (!f) + f = fn; + else + f++; + } + + return f; +} + // flags: 1:no ExSaveMap (backup.map) and no taglabels saving const char *SaveBoard(const char *fn, uint32_t flags) { diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index d328052ea..4696001ed 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -62,6 +62,7 @@ static int32_t g_fillCurSector = 0; static char g_modDir[BMAX_PATH]; char defsfilename[BMAX_PATH] = "duke3d.def"; +char levelname[BMAX_PATH]; // static char *startwin_labeltext = "Starting Mapster32..."; static char *setupfilename = "mapster32.cfg"; @@ -805,7 +806,7 @@ static void MultiPskyInit(void) void ExtLoadMap(const char *mapname) { int32_t i; - int32_t sky=-1; + int32_t sky=LA; getmessageleng = 0; getmessagetimeoff = 0; @@ -7552,6 +7553,7 @@ static void Keys2d(void) { g_fillCurSector = !g_fillCurSector; message("Fill currently pointed-at sector: %s", ONOFF(g_fillCurSector)); + keystatus[KEYSC_TAB] = 0; } else if (eitherSHIFT) { @@ -11048,11 +11050,15 @@ static void Keys2d3d(void) i = CheckMapCorruption(4, 0); if (i<4) { - SaveBoard(levelname, 0); + Bsprintf(tempbuf, "Save to %s?", levelname); + if (!AskIfSure(tempbuf)) + { + SaveBoard(levelname, 0); - message("Board saved"); - asksave = 0; - lastsave=totalclock; + message("Board saved to %s", levelname); + asksave = 0; + lastsave=totalclock; + } } else message("Map is heavily corrupted, not saving. See OSD for details."); diff --git a/polymer/eduke32/source/mapster32.h b/polymer/eduke32/source/mapster32.h index f0fc3c126..d2275c21f 100644 --- a/polymer/eduke32/source/mapster32.h +++ b/polymer/eduke32/source/mapster32.h @@ -52,7 +52,6 @@ static char autospritehelp=0, autosecthelp=0; static char tempbuf[1024]; static int32_t numsprite[MAXTILES], multisprite[MAXTILES]; static char lo[64]; -static char levelname[BMAX_PATH]; static int16_t curwall=0, curwallnum=0; static int16_t /*cursearchsprite=0,*/ cursearchspritenum=0, cursector_lotag=0, cursectornum=0; static int16_t search_lotag=0,search_hitag=0;