Skip to content

Commit

Permalink
Make all code in GameGUI library build properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamyCecil committed Oct 19, 2023
1 parent 53afb1e commit dc7d2c9
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 73 deletions.
6 changes: 3 additions & 3 deletions Sources/GameGUIMP/DlgEditButtonAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ void CDlgEditButtonAction::DoDataExchange(CDataExchange* pDX)
// if dialog is giving data
if( pDX->m_bSaveAndValidate != FALSE)
{
m_pbaButtonAction->ba_strName = m_strButtonActionName;
m_pbaButtonAction->ba_strCommandLineWhenPressed = m_strButtonDownCommand;
m_pbaButtonAction->ba_strCommandLineWhenReleased = m_strButtonUpCommand;
m_pbaButtonAction->ba_strName = CStringA(m_strButtonActionName);
m_pbaButtonAction->ba_strCommandLineWhenPressed = CStringA(m_strButtonDownCommand);
m_pbaButtonAction->ba_strCommandLineWhenReleased = CStringA(m_strButtonUpCommand);
}
}

Expand Down
34 changes: 17 additions & 17 deletions Sources/GameGUIMP/DlgPlayerControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void CDlgPlayerControls::DoDataExchange(CDataExchange* pDX)
// enable combo control
m_comboControlerAxis.EnableWindow();
// get curently mounted controler description
CTString strControlerName = m_listAxisActions.GetItemText( iSelectedAxis, 1);
CString strControlerName = m_listAxisActions.GetItemText( iSelectedAxis, 1);
// find in combo currently selected mounted axis
int iComboEntry = m_comboControlerAxis.FindStringExact( -1, strControlerName);
// and select it
Expand Down Expand Up @@ -187,13 +187,13 @@ void CDlgPlayerControls::FillActionsList(void)
// macro for adding single button action into list control
itItem.iItem = ctItemsAdded;
itItem.iSubItem = 0;
itItem.pszText = (char *)(const char *) itButtonAction->ba_strName;
itItem.pszText = (LPTSTR)itButtonAction->ba_strName.Data();
m_listButtonActions.InsertItem( &itItem);
itItem.iSubItem = 1;
itItem.pszText = (char *)(const char *)_pInput->GetButtonName( itButtonAction->ba_iFirstKey);
itItem.pszText = (LPTSTR)_pInput->GetButtonName( itButtonAction->ba_iFirstKey).ConstData();
m_listButtonActions.SetItem( &itItem);
itItem.iSubItem = 2;
itItem.pszText = (char *)(const char *)_pInput->GetButtonName( itButtonAction->ba_iSecondKey);
itItem.pszText = (LPTSTR)_pInput->GetButtonName( itButtonAction->ba_iSecondKey).ConstData();
m_listButtonActions.SetItem( &itItem);
ctItemsAdded++;
}
Expand Down Expand Up @@ -225,11 +225,11 @@ void CDlgPlayerControls::FillAxisList(void)
for(INDEX iAxis = 0; iAxis<AXIS_ACTIONS_CT; iAxis++) {
itItem.iItem = iAxis;
itItem.iSubItem = 0;
itItem.pszText = (char*)(const char*)_pGame->gm_astrAxisNames[iAxis];
itItem.pszText = (LPTSTR)_pGame->gm_astrAxisNames[iAxis].ConstData();
m_listAxisActions.InsertItem( &itItem);
itItem.iSubItem = 1;
itItem.pszText = (char *)(const char *)_pInput->GetAxisName(
m_ctrlControls.ctrl_aaAxisActions[iAxis].aa_iAxisAction);
itItem.pszText = (LPTSTR)_pInput->GetAxisName(
m_ctrlControls.ctrl_aaAxisActions[iAxis].aa_iAxisAction).ConstData();
m_listAxisActions.SetItem( &itItem);
}

Expand Down Expand Up @@ -259,14 +259,14 @@ BOOL CDlgPlayerControls::OnInitDialog()
m_listButtonActions.GetClientRect( rectListControl);
// insert column for action names
INDEX iMainColumnWidth = rectListControl.Width()*BUTTON_ACTION_NAME_PERCENTAGE/100;
m_listButtonActions.InsertColumn( 0, "Button action", LVCFMT_LEFT, iMainColumnWidth);
m_listButtonActions.InsertColumn( 0, CString("Button action"), LVCFMT_LEFT, iMainColumnWidth);
// insert first control column
INDEX iFirstSubColumnWidth = (rectListControl.Width()*(100-BUTTON_ACTION_NAME_PERCENTAGE)/2)/100;
m_listButtonActions.InsertColumn( 1, "First", LVCFMT_LEFT, iFirstSubColumnWidth);
m_listButtonActions.InsertColumn( 1, CString("First"), LVCFMT_LEFT, iFirstSubColumnWidth);
// insert second control column
INDEX iSecondSubColumnWidth =
rectListControl.Width()-iMainColumnWidth-iFirstSubColumnWidth - 16;
m_listButtonActions.InsertColumn( 2, "Second", LVCFMT_LEFT, iSecondSubColumnWidth);
m_listButtonActions.InsertColumn( 2, CString("Second"), LVCFMT_LEFT, iSecondSubColumnWidth);

// add all actions into actions list
FillActionsList();
Expand All @@ -275,18 +275,18 @@ BOOL CDlgPlayerControls::OnInitDialog()
m_listAxisActions.GetClientRect( rectListControl);
// insert column for axis action names
iMainColumnWidth = rectListControl.Width()*AXIS_ACTION_NAME_PERCENTAGE/100;
m_listAxisActions.InsertColumn( 0, "Axis action", LVCFMT_LEFT, iMainColumnWidth);
m_listAxisActions.InsertColumn( 0, CString("Axis action"), LVCFMT_LEFT, iMainColumnWidth);
// insert mounting controls column
INDEX iAxisMouterNameWidth = rectListControl.Width()*(100-AXIS_ACTION_NAME_PERCENTAGE)/100-1;
m_listAxisActions.InsertColumn( 1, "Current controler", LVCFMT_LEFT, iAxisMouterNameWidth);
m_listAxisActions.InsertColumn( 1, CString("Current controler"), LVCFMT_LEFT, iAxisMouterNameWidth);

// add all available axis into axis list
FillAxisList();

// for all possible axis mounting controlers
for( INDEX iAxis=0; iAxis<_pInput->GetAvailableAxisCount(); iAxis++)
{
m_comboControlerAxis.AddString( _pInput->GetAxisName( iAxis));
m_comboControlerAxis.AddString( CString( _pInput->GetAxisName( iAxis)));
}

return TRUE;
Expand All @@ -299,11 +299,11 @@ void CDlgPlayerControls::SetFirstAndSecondButtonNames(void)
if( pbaCurrent != NULL)
{
// type first currently mounted button's name
m_editFirstControl.SetWindowText( (char *)(const char *)
_pInput->GetButtonName( pbaCurrent->ba_iFirstKey) );
m_editFirstControl.SetWindowText( CString(
_pInput->GetButtonName( pbaCurrent->ba_iFirstKey) ));
// type second currently mounted button's name
m_editSecondControl.SetWindowText( (char *)(const char *)
_pInput->GetButtonName( pbaCurrent->ba_iSecondKey) );
m_editSecondControl.SetWindowText( CString(
_pInput->GetButtonName( pbaCurrent->ba_iSecondKey) ));
// enable edit key and "none" controls
bEnablePressKeyControls = TRUE;
}
Expand Down
12 changes: 6 additions & 6 deletions Sources/GameGUIMP/DlgPlayerSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ void CDlgPlayerSettings::InitPlayersAndControlsLists(void)
for( INDEX iPC=0; iPC<8; iPC++)
{
CTString strPlayer = _pGame->gm_apcPlayers[ iPC].pc_strName;
m_listAvailablePlayers.AddString( strPlayer);
m_listAvailablePlayers.AddString( CString(strPlayer));
//CTString strControls = _pGame->gm_actrlControls[ iPC].ctrl_strName;
m_listAvailableControls.AddString( "dummy");
m_listAvailableControls.AddString( CString("dummy"));
}
m_listAvailableControls.SetCurSel( 0);
m_listAvailablePlayers.SetCurSel( 0);
Expand Down Expand Up @@ -168,7 +168,7 @@ void CDlgPlayerSettings::OnEditControls()
}
catch (char *strError)
{
AfxMessageBox( strError);
AfxMessageBox( CString(strError));
return;
}
}
Expand All @@ -184,7 +184,7 @@ void CDlgPlayerSettings::OnRenameControls()
dlgRename.m_strName = "dummy";
// if new file properly edited and ok pressed
if( (dlgRename.DoModal() == IDOK) &&
(strlen( dlgRename.m_strName) != 0) )
(dlgRename.m_strName.GetLength() != 0) )
{
// _pGame->gm_actrlControls[ iSelectedControls].ctrl_strName = dlgRename.m_strName;
// save players and controls
Expand All @@ -204,9 +204,9 @@ void CDlgPlayerSettings::OnRenamePlayer()
dlgRename.m_strName = strName;
// if new file properly edited and ok pressed
if( (dlgRename.DoModal() == IDOK) &&
(strlen( dlgRename.m_strName) != 0) )
(dlgRename.m_strName.GetLength() != 0) )
{
_pGame->gm_apcPlayers[ iSelectedPlayer].pc_strName = dlgRename.m_strName;
_pGame->gm_apcPlayers[ iSelectedPlayer].pc_strName = CStringA(dlgRename.m_strName);
// save players and controls
_pGame->SavePlayersAndControls();
InitPlayersAndControlsLists();
Expand Down
4 changes: 2 additions & 2 deletions Sources/GameGUIMP/DlgSelectPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ BOOL CDlgSelectPlayer::OnInitDialog()
for( INDEX iPC=0; iPC<8; iPC++)
{
CTString strPlayer = _pGame->gm_apcPlayers[ iPC].pc_strName;
m_comboAvailablePlayers.AddString( strPlayer);
m_comboAvailablePlayers.AddString( CString(strPlayer));
// CTString strControls = _pGame->gm_actrlControls[ iPC].ctrl_strName;
m_comboAvailableControls.AddString( "dummy");
m_comboAvailableControls.AddString( CString("dummy"));
}
m_comboAvailablePlayers.SetCurSel( _pGame->gm_iWEDSinglePlayer);
m_comboAvailableControls.SetCurSel( _pGame->gm_iWEDSinglePlayer);
Expand Down
2 changes: 1 addition & 1 deletion Sources/GameGUIMP/EditConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ BOOL CEditConsole::PreTranslateMessage(MSG* pMsg)
if( !bCtrl && (iCharOffset != -1) )
{
// extract string to execute
wchar_t achrToExecute[ 1024];
TCHAR achrToExecute[ 1024];
INDEX ctLetters = GetLine( iCurrentLine, achrToExecute, 1023);
// set EOF delimiter
achrToExecute[ ctLetters] = 0;
Expand Down
4 changes: 2 additions & 2 deletions Sources/GameGUIMP/GameGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void CGameGUI::OnInvokeConsole(void)

void CGameGUI::OnPlayerSettings(void)
{
//CALL_DIALOG( CDlgPlayerSettings, dlgPlayerSettings);
CALL_DIALOG( CDlgPlayerSettings, dlgPlayerSettings);
}

void CGameGUI::OnAudioQuality(void)
Expand All @@ -183,5 +183,5 @@ void CGameGUI::OnVideoQuality(void)

void CGameGUI::OnSelectPlayerAndControls(void)
{
//CALL_DIALOG( CDlgSelectPlayer, dlgSelectPlayerAndControls);
CALL_DIALOG( CDlgSelectPlayer, dlgSelectPlayerAndControls);
}
49 changes: 7 additions & 42 deletions Sources/GameGUIMP/GameGUIMP.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -269,52 +269,17 @@
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="ActionsListControl.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="AxisListCtrl.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="ActionsListControl.cpp" />
<ClCompile Include="AxisListCtrl.cpp" />
<ClCompile Include="ConsoleSymbolsCombo.cpp" />
<ClCompile Include="DlgAudioQuality.cpp" />
<ClCompile Include="DlgConsole.cpp" />
<ClCompile Include="DlgEditButtonAction.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="DlgEditButtonAction.cpp" />
<ClCompile Include="DlgPlayerAppearance.cpp" />
<ClCompile Include="DlgPlayerControls.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="DlgPlayerSettings.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="DlgRenameControls.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="DlgSelectPlayer.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="DlgPlayerControls.cpp" />
<ClCompile Include="DlgPlayerSettings.cpp" />
<ClCompile Include="DlgRenameControls.cpp" />
<ClCompile Include="DlgSelectPlayer.cpp" />
<ClCompile Include="DlgVideoQuality.cpp" />
<ClCompile Include="EditConsole.cpp" />
<ClCompile Include="GameGUI.cpp" />
Expand Down

0 comments on commit dc7d2c9

Please sign in to comment.