From ffc7de9911b21e26a37ae31c39976df04a467995 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sat, 24 Jun 2017 09:20:50 +0000 Subject: [PATCH] CON: Add EVENT_DISPLAYOVERHEADMAPTEXT. Set RETURN to any non-zero value to disable hardcoded display of text. If you wish to replace the hardcoded text, you must check that userdef[].overhead_on == 2 yourself. git-svn-id: https://svn.eduke32.com/eduke32@6258 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/events_defs.h | 1 + source/duke3d/src/gamedef.cpp | 1 + source/duke3d/src/screens.cpp | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/duke3d/src/events_defs.h b/source/duke3d/src/events_defs.h index 50e828e5e..3c9d8243e 100644 --- a/source/duke3d/src/events_defs.h +++ b/source/duke3d/src/events_defs.h @@ -122,6 +122,7 @@ enum GameEvent_t { EVENT_DISPLAYACCESS, EVENT_MOVESECTOR, EVENT_MOVEEFFECTORS, + EVENT_DISPLAYOVERHEADMAPTEXT, #ifdef LUNATIC EVENT_ANIMATEALLSPRITES, #endif diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 730f9d6bc..51f3215f6 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -698,6 +698,7 @@ const char *EventNames[MAXEVENTS] = "EVENT_DISPLAYACCESS", "EVENT_MOVESECTOR", "EVENT_MOVEEFFECTORS", + "EVENT_DISPLAYOVERHEADMAPTEXT", #ifdef LUNATIC "EVENT_ANIMATEALLSPRITES", #endif diff --git a/source/duke3d/src/screens.cpp b/source/duke3d/src/screens.cpp index d07a5c351..90ef57542 100644 --- a/source/duke3d/src/screens.cpp +++ b/source/duke3d/src/screens.cpp @@ -1059,7 +1059,9 @@ void G_DisplayRest(int32_t smoothratio) G_RestoreInterpolations(); - if (ud.overhead_on == 2) + int32_t const textret = VM_OnEvent(EVENT_DISPLAYOVERHEADMAPTEXT, g_player[screenpeek].ps->i, screenpeek); + + if (textret == 0 && ud.overhead_on == 2) { const int32_t a = (ud.screen_size > 0) ? 147 : 179; minitext(5, a+6, g_volumeNames[ud.volume_number], 0, 2+8+16+256);