Add xpos scale for chapters panel
This commit is contained in:
parent
3fe04750ab
commit
4fdd5cd3d7
1 changed files with 18 additions and 6 deletions
|
@ -525,11 +525,23 @@ CNewGameDialog::CNewGameDialog(vgui::Panel *parent, bool bCommentaryMode) : Base
|
|||
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.
|
||||
int panelWidth = m_ChapterPanels[0]->GetWide() + 16;
|
||||
int panelWidth = m_ChapterPanels[0]->GetWide() + wide;
|
||||
int dialogWidth = GetWide();
|
||||
|
||||
m_PanelXPos[2] = ( dialogWidth - panelWidth ) / 2 + 8;
|
||||
m_PanelXPos[2] = ( dialogWidth - panelWidth ) / 2 + indent;
|
||||
|
||||
if (m_ChapterPanels.Count() > 1)
|
||||
{
|
||||
|
@ -553,8 +565,8 @@ CNewGameDialog::CNewGameDialog(vgui::Panel *parent, bool bCommentaryMode) : Base
|
|||
|
||||
int panelHeight;
|
||||
m_ChapterPanels[0]->GetSize( panelWidth, panelHeight );
|
||||
m_pCenterBg->SetWide( panelWidth + 16 );
|
||||
m_pCenterBg->SetPos( m_PanelXPos[2] - 8, m_PanelYPos[2] - (m_pCenterBg->GetTall() - panelHeight) + 8 );
|
||||
m_pCenterBg->SetWide( panelWidth + wide);
|
||||
m_pCenterBg->SetPos( m_PanelXPos[2] - indent, m_PanelYPos[2] - (m_pCenterBg->GetTall() - panelHeight) + indent );
|
||||
m_pCenterBg->SetBgColor( Color( 190, 115, 0, 255 ) );
|
||||
|
||||
// start the first item selected
|
||||
|
|
Loading…
Reference in a new issue