Browse Source

Add xpos scale for chapters panel

ToGLES3
JusicP 3 years ago
parent
commit
94fb7d4c00
  1. 20
      gameui/NewGameDialog.cpp

20
gameui/NewGameDialog.cpp

@ -525,11 +525,23 @@ CNewGameDialog::CNewGameDialog(vgui::Panel *parent, bool bCommentaryMode) : Base
return; return;
} }
int indent = 8;
if ( IsProportional() )
{
indent = scheme()->GetProportionalScaledValueEx( GetScheme(), indent );
}
int wide = 16;
if ( IsProportional() )
{
wide = scheme()->GetProportionalScaledValueEx( GetScheme(), wide );
}
// Layout panel positions relative to the dialog center. // Layout panel positions relative to the dialog center.
int panelWidth = m_ChapterPanels[0]->GetWide() + 16; int panelWidth = m_ChapterPanels[0]->GetWide() + wide;
int dialogWidth = GetWide(); int dialogWidth = GetWide();
m_PanelXPos[2] = ( dialogWidth - panelWidth ) / 2 + 8; m_PanelXPos[2] = ( dialogWidth - panelWidth ) / 2 + indent;
if (m_ChapterPanels.Count() > 1) if (m_ChapterPanels.Count() > 1)
{ {
@ -553,8 +565,8 @@ CNewGameDialog::CNewGameDialog(vgui::Panel *parent, bool bCommentaryMode) : Base
int panelHeight; int panelHeight;
m_ChapterPanels[0]->GetSize( panelWidth, panelHeight ); m_ChapterPanels[0]->GetSize( panelWidth, panelHeight );
m_pCenterBg->SetWide( panelWidth + 16 ); m_pCenterBg->SetWide( panelWidth + wide);
m_pCenterBg->SetPos( m_PanelXPos[2] - 8, m_PanelYPos[2] - (m_pCenterBg->GetTall() - panelHeight) + 8 ); m_pCenterBg->SetPos( m_PanelXPos[2] - indent, m_PanelYPos[2] - (m_pCenterBg->GetTall() - panelHeight) + indent );
m_pCenterBg->SetBgColor( Color( 190, 115, 0, 255 ) ); m_pCenterBg->SetBgColor( Color( 190, 115, 0, 255 ) );
// start the first item selected // start the first item selected

Loading…
Cancel
Save