diff --git a/src/menu/menu.cpp b/src/menu/menu.cpp index 008f13b55..fa36a9b55 100644 --- a/src/menu/menu.cpp +++ b/src/menu/menu.cpp @@ -56,6 +56,7 @@ #include "scripting/types.h" int DMenu::InMenu; +static ScaleOverrider *CurrentScaleOverrider; // // Todo: Move these elsewhere // @@ -348,7 +349,7 @@ bool DMenu::TranslateKeyboardEvents() // //============================================================================= -void M_StartControlPanel (bool makeSound) +void M_StartControlPanel (bool makeSound, bool scaleoverride) { // intro might call this repeatedly if (CurrentMenu != nullptr) @@ -372,6 +373,7 @@ void M_StartControlPanel (bool makeSound) } BackbuttonTime = 0; BackbuttonAlpha = 0; + if (scaleoverride && !CurrentScaleOverrider) CurrentScaleOverrider = new ScaleOverrider; } //============================================================================= @@ -912,6 +914,8 @@ void M_ClearMenus() CurrentMenu = parent; } menuactive = MENU_Off; + if (CurrentScaleOverrider) delete CurrentScaleOverrider; + CurrentScaleOverrider = nullptr; } //============================================================================= diff --git a/src/menu/menu.h b/src/menu/menu.h index 21b10d785..cabf526ac 100644 --- a/src/menu/menu.h +++ b/src/menu/menu.h @@ -347,7 +347,7 @@ void M_PreviousMenu (); void M_ParseMenuDefs(); void M_StartupEpisodeMenu(FGameStartup *gs); void M_StartupSkillMenu(FGameStartup *gs); -void M_StartControlPanel (bool makeSound); +void M_StartControlPanel (bool makeSound, bool scaleoverride = true); void M_SetMenu(FName menu, int param = -1); void M_StartMessage(const char *message, int messagemode, FName action = NAME_None); DMenu *StartPickerMenu(DMenu *parent, const char *name, FColorCVar *cvar); diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index 6f3bec89b..9dad979eb 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -381,6 +381,7 @@ void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveang I_SetMusicVolume (dlg_musicvolume); S_Sound (npc, CHAN_VOICE|CHAN_NOPAUSE, CurNode->SpeakerVoice, 1, ATTN_NORM); } + M_StartControlPanel(false, true); // Create the menu. This may be a user-defined class so check if it is good to use. FName cls = CurNode->MenuClassName; @@ -405,7 +406,6 @@ void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveang } // And open the menu - M_StartControlPanel (false); M_ActivateMenu((DMenu*)cmenu); menuactive = MENU_OnNoPause; } diff --git a/wadsrc/static/zscript/ui/menu/conversationmenu.zs b/wadsrc/static/zscript/ui/menu/conversationmenu.zs index 1c5043512..76b280578 100644 --- a/wadsrc/static/zscript/ui/menu/conversationmenu.zs +++ b/wadsrc/static/zscript/ui/menu/conversationmenu.zs @@ -82,6 +82,7 @@ class ConversationMenu : Menu PlayerInfo mPlayer; int mSelection; int ConversationPauseTic; + int LineHeight; int SpeechWidth; int ReplyWidth; @@ -107,6 +108,7 @@ class ConversationMenu : Menu ReplyWidth = 320-50-10; SpeechWidth = screen.GetWidth()/CleanXfac - 24*2; + LineHeight = SmallFont.GetHeight(); FormatSpeakerMessage(); return FormatReplies(activereply); @@ -174,8 +176,8 @@ class ConversationMenu : Menu mResponseLines.Push(goodbyestr); // Determine where the top of the reply list should be positioned. - mYpos = MIN (140, 192 - mResponseLines.Size() * OptionMenuSettings.mLinespacing); - i = 44 + mResponseLines.Size() * OptionMenuSettings.mLinespacing; + mYpos = MIN (140, 192 - mResponseLines.Size() * LineHeight); + i = 44 + mResponseLines.Size() * LineHeight; if (mYpos - 100 < i - screen.GetHeight() / CleanYfac / 2) { mYpos = i - screen.GetHeight() / CleanYfac / 2 + 100; @@ -305,7 +307,7 @@ class ConversationMenu : Menu override bool MouseEvent(int type, int x, int y) { int sel = -1; - int fh = OptionMenuSettings.mLinespacing; + int fh = LineHeight; // convert x/y from screen to virtual coordinates, according to CleanX/Yfac use in DrawTexture x = ((x - (screen.GetWidth() / 2)) / CleanXfac) + 160; @@ -382,7 +384,7 @@ class ConversationMenu : Menu virtual void DrawSpeakerText(bool dimbg) { String speakerName; - int linesize = OptionMenuSettings.mLinespacing * CleanYfac; + int linesize = LineHeight * CleanYfac; int cnt = mDialogueLines.Count(); // Who is talking to you? @@ -434,10 +436,10 @@ class ConversationMenu : Menu { // Dim the screen behind the PC's choices. screen.Dim(0, 0.45, (24 - 160) * CleanXfac + screen.GetWidth() / 2, (mYpos - 2 - 100) * CleanYfac + screen.GetHeight() / 2, - 272 * CleanXfac, MIN(mResponseLines.Size() * OptionMenuSettings.mLinespacing + 4, 200 - mYpos) * CleanYfac); + 272 * CleanXfac, MIN(mResponseLines.Size() * LineHeight + 4, 200 - mYpos) * CleanYfac); int y = mYpos; - int fontheight = OptionMenuSettings.mLinespacing; + int fontheight = LineHeight; int response = 0; for (int i = 0; i < mResponseLines.Size(); i++)