mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 21:21:04 +00:00
- fixed layout issues with Strife's dialogues.
They were using some settings from the option menu which they never should have used to begin with.
This commit is contained in:
parent
be7d6241c2
commit
a1acc4adc4
4 changed files with 15 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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++)
|
||||
|
|
Loading…
Reference in a new issue