mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-30 16:00:55 +00:00
- fixed mouse coordinate checks when using the generic VGA font with Strife conversations.
This commit is contained in:
parent
3c449f3908
commit
352d5d098d
1 changed files with 7 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue