Skip to content

Commit 3787689

Browse files
author
Marek Kulik
committed
Implement chat positioning
1 parent 8a73df3 commit 3787689

File tree

5 files changed

+180
-57
lines changed

5 files changed

+180
-57
lines changed

Client/core/CChat.cpp

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,44 @@ void CChat::LoadCVars ( void )
126126
CVARS_GET ( "chat_font", (unsigned int &)Font ); SetChatFont ( (eChatFont)Font );
127127
CVARS_GET ( "chat_nickcompletion", m_bNickCompletion );
128128

129-
float fX, fY;
130-
CVARS_GET ( "chat_pos_x", fX );
131-
CVARS_GET ( "chat_pos_y", fY );
132-
m_vecBackgroundPosition = CVector2D( fX, fY ) * m_pManager->GetResolution();
129+
CVector2D vecResolution = m_pManager->GetResolution();
130+
float fLineDifference = CChat::GetFontHeight ( m_vecScale.fY );
131+
float fRelativeWidth = (m_vecBackgroundSize.fX / vecResolution.fX),
132+
fRelativeHeight = ((m_vecBackgroundSize.fY + fLineDifference * 1.25f) / vecResolution.fY);
133+
134+
int iHorizontal, iVertical;
135+
float fOffsetX, fOffsetY, fPosX, fPosY;
136+
CVARS_GET ( "chat_position_offset_x", fOffsetX );
137+
CVARS_GET ( "chat_position_offset_y", fOffsetY );
138+
CVARS_GET ( "chat_position_horizontal", iHorizontal );
139+
CVARS_GET ( "chat_position_vertical", iVertical );
140+
switch ( iHorizontal )
141+
{
142+
case Chat::Position::Horizontal::RIGHT:
143+
fPosX = 1.0 - fRelativeWidth - fOffsetX;
144+
break;
145+
case Chat::Position::Horizontal::CENTER:
146+
fPosX = (1.0 - fRelativeWidth) / 2 - fOffsetX;
147+
break;
148+
case Chat::Position::Horizontal::LEFT:
149+
default:
150+
fPosX = fOffsetX;
151+
break;
152+
}
153+
switch ( iVertical )
154+
{
155+
case Chat::Position::Vertical::BOTTOM:
156+
fPosY = 1.0 - fRelativeHeight - fOffsetY;
157+
break;
158+
case Chat::Position::Vertical::CENTER:
159+
fPosY = (1.0 - fRelativeHeight) / 2 - fOffsetY;
160+
break;
161+
case Chat::Position::Vertical::TOP:
162+
default:
163+
fPosY = fOffsetY;
164+
break;
165+
}
166+
m_vecBackgroundPosition = CVector2D( fPosX, fPosY ) * vecResolution;
133167
m_pBackground->SetPosition( m_vecBackgroundPosition );
134168

135169
// Modify default chat box to be like 'Transparent' preset

Client/core/CClientVariables.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,10 @@ void CClientVariables::ValidateValues ( void )
241241
ClampValue ( "chat_width", 0.5f, 4.f );
242242
ClampValue ( "chat_line_life", 1000, 120000000 );
243243
ClampValue ( "chat_line_fade_out", 1000, 30000000 );
244-
ClampValue ( "chat_pos_x", 0.0f, 1.0f );
245-
ClampValue ( "chat_pos_y", 0.0f, 1.0f );
244+
ClampValue ( "chat_position_offset_x", 0.0f, 1.0f );
245+
ClampValue ( "chat_position_offset_y", 0.0f, 1.0f );
246+
ClampValue ( "chat_position_horizontal",Chat::Position::Horizontal::LEFT, Chat::Position::Horizontal::RIGHT );
247+
ClampValue ( "chat_position_vertical", Chat::Position::Vertical::TOP, Chat::Position::Vertical::BOTTOM );
246248
ClampValue ( "text_scale", 0.8f, 3.0f );
247249
ClampValue ( "mtavolume", 0.0f, 1.0f );
248250
ClampValue ( "voicevolume", 0.0f, 1.0f );
@@ -288,8 +290,10 @@ void CClientVariables::LoadDefaults ( void )
288290
DEFAULT ( "chat_line_fade_out", 3000 ); // chatbox line fade out time
289291
DEFAULT ( "chat_use_cegui", false ); // chatbox uses cegui
290292
DEFAULT ( "chat_nickcompletion", true ); // chatbox nick completion
291-
DEFAULT ( "chat_pos_x", 0.0125f ); // chatbox relative x position
292-
DEFAULT ( "chat_pos_y", 0.015f ); // chatbox relative y position
293+
DEFAULT ( "chat_position_offset_x", 0.0125f ); // chatbox relative x position offset
294+
DEFAULT ( "chat_position_offset_y", 0.015f ); // chatbox relative y position offset
295+
DEFAULT ( "chat_position_horizontal", Chat::Position::Horizontal::LEFT); // chatbox horizontal position
296+
DEFAULT ( "chat_position_vertical", Chat::Position::Vertical::TOP); // chatbox vertical position
293297
DEFAULT ( "server_can_flash_window", true ); // allow server to flash the window
294298
DEFAULT ( "allow_tray_notifications", true ); // allow scripts to create tray balloon notifications
295299
DEFAULT ( "text_scale", 1.0f ); // text scale

Client/core/CSettings.cpp

Lines changed: 114 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ void CSettings::CreateGUI ( void )
985985
);
986986

987987
// Add a small indent for edit boxes
988-
fIndentX += 20.0f;
988+
fIndentX += 10.0f;
989989

990990
// Cache position and size from color tab panel (for positioning and height)
991991
pColorTabPanel->GetPosition ( vecTemp );
@@ -1006,66 +1006,36 @@ void CSettings::CreateGUI ( void )
10061006
// Layout tab
10071007
CGUITab* pLayoutTab = pChatOptionsPanel->CreateTab ( _("Layout") );
10081008

1009-
pLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pLayoutTab, "X:" ) );
1010-
pLabel->SetPosition ( CVector2D ( 10.0f, 10.0f ) );
1011-
pLabel->GetPosition ( vecTemp );
1012-
pLabel->AutoSize ( );
1013-
pLabel->SetAlwaysOnTop ( true );
1014-
1015-
m_pChatPosX = reinterpret_cast < CGUIEdit* > ( pManager->CreateEdit ( pLayoutTab, "") );
1016-
m_pChatPosX->SetPosition ( CVector2D ( vecTemp.fX + 12.0f, vecTemp.fY - 2.0f ) );
1017-
m_pChatPosX->GetPosition ( vecTemp );
1018-
m_pChatPosX->SetSize ( CVector2D ( 70.0f, 24.0f ) );
1019-
m_pChatPosX->SetAlwaysOnTop ( true );
1020-
1021-
pLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pLayoutTab, "Y:" ) );
1022-
pLabel->SetPosition ( CVector2D ( vecTemp.fX + 75.0f, vecTemp.fY + 2.0f ) );
1023-
pLabel->GetPosition ( vecTemp );
1024-
pLabel->AutoSize ( );
1025-
pLabel->SetAlwaysOnTop ( true );
1026-
1027-
m_pChatPosY = reinterpret_cast < CGUIEdit* > ( pManager->CreateEdit ( pLayoutTab, "") );
1028-
m_pChatPosY->SetPosition ( CVector2D ( vecTemp.fX + 12.0f, vecTemp.fY - 2.0f ) );
1029-
m_pChatPosY->SetSize ( CVector2D ( 70.0f, 24.0f ) );
1030-
m_pChatPosY->SetAlwaysOnTop ( true );
1031-
10321009
pLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pLayoutTab, _("Lines:") ) );
1033-
pLabel->SetPosition ( CVector2D ( 10.0f, vecTemp.fY + fLineSizeY + fLineGapY ) );
1010+
pLabel->SetPosition ( CVector2D ( 10.0f, 10.0f ) );
10341011
pLabel->GetPosition ( vecTemp );
10351012
pLabel->AutoSize ( );
1036-
pLabel->SetAlwaysOnTop ( true );
10371013

10381014
m_pChatLines = reinterpret_cast < CGUIEdit* > ( pManager->CreateEdit ( pLayoutTab, "" ) );
10391015
m_pChatLines->SetPosition ( CVector2D ( vecTemp.fX + fIndentX, vecTemp.fY - 2.0f ) );
10401016
m_pChatLines->SetSize ( CVector2D ( 80.0f, 24.0f ) );
1041-
m_pChatLines->SetAlwaysOnTop ( true );
10421017

10431018
pLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pLayoutTab, _("Scale:") ) );
10441019
pLabel->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY + fLineSizeY + fLineGapY ) );
10451020
pLabel->GetPosition ( vecTemp );
10461021
pLabel->AutoSize ( );
1047-
pLabel->SetAlwaysOnTop ( true );
10481022

10491023
m_pChatScaleX = reinterpret_cast < CGUIEdit* > ( pManager->CreateEdit ( pLayoutTab, "") );
10501024
m_pChatScaleX->SetPosition ( CVector2D ( vecTemp.fX + fIndentX, vecTemp.fY - 2.0f ) );
10511025
m_pChatScaleX->SetSize ( CVector2D ( 35.0f, 24.0f ) );
1052-
m_pChatScaleX->SetAlwaysOnTop ( true );
10531026

10541027
pLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pLayoutTab, "x") );
10551028
pLabel->SetPosition ( CVector2D ( vecTemp.fX + fIndentX + 37.0f, vecTemp.fY + 2.0f ) );
10561029
pLabel->AutoSize ( );
1057-
pLabel->SetAlwaysOnTop ( true );
10581030

10591031
m_pChatScaleY = reinterpret_cast < CGUIEdit* > ( pManager->CreateEdit ( pLayoutTab, "") );
10601032
m_pChatScaleY->SetPosition ( CVector2D ( vecTemp.fX + fIndentX + 45.0f, vecTemp.fY - 2.0f ) );
10611033
m_pChatScaleY->SetSize ( CVector2D ( 35.0f, 24.0f ) );
1062-
m_pChatScaleY->SetAlwaysOnTop ( true );
10631034

10641035
pLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pLayoutTab, _("Width:") ) );
10651036
pLabel->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY + fLineSizeY + fLineGapY ) );
10661037
pLabel->GetPosition ( vecTemp );
10671038
pLabel->AutoSize ( );
1068-
pLabel->SetAlwaysOnTop ( true );
10691039

10701040
m_pChatWidth = reinterpret_cast < CGUIEdit* > ( pManager->CreateEdit ( pLayoutTab, "") );
10711041
m_pChatWidth->SetPosition ( CVector2D ( vecTemp.fX + fIndentX, vecTemp.fY - 2.0f ) );
@@ -1121,6 +1091,68 @@ void CSettings::CreateGUI ( void )
11211091
m_pChatCssText->GetPosition().fY )
11221092
);
11231093
}
1094+
1095+
// Position tab
1096+
float fComboWidth = 100.0f;
1097+
1098+
CGUITab* pPositionTab = pChatOptionsPanel->CreateTab( _("Position") );
1099+
pChatOptionsPanel->SetSelectedTab( pPositionTab );
1100+
1101+
fIndentX = pManager->CGUI_GetMaxTextExtent( "default-normal",
1102+
_("Horizontal:"),
1103+
_("Vertical:"),
1104+
_("X-Offset:"),
1105+
_("Y-Offset:")
1106+
);
1107+
1108+
// Add a small indent for edit boxes
1109+
fIndentX += 10.0f;
1110+
1111+
pLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pPositionTab, _("Horizontal:") ) );
1112+
pLabel->SetPosition ( CVector2D ( 10.0f, 10.0f ) );
1113+
pLabel->GetPosition ( vecTemp );
1114+
pLabel->AutoSize ( );
1115+
1116+
m_pChatHorizontalCombo = reinterpret_cast < CGUIComboBox* > ( pManager->CreateComboBox ( pPositionTab, "" ) );
1117+
m_pChatHorizontalCombo->SetPosition ( CVector2D ( vecTemp.fX + fIndentX, vecTemp.fY - 1.0f ) );
1118+
m_pChatHorizontalCombo->SetSize ( CVector2D ( fComboWidth, 85.0f ) );
1119+
m_pChatHorizontalCombo->AddItem ( _("Left") )->SetData( (void *) Chat::Position::Horizontal::LEFT );
1120+
m_pChatHorizontalCombo->AddItem ( _("Center") )->SetData( (void *) Chat::Position::Horizontal::CENTER );
1121+
m_pChatHorizontalCombo->AddItem ( _("Right") )->SetData( (void *) Chat::Position::Horizontal::RIGHT );
1122+
m_pChatHorizontalCombo->SetReadOnly ( true );
1123+
m_pChatHorizontalCombo->SetSelectedItemByIndex( 0 );
1124+
1125+
pLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pPositionTab, _("Vertical:") ) );
1126+
pLabel->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY + fLineSizeY + fLineGapY ) );
1127+
pLabel->GetPosition ( vecTemp );
1128+
pLabel->AutoSize ( );
1129+
1130+
m_pChatVerticalCombo = reinterpret_cast < CGUIComboBox* > ( pManager->CreateComboBox ( pPositionTab, "" ) );
1131+
m_pChatVerticalCombo->SetPosition ( CVector2D ( vecTemp.fX + fIndentX, vecTemp.fY - 1.0f ) );
1132+
m_pChatVerticalCombo->SetSize ( CVector2D ( fComboWidth, 85.0f ) );
1133+
m_pChatVerticalCombo->AddItem ( _("Top") )->SetData( (void *) Chat::Position::Vertical::TOP );
1134+
m_pChatVerticalCombo->AddItem ( _("Center") )->SetData( (void *) Chat::Position::Vertical::CENTER );
1135+
m_pChatVerticalCombo->AddItem ( _("Bottom") )->SetData( (void *) Chat::Position::Vertical::BOTTOM );
1136+
m_pChatVerticalCombo->SetReadOnly ( true );
1137+
m_pChatVerticalCombo->SetSelectedItemByIndex( 0 );
1138+
1139+
pLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pPositionTab, _("X-Offset:") ) );
1140+
pLabel->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY + fLineSizeY + fLineGapY ) );
1141+
pLabel->GetPosition ( vecTemp );
1142+
pLabel->AutoSize ( );
1143+
1144+
m_pChatOffsetX = reinterpret_cast < CGUIEdit* > ( pManager->CreateEdit ( pPositionTab, "") );
1145+
m_pChatOffsetX->SetPosition ( CVector2D ( vecTemp.fX + fIndentX, vecTemp.fY - 2.0f ) );
1146+
m_pChatOffsetX->SetSize ( CVector2D ( fComboWidth, 24.0f ) );
1147+
1148+
pLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pPositionTab, _("Y-Offset:") ) );
1149+
pLabel->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY + fLineSizeY + fLineGapY ) );
1150+
pLabel->GetPosition ( vecTemp );
1151+
pLabel->AutoSize ( );
1152+
1153+
m_pChatOffsetY = reinterpret_cast < CGUIEdit* > ( pManager->CreateEdit ( pPositionTab, "") );
1154+
m_pChatOffsetY->SetPosition ( CVector2D ( vecTemp.fX + fIndentX, vecTemp.fY - 2.0f ) );
1155+
m_pChatOffsetY->SetSize ( CVector2D ( fComboWidth, 24.0f ) );
11241156

11251157
// Cache position and size from font panel
11261158
m_pPaneChatFont->GetPosition ( vecTemp );
@@ -2905,8 +2937,6 @@ void CSettings::LoadData ( void )
29052937
{
29062938
}
29072939

2908-
CVARS_GET ( "chat_pos_x", strVar ); m_pChatPosX->SetText( strVar.c_str() );
2909-
CVARS_GET ( "chat_pos_y", strVar ); m_pChatPosY->SetText( strVar.c_str() );
29102940
CVARS_GET ( "chat_width", strVar ); m_pChatWidth->SetText ( strVar.c_str () );
29112941
CVARS_GET ( "chat_css_style_text", bVar ); m_pChatCssText->SetSelected ( bVar );
29122942
CVARS_GET ( "chat_css_style_background", bVar ); m_pChatCssBackground->SetSelected ( bVar );
@@ -2920,7 +2950,21 @@ void CSettings::LoadData ( void )
29202950
CVARS_GET ( "chat_line_fade_out", iVar );
29212951
SetMilliseconds ( m_pChatLineFadeout, iVar );
29222952
}
2923-
2953+
2954+
// Chat position
2955+
CVARS_GET ( "chat_position_horizontal", iVar );
2956+
if ( iVar > Chat::Position::Horizontal::RIGHT )
2957+
iVar = Chat::Position::Horizontal::LEFT;
2958+
m_pChatHorizontalCombo->SetSelectedItemByIndex( iVar );
2959+
2960+
CVARS_GET ( "chat_position_vertical", iVar );
2961+
if ( iVar > Chat::Position::Vertical::BOTTOM )
2962+
iVar = Chat::Position::Vertical::TOP;
2963+
m_pChatVerticalCombo->SetSelectedItemByIndex( iVar );
2964+
2965+
CVARS_GET ( "chat_position_offset_x", strVar ); m_pChatOffsetX->SetText( strVar.c_str() );
2966+
CVARS_GET ( "chat_position_offset_y", strVar ); m_pChatOffsetY->SetText( strVar.c_str() );
2967+
29242968
// Interface
29252969
CVARS_GET ( "server_can_flash_window", bVar ); m_pFlashWindow->SetSelected ( bVar );
29262970
CVARS_GET ( "allow_tray_notifications", bVar ); m_pTrayBalloon->SetSelected ( bVar );
@@ -3220,15 +3264,26 @@ void CSettings::SaveData ( void )
32203264
strVar = m_pChatScaleX->GetText () + " " + m_pChatScaleY->GetText ();
32213265
CVARS_SET ( "chat_scale", strVar );
32223266
CVARS_SET ( "chat_lines", m_pChatLines->GetText () );
3223-
CVARS_SET ( "chat_pos_x", m_pChatPosX->GetText () );
3224-
CVARS_SET ( "chat_pos_y", m_pChatPosY->GetText () );
32253267
CVARS_SET ( "chat_width", m_pChatWidth->GetText () );
32263268
CVARS_SET ( "chat_css_style_text", m_pChatCssText->GetSelected () );
32273269
CVARS_SET ( "chat_css_style_background", m_pChatCssBackground->GetSelected () );
32283270
CVARS_SET ( "chat_nickcompletion", m_pChatNickCompletion->GetSelected () );
32293271
CVARS_SET ( "chat_line_life", GetMilliseconds ( m_pChatLineLife ) );
32303272
CVARS_SET ( "chat_line_fade_out", GetMilliseconds ( m_pChatLineFadeout ) );
32313273

3274+
CVARS_SET ( "chat_position_offset_x", m_pChatOffsetX->GetText() );
3275+
CVARS_SET ( "chat_position_offset_y", m_pChatOffsetY->GetText() );
3276+
if ( CGUIListItem* pSelected = m_pChatHorizontalCombo->GetSelectedItem() )
3277+
{
3278+
int iSelected = ( int ) pSelected->GetData();
3279+
CVARS_SET ( "chat_position_horizontal", iSelected );
3280+
}
3281+
if ( CGUIListItem* pSelected = m_pChatVerticalCombo->GetSelectedItem() )
3282+
{
3283+
int iSelected = ( int ) pSelected->GetData();
3284+
CVARS_SET ( "chat_position_vertical", iSelected );
3285+
}
3286+
32323287
// Interface
32333288
CVARS_SET ( "server_can_flash_window", m_pFlashWindow->GetSelected ( ) );
32343289
CVARS_SET ( "allow_tray_notifications", m_pTrayBalloon->GetSelected ( ) );
@@ -3576,13 +3631,31 @@ bool CSettings::OnChatLoadPresetClick( CGUIElement* pElement )
35763631
{
35773632
}
35783633
}
3579-
else if ( strTag == "pos_x" )
3634+
else if ( strTag == "position_horizontal" )
3635+
{
3636+
int iValue;
3637+
pSubNode->GetTagContent ( iValue );
3638+
3639+
if ( iValue >= Chat::Position::Horizontal::LEFT && iValue <= Chat::Position::Horizontal::RIGHT ) {
3640+
m_pChatHorizontalCombo->SetSelectedItemByIndex( iValue );
3641+
}
3642+
}
3643+
else if ( strTag == "position_vertical" )
3644+
{
3645+
int iValue;
3646+
pSubNode->GetTagContent ( iValue );
3647+
3648+
if ( iValue >= Chat::Position::Vertical::TOP && iValue <= Chat::Position::Vertical::BOTTOM ) {
3649+
m_pChatVerticalCombo->SetSelectedItemByIndex( iValue );
3650+
}
3651+
}
3652+
else if ( strTag == "offset_x" )
35803653
{
3581-
m_pChatPosX->SetText ( strValue.c_str () );
3654+
m_pChatOffsetX->SetText ( strValue.c_str () );
35823655
}
3583-
else if ( strTag == "pos_y" )
3656+
else if ( strTag == "offset_y" )
35843657
{
3585-
m_pChatPosY->SetText ( strValue.c_str () );
3658+
m_pChatOffsetY->SetText ( strValue.c_str () );
35863659
}
35873660
else if ( strTag == "width" )
35883661
{

Client/core/CSettings.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,11 @@ class CSettings
293293
CGUIScrollPane* m_pPaneChatFont;
294294
CGUIRadioButton* m_pRadioChatFont [ Chat::Font::MAX ];
295295

296-
CGUIEdit* m_pChatPosX;
297-
CGUIEdit* m_pChatPosY;
296+
CGUIComboBox* m_pChatHorizontalCombo;
297+
CGUIComboBox* m_pChatVerticalCombo;
298+
CGUIEdit* m_pChatOffsetX;
299+
CGUIEdit* m_pChatOffsetY;
300+
298301
CGUIEdit* m_pChatLines;
299302
CGUIEdit* m_pChatScaleX;
300303
CGUIEdit* m_pChatScaleY;

Client/mods/deathmatch/logic/luadefs/CLuaGUIDefs.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3330,8 +3330,10 @@ int CLuaGUIDefs::GUIGetChatboxLayout ( lua_State* luaVM )
33303330
//* chat_input_prefix_color - Returns the color of the input prefix text
33313331
//* chat_input_text_color - Returns the color of the text in the chatbox input
33323332
//* chat_scale - Returns the scale of the text in the chatbox
3333-
//* chat_pos_x - Returns the position of the chatbox on the x axis
3334-
//* chat_pos_y - Returns the position of the chatbox on the y axis
3333+
//* chat_position_offset_x - Returns the position offset of the chatbox on the x axis
3334+
//* chat_position_offset_y - Returns the position offset of the chatbox on the y axis
3335+
//* chat_position_horizontal - Returns the horizontal position of the chatbox
3336+
//* chat_position_vertical - Returns the vertical position of the chatbox
33353337
//* chat_width - Returns the scale of the background width
33363338
//* chat_css_style_text - Returns whether text fades out over time
33373339
//* chat_css_style_background - Returns whether the background fades out over time
@@ -3341,6 +3343,7 @@ int CLuaGUIDefs::GUIGetChatboxLayout ( lua_State* luaVM )
33413343
//* text_scale - Returns text scale
33423344

33433345
CCVarsInterface* pCVars = g_pCore->GetCVars ();
3346+
float iNumber;
33443347
float fNumber;
33453348
pCVars->Get("chat_font", fNumber);
33463349
lua_newtable ( luaVM );
@@ -3352,12 +3355,18 @@ int CLuaGUIDefs::GUIGetChatboxLayout ( lua_State* luaVM )
33523355
pCVars->Get("chat_width", fNumber);
33533356
lua_pushnumber ( luaVM, fNumber );
33543357
lua_setfield ( luaVM, -2, "chat_width" );
3355-
pCVars->Get("chat_pos_x", fNumber);
3358+
pCVars->Get("chat_position_offset_x", fNumber);
33563359
lua_pushnumber ( luaVM, fNumber );
3357-
lua_setfield ( luaVM, -2, "chat_pos_x" );
3358-
pCVars->Get("chat_pos_y", fNumber);
3360+
lua_setfield ( luaVM, -2, "chat_position_offset_x" );
3361+
pCVars->Get("chat_position_offset_y", fNumber);
33593362
lua_pushnumber ( luaVM, fNumber );
3360-
lua_setfield ( luaVM, -2, "chat_pos_y" );
3363+
lua_setfield ( luaVM, -2, "chat_position_offset_y" );
3364+
pCVars->Get("chat_position_horizontal", fNumber);
3365+
lua_pushnumber ( luaVM, fNumber );
3366+
lua_setfield ( luaVM, -2, "chat_position_horizontal" );
3367+
pCVars->Get("chat_position_vertical", fNumber);
3368+
lua_pushnumber ( luaVM, fNumber );
3369+
lua_setfield ( luaVM, -2, "chat_position_vertical" );
33613370
pCVars->Get("chat_css_style_text", fNumber);
33623371
lua_pushnumber ( luaVM, fNumber );
33633372
lua_setfield ( luaVM, -2, "chat_css_style_text" );

0 commit comments

Comments
 (0)