Skip to content
Permalink
Browse files

- fixed mouse coordinate checks when using the generic VGA font with …

…Strife conversations.
  • Loading branch information...
coelckers committed Aug 7, 2019
1 parent 3c449f3 commit 352d5d098df325d53e07e58ed6d50c059c6a7021
Showing with 7 additions and 2 deletions.
  1. +7 −2 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)

0 comments on commit 352d5d0

Please sign in to comment.
You can’t perform that action at this time.