From e190109c03d73082cd4ef9030d7bfa0a0fd11b5a Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 23 Jan 2010 21:26:07 +0000 Subject: [PATCH] - Made conversation "mini responses" more prominent rather than packing them in with the rest of the generic console output at the top of the screen. SVN r2123 (trunk) --- src/p_conversation.cpp | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index a2840f355..8e32ee8ab 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -57,6 +57,8 @@ #include "g_level.h" #include "d_event.h" #include "doomstat.h" +#include "c_console.h" +#include "sbar.h" // The conversations as they exist inside a SCRIPTxx lump. struct Response @@ -121,6 +123,7 @@ static bool DrawConversationMenu (); static void PickConversationReply (); static void CleanupConversationMenu (); static void ConversationMenuEscaped (); +static void TerminalResponse (const char *str); static FStrifeDialogueNode *CurNode, *PrevNode; static FBrokenLines *DialogueLines; @@ -1067,7 +1070,7 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply // No, you don't. Say so and let the NPC animate negatively. if (reply->QuickNo && isconsole) { - Printf("%s\n", reply->QuickNo); + TerminalResponse(reply->QuickNo); } npc->ConversationAnimation(2); npc->angle = player->ConversationNPCAngle; @@ -1151,7 +1154,7 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply if (replyText != NULL && isconsole) { - Printf("%s\n", replyText); + TerminalResponse(replyText); } // Does this reply alter the speaker's conversation node? If NextNode is positive, @@ -1281,3 +1284,35 @@ void P_ConversationCommand (int netcode, int pnum, BYTE **stream) } } } + +//============================================================================ +// +// TerminalResponse +// +// Similar to C_MidPrint, but lower and colored and sized to match the +// rest of the dialogue text. +// +//============================================================================ + +static void TerminalResponse (const char *str) +{ + if (str != NULL) + { + if (StatusBar != NULL) + { + AddToConsole(-1, str); + AddToConsole(-1, "\n"); + // The message is positioned a bit above the menu choices, because + // merchants can tell you something like this but continue to show + // their dialogue screen. I think most other conversations use this + // only as a response for terminating the dialogue. + StatusBar->AttachMessage(new DHUDMessageFadeOut(SmallFont, str, + float(CleanWidth/2) + 0.4f, float(ConversationMenu.y - 110 + CleanHeight/2), CleanWidth, -CleanHeight, + CR_UNTRANSLATED, 3, 1), MAKE_ID('T','A','L','K')); + } + else + { + Printf("%s\n", str); + } + } +}