2022-05-26 01:44:46 +02:00
|
|
|
//=============================================================================//
|
|
|
|
//
|
2023-03-20 11:16:29 +01:00
|
|
|
// Purpose: Launcher user interface implementation.
|
2022-05-26 01:44:46 +02:00
|
|
|
//
|
|
|
|
//=============================================================================//
|
2022-05-23 19:14:12 +02:00
|
|
|
#include "core/stdafx.h"
|
2022-05-24 02:23:37 +02:00
|
|
|
#include "sdklauncher.h"
|
2022-05-23 19:14:12 +02:00
|
|
|
#include "basepanel.h"
|
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: creates the surface layout
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::Init()
|
2022-05-23 19:14:12 +02:00
|
|
|
{
|
2022-05-24 02:23:37 +02:00
|
|
|
// START DESIGNER CODE
|
2022-05-23 19:14:12 +02:00
|
|
|
const INT WindowX = 800;
|
2023-01-21 14:59:42 +01:00
|
|
|
const INT WindowY = 353;
|
2022-05-23 19:14:12 +02:00
|
|
|
|
|
|
|
this->SuspendLayout();
|
|
|
|
this->SetAutoScaleDimensions({ 6, 13 });
|
|
|
|
this->SetAutoScaleMode(Forms::AutoScaleMode::Font);
|
2023-01-21 14:59:42 +01:00
|
|
|
this->SetText("Dashboard");
|
2022-05-23 19:14:12 +02:00
|
|
|
this->SetClientSize({ WindowX, WindowY });
|
|
|
|
this->SetFormBorderStyle(Forms::FormBorderStyle::FixedSingle);
|
|
|
|
this->SetStartPosition(Forms::FormStartPosition::CenterParent);
|
2022-10-20 14:14:47 +02:00
|
|
|
this->SetMinimizeBox(true);
|
2022-05-23 19:14:12 +02:00
|
|
|
this->SetMaximizeBox(false);
|
2022-05-26 01:44:46 +02:00
|
|
|
this->SetBackColor(Drawing::Color(47, 54, 61));
|
2022-05-23 19:14:12 +02:00
|
|
|
|
2023-03-24 00:10:48 +01:00
|
|
|
this->Load += &OnLoad;
|
|
|
|
this->FormClosing += &OnClose;
|
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
// ########################################################################
|
|
|
|
// GAME
|
|
|
|
// ########################################################################
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_GameGroup = new UIX::UIXGroupBox();
|
|
|
|
this->m_GameGroup->SetSize({ 458, 84 });
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_GameGroup->SetLocation({ 12, 12 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_GameGroup->SetTabIndex(0);
|
|
|
|
this->m_GameGroup->SetText("Game");
|
|
|
|
this->m_GameGroup->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->AddControl(this->m_GameGroup);
|
|
|
|
|
|
|
|
this->m_GameGroupExt = new UIX::UIXGroupBox();
|
|
|
|
this->m_GameGroupExt->SetSize({ 458, 55 });
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_GameGroupExt->SetLocation({ 12, 95 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_GameGroupExt->SetTabIndex(0);
|
|
|
|
this->m_GameGroupExt->SetText("");
|
|
|
|
this->m_GameGroupExt->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->AddControl(this->m_GameGroupExt);
|
|
|
|
|
|
|
|
this->m_MapLabel = new UIX::UIXLabel();
|
|
|
|
this->m_MapLabel->SetSize({ 50, 25 });
|
|
|
|
this->m_MapLabel->SetLocation({ 365, 28 });
|
|
|
|
this->m_MapLabel->SetTabIndex(0);
|
|
|
|
this->m_MapLabel->SetText("Map");
|
|
|
|
this->m_MapLabel->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_MapLabel->SetTextAlign(Drawing::ContentAlignment::TopLeft);
|
|
|
|
this->m_GameGroup->AddControl(this->m_MapLabel);
|
|
|
|
|
|
|
|
this->m_MapCombo = new UIX::UIXComboBox();
|
|
|
|
this->m_MapCombo->SetSize({ 347, 25 });
|
|
|
|
this->m_MapCombo->SetLocation({ 15, 25 });
|
|
|
|
this->m_MapCombo->SetTabIndex(0);
|
2023-02-12 20:30:35 +01:00
|
|
|
this->m_MapCombo->SetSelectedIndex(0);
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_MapCombo->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_MapCombo->SetDropDownStyle(Forms::ComboBoxStyle::DropDownList);
|
|
|
|
this->m_GameGroup->AddControl(this->m_MapCombo);
|
|
|
|
|
|
|
|
this->m_PlaylistLabel = new UIX::UIXLabel();
|
|
|
|
this->m_PlaylistLabel->SetSize({ 50, 25 });
|
|
|
|
this->m_PlaylistLabel->SetLocation({ 365, 53 });
|
|
|
|
this->m_PlaylistLabel->SetTabIndex(0);
|
|
|
|
this->m_PlaylistLabel->SetText("Playlist");
|
|
|
|
this->m_PlaylistLabel->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_PlaylistLabel->SetTextAlign(Drawing::ContentAlignment::TopLeft);
|
|
|
|
this->m_GameGroup->AddControl(this->m_PlaylistLabel);
|
|
|
|
|
|
|
|
this->m_PlaylistCombo = new UIX::UIXComboBox();
|
|
|
|
this->m_PlaylistCombo->SetSize({ 347, 25 });
|
|
|
|
this->m_PlaylistCombo->SetLocation({ 15, 50 });
|
|
|
|
this->m_PlaylistCombo->SetTabIndex(0);
|
2023-02-12 20:30:35 +01:00
|
|
|
this->m_PlaylistCombo->SetSelectedIndex(0);
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_PlaylistCombo->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_PlaylistCombo->SetDropDownStyle(Forms::ComboBoxStyle::DropDownList);
|
|
|
|
this->m_GameGroup->AddControl(this->m_PlaylistCombo);
|
|
|
|
|
|
|
|
this->m_CheatsToggle = new UIX::UIXCheckBox();
|
|
|
|
this->m_CheatsToggle->SetSize({ 110, 18 });
|
|
|
|
this->m_CheatsToggle->SetLocation({ 15, 7 });
|
|
|
|
this->m_CheatsToggle->SetTabIndex(0);
|
|
|
|
this->m_CheatsToggle->SetText("Enable cheats");
|
|
|
|
this->m_CheatsToggle->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_GameGroupExt->AddControl(this->m_CheatsToggle);
|
|
|
|
|
2022-10-07 22:33:37 +02:00
|
|
|
this->m_DeveloperToggle = new UIX::UIXCheckBox();
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_DeveloperToggle->SetSize({ 110, 18 });
|
2022-10-07 22:33:37 +02:00
|
|
|
this->m_DeveloperToggle->SetLocation({ 130, 7 });
|
|
|
|
this->m_DeveloperToggle->SetTabIndex(0);
|
|
|
|
this->m_DeveloperToggle->SetText("Enable developer");
|
|
|
|
this->m_DeveloperToggle->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_GameGroupExt->AddControl(this->m_DeveloperToggle);
|
2022-05-23 19:14:12 +02:00
|
|
|
|
|
|
|
this->m_ConsoleToggle = new UIX::UIXCheckBox();
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_ConsoleToggle->SetSize({ 110, 18 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_ConsoleToggle->SetLocation({ 290, 7 });
|
|
|
|
this->m_ConsoleToggle->SetTabIndex(0);
|
|
|
|
this->m_ConsoleToggle->SetText("Show console");
|
|
|
|
this->m_ConsoleToggle->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_GameGroupExt->AddControl(this->m_ConsoleToggle);
|
|
|
|
|
|
|
|
this->m_ColorConsoleToggle = new UIX::UIXCheckBox();
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_ColorConsoleToggle->SetSize({ 110, 18 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_ColorConsoleToggle->SetLocation({ 15, 30 });
|
|
|
|
this->m_ColorConsoleToggle->SetTabIndex(0);
|
|
|
|
this->m_ColorConsoleToggle->SetChecked(true);
|
|
|
|
this->m_ColorConsoleToggle->SetText("Color console");
|
|
|
|
this->m_ColorConsoleToggle->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_GameGroupExt->AddControl(this->m_ColorConsoleToggle);
|
|
|
|
|
|
|
|
this->m_PlaylistFileTextBox = new UIX::UIXTextBox();
|
|
|
|
this->m_PlaylistFileTextBox->SetSize({ 178, 18 });
|
|
|
|
this->m_PlaylistFileTextBox->SetLocation({ 130, 30 });
|
|
|
|
this->m_PlaylistFileTextBox->SetTabIndex(0);
|
|
|
|
this->m_PlaylistFileTextBox->SetText("playlists_r5_patch.txt");
|
|
|
|
this->m_PlaylistFileTextBox->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
2022-05-26 01:44:46 +02:00
|
|
|
this->m_PlaylistFileTextBox->LostFocus += &ReloadPlaylists;
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_GameGroupExt->AddControl(this->m_PlaylistFileTextBox);
|
|
|
|
|
|
|
|
this->m_PlaylistFileLabel = new UIX::UIXLabel();
|
2022-09-11 16:37:14 +02:00
|
|
|
this->m_PlaylistFileLabel->SetSize({ 60, 18 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_PlaylistFileLabel->SetLocation({ 311, 32 });
|
|
|
|
this->m_PlaylistFileLabel->SetTabIndex(0);
|
2022-09-11 00:19:31 +02:00
|
|
|
this->m_PlaylistFileLabel->SetText("Playlists file");
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_PlaylistFileLabel->SetAnchor(Forms::AnchorStyles::Bottom | Forms::AnchorStyles::Left);
|
|
|
|
this->m_GameGroupExt->AddControl(this->m_PlaylistFileLabel);
|
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
// ########################################################################
|
|
|
|
// MAIN
|
|
|
|
// ########################################################################
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_MainGroup = new UIX::UIXGroupBox();
|
|
|
|
this->m_MainGroup->SetSize({ 308, 84 });
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_MainGroup->SetLocation({ 480, 12 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_MainGroup->SetTabIndex(0);
|
|
|
|
this->m_MainGroup->SetText("Main");
|
|
|
|
this->m_MainGroup->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->AddControl(this->m_MainGroup);
|
|
|
|
|
|
|
|
this->m_MainGroupExt = new UIX::UIXGroupBox();
|
|
|
|
this->m_MainGroupExt->SetSize({ 308, 55 });
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_MainGroupExt->SetLocation({ 480, 95 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_MainGroupExt->SetTabIndex(0);
|
|
|
|
this->m_MainGroupExt->SetText("");
|
|
|
|
this->m_MainGroupExt->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->AddControl(this->m_MainGroupExt);
|
|
|
|
|
|
|
|
this->m_ModeCombo = new UIX::UIXComboBox();
|
|
|
|
this->m_ModeCombo->SetSize({ 82, 25 });
|
|
|
|
this->m_ModeCombo->SetLocation({ 15, 25 });
|
|
|
|
this->m_ModeCombo->SetTabIndex(0);
|
2022-05-24 02:23:37 +02:00
|
|
|
this->m_ModeCombo->SetSelectedIndex(0);
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_ModeCombo->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_ModeCombo->SetDropDownStyle(Forms::ComboBoxStyle::DropDownList);
|
|
|
|
this->m_MainGroup->AddControl(this->m_ModeCombo);
|
|
|
|
|
|
|
|
this->m_ModeLabel = new UIX::UIXLabel();
|
|
|
|
this->m_ModeLabel->SetSize({ 50, 25 });
|
|
|
|
this->m_ModeLabel->SetLocation({ 100, 28 });
|
|
|
|
this->m_ModeLabel->SetTabIndex(0);
|
|
|
|
this->m_ModeLabel->SetText("Mode");
|
|
|
|
this->m_ModeLabel->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_ModeLabel->SetTextAlign(Drawing::ContentAlignment::TopLeft);
|
|
|
|
this->m_MainGroup->AddControl(this->m_ModeLabel);
|
|
|
|
|
2022-05-24 02:23:37 +02:00
|
|
|
this->m_HostNameTextBox = new UIX::UIXTextBox();
|
|
|
|
this->m_HostNameTextBox->SetSize({ 80, 21 });
|
|
|
|
this->m_HostNameTextBox->SetLocation({ 150, 25 });
|
|
|
|
this->m_HostNameTextBox->SetTabIndex(0);
|
|
|
|
this->m_HostNameTextBox->SetText("");
|
|
|
|
this->m_HostNameTextBox->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_MainGroup->AddControl(this->m_HostNameTextBox);
|
|
|
|
|
|
|
|
this->m_HostNameLabel = new UIX::UIXLabel();
|
|
|
|
this->m_HostNameLabel->SetSize({ 70, 21 });
|
|
|
|
this->m_HostNameLabel->SetLocation({ 233, 28 });
|
|
|
|
this->m_HostNameLabel->SetTabIndex(0);
|
|
|
|
this->m_HostNameLabel->SetText("Host name");
|
|
|
|
this->m_HostNameLabel->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_MainGroup->AddControl(this->m_HostNameLabel);
|
2022-05-23 19:14:12 +02:00
|
|
|
|
2022-05-24 19:26:05 +02:00
|
|
|
this->m_VisibilityCombo = new UIX::UIXComboBox();
|
|
|
|
this->m_VisibilityCombo->SetSize({ 82, 25 });
|
|
|
|
this->m_VisibilityCombo->SetLocation({ 15, 50 });
|
|
|
|
this->m_VisibilityCombo->SetTabIndex(0);
|
|
|
|
this->m_VisibilityCombo->SetSelectedIndex(0);
|
|
|
|
this->m_VisibilityCombo->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_VisibilityCombo->SetDropDownStyle(Forms::ComboBoxStyle::DropDownList);
|
|
|
|
this->m_MainGroup->AddControl(this->m_VisibilityCombo);
|
|
|
|
|
|
|
|
this->m_VisibilityLabel = new UIX::UIXLabel();
|
|
|
|
this->m_VisibilityLabel->SetSize({ 70, 21 });
|
|
|
|
this->m_VisibilityLabel->SetLocation({ 100, 53 });
|
|
|
|
this->m_VisibilityLabel->SetTabIndex(0);
|
|
|
|
this->m_VisibilityLabel->SetText("Visibility");
|
|
|
|
this->m_VisibilityLabel->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_MainGroup->AddControl(this->m_VisibilityLabel);
|
|
|
|
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_LaunchArgsTextBox = new UIX::UIXTextBox();
|
2022-05-24 19:26:05 +02:00
|
|
|
this->m_LaunchArgsTextBox->SetSize({ 80, 21 });
|
|
|
|
this->m_LaunchArgsTextBox->SetLocation({ 150, 50 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_LaunchArgsTextBox->SetTabIndex(0);
|
|
|
|
this->m_LaunchArgsTextBox->SetText("");
|
|
|
|
this->m_LaunchArgsTextBox->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_MainGroup->AddControl(this->m_LaunchArgsTextBox);
|
|
|
|
|
|
|
|
this->m_LaunchArgsLabel = new UIX::UIXLabel();
|
|
|
|
this->m_LaunchArgsLabel->SetSize({ 70, 21 });
|
|
|
|
this->m_LaunchArgsLabel->SetLocation({ 233, 53 });
|
|
|
|
this->m_LaunchArgsLabel->SetTabIndex(0);
|
2022-05-24 02:23:37 +02:00
|
|
|
this->m_LaunchArgsLabel->SetText("Command line");
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_LaunchArgsLabel->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_MainGroup->AddControl(this->m_LaunchArgsLabel);
|
|
|
|
|
|
|
|
this->m_CleanSDK = new UIX::UIXButton();
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_CleanSDK->SetSize({ 111, 18 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_CleanSDK->SetLocation({ 15, 7 });
|
|
|
|
this->m_CleanSDK->SetTabIndex(0);
|
|
|
|
this->m_CleanSDK->SetText("Clean SDK");
|
|
|
|
this->m_CleanSDK->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
2022-05-26 22:04:50 +02:00
|
|
|
this->m_CleanSDK->Click += &CleanSDK;
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_MainGroupExt->AddControl(this->m_CleanSDK);
|
|
|
|
|
|
|
|
this->m_UpdateSDK = new UIX::UIXButton();
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_UpdateSDK->SetSize({ 111, 18 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_UpdateSDK->SetLocation({ 15, 30 });
|
|
|
|
this->m_UpdateSDK->SetTabIndex(0);
|
2022-12-07 01:07:26 +01:00
|
|
|
this->m_UpdateSDK->SetEnabled(true); // !TODO: Implement updater
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_UpdateSDK->SetText("Update SDK");
|
2022-12-07 01:07:26 +01:00
|
|
|
this->m_UpdateSDK->Click += &UpdateSDK;
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_UpdateSDK->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_MainGroupExt->AddControl(this->m_UpdateSDK);
|
|
|
|
|
|
|
|
this->m_LaunchSDK = new UIX::UIXButton();
|
|
|
|
this->m_LaunchSDK->SetSize({ 170, 41 });
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_LaunchSDK->SetLocation({ 131, 7 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_LaunchSDK->SetTabIndex(0);
|
|
|
|
this->m_LaunchSDK->SetText("Launch game");
|
|
|
|
this->m_LaunchSDK->SetBackColor(Drawing::Color(3, 102, 214));
|
|
|
|
this->m_LaunchSDK->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
2022-05-24 02:23:37 +02:00
|
|
|
this->m_LaunchSDK->Click += &LaunchGame;
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_MainGroupExt->AddControl(this->m_LaunchSDK);
|
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
// ########################################################################
|
|
|
|
// ENGINE
|
|
|
|
// ########################################################################
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_EngineBaseGroup = new UIX::UIXGroupBox();
|
|
|
|
this->m_EngineBaseGroup->SetSize({ 337, 73 });
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_EngineBaseGroup->SetLocation({ 12, 160 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_EngineBaseGroup->SetTabIndex(0);
|
|
|
|
this->m_EngineBaseGroup->SetText("Engine");
|
|
|
|
this->m_EngineBaseGroup->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->AddControl(this->m_EngineBaseGroup);
|
|
|
|
|
|
|
|
this->m_EngineNetworkGroup = new UIX::UIXGroupBox();
|
|
|
|
this->m_EngineNetworkGroup->SetSize({ 337, 55 });
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_EngineNetworkGroup->SetLocation({ 12, 232 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_EngineNetworkGroup->SetTabIndex(0);
|
|
|
|
this->m_EngineNetworkGroup->SetText("");
|
|
|
|
this->m_EngineNetworkGroup->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->AddControl(this->m_EngineNetworkGroup);
|
|
|
|
|
|
|
|
this->m_EngineVideoGroup = new UIX::UIXGroupBox();
|
|
|
|
this->m_EngineVideoGroup->SetSize({ 337, 55 });
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_EngineVideoGroup->SetLocation({ 12, 286 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_EngineVideoGroup->SetTabIndex(0);
|
|
|
|
this->m_EngineVideoGroup->SetText("");
|
|
|
|
this->m_EngineVideoGroup->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->AddControl(this->m_EngineVideoGroup);
|
|
|
|
|
|
|
|
this->m_ReservedCoresTextBox = new UIX::UIXTextBox();
|
|
|
|
this->m_ReservedCoresTextBox->SetSize({ 18, 18 });
|
|
|
|
this->m_ReservedCoresTextBox->SetLocation({ 15, 25 });
|
|
|
|
this->m_ReservedCoresTextBox->SetTabIndex(0);
|
|
|
|
this->m_ReservedCoresTextBox->SetReadOnly(false);
|
2023-01-21 15:34:37 +01:00
|
|
|
this->m_ReservedCoresTextBox->SetText("-1");
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_ReservedCoresTextBox->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_EngineBaseGroup->AddControl(this->m_ReservedCoresTextBox);
|
|
|
|
|
|
|
|
this->m_ReservedCoresLabel = new UIX::UIXLabel();
|
|
|
|
this->m_ReservedCoresLabel->SetSize({ 125, 18 });
|
|
|
|
this->m_ReservedCoresLabel->SetLocation({ 36, 27 });
|
|
|
|
this->m_ReservedCoresLabel->SetTabIndex(0);
|
|
|
|
this->m_ReservedCoresLabel->SetText("Reserved cores");
|
|
|
|
this->m_ReservedCoresLabel->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_ReservedCoresLabel->SetTextAlign(Drawing::ContentAlignment::TopLeft);
|
|
|
|
this->m_EngineBaseGroup->AddControl(this->m_ReservedCoresLabel);
|
|
|
|
|
|
|
|
this->m_WorkerThreadsTextBox = new UIX::UIXTextBox();
|
|
|
|
this->m_WorkerThreadsTextBox->SetSize({ 18, 18 });
|
|
|
|
this->m_WorkerThreadsTextBox->SetLocation({ 155, 25 });
|
|
|
|
this->m_WorkerThreadsTextBox->SetTabIndex(0);
|
|
|
|
this->m_WorkerThreadsTextBox->SetReadOnly(false);
|
|
|
|
this->m_WorkerThreadsTextBox->SetText("28");
|
|
|
|
this->m_WorkerThreadsTextBox->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_EngineBaseGroup->AddControl(this->m_WorkerThreadsTextBox);
|
|
|
|
|
|
|
|
this->m_WorkerThreadsLabel = new UIX::UIXLabel();
|
|
|
|
this->m_WorkerThreadsLabel->SetSize({ 125, 18 });
|
|
|
|
this->m_WorkerThreadsLabel->SetLocation({ 176, 27 });
|
|
|
|
this->m_WorkerThreadsLabel->SetTabIndex(0);
|
|
|
|
this->m_WorkerThreadsLabel->SetText("Worker threads");
|
|
|
|
this->m_WorkerThreadsLabel->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_WorkerThreadsLabel->SetTextAlign(Drawing::ContentAlignment::TopLeft);
|
|
|
|
this->m_EngineBaseGroup->AddControl(this->m_WorkerThreadsLabel);
|
|
|
|
|
|
|
|
this->m_SingleCoreDediToggle = new UIX::UIXCheckBox();
|
|
|
|
this->m_SingleCoreDediToggle->SetSize({ 125, 18 });
|
|
|
|
this->m_SingleCoreDediToggle->SetLocation({ 15, 48 });
|
|
|
|
this->m_SingleCoreDediToggle->SetTabIndex(0);
|
|
|
|
this->m_SingleCoreDediToggle->SetText("Single-core server");
|
|
|
|
this->m_SingleCoreDediToggle->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_EngineBaseGroup->AddControl(this->m_SingleCoreDediToggle);
|
|
|
|
|
|
|
|
this->m_NoAsyncJobsToggle = new UIX::UIXCheckBox();
|
|
|
|
this->m_NoAsyncJobsToggle->SetSize({ 125, 18 });
|
|
|
|
this->m_NoAsyncJobsToggle->SetLocation({ 155, 48 });
|
|
|
|
this->m_NoAsyncJobsToggle->SetTabIndex(2);
|
|
|
|
this->m_NoAsyncJobsToggle->SetText("Synchronize jobs");
|
|
|
|
this->m_NoAsyncJobsToggle->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_EngineBaseGroup->AddControl(this->m_NoAsyncJobsToggle);
|
|
|
|
|
|
|
|
this->m_NetEncryptionToggle = new UIX::UIXCheckBox();
|
|
|
|
this->m_NetEncryptionToggle->SetSize({ 125, 18 });
|
|
|
|
this->m_NetEncryptionToggle->SetLocation({ 15, 7 });
|
|
|
|
this->m_NetEncryptionToggle->SetTabIndex(0);
|
|
|
|
this->m_NetEncryptionToggle->SetChecked(true);
|
|
|
|
this->m_NetEncryptionToggle->SetText("Net encryption");
|
|
|
|
this->m_NetEncryptionToggle->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_EngineNetworkGroup->AddControl(this->m_NetEncryptionToggle);
|
|
|
|
|
|
|
|
this->m_NetRandomKeyToggle = new UIX::UIXCheckBox();
|
|
|
|
this->m_NetRandomKeyToggle->SetSize({ 125, 18 });
|
|
|
|
this->m_NetRandomKeyToggle->SetLocation({ 155, 7 });
|
|
|
|
this->m_NetRandomKeyToggle->SetTabIndex(0);
|
|
|
|
this->m_NetRandomKeyToggle->SetChecked(true);
|
|
|
|
this->m_NetRandomKeyToggle->SetText("Net random key");
|
|
|
|
this->m_NetRandomKeyToggle->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_EngineNetworkGroup->AddControl(this->m_NetRandomKeyToggle);
|
|
|
|
|
2022-05-24 02:23:37 +02:00
|
|
|
this->m_NoQueuedPacketThread = new UIX::UIXCheckBox();
|
|
|
|
this->m_NoQueuedPacketThread->SetSize({ 125, 18 });
|
|
|
|
this->m_NoQueuedPacketThread->SetLocation({ 15, 30 });
|
|
|
|
this->m_NoQueuedPacketThread->SetTabIndex(2);
|
|
|
|
this->m_NoQueuedPacketThread->SetText("No queued packets");
|
|
|
|
this->m_NoQueuedPacketThread->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_EngineNetworkGroup->AddControl(this->m_NoQueuedPacketThread);
|
2022-05-23 19:14:12 +02:00
|
|
|
|
2022-05-24 02:23:37 +02:00
|
|
|
this->m_NoTimeOutToggle = new UIX::UIXCheckBox();
|
|
|
|
this->m_NoTimeOutToggle->SetSize({ 125, 18 });
|
|
|
|
this->m_NoTimeOutToggle->SetLocation({ 155, 30 });
|
|
|
|
this->m_NoTimeOutToggle->SetTabIndex(0);
|
|
|
|
this->m_NoTimeOutToggle->SetText("No time out");
|
|
|
|
this->m_NoTimeOutToggle->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_EngineNetworkGroup->AddControl(this->m_NoTimeOutToggle);
|
2022-05-23 19:14:12 +02:00
|
|
|
|
|
|
|
this->m_WindowedToggle = new UIX::UIXCheckBox();
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_WindowedToggle->SetSize({ 125, 18 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_WindowedToggle->SetLocation({ 15, 7 });
|
|
|
|
this->m_WindowedToggle->SetTabIndex(0);
|
|
|
|
this->m_WindowedToggle->SetChecked(true);
|
|
|
|
this->m_WindowedToggle->SetText("Windowed");
|
|
|
|
this->m_WindowedToggle->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_EngineVideoGroup->AddControl(this->m_WindowedToggle);
|
|
|
|
|
2022-05-24 02:23:37 +02:00
|
|
|
this->m_NoBorderToggle = new UIX::UIXCheckBox();
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_NoBorderToggle->SetSize({ 125, 18 });
|
2022-05-24 02:23:37 +02:00
|
|
|
this->m_NoBorderToggle->SetLocation({ 155, 7 });
|
|
|
|
this->m_NoBorderToggle->SetTabIndex(0);
|
2022-12-07 01:07:26 +01:00
|
|
|
this->m_NoBorderToggle->SetText("Borderless");
|
2022-05-24 02:23:37 +02:00
|
|
|
this->m_NoBorderToggle->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_EngineVideoGroup->AddControl(this->m_NoBorderToggle);
|
2022-05-23 19:14:12 +02:00
|
|
|
|
|
|
|
this->m_FpsTextBox = new UIX::UIXTextBox();
|
|
|
|
this->m_FpsTextBox->SetSize({ 25, 18 });
|
|
|
|
this->m_FpsTextBox->SetLocation({ 15, 30 });
|
|
|
|
this->m_FpsTextBox->SetTabIndex(0);
|
|
|
|
this->m_FpsTextBox->SetReadOnly(false);
|
|
|
|
this->m_FpsTextBox->SetText("-1");
|
|
|
|
this->m_FpsTextBox->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_EngineVideoGroup->AddControl(this->m_FpsTextBox);
|
|
|
|
|
|
|
|
this->m_FpsLabel = new UIX::UIXLabel();
|
|
|
|
this->m_FpsLabel->SetSize({ 125, 18 });
|
|
|
|
this->m_FpsLabel->SetLocation({ 43, 32 });
|
|
|
|
this->m_FpsLabel->SetTabIndex(0);
|
|
|
|
this->m_FpsLabel->SetText("Max FPS");
|
|
|
|
this->m_FpsLabel->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_FpsLabel->SetTextAlign(Drawing::ContentAlignment::TopLeft);
|
|
|
|
this->m_EngineVideoGroup->AddControl(this->m_FpsLabel);
|
|
|
|
|
|
|
|
this->m_WidthTextBox = new UIX::UIXTextBox();
|
|
|
|
this->m_WidthTextBox->SetSize({ 50, 18 });
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_WidthTextBox->SetLocation({ 106, 30 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_WidthTextBox->SetTabIndex(0);
|
|
|
|
this->m_WidthTextBox->SetReadOnly(false);
|
|
|
|
this->m_WidthTextBox->SetText("");
|
|
|
|
this->m_WidthTextBox->SetAnchor(Forms::AnchorStyles::Bottom | Forms::AnchorStyles::Right);
|
|
|
|
this->m_EngineVideoGroup->AddControl(this->m_WidthTextBox);
|
|
|
|
|
|
|
|
this->m_HeightTextBox = new UIX::UIXTextBox();
|
|
|
|
this->m_HeightTextBox->SetSize({ 50, 18 });
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_HeightTextBox->SetLocation({ 155, 30 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_HeightTextBox->SetTabIndex(0);
|
|
|
|
this->m_HeightTextBox->SetReadOnly(false);
|
|
|
|
this->m_HeightTextBox->SetText("");
|
|
|
|
this->m_HeightTextBox->SetAnchor(Forms::AnchorStyles::Bottom | Forms::AnchorStyles::Right);
|
|
|
|
this->m_EngineVideoGroup->AddControl(this->m_HeightTextBox);
|
|
|
|
|
|
|
|
this->m_ResolutionLabel = new UIX::UIXLabel();
|
|
|
|
this->m_ResolutionLabel->SetSize({ 125, 18 });
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_ResolutionLabel->SetLocation({ 208, 32 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_ResolutionLabel->SetTabIndex(0);
|
|
|
|
this->m_ResolutionLabel->SetText("Resolution (width | height)");
|
|
|
|
this->m_ResolutionLabel->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left);
|
|
|
|
this->m_ResolutionLabel->SetTextAlign(Drawing::ContentAlignment::TopLeft);
|
|
|
|
this->m_EngineVideoGroup->AddControl(this->m_ResolutionLabel);
|
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
// ########################################################################
|
|
|
|
// CONSOLE
|
|
|
|
// ########################################################################
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_ConsoleGroup = new UIX::UIXGroupBox();
|
2022-05-26 22:04:50 +02:00
|
|
|
this->m_ConsoleGroup->SetSize({ 429, 15 });
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_ConsoleGroup->SetLocation({ 359, 160 });
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_ConsoleGroup->SetTabIndex(0);
|
|
|
|
this->m_ConsoleGroup->SetText("Console");
|
|
|
|
this->m_ConsoleGroup->SetAnchor(Forms::AnchorStyles::Bottom | Forms::AnchorStyles::Left | Forms::AnchorStyles::Right);
|
|
|
|
this->AddControl(this->m_ConsoleGroup);
|
|
|
|
|
2022-05-26 22:04:50 +02:00
|
|
|
this->m_ConsoleGroupExt = new UIX::UIXGroupBox();
|
|
|
|
this->m_ConsoleGroupExt->SetSize({ 429, 167 });
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_ConsoleGroupExt->SetLocation({ 359, 174 });
|
2022-05-26 22:04:50 +02:00
|
|
|
this->m_ConsoleGroupExt->SetTabIndex(0);
|
|
|
|
this->m_ConsoleGroupExt->SetText("");
|
|
|
|
this->m_ConsoleGroupExt->SetAnchor(Forms::AnchorStyles::Bottom | Forms::AnchorStyles::Left | Forms::AnchorStyles::Right);
|
|
|
|
this->AddControl(this->m_ConsoleGroupExt);
|
|
|
|
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_ConsoleListView = new UIX::UIXListView();
|
2022-05-31 18:05:43 +02:00
|
|
|
this->m_ConsoleListView->SetSize({ 427, 172 });
|
2023-01-21 14:59:42 +01:00
|
|
|
this->m_ConsoleListView->SetLocation({ 1, -23 }); // HACK: hide columns
|
2022-05-23 19:14:12 +02:00
|
|
|
this->m_ConsoleListView->SetTabIndex(0);
|
|
|
|
this->m_ConsoleListView->SetBackColor(Drawing::Color(29, 33, 37));
|
2022-05-26 22:04:50 +02:00
|
|
|
this->m_ConsoleListView->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Bottom | Forms::AnchorStyles::Left | Forms::AnchorStyles::Right);
|
|
|
|
this->m_ConsoleListView->SetView(Forms::View::Details);
|
|
|
|
this->m_ConsoleListView->SetVirtualMode(true);
|
|
|
|
this->m_ConsoleListView->SetFullRowSelect(true);
|
|
|
|
this->m_ConsoleListView->Columns.Add({ "index", 40 });
|
|
|
|
this->m_ConsoleListView->Columns.Add({ "buffer", 387 });
|
|
|
|
this->m_ConsoleListView->MouseClick += &VirtualItemToClipboard;
|
|
|
|
this->m_ConsoleListView->RetrieveVirtualItem += &GetVirtualItem;
|
2022-05-27 14:39:43 +02:00
|
|
|
this->m_ConsoleGroupExt->AddControl(this->m_ConsoleListView);
|
2022-05-23 19:14:12 +02:00
|
|
|
|
2022-05-31 18:05:43 +02:00
|
|
|
this->m_ConsoleCommandTextBox = new UIX::UIXTextBox();
|
2022-06-06 01:16:40 +02:00
|
|
|
this->m_ConsoleCommandTextBox->SetSize({ 351, 18 });
|
2022-05-31 18:05:43 +02:00
|
|
|
this->m_ConsoleCommandTextBox->SetLocation({ 0, 149 });
|
|
|
|
this->m_ConsoleCommandTextBox->SetTabIndex(0);
|
|
|
|
this->m_ConsoleCommandTextBox->SetReadOnly(false);
|
|
|
|
this->m_ConsoleCommandTextBox->SetText("");
|
|
|
|
this->m_ConsoleCommandTextBox->SetAnchor(Forms::AnchorStyles::Bottom | Forms::AnchorStyles::Left);
|
|
|
|
this->m_ConsoleGroupExt->AddControl(this->m_ConsoleCommandTextBox);
|
|
|
|
|
|
|
|
this->m_ConsoleSendCommand = new UIX::UIXButton();
|
|
|
|
this->m_ConsoleSendCommand->SetSize({ 79, 18 });
|
|
|
|
this->m_ConsoleSendCommand->SetLocation({ 350, 149 });
|
|
|
|
this->m_ConsoleSendCommand->SetTabIndex(0);
|
|
|
|
this->m_ConsoleSendCommand->SetText("Send");
|
|
|
|
this->m_ConsoleSendCommand->SetBackColor(Drawing::Color(3, 102, 214));
|
|
|
|
this->m_ConsoleSendCommand->SetAnchor(Forms::AnchorStyles::None);
|
|
|
|
this->m_ConsoleSendCommand->Click += &ForwardCommandToGame;
|
|
|
|
this->m_ConsoleGroupExt->AddControl(this->m_ConsoleSendCommand);
|
|
|
|
|
2022-05-23 19:14:12 +02:00
|
|
|
this->ResumeLayout(false);
|
|
|
|
this->PerformLayout();
|
2022-05-26 22:04:50 +02:00
|
|
|
|
2022-05-23 19:14:12 +02:00
|
|
|
// END DESIGNER CODE
|
2022-05-26 01:44:46 +02:00
|
|
|
}
|
2022-05-23 19:14:12 +02:00
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: post-init surface setup
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::Setup()
|
2022-05-26 01:44:46 +02:00
|
|
|
{
|
|
|
|
this->ParseMaps();
|
|
|
|
this->ParsePlaylists();
|
|
|
|
|
|
|
|
this->m_ModeCombo->Items.Add("Host");
|
|
|
|
this->m_ModeCombo->Items.Add("Server");
|
|
|
|
this->m_ModeCombo->Items.Add("Client");
|
|
|
|
|
2022-06-06 01:31:20 +02:00
|
|
|
#ifdef DEDI_LAUNCHER
|
|
|
|
this->m_ModeCombo->SetSelectedIndex(1);
|
|
|
|
#endif // DEDI_LAUNCHER
|
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
this->m_VisibilityCombo->Items.Add("Public");
|
|
|
|
this->m_VisibilityCombo->Items.Add("Hidden");
|
|
|
|
this->m_VisibilityCombo->Items.Add("Offline");
|
2022-05-24 02:23:37 +02:00
|
|
|
}
|
|
|
|
|
2023-03-24 00:10:48 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: load and apply settings
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
void CSurface::LoadSettings()
|
|
|
|
{
|
|
|
|
const fs::path settingsPath(Format("platform/%s/%s", SDK_SYSTEM_CFG_PATH, LAUNCHER_SETTING_FILE));
|
|
|
|
if (!fs::exists(settingsPath))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool success{ };
|
|
|
|
std::ifstream fileStream(settingsPath, fstream::in);
|
|
|
|
vdf::object vRoot = vdf::read(fileStream, &success);
|
|
|
|
|
|
|
|
if (!success)
|
|
|
|
{
|
|
|
|
printf("%s: Failed to parse VDF file: '%s'\n", __FUNCTION__,
|
|
|
|
settingsPath.u8string().c_str());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
// Game.
|
|
|
|
string& attributeView = vRoot.attribs["playlistsFile"];
|
|
|
|
this->m_PlaylistFileTextBox->SetText(attributeView.data());
|
|
|
|
|
|
|
|
attributeView = vRoot.attribs["enableCheats"];
|
|
|
|
this->m_CheatsToggle->SetChecked(attributeView != "0");
|
|
|
|
|
|
|
|
attributeView = vRoot.attribs["enableDeveloper"];
|
|
|
|
this->m_DeveloperToggle->SetChecked(attributeView != "0");
|
|
|
|
|
|
|
|
attributeView = vRoot.attribs["enableConsole"];
|
|
|
|
this->m_ConsoleToggle->SetChecked(attributeView != "0");
|
|
|
|
|
|
|
|
attributeView = vRoot.attribs["colorConsole"];
|
|
|
|
this->m_ColorConsoleToggle->SetChecked(attributeView != "0");
|
|
|
|
|
|
|
|
// Engine.
|
|
|
|
attributeView = vRoot.attribs["reservedCoreCount"];
|
|
|
|
this->m_ReservedCoresTextBox->SetText(attributeView.data());
|
|
|
|
|
|
|
|
attributeView = vRoot.attribs["workerThreadCount"];
|
|
|
|
this->m_WorkerThreadsTextBox->SetText(attributeView.data());
|
|
|
|
|
|
|
|
attributeView = vRoot.attribs["singleCoreServer"];
|
|
|
|
this->m_SingleCoreDediToggle->SetChecked(attributeView != "0");
|
|
|
|
|
|
|
|
attributeView = vRoot.attribs["synchronizeJobs"]; // No-async
|
|
|
|
this->m_NoAsyncJobsToggle->SetChecked(attributeView != "0");
|
|
|
|
|
|
|
|
// Network.
|
|
|
|
attributeView = vRoot.attribs["encryptionEnable"];
|
|
|
|
this->m_NetEncryptionToggle->SetChecked(attributeView != "0");
|
|
|
|
|
|
|
|
attributeView = vRoot.attribs["randomNetKey"];
|
|
|
|
this->m_NetRandomKeyToggle->SetChecked(attributeView != "0");
|
|
|
|
|
|
|
|
attributeView = vRoot.attribs["noQueuedPackets"];
|
|
|
|
this->m_NoQueuedPacketThread->SetChecked(attributeView != "0");
|
|
|
|
|
|
|
|
attributeView = vRoot.attribs["noTimeOut"];
|
|
|
|
this->m_NoTimeOutToggle->SetChecked(attributeView != "0");
|
|
|
|
|
|
|
|
// Video.
|
|
|
|
attributeView = vRoot.attribs["windowed"];
|
|
|
|
this->m_WindowedToggle->SetChecked(attributeView != "0");
|
|
|
|
|
|
|
|
attributeView = vRoot.attribs["borderless"];
|
|
|
|
this->m_NoBorderToggle->SetChecked(attributeView != "0");
|
|
|
|
|
|
|
|
attributeView = vRoot.attribs["maxFPS"];
|
|
|
|
this->m_FpsTextBox->SetText(attributeView.data());
|
|
|
|
|
|
|
|
attributeView = vRoot.attribs["width"];
|
|
|
|
this->m_WidthTextBox->SetText(attributeView.data());
|
|
|
|
|
|
|
|
attributeView = vRoot.attribs["height"];
|
|
|
|
this->m_HeightTextBox->SetText(attributeView.data());
|
|
|
|
}
|
|
|
|
catch (const std::exception& e)
|
|
|
|
{
|
2023-04-03 13:12:22 +02:00
|
|
|
printf("%s: Exception while parsing VDF file: %s\n", __FUNCTION__, e.what());
|
2023-03-24 00:10:48 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: save current launcher state
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
void CSurface::SaveSettings()
|
|
|
|
{
|
|
|
|
const fs::path settingsPath(Format("platform/%s/%s", SDK_SYSTEM_CFG_PATH, LAUNCHER_SETTING_FILE));
|
|
|
|
const fs::path parentPath = settingsPath.parent_path();
|
|
|
|
|
|
|
|
if (!fs::exists(parentPath) && !fs::create_directories(parentPath))
|
|
|
|
{
|
|
|
|
printf("%s: Failed to create directory: '%s'\n", __FUNCTION__,
|
|
|
|
parentPath.relative_path().u8string().c_str());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::ofstream fileStream(settingsPath, fstream::out);
|
|
|
|
if (!fileStream)
|
|
|
|
{
|
|
|
|
printf("%s: Failed to create VDF file: '%s'\n", __FUNCTION__,
|
|
|
|
settingsPath.u8string().c_str());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
vdf::object vRoot;
|
|
|
|
vRoot.set_name("LauncherSettings");
|
|
|
|
|
|
|
|
// Game.
|
|
|
|
vRoot.add_attribute("playlistsFile", GetControlValue(this->m_PlaylistFileTextBox));
|
|
|
|
vRoot.add_attribute("enableCheats", GetControlValue(this->m_CheatsToggle));
|
|
|
|
vRoot.add_attribute("enableDeveloper", GetControlValue(this->m_DeveloperToggle));
|
|
|
|
vRoot.add_attribute("enableConsole", GetControlValue(this->m_ConsoleToggle));
|
|
|
|
vRoot.add_attribute("colorConsole", GetControlValue(this->m_ColorConsoleToggle));
|
|
|
|
|
|
|
|
// Engine.
|
|
|
|
vRoot.add_attribute("reservedCoreCount", GetControlValue(this->m_ReservedCoresTextBox));
|
|
|
|
vRoot.add_attribute("workerThreadCount", GetControlValue(this->m_WorkerThreadsTextBox));
|
|
|
|
vRoot.add_attribute("singleCoreServer", GetControlValue(this->m_SingleCoreDediToggle));
|
|
|
|
vRoot.add_attribute("synchronizeJobs", GetControlValue(this->m_NoAsyncJobsToggle));
|
|
|
|
|
|
|
|
// Network.
|
|
|
|
vRoot.add_attribute("encryptionEnable", GetControlValue(this->m_NetEncryptionToggle));
|
|
|
|
vRoot.add_attribute("randomNetKey", GetControlValue(this->m_NetRandomKeyToggle));
|
|
|
|
vRoot.add_attribute("noQueuedPackets", GetControlValue(this->m_NoQueuedPacketThread));
|
|
|
|
vRoot.add_attribute("noTimeOut", GetControlValue(this->m_NoTimeOutToggle));
|
|
|
|
|
|
|
|
// Video.
|
|
|
|
vRoot.add_attribute("windowed", GetControlValue(this->m_WindowedToggle));
|
|
|
|
vRoot.add_attribute("borderless", GetControlValue(this->m_NoBorderToggle));
|
|
|
|
vRoot.add_attribute("maxFPS", GetControlValue(this->m_FpsTextBox));
|
|
|
|
vRoot.add_attribute("width", GetControlValue(this->m_WidthTextBox));
|
|
|
|
vRoot.add_attribute("height", GetControlValue(this->m_HeightTextBox));
|
|
|
|
|
|
|
|
vdf::write(fileStream, vRoot);
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: load callback
|
|
|
|
// Input : *pSender -
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
void CSurface::OnLoad(Forms::Control* pSender)
|
|
|
|
{
|
|
|
|
((CSurface*)pSender->FindForm())->LoadSettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: close callback
|
|
|
|
// Input : *pSender -
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-04-03 13:12:22 +02:00
|
|
|
void CSurface::OnClose(const std::unique_ptr<FormClosingEventArgs>& /*pEventArgs*/, Forms::Control* pSender)
|
2023-03-24 00:10:48 +01:00
|
|
|
{
|
|
|
|
((CSurface*)pSender->FindForm())->SaveSettings();
|
|
|
|
}
|
|
|
|
|
2022-05-26 22:04:50 +02:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: removes redundant files from the game install
|
|
|
|
// Input : *pSender -
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::CleanSDK(Forms::Control* pSender)
|
2022-05-26 22:04:50 +02:00
|
|
|
{
|
2023-03-20 11:16:29 +01:00
|
|
|
CSurface* pSurface = reinterpret_cast<CSurface*>(pSender->FindForm());
|
2022-05-26 22:04:50 +02:00
|
|
|
pSurface->m_LogList.push_back(LogList_t(spdlog::level::info, "Running cleaner for SDK installation\n"));
|
|
|
|
pSurface->m_ConsoleListView->SetVirtualListSize(static_cast<int32_t>(pSurface->m_LogList.size()));
|
|
|
|
|
|
|
|
std::system("platform\\clean_sdk.bat");
|
|
|
|
}
|
|
|
|
|
2022-12-07 01:07:26 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: updates the SDK
|
|
|
|
// Input : *pSender -
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::UpdateSDK(Forms::Control* pSender)
|
2022-12-07 01:07:26 +01:00
|
|
|
{
|
2023-03-20 11:16:29 +01:00
|
|
|
CSurface* pSurface = reinterpret_cast<CSurface*>(pSender->FindForm());
|
2022-12-07 01:07:26 +01:00
|
|
|
pSurface->m_LogList.push_back(LogList_t(spdlog::level::info, "Running updater for SDK installation\n"));
|
|
|
|
pSurface->m_ConsoleListView->SetVirtualListSize(static_cast<int32_t>(pSurface->m_LogList.size()));
|
|
|
|
|
|
|
|
std::system("platform\\update_sdk.bat");
|
|
|
|
}
|
|
|
|
|
2022-05-26 22:04:50 +02:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: launches the game with the SDK
|
|
|
|
// Input : *pSender -
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::LaunchGame(Forms::Control* pSender)
|
2022-05-26 22:04:50 +02:00
|
|
|
{
|
2023-03-20 11:16:29 +01:00
|
|
|
CSurface* pSurface = reinterpret_cast<CSurface*>(pSender->FindForm());
|
2022-06-12 13:30:37 +02:00
|
|
|
|
2022-11-23 12:30:38 +01:00
|
|
|
pSurface->m_LogList.clear(); // Clear console.
|
|
|
|
pSurface->m_ConsoleListView->SetVirtualListSize(0);
|
|
|
|
pSurface->m_ConsoleListView->Refresh();
|
|
|
|
|
2023-03-20 00:01:49 +01:00
|
|
|
string svParameter;
|
|
|
|
pSurface->AppendParameterInternal(svParameter, "-launcher");
|
2022-06-12 13:30:37 +02:00
|
|
|
|
|
|
|
eLaunchMode launchMode = g_pLauncher->GetMainSurface()->BuildParameter(svParameter);
|
2022-05-26 22:04:50 +02:00
|
|
|
|
2023-03-20 10:26:43 +01:00
|
|
|
if (g_pLauncher->CreateLaunchContext(launchMode, svParameter.c_str(), "startup_launcher.cfg"))
|
|
|
|
g_pLauncher->LaunchProcess();
|
2022-05-26 22:04:50 +02:00
|
|
|
}
|
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: parses all available maps from the main vpk directory
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::ParseMaps()
|
2022-05-26 01:44:46 +02:00
|
|
|
{
|
2023-04-03 18:38:20 +02:00
|
|
|
const fs::path vpkPath("vpk");
|
|
|
|
if (!fs::exists(vpkPath))
|
2023-03-19 11:20:04 +01:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-04-03 18:38:20 +02:00
|
|
|
fs::directory_iterator directoryIterator(vpkPath);
|
|
|
|
std::regex archiveRegex{ R"([^_]*_(.*)(.bsp.pak000_dir).*)" };
|
|
|
|
std::smatch regexMatches;
|
2023-01-21 15:34:37 +01:00
|
|
|
|
2023-02-12 20:30:35 +01:00
|
|
|
m_MapCombo->Items.Add("");
|
2023-04-03 18:38:20 +02:00
|
|
|
for (const fs::directory_entry& directoryEntry : directoryIterator)
|
2022-05-26 01:44:46 +02:00
|
|
|
{
|
2023-04-03 18:38:20 +02:00
|
|
|
std::string fileName = directoryEntry.path().u8string();
|
|
|
|
std::regex_search(fileName, regexMatches, archiveRegex);
|
2022-05-26 01:44:46 +02:00
|
|
|
|
2023-04-03 18:38:20 +02:00
|
|
|
if (!regexMatches.empty())
|
2022-05-26 01:44:46 +02:00
|
|
|
{
|
2023-04-03 18:38:20 +02:00
|
|
|
if (regexMatches[1].str().compare("frontend") == 0)
|
2022-05-26 01:44:46 +02:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
2023-04-03 18:38:20 +02:00
|
|
|
else if (regexMatches[1].str().compare("mp_common") == 0)
|
2022-05-26 01:44:46 +02:00
|
|
|
{
|
2022-06-24 17:03:50 +02:00
|
|
|
if (!this->m_MapCombo->Items.Contains("mp_lobby"))
|
|
|
|
{
|
|
|
|
this->m_MapCombo->Items.Add("mp_lobby");
|
|
|
|
}
|
2022-05-26 01:44:46 +02:00
|
|
|
continue;
|
|
|
|
}
|
2023-04-03 18:38:20 +02:00
|
|
|
else if (!this->m_MapCombo->Items.Contains(regexMatches[1].str().c_str()))
|
2022-06-24 17:03:50 +02:00
|
|
|
{
|
2023-04-03 18:38:20 +02:00
|
|
|
this->m_MapCombo->Items.Add(regexMatches[1].str().c_str());
|
2022-06-24 17:03:50 +02:00
|
|
|
}
|
2022-05-26 01:44:46 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: parses all playlists from user selected playlist file
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::ParsePlaylists()
|
2022-05-26 01:44:46 +02:00
|
|
|
{
|
2023-04-03 18:38:20 +02:00
|
|
|
fs::path playlistPath(Format("platform\\%s", this->m_PlaylistFileTextBox->Text().ToCString()));
|
2023-02-12 20:30:35 +01:00
|
|
|
m_PlaylistCombo->Items.Add("");
|
2023-04-03 18:38:20 +02:00
|
|
|
|
|
|
|
if (!fs::exists(playlistPath))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool success{ };
|
|
|
|
std::ifstream iFile(playlistPath);
|
|
|
|
vdf::object vRoot = vdf::read(iFile, &success);
|
|
|
|
|
|
|
|
if (!success)
|
2022-05-26 01:44:46 +02:00
|
|
|
{
|
2023-04-03 18:38:20 +02:00
|
|
|
printf("%s: Failed to parse VDF file: '%s'\n", __FUNCTION__,
|
|
|
|
playlistPath.u8string().c_str());
|
|
|
|
return;
|
|
|
|
}
|
2022-05-26 01:44:46 +02:00
|
|
|
|
2023-04-03 18:38:20 +02:00
|
|
|
try
|
|
|
|
{
|
|
|
|
const auto& vcPlaylists = vRoot.childs.at("Playlists");
|
|
|
|
for (auto [id, it] = std::tuple<int, decltype(vcPlaylists->childs.begin())>
|
|
|
|
{ 1, vcPlaylists->childs.begin() }; it != vcPlaylists->childs.end(); id++, it++)
|
2022-05-26 01:44:46 +02:00
|
|
|
{
|
2023-04-03 18:38:20 +02:00
|
|
|
if (!this->m_PlaylistCombo->Items.Contains(it->first.c_str()))
|
2022-05-26 01:44:46 +02:00
|
|
|
{
|
2023-04-03 18:38:20 +02:00
|
|
|
this->m_PlaylistCombo->Items.Add(it->first.c_str());
|
2022-05-26 01:44:46 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-04-03 18:38:20 +02:00
|
|
|
catch (const std::exception& e)
|
|
|
|
{
|
|
|
|
printf("%s: Exception while parsing VDF file: %s\n", __FUNCTION__, e.what());
|
|
|
|
}
|
2022-05-26 01:44:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
2022-05-26 22:04:50 +02:00
|
|
|
// Purpose: clears the form and reloads the playlist
|
2022-05-26 01:44:46 +02:00
|
|
|
// Input : *pSender -
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::ReloadPlaylists(Forms::Control* pSender)
|
2022-05-24 02:23:37 +02:00
|
|
|
{
|
2023-03-20 11:16:29 +01:00
|
|
|
CSurface* pSurface = reinterpret_cast<CSurface*>(pSender->FindForm());
|
2022-05-24 02:23:37 +02:00
|
|
|
|
2022-05-26 22:04:50 +02:00
|
|
|
pSurface->m_PlaylistCombo->Items.Clear();
|
|
|
|
pSurface->m_PlaylistCombo->OnSizeChanged();
|
|
|
|
pSurface->ParsePlaylists();
|
2022-05-24 02:23:37 +02:00
|
|
|
}
|
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
//-----------------------------------------------------------------------------
|
2022-05-26 22:04:50 +02:00
|
|
|
// Purpose: copies selected virtual items to clipboard
|
|
|
|
// Input : &pEventArgs -
|
2022-05-26 01:44:46 +02:00
|
|
|
// Input : *pSender -
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::VirtualItemToClipboard(const std::unique_ptr<MouseEventArgs>& pEventArgs, Forms::Control* pSender)
|
2022-05-26 01:44:46 +02:00
|
|
|
{
|
2022-05-26 22:04:50 +02:00
|
|
|
if (pEventArgs->Button != Forms::MouseButtons::Right)
|
|
|
|
return;
|
|
|
|
|
2023-03-20 11:16:29 +01:00
|
|
|
CSurface* pSurface = reinterpret_cast<CSurface*>(pSender->FindForm());
|
2022-05-26 22:04:50 +02:00
|
|
|
List<uint32_t> lSelected = pSurface->m_ConsoleListView->SelectedIndices();
|
2022-05-26 01:44:46 +02:00
|
|
|
|
2022-05-26 22:04:50 +02:00
|
|
|
if (!lSelected.Count())
|
|
|
|
return;
|
|
|
|
|
|
|
|
string svClipBoard;
|
|
|
|
for (uint32_t i = 0; i < lSelected.Count(); i++)
|
2023-03-22 00:28:41 +01:00
|
|
|
svClipBoard.append(pSurface->m_LogList[lSelected[i]].m_svText);
|
2022-05-26 22:04:50 +02:00
|
|
|
|
|
|
|
clip::set_text(svClipBoard);
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: gets and handles the virtual item
|
|
|
|
// Input : &pEventArgs -
|
|
|
|
// *pSender -
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::GetVirtualItem(const std::unique_ptr<Forms::RetrieveVirtualItemEventArgs>& pEventArgs, Forms::Control* pSender)
|
2022-05-26 22:04:50 +02:00
|
|
|
{
|
2023-03-20 11:16:29 +01:00
|
|
|
CSurface* pSurface = reinterpret_cast<CSurface*>(pSender->FindForm());
|
2022-05-26 22:04:50 +02:00
|
|
|
if (static_cast<int>(pSurface->m_LogList.size()) <= 0)
|
|
|
|
return;
|
|
|
|
|
2023-04-03 13:12:22 +02:00
|
|
|
pEventArgs->Style.ForeColor = (Gdiplus::ARGB)Drawing::Color::White;
|
2022-05-26 22:04:50 +02:00
|
|
|
pEventArgs->Style.BackColor = pSender->BackColor();
|
|
|
|
pSurface->m_ConsoleListView->SetVirtualListSize(static_cast<int32_t>(pSurface->m_LogList.size()));
|
|
|
|
|
|
|
|
static const Drawing::Color cColor[] =
|
|
|
|
{
|
|
|
|
Drawing::Color(255, 255, 255), // Trace
|
|
|
|
Drawing::Color(0, 120, 215), // Debug
|
|
|
|
Drawing::Color(92, 236, 89), // Info
|
|
|
|
Drawing::Color(236, 203, 0), // Warn
|
|
|
|
Drawing::Color(236, 28, 0), // Error
|
|
|
|
Drawing::Color(236, 28, 0), // Critical
|
|
|
|
Drawing::Color(255, 255, 255), // General
|
|
|
|
};
|
|
|
|
static const String svLevel[] =
|
|
|
|
{
|
|
|
|
"trace",
|
|
|
|
"debug",
|
|
|
|
"info",
|
|
|
|
"warning",
|
|
|
|
"error",
|
|
|
|
"critical",
|
|
|
|
"general",
|
|
|
|
};
|
|
|
|
|
|
|
|
switch (pEventArgs->SubItemIndex)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
pEventArgs->Style.ForeColor = cColor[pSurface->m_LogList[pEventArgs->ItemIndex].m_nLevel];
|
|
|
|
pEventArgs->Text = svLevel[pSurface->m_LogList[pEventArgs->ItemIndex].m_nLevel];
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
pEventArgs->Text = pSurface->m_LogList[pEventArgs->ItemIndex].m_svText;
|
|
|
|
break;
|
|
|
|
}
|
2022-05-26 01:44:46 +02:00
|
|
|
}
|
|
|
|
|
2022-05-31 18:05:43 +02:00
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-21 00:14:54 +01:00
|
|
|
// Purpose: forward input command to all game window instances
|
2022-05-31 18:05:43 +02:00
|
|
|
// Input : *pSender -
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::ForwardCommandToGame(Forms::Control* pSender)
|
2022-05-31 18:05:43 +02:00
|
|
|
{
|
2023-03-20 11:16:29 +01:00
|
|
|
CSurface* pSurface = reinterpret_cast<CSurface*>(pSender->FindForm());
|
2023-03-21 00:14:54 +01:00
|
|
|
vector<HWND> vecHandles;
|
2022-05-31 18:05:43 +02:00
|
|
|
|
2023-03-21 00:14:54 +01:00
|
|
|
if (!EnumWindows(EnumWindowsProc, reinterpret_cast<LPARAM>(&vecHandles)))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (vecHandles.empty())
|
|
|
|
return;
|
|
|
|
|
2023-03-22 00:28:41 +01:00
|
|
|
const string kzCommand = pSurface->m_ConsoleCommandTextBox->Text().ToCString();
|
2023-03-21 00:14:54 +01:00
|
|
|
bool bSuccess = false;
|
|
|
|
|
|
|
|
for (const HWND hWindow : vecHandles)
|
2022-05-31 18:05:43 +02:00
|
|
|
{
|
2023-03-21 00:14:54 +01:00
|
|
|
char szWindowName[256];
|
|
|
|
GetWindowTextA(hWindow, szWindowName, 256);
|
2022-05-31 18:05:43 +02:00
|
|
|
|
2023-03-22 00:28:41 +01:00
|
|
|
COPYDATASTRUCT cData = { 0, (DWORD)(std::min)(kzCommand.size(), (size_t)259) + 1, (void*)kzCommand.c_str() };
|
2022-05-31 18:05:43 +02:00
|
|
|
bool bProcessingMessage = SendMessageA(hWindow, WM_COPYDATA, NULL, (LPARAM)&cData); // WM_COPYDATA will only return 0 or 1, that's why we use a boolean.
|
2023-03-21 00:14:54 +01:00
|
|
|
if (bProcessingMessage && !bSuccess)
|
2022-05-31 18:05:43 +02:00
|
|
|
{
|
2023-03-21 00:14:54 +01:00
|
|
|
bSuccess = true;
|
2022-05-31 18:05:43 +02:00
|
|
|
}
|
|
|
|
}
|
2023-03-21 00:14:54 +01:00
|
|
|
|
|
|
|
if (bSuccess) // At least one game instance received the command.
|
|
|
|
{
|
|
|
|
pSurface->m_LogList.push_back(LogList_t((spdlog::level::level_enum)2, kzCommand));
|
|
|
|
pSurface->m_ConsoleListView->SetVirtualListSize(static_cast<int32_t>(pSurface->m_LogList.size()));
|
|
|
|
pSurface->m_ConsoleListView->Refresh();
|
|
|
|
pSurface->m_ConsoleCommandTextBox->SetText("");
|
|
|
|
}
|
2022-05-31 18:05:43 +02:00
|
|
|
}
|
|
|
|
|
2023-03-20 00:01:49 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: formats and appends parameters, arguments to the parameter list
|
|
|
|
// Input : &svParameterList -
|
|
|
|
// *szParameter -
|
|
|
|
// *szArgument -
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::AppendParameterInternal(string& svParameterList, const char* szParameter, const char* szArgument /*= nullptr*/)
|
2023-03-20 00:01:49 +01:00
|
|
|
{
|
|
|
|
if (szArgument)
|
|
|
|
svParameterList.append(Format("%s \"%s\"\n", szParameter, szArgument));
|
|
|
|
else
|
|
|
|
svParameterList.append(Format("%s\n", szParameter));
|
|
|
|
}
|
|
|
|
|
2022-12-06 00:48:11 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: appends the reversed core count value to the command line buffer
|
|
|
|
// Input : &svParameters -
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::AppendReservedCoreCount(string& svParameters)
|
2022-12-06 00:48:11 +01:00
|
|
|
{
|
2023-01-21 15:34:37 +01:00
|
|
|
int nReservedCores = atoi(this->m_ReservedCoresTextBox->Text().ToCString());
|
|
|
|
if (nReservedCores > -1) // A reserved core count of 0 seems to crash the game on some systems.
|
2022-12-06 00:48:11 +01:00
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-numreservedcores",
|
|
|
|
this->m_ReservedCoresTextBox->Text().ToCString());
|
2022-12-06 00:48:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-06 12:04:44 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
2022-12-07 01:07:26 +01:00
|
|
|
// Purpose: appends the console parameters
|
|
|
|
// Input : &svParameters -
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::AppendConsoleParameters(string& svParameters)
|
2022-12-07 01:07:26 +01:00
|
|
|
{
|
|
|
|
if (this->m_ConsoleToggle->Checked())
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-wconsole");
|
2022-12-07 01:07:26 +01:00
|
|
|
|
|
|
|
if (this->m_ColorConsoleToggle->Checked())
|
2023-03-27 02:01:48 +02:00
|
|
|
AppendParameterInternal(svParameters, "-ansicolor");
|
2022-12-07 01:07:26 +01:00
|
|
|
|
|
|
|
if (!String::IsNullOrEmpty(this->m_PlaylistFileTextBox->Text()))
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-playlistfile",
|
|
|
|
this->m_PlaylistFileTextBox->Text().ToCString());
|
2022-12-07 01:07:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: appends the video parameters
|
2022-12-06 12:04:44 +01:00
|
|
|
// Input : &svParameters -
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::AppendVideoParameters(string& svParameters)
|
2022-12-06 12:04:44 +01:00
|
|
|
{
|
2022-12-07 01:07:26 +01:00
|
|
|
if (this->m_WindowedToggle->Checked())
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-windowed");
|
2022-12-07 01:07:26 +01:00
|
|
|
else
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-fullscreen");
|
2022-12-07 01:07:26 +01:00
|
|
|
|
|
|
|
if (this->m_NoBorderToggle->Checked())
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-noborder");
|
2022-12-07 01:07:26 +01:00
|
|
|
else
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-forceborder");
|
2022-12-07 01:07:26 +01:00
|
|
|
|
|
|
|
if (StringIsDigit(this->m_FpsTextBox->Text().ToCString()))
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "+fps_max",
|
|
|
|
this->m_FpsTextBox->Text().ToCString());
|
2022-12-07 01:07:26 +01:00
|
|
|
|
|
|
|
if (!String::IsNullOrEmpty(this->m_WidthTextBox->Text()))
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-w",
|
|
|
|
this->m_WidthTextBox->Text().ToCString());
|
2022-12-07 01:07:26 +01:00
|
|
|
|
|
|
|
if (!String::IsNullOrEmpty(this->m_HeightTextBox->Text()))
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-h",
|
|
|
|
this->m_HeightTextBox->Text().ToCString());
|
2022-12-07 01:07:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: appends the host parameters
|
|
|
|
// Input : &svParameters -
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::AppendHostParameters(string& svParameters)
|
2022-12-07 01:07:26 +01:00
|
|
|
{
|
|
|
|
if (!String::IsNullOrEmpty(this->m_HostNameTextBox->Text()))
|
2022-12-06 12:04:44 +01:00
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "+hostname", this->m_HostNameTextBox->Text().ToCString());
|
|
|
|
const char* szMode = "0"; // '0' = Offline (default).
|
2022-12-06 12:04:44 +01:00
|
|
|
|
2022-12-07 01:07:26 +01:00
|
|
|
switch (static_cast<eVisibility>(this->m_VisibilityCombo->SelectedIndex()))
|
|
|
|
{
|
|
|
|
case eVisibility::PUBLIC:
|
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
szMode = "2";
|
2022-12-07 01:07:26 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case eVisibility::HIDDEN:
|
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
szMode = "1";
|
2022-12-07 01:07:26 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2023-03-20 00:01:49 +01:00
|
|
|
|
|
|
|
AppendParameterInternal(svParameters, "+sv_pylonVisibility", szMode);
|
2022-12-06 12:04:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-07 01:07:26 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: appends the net parameters
|
|
|
|
// Input : &svParameters -
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
void CSurface::AppendNetParameters(string& svParameters)
|
2022-12-07 01:07:26 +01:00
|
|
|
{
|
|
|
|
if (this->m_NetEncryptionToggle->Checked())
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "+net_encryptionEnable", "1");
|
2022-12-07 01:07:26 +01:00
|
|
|
|
|
|
|
if (this->m_NetRandomKeyToggle->Checked())
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "+net_useRandomKey", "1");
|
2022-12-07 01:07:26 +01:00
|
|
|
|
|
|
|
if (this->m_NoQueuedPacketThread->Checked())
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "+net_queued_packet_thread", "0");
|
2022-12-07 01:07:26 +01:00
|
|
|
|
|
|
|
if (this->m_NoTimeOutToggle->Checked())
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-notimeout");
|
2022-12-07 01:07:26 +01:00
|
|
|
}
|
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: clears the form and reloads the playlist
|
|
|
|
// Input : &svParameters -
|
|
|
|
// Output : eLaunchMode [HOST - SERVER - CLIENT - NONE]
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
eLaunchMode CSurface::BuildParameter(string& svParameters)
|
2022-05-24 02:23:37 +02:00
|
|
|
{
|
2022-05-26 01:44:46 +02:00
|
|
|
eLaunchMode results = eLaunchMode::LM_NONE;
|
2022-05-24 02:23:37 +02:00
|
|
|
|
|
|
|
switch (static_cast<eMode>(this->m_ModeCombo->SelectedIndex()))
|
|
|
|
{
|
|
|
|
case eMode::HOST:
|
|
|
|
{
|
2022-05-26 01:44:46 +02:00
|
|
|
// GAME ###############################################################
|
2022-05-24 19:26:05 +02:00
|
|
|
if (!String::IsNullOrEmpty(this->m_MapCombo->Text()))
|
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "+map", this->m_MapCombo->Text().ToCString());
|
2022-05-24 19:26:05 +02:00
|
|
|
}
|
|
|
|
if (!String::IsNullOrEmpty(this->m_PlaylistCombo->Text()))
|
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "+launchplaylist", this->m_PlaylistCombo->Text().ToCString());
|
2022-05-24 19:26:05 +02:00
|
|
|
}
|
2022-10-07 22:33:37 +02:00
|
|
|
if (this->m_DeveloperToggle->Checked())
|
2022-05-24 02:23:37 +02:00
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-dev");
|
|
|
|
AppendParameterInternal(svParameters, "-devsdk");
|
2023-03-21 00:14:54 +01:00
|
|
|
results = eLaunchMode::LM_GAME_DEV;
|
2022-05-24 02:23:37 +02:00
|
|
|
}
|
|
|
|
else
|
2023-03-21 00:14:54 +01:00
|
|
|
results = eLaunchMode::LM_GAME;
|
2022-05-24 02:23:37 +02:00
|
|
|
|
|
|
|
if (this->m_CheatsToggle->Checked())
|
2022-05-30 22:28:03 +02:00
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-dev");
|
|
|
|
AppendParameterInternal(svParameters, "-showdevmenu");
|
2022-05-30 22:28:03 +02:00
|
|
|
}
|
2022-05-24 02:23:37 +02:00
|
|
|
|
2022-12-07 01:07:26 +01:00
|
|
|
this->AppendConsoleParameters(svParameters);
|
2022-05-24 02:23:37 +02:00
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
// ENGINE ###############################################################
|
2022-12-06 00:48:11 +01:00
|
|
|
this->AppendReservedCoreCount(svParameters);
|
2022-05-24 02:23:37 +02:00
|
|
|
|
|
|
|
if (this->m_SingleCoreDediToggle->Checked())
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "+sv_single_core_dedi", "1");
|
2022-05-24 02:23:37 +02:00
|
|
|
|
|
|
|
if (this->m_NoAsyncJobsToggle->Checked())
|
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-noasync");
|
|
|
|
AppendParameterInternal(svParameters, "+async_serialize", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+buildcubemaps_async", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+sv_asyncAIInit", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+sv_asyncSendSnapshot", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+sv_scriptCompileAsync", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+cl_scriptCompileAsync", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+cl_async_bone_setup", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+cl_updatedirty_async", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+mat_syncGPU", "1");
|
|
|
|
AppendParameterInternal(svParameters, "+mat_sync_rt", "1");
|
|
|
|
AppendParameterInternal(svParameters, "+mat_sync_rt_flushes_gpu", "1");
|
|
|
|
AppendParameterInternal(svParameters, "+net_async_sendto", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+physics_async_sv", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+physics_async_cl", "0");
|
2022-05-24 02:23:37 +02:00
|
|
|
}
|
|
|
|
|
2022-12-07 01:07:26 +01:00
|
|
|
this->AppendHostParameters(svParameters);
|
|
|
|
this->AppendNetParameters(svParameters);
|
|
|
|
this->AppendVideoParameters(svParameters);
|
2022-05-24 02:23:37 +02:00
|
|
|
|
|
|
|
if (!String::IsNullOrEmpty(this->m_LaunchArgsTextBox->Text()))
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, this->m_LaunchArgsTextBox->Text().ToCString());
|
2022-05-24 02:23:37 +02:00
|
|
|
|
|
|
|
return results;
|
2022-05-24 19:26:05 +02:00
|
|
|
}
|
|
|
|
case eMode::SERVER:
|
|
|
|
{
|
2022-05-26 01:44:46 +02:00
|
|
|
// GAME ###############################################################
|
2022-05-25 12:07:08 +02:00
|
|
|
if (!String::IsNullOrEmpty(this->m_MapCombo->Text()))
|
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "+map", this->m_MapCombo->Text().ToCString());
|
2022-05-25 12:07:08 +02:00
|
|
|
}
|
|
|
|
if (!String::IsNullOrEmpty(this->m_PlaylistCombo->Text()))
|
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "+launchplaylist", this->m_PlaylistCombo->Text().ToCString());
|
2022-05-25 12:07:08 +02:00
|
|
|
}
|
2022-10-07 22:33:37 +02:00
|
|
|
if (this->m_DeveloperToggle->Checked())
|
2022-05-25 12:07:08 +02:00
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-dev");
|
|
|
|
AppendParameterInternal(svParameters, "-devsdk");
|
2022-09-21 20:41:10 +02:00
|
|
|
results = eLaunchMode::LM_SERVER_DEV;
|
2022-05-25 12:07:08 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
results = eLaunchMode::LM_SERVER;
|
|
|
|
|
|
|
|
if (this->m_CheatsToggle->Checked())
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "+sv_cheats", "1");
|
2022-05-25 12:07:08 +02:00
|
|
|
|
2022-12-07 01:07:26 +01:00
|
|
|
this->AppendConsoleParameters(svParameters);
|
2022-05-25 12:07:08 +02:00
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
// ENGINE ###############################################################
|
2022-12-06 00:48:11 +01:00
|
|
|
this->AppendReservedCoreCount(svParameters);
|
2022-05-25 12:07:08 +02:00
|
|
|
|
|
|
|
if (this->m_SingleCoreDediToggle->Checked())
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "+sv_single_core_dedi", "1");
|
2022-05-25 12:07:08 +02:00
|
|
|
|
|
|
|
if (this->m_NoAsyncJobsToggle->Checked())
|
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-noasync");
|
|
|
|
AppendParameterInternal(svParameters, "+async_serialize", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+sv_asyncAIInit", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+sv_asyncSendSnapshot", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+sv_scriptCompileAsync", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+physics_async_sv", "0");
|
2022-05-25 12:07:08 +02:00
|
|
|
}
|
|
|
|
|
2022-12-07 01:07:26 +01:00
|
|
|
this->AppendHostParameters(svParameters);
|
|
|
|
this->AppendNetParameters(svParameters);
|
2022-05-25 12:07:08 +02:00
|
|
|
|
|
|
|
if (!String::IsNullOrEmpty(this->m_LaunchArgsTextBox->Text()))
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, this->m_LaunchArgsTextBox->Text().ToCString());
|
2022-05-24 19:26:05 +02:00
|
|
|
|
2022-05-25 12:07:08 +02:00
|
|
|
return results;
|
2022-05-24 19:26:05 +02:00
|
|
|
}
|
|
|
|
case eMode::CLIENT:
|
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-noworkerdll"); // This prevents init of worker dll
|
2022-10-09 12:41:22 +02:00
|
|
|
//(this dll is always imported, but we want client.dll to do the work instead).
|
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
// GAME ###############################################################
|
2022-10-07 22:33:37 +02:00
|
|
|
if (this->m_DeveloperToggle->Checked())
|
2022-05-25 12:07:08 +02:00
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-dev");
|
|
|
|
AppendParameterInternal(svParameters, "-devsdk");
|
2022-09-21 20:41:10 +02:00
|
|
|
results = eLaunchMode::LM_CLIENT_DEV;
|
2022-05-25 12:07:08 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
results = eLaunchMode::LM_CLIENT;
|
|
|
|
|
|
|
|
if (this->m_CheatsToggle->Checked())
|
2022-05-30 22:28:03 +02:00
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-dev");
|
|
|
|
AppendParameterInternal(svParameters, "-showdevmenu");
|
2022-05-30 22:28:03 +02:00
|
|
|
}
|
2022-05-25 12:07:08 +02:00
|
|
|
|
2022-12-07 01:07:26 +01:00
|
|
|
this->AppendConsoleParameters(svParameters);
|
2022-05-25 12:07:08 +02:00
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
// ENGINE ###############################################################
|
2022-12-06 00:48:11 +01:00
|
|
|
this->AppendReservedCoreCount(svParameters);
|
2022-05-25 12:07:08 +02:00
|
|
|
|
|
|
|
if (this->m_SingleCoreDediToggle->Checked())
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "+sv_single_core_dedi", "1");
|
2022-05-25 12:07:08 +02:00
|
|
|
|
|
|
|
if (this->m_NoAsyncJobsToggle->Checked())
|
|
|
|
{
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, "-noasync");
|
|
|
|
AppendParameterInternal(svParameters, "+async_serialize", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+buildcubemaps_async", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+cl_scriptCompileAsync", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+cl_async_bone_setup", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+cl_updatedirty_async", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+mat_syncGPU", "1");
|
|
|
|
AppendParameterInternal(svParameters, "+mat_sync_rt", "1");
|
|
|
|
AppendParameterInternal(svParameters, "+mat_sync_rt_flushes_gpu", "1");
|
|
|
|
AppendParameterInternal(svParameters, "+net_async_sendto", "0");
|
|
|
|
AppendParameterInternal(svParameters, "+physics_async_cl", "0");
|
2022-05-25 12:07:08 +02:00
|
|
|
}
|
|
|
|
|
2022-12-07 01:07:26 +01:00
|
|
|
this->AppendNetParameters(svParameters);
|
|
|
|
this->AppendVideoParameters(svParameters);
|
2022-05-25 12:07:08 +02:00
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
// MAIN ###############################################################
|
2022-05-25 12:07:08 +02:00
|
|
|
if (!String::IsNullOrEmpty(this->m_LaunchArgsTextBox->Text()))
|
2023-03-20 00:01:49 +01:00
|
|
|
AppendParameterInternal(svParameters, this->m_LaunchArgsTextBox->Text().ToCString());
|
2022-05-25 12:07:08 +02:00
|
|
|
|
|
|
|
return results;
|
2022-05-24 02:23:37 +02:00
|
|
|
}
|
|
|
|
default:
|
|
|
|
return results;
|
|
|
|
}
|
2022-05-23 19:14:12 +02:00
|
|
|
}
|
|
|
|
|
2023-03-24 00:10:48 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: gets the control item value
|
|
|
|
// Input : *pControl -
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
const char* CSurface::GetControlValue(Forms::Control* pControl)
|
|
|
|
{
|
|
|
|
switch (pControl->GetType())
|
|
|
|
{
|
|
|
|
case Forms::ControlTypes::CheckBox:
|
|
|
|
case Forms::ControlTypes::RadioButton:
|
|
|
|
{
|
|
|
|
return reinterpret_cast<UIX::UIXCheckBox*>(pControl)->Checked() ? "1" : "0";
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
return pControl->Text().ToCString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-26 01:44:46 +02:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-20 11:16:29 +01:00
|
|
|
CSurface::CSurface() : Forms::Form()
|
2022-05-23 19:14:12 +02:00
|
|
|
{
|
|
|
|
this->Init();
|
2022-05-26 01:44:46 +02:00
|
|
|
this->Setup();
|
2022-05-23 19:14:12 +02:00
|
|
|
}
|
2022-12-07 01:07:26 +01:00
|
|
|
|
2023-03-20 11:16:29 +01:00
|
|
|
CSurface* g_pMainUI;
|