@@ -1180,18 +1180,21 @@ void CSettings::CreateGUI ( void )
1180
1180
**/
1181
1181
vecTemp = CVector2D ( 12 .f , 12 .f );
1182
1182
float fComboWidth = 170 .f ;
1183
+ float fHeaderHeight = 20 ;
1184
+ float fLineHeight = 27 ;
1183
1185
1184
1186
// Misc section label
1185
1187
m_pAdvancedMiscLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, _ (" Misc" ) ) );
1186
1188
m_pAdvancedMiscLabel->SetPosition ( CVector2D ( vecTemp.fX , vecTemp.fY ) );
1187
1189
m_pAdvancedMiscLabel->SetFont ( " default-bold-small" );
1188
1190
m_pAdvancedMiscLabel->AutoSize ( );
1189
- vecTemp.fY += 20 ;
1191
+ vecTemp.fY += fHeaderHeight ;
1190
1192
1191
1193
fIndentX = pManager->CGUI_GetMaxTextExtent ( " default-normal" ,
1192
1194
_ (" Fast CJ clothes loading:" ),
1193
1195
_ (" Browser speed:" ),
1194
1196
_ (" Single connection:" ),
1197
+ _ (" Packet tag:" ),
1195
1198
_ (" Fullscreen mode:" ),
1196
1199
_ (" Process priority:" ),
1197
1200
_ (" Debug setting:" ),
@@ -1214,7 +1217,7 @@ void CSettings::CreateGUI ( void )
1214
1217
m_pFastClothesCombo->AddItem ( _ (" On" ) )->SetData ( (void *)CMultiplayer::FAST_CLOTHES_ON );
1215
1218
m_pFastClothesCombo->AddItem ( _ (" Auto" ) )->SetData ( (void *)CMultiplayer::FAST_CLOTHES_AUTO );
1216
1219
m_pFastClothesCombo->SetReadOnly ( true );
1217
- vecTemp.fY += 29 ;
1220
+ vecTemp.fY += fLineHeight ;
1218
1221
1219
1222
// Browser scan speed
1220
1223
m_pBrowserSpeedLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, _ (" Browser speed:" ) ) );
@@ -1241,7 +1244,20 @@ void CSettings::CreateGUI ( void )
1241
1244
m_pSingleDownloadCombo->AddItem ( _ (" Default" ) )->SetData ( (void *)0 );
1242
1245
m_pSingleDownloadCombo->AddItem ( _ (" On" ) )->SetData ( (void *)1 );
1243
1246
m_pSingleDownloadCombo->SetReadOnly ( true );
1244
- vecTemp.fY += 29 ;
1247
+ vecTemp.fY += fLineHeight ;
1248
+
1249
+ // Packet tag
1250
+ m_pPacketTagLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, _ (" Packet tag:" ) ) );
1251
+ m_pPacketTagLabel->SetPosition ( CVector2D ( vecTemp.fX , vecTemp.fY ) );
1252
+ m_pPacketTagLabel->AutoSize ( );
1253
+
1254
+ m_pPacketTagCombo = reinterpret_cast < CGUIComboBox* > ( pManager->CreateComboBox ( pTabAdvanced, " " ) );
1255
+ m_pPacketTagCombo->SetPosition ( CVector2D ( vecTemp.fX + fIndentX , vecTemp.fY - 1 .0f ) );
1256
+ m_pPacketTagCombo->SetSize ( CVector2D ( fComboWidth , 95 .0f ) );
1257
+ m_pPacketTagCombo->AddItem ( _ (" Default" ) )->SetData ( (void *)0 );
1258
+ m_pPacketTagCombo->AddItem ( _ (" On" ) )->SetData ( (void *)1 );
1259
+ m_pPacketTagCombo->SetReadOnly ( true );
1260
+ vecTemp.fY += fLineHeight ;
1245
1261
1246
1262
// Fullscreen mode
1247
1263
m_pFullscreenStyleLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, _ (" Fullscreen mode:" ) ) );
@@ -1255,7 +1271,7 @@ void CSettings::CreateGUI ( void )
1255
1271
m_pFullscreenStyleCombo->AddItem ( _ (" Borderless window" ) )->SetData ( (void *)FULLSCREEN_BORDERLESS );
1256
1272
m_pFullscreenStyleCombo->AddItem ( _ (" Borderless keep res" ) )->SetData ( (void *)FULLSCREEN_BORDERLESS_KEEP_RES );
1257
1273
m_pFullscreenStyleCombo->SetReadOnly ( true );
1258
- vecTemp.fY += 29 ;
1274
+ vecTemp.fY += fLineHeight ;
1259
1275
1260
1276
// Process priority
1261
1277
m_pPriorityLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, " Process priority:" ) );
@@ -1287,7 +1303,7 @@ void CSettings::CreateGUI ( void )
1287
1303
m_pDebugSettingCombo->AddItem ( " #0000 Joystick" )->SetData ( (void *)EDiagnosticDebug::JOYSTICK_0000 );
1288
1304
m_pDebugSettingCombo->AddItem ( " #0000 Lua trace" )->SetData ( (void *)EDiagnosticDebug::LUA_TRACE_0000 );
1289
1305
m_pDebugSettingCombo->SetReadOnly ( true );
1290
- vecTemp.fY += 29 ;
1306
+ vecTemp.fY += fLineHeight ;
1291
1307
1292
1308
m_pDebugSettingCombo->SetText ( _ (" Default" ) );
1293
1309
SetApplicationSetting ( " diagnostics" , " debug-setting" , " none" );
@@ -1317,7 +1333,7 @@ void CSettings::CreateGUI ( void )
1317
1333
m_pStreamingMemoryMaxLabel->SetPosition ( CVector2D ( vecTemp.fX + vecSize.fX + 5 .0f , vecTemp.fY ) );
1318
1334
m_pStreamingMemoryMaxLabel->AutoSize ( );
1319
1335
vecTemp.fX = 22 .f ;
1320
- vecTemp.fY += 29 ;
1336
+ vecTemp.fY += fLineHeight ;
1321
1337
1322
1338
// Windows 8 compatibility
1323
1339
m_pWin8Label = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, _ (" Windows 8 compatibility:" ) ) );
@@ -1333,7 +1349,7 @@ void CSettings::CreateGUI ( void )
1333
1349
m_pWin8MouseCheckBox = reinterpret_cast < CGUICheckBox* > ( pManager->CreateCheckBox ( pTabAdvanced, _ (" Mouse fix" ) ) );
1334
1350
m_pWin8MouseCheckBox->SetPosition ( CVector2D ( vecTemp.fX + fIndentX , vecTemp.fY - 1 .0f ) );
1335
1351
m_pWin8MouseCheckBox->AutoSize ( NULL , 20 .0f );
1336
- vecTemp.fY += 29 ;
1352
+ vecTemp.fY += fLineHeight ;
1337
1353
vecTemp.fX -= 110 ;
1338
1354
1339
1355
if ( GetApplicationSetting ( " os-version" ) < " 6.2" )
@@ -1342,7 +1358,7 @@ void CSettings::CreateGUI ( void )
1342
1358
m_pWin8Label->SetVisible ( false );
1343
1359
m_pWin8ColorCheckBox->SetVisible ( false );
1344
1360
m_pWin8MouseCheckBox->SetVisible ( false );
1345
- vecTemp.fY -= 29 ;
1361
+ vecTemp.fY -= fLineHeight ;
1346
1362
#endif
1347
1363
}
1348
1364
@@ -1351,7 +1367,7 @@ void CSettings::CreateGUI ( void )
1351
1367
m_pAdvancedUpdaterLabel->SetPosition ( CVector2D ( vecTemp.fX - 10 .0f , vecTemp.fY ) );
1352
1368
m_pAdvancedUpdaterLabel->SetFont ( " default-bold-small" );
1353
1369
m_pAdvancedUpdaterLabel->AutoSize ( _ (" Auto updater" ) );
1354
- vecTemp.fY += 20 ;
1370
+ vecTemp.fY += fHeaderHeight ;
1355
1371
1356
1372
// UpdateAutoInstall
1357
1373
m_pUpdateAutoInstallLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, _ (" Install important updates:" ) ) );
@@ -1364,7 +1380,7 @@ void CSettings::CreateGUI ( void )
1364
1380
m_pUpdateAutoInstallCombo->AddItem ( _ (" Off" ) )->SetData ( (void *)0 );
1365
1381
m_pUpdateAutoInstallCombo->AddItem ( _ (" Default" ) )->SetData ( (void *)1 );
1366
1382
m_pUpdateAutoInstallCombo->SetReadOnly ( true );
1367
- vecTemp.fY += 29 ;
1383
+ vecTemp.fY += fLineHeight ;
1368
1384
1369
1385
// Update build type
1370
1386
m_pUpdateBuildTypeLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, _ (" Update build type:" ) ) );
@@ -1386,11 +1402,11 @@ void CSettings::CreateGUI ( void )
1386
1402
m_pButtonUpdate->AutoSize ( NULL , 20 .0f , 8 .0f );
1387
1403
m_pButtonUpdate->SetClickHandler ( GUI_CALLBACK ( &CSettings::OnUpdateButtonClick, this ) );
1388
1404
m_pButtonUpdate->SetZOrderingEnabled ( false );
1389
- vecTemp.fY += 29 ;
1405
+ vecTemp.fY += fLineHeight ;
1390
1406
vecTemp.fX -= fComboWidth + 15 ;
1391
1407
1392
1408
// Description label
1393
- vecTemp.fY = 354 ;
1409
+ vecTemp.fY = 354 + 10 ;
1394
1410
m_pAdvancedSettingDescriptionLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, " " ) );
1395
1411
m_pAdvancedSettingDescriptionLabel->SetPosition ( CVector2D ( vecTemp.fX + 10 .f , vecTemp.fY ) );
1396
1412
m_pAdvancedSettingDescriptionLabel->SetFont ( " default-bold-small" );
@@ -1454,6 +1470,12 @@ void CSettings::CreateGUI ( void )
1454
1470
m_pSingleDownloadCombo->SetMouseEnterHandler ( GUI_CALLBACK ( &CSettings::OnShowAdvancedSettingDescription, this ) );
1455
1471
m_pSingleDownloadCombo->SetMouseLeaveHandler ( GUI_CALLBACK ( &CSettings::OnHideAdvancedSettingDescription, this ) );
1456
1472
1473
+ m_pPacketTagLabel->SetMouseEnterHandler ( GUI_CALLBACK ( &CSettings::OnShowAdvancedSettingDescription, this ) );
1474
+ m_pPacketTagLabel->SetMouseLeaveHandler ( GUI_CALLBACK ( &CSettings::OnHideAdvancedSettingDescription, this ) );
1475
+
1476
+ m_pPacketTagCombo->SetMouseEnterHandler ( GUI_CALLBACK ( &CSettings::OnShowAdvancedSettingDescription, this ) );
1477
+ m_pPacketTagCombo->SetMouseLeaveHandler ( GUI_CALLBACK ( &CSettings::OnHideAdvancedSettingDescription, this ) );
1478
+
1457
1479
m_pFullscreenStyleLabel->SetMouseEnterHandler ( GUI_CALLBACK ( &CSettings::OnShowAdvancedSettingDescription, this ) );
1458
1480
m_pFullscreenStyleLabel->SetMouseLeaveHandler ( GUI_CALLBACK ( &CSettings::OnHideAdvancedSettingDescription, this ) );
1459
1481
@@ -2803,6 +2825,11 @@ void CSettings::LoadData ( void )
2803
2825
if ( iVar == 0 ) m_pSingleDownloadCombo->SetText ( _ (" Default" ) );
2804
2826
else if ( iVar == 1 ) m_pSingleDownloadCombo->SetText ( _ (" On" ) );
2805
2827
2828
+ // Packet tag
2829
+ CVARS_GET ( " packet_tag" , iVar );
2830
+ if ( iVar == 0 ) m_pPacketTagCombo->SetText ( _ (" Default" ) );
2831
+ else if ( iVar == 1 ) m_pPacketTagCombo->SetText ( _ (" On" ) );
2832
+
2806
2833
// Windows 8 16-bit color
2807
2834
iVar = GetApplicationSettingInt ( " Win8Color16" );
2808
2835
m_pWin8ColorCheckBox->SetSelected ( iVar != 0 );
@@ -3065,6 +3092,13 @@ void CSettings::SaveData ( void )
3065
3092
CVARS_SET ( " single_download" , iSelected );
3066
3093
}
3067
3094
3095
+ // Packet tag
3096
+ if ( CGUIListItem* pSelected = m_pPacketTagCombo->GetSelectedItem () )
3097
+ {
3098
+ int iSelected = ( int ) pSelected->GetData ();
3099
+ CVARS_SET ( " packet_tag" , iSelected );
3100
+ }
3101
+
3068
3102
// Windows 8 16-bit color
3069
3103
SetApplicationSettingInt ( " Win8Color16" , m_pWin8ColorCheckBox->GetSelected () );
3070
3104
@@ -3943,6 +3977,8 @@ bool CSettings::OnShowAdvancedSettingDescription ( CGUIElement* pElement )
3943
3977
strText = std::string ( _ ( " Browser speed:" ) ) + " " + std::string ( _ ( " Older routers may require a slower scan speed." ) );
3944
3978
else if ( pLabel && pLabel == m_pSingleDownloadLabel || pComboBox && pComboBox == m_pSingleDownloadCombo )
3945
3979
strText = std::string ( _ ( " Single connection:" ) ) + " " + std::string ( _ ( " Switch on to use only one connection when downloading." ) );
3980
+ else if ( pLabel && pLabel == m_pPacketTagLabel || pComboBox && pComboBox == m_pPacketTagCombo )
3981
+ strText = std::string ( _ ( " Packet tag:" ) ) + " " + std::string ( _ ( " Tag network packets to help ISPs identify MTA traffic." ) );
3946
3982
else if ( pLabel && pLabel == m_pFullscreenStyleLabel || pComboBox && pComboBox == m_pFullscreenStyleCombo )
3947
3983
strText = std::string ( _ ( " Fullscreen mode:" ) ) + " " + std::string ( _ ( " Experimental feature." ) );
3948
3984
else if ( pLabel && pLabel == m_pDebugSettingLabel || pComboBox && pComboBox == m_pDebugSettingCombo )
0 commit comments