From 352d5d098df325d53e07e58ed6d50c059c6a7021 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 7 Aug 2019 20:24:45 +0200 Subject: [PATCH] - fixed mouse coordinate checks when using the generic VGA font with Strife conversations. --- wadsrc/static/zscript/ui/menu/conversationmenu.zs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wadsrc/static/zscript/ui/menu/conversationmenu.zs b/wadsrc/static/zscript/ui/menu/conversationmenu.zs index efa1b10ec..5f62eba31 100644 --- a/wadsrc/static/zscript/ui/menu/conversationmenu.zs +++ b/wadsrc/static/zscript/ui/menu/conversationmenu.zs @@ -93,6 +93,7 @@ class ConversationMenu : Menu int fontScale; int refwidth; int refheight; + double fontfactor; int SpeechWidth; int ReplyWidth; @@ -125,6 +126,7 @@ class ConversationMenu : Menu displayWidth = CleanWidth; displayHeight = CleanHeight; fontScale = CleanXfac; + fontFactor = 1; refwidth = 320; refheight = 200; ReplyWidth = 320-50-10; @@ -137,6 +139,7 @@ class ConversationMenu : Menu { displayFont = NewSmallFont; fontScale = (CleanXfac+1) / 2; + fontFactor = double(CleanXfac) / fontScale; refwidth = 640; refheight = 400; ReplyWidth = 640-100-20; @@ -363,10 +366,12 @@ class ConversationMenu : Menu // convert x/y from screen to virtual coordinates, according to CleanX/Yfac use in DrawTexture x = ((x - (screen.GetWidth() / 2)) / fontScale) + refWidth/2; y = ((y - (screen.GetHeight() / 2)) / fontScale) + refHeight/2; + + int ypos = int(mYpos * FontFactor); - if (x >= 24 && x <= refWidth-24 && y >= mYpos && y < mYpos + fh * mResponseLines.Size()) + if (x >= 24 && x <= refWidth-24 && y >= ypos && y < ypos + fh * mResponseLines.Size()) { - sel = (y - mYpos) / fh; + sel = (y - ypos) / fh; for(int i = 0; i < mResponses.Size(); i++) { if (mResponses[i] > sel)