Skip to content

Commit

Permalink
Remove old CEGUI version (0.4.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lpsd committed Oct 7, 2024
1 parent 2a42af5 commit bd4cdbf
Show file tree
Hide file tree
Showing 584 changed files with 1,570 additions and 167,264 deletions.
1 change: 0 additions & 1 deletion Client/core/CClientVariables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ void CClientVariables::LoadDefaults()
DEFAULT("discord_rpc_share_data", false); // Consistent Rich Presence data sharing
DEFAULT("discord_rpc_share_data_firsttime", false); // Display the user data sharing consent dialog box - for the first time
DEFAULT("_beta_qc_rightclick_command", _S("reconnect")); // Command to run when right clicking quick connect (beta - can be removed at any time)
DEFAULT("use_new_cegui", 0); // Should we use the new CEGUI 0.8.7? (for testing / development only)

if (!Exists("locale"))
{
Expand Down
14 changes: 2 additions & 12 deletions Client/core/CConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,6 @@ void CConsole::SetNextAutoCompleteMatch()

void CConsole::CreateElements(CGUIElement* pParent)
{
bool bNewCEGUI = CCore::GetSingleton().IsUsingNewCEGUI();

// Adjust window size to resolution
CVector2D ScreenSize = m_pManager->GetResolution();
m_fWindowX *= ScreenSize.fX / NATIVE_RES_X;
Expand All @@ -434,11 +432,7 @@ void CConsole::CreateElements(CGUIElement* pParent)
*/
CVector2D HistorySize = CVector2D(m_fWindowX - m_fWindowSpacer * 2.0f, m_fWindowY - m_fWindowSpacer * 1.5f - m_fWindowSpacerTop - m_fInputHeight);
m_pHistory = reinterpret_cast<CGUIMemo*>(m_pManager->CreateMemo(m_pWindow));

if (!bNewCEGUI)
m_pHistory->SetPosition(CVector2D(m_fWindowSpacer, m_fWindowSpacerTop));
else
m_pHistory->SetPosition(CVector2D(0, m_fWindowSpacer * 0.5f));
m_pHistory->SetPosition(CVector2D(0, m_fWindowSpacer * 0.5f));

CVector2D RelHistorySize = m_pWindow->AbsoluteToRelative(HistorySize);
m_pHistory->SetSize(HistorySize);
Expand All @@ -449,11 +443,7 @@ void CConsole::CreateElements(CGUIElement* pParent)
pos y: SPACER (TOP) + HISTORY HEIGHT + SPACER
*/
m_pInput = reinterpret_cast<CGUIEdit*>(m_pManager->CreateEdit(m_pWindow));

if (!bNewCEGUI)
m_pInput->SetPosition(CVector2D(m_fWindowSpacer, HistorySize.fY + m_fWindowSpacer * 0.5f + m_fWindowSpacerTop));
else
m_pInput->SetPosition(CVector2D(0, HistorySize.fY + m_fWindowSpacer));
m_pInput->SetPosition(CVector2D(0, HistorySize.fY + m_fWindowSpacer));

m_pInput->SetWidth(HistorySize.fX);
m_pInput->SetHeight(m_fInputHeight);
Expand Down
17 changes: 3 additions & 14 deletions Client/core/CCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1019,26 +1019,15 @@ void CCore::DeinitGUI()

void CCore::InitGUI(IDirect3DDevice9* pDevice)
{
SString sModuleName = IsUsingNewCEGUI() ? "GUINew" : "GUI";
SString sInitMethodName = IsUsingNewCEGUI() ? "InitNewGUIInterface" : "InitGUIInterface";
SString sModuleName = "GUI";
SString sInitMethodName = "InitGUIInterface";

m_pGUI = InitModule<CGUI>(m_GUIModule, sModuleName, sInitMethodName, pDevice);
}

void CCore::CreateGUI()
{
CVARS_GET("use_new_cegui", m_bUsingNewCEGUI);
m_bUsingNewCEGUI = true;

if (IsUsingNewCEGUI())
LoadModule(m_GUIModule, "GUINew", "cgui_new");
else
LoadModule(m_GUIModule, "GUI", "cgui");
}

bool CCore::IsUsingNewCEGUI()
{
return true;
LoadModule(m_GUIModule, "GUI", "cgui");
}

void CCore::DestroyGUI()
Expand Down
3 changes: 0 additions & 3 deletions Client/core/CCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@ class CCore : public CCoreInterface, public CSingleton<CCore>
void DeinitGUI();
void DestroyGUI();

// Temporary to get if using new CEGUI
bool IsUsingNewCEGUI();

// Web
bool IsWebCoreLoaded() { return m_pWebCore != nullptr; }
void DestroyWeb();
Expand Down
6 changes: 0 additions & 6 deletions Client/core/CGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,6 @@ void CLocalGUI::CreateObjects(IUnknown* pDevice)
CVARS_SET("current_skin", currentSkinName);
}

if (CCore::GetSingleton().IsUsingNewCEGUI())
{
currentSkinName = pGUI->GetDefaultSkinName();
CVARS_SET("current_skin", currentSkinName);
}

SetSkin(currentSkinName);

CreateWindows(false);
Expand Down
72 changes: 36 additions & 36 deletions Client/core/CSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ void CSettings::CreateGUI()
m_pButtonGenerateNickIcon = reinterpret_cast<CGUIStaticImage*>(pManager->CreateStaticImage(m_pButtonGenerateNick));
m_pButtonGenerateNickIcon->SetSize(CVector2D(1, 1), true);
m_pButtonGenerateNickIcon->LoadFromFile("cgui\\images\\serverbrowser\\refresh.png");
m_pButtonGenerateNickIcon->SetProperty("MousePassThroughEnabled", "True");
m_pButtonGenerateNickIcon->SetProperty("DistributeCapturedInputs", "True");
m_pButtonGenerateNickIcon->SetCursorPassThroughEnabled(true);
m_pButtonGenerateNickIcon->SetDistributeCapturedInputs(true);

m_pSavePasswords = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabMultiplayer, _("Save server passwords"), true));
m_pSavePasswords->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 50.0f));
Expand Down Expand Up @@ -933,8 +933,8 @@ void CSettings::CreateGUI()
m_pLabelBrowserBlacklistAdd->SetTextColor(0, 0, 0);
m_pLabelBrowserBlacklistAdd->SetSize(CVector2D(1, 1), true);
m_pLabelBrowserBlacklistAdd->SetAlpha(0.7f);
m_pLabelBrowserBlacklistAdd->SetProperty("MousePassThroughEnabled", "True");
m_pLabelBrowserBlacklistAdd->SetProperty("DistributeCapturedInputs", "True");
m_pLabelBrowserBlacklistAdd->SetCursorPassThroughEnabled(true);
m_pLabelBrowserBlacklistAdd->SetDistributeCapturedInputs(true);

m_pButtonBrowserBlacklistAdd = reinterpret_cast<CGUIButton*>(pManager->CreateButton(m_pTabBrowser, _("Block")));
m_pButtonBrowserBlacklistAdd->SetPosition(CVector2D(vecTemp.fX + m_pEditBrowserBlacklistAdd->GetSize().fX + 2.0f, vecTemp.fY));
Expand Down Expand Up @@ -968,8 +968,8 @@ void CSettings::CreateGUI()
m_pLabelBrowserWhitelistAdd->SetTextColor(0, 0, 0);
m_pLabelBrowserWhitelistAdd->SetSize(CVector2D(1, 1), true);
m_pLabelBrowserWhitelistAdd->SetAlpha(0.7f);
m_pLabelBrowserWhitelistAdd->SetProperty("MousePassThroughEnabled", "True");
m_pLabelBrowserWhitelistAdd->SetProperty("DistributeCapturedInputs", "True");
m_pLabelBrowserWhitelistAdd->SetCursorPassThroughEnabled(true);
m_pLabelBrowserWhitelistAdd->SetDistributeCapturedInputs(true);

m_pButtonBrowserWhitelistAdd = reinterpret_cast<CGUIButton*>(pManager->CreateButton(m_pTabBrowser, _("Allow")));
m_pButtonBrowserWhitelistAdd->SetPosition(CVector2D(vecTemp.fX + m_pEditBrowserWhitelistAdd->GetSize().fX + 2.0f, vecTemp.fY));
Expand Down Expand Up @@ -2590,10 +2590,10 @@ void CSettings::ProcessKeyBinds()

bool CSettings::OnBindsListClick(CGUIElement* pElement)
{
CGUIListItem* pItem = m_pBindsList->GetSelectedItem();
CGUIGridListItem* pItem = m_pBindsList->GetSelectedItem();
if (pItem)
{
CGUIListItem* pItemBind = m_pBindsList->GetItem(m_pBindsList->GetItemRowIndex(pItem), m_hBind);
CGUIGridListItem* pItemBind = m_pBindsList->GetItem(m_pBindsList->GetItemRowIndex(pItem), m_hBind);

// Proceed if the user didn't select the "Bind"-column
if (pItem != pItemBind)
Expand Down Expand Up @@ -3112,7 +3112,7 @@ void CSettings::LoadData()
unsigned int uiIndex = 0;
while (uiIndex != m_pInterfaceLanguageSelector->GetItemCount())
{
CGUIListItem* pItem = m_pInterfaceLanguageSelector->GetItemByIndex(uiIndex);
CGUIStandardItem* pItem = m_pInterfaceLanguageSelector->GetItemByIndex(uiIndex);
if (((const char*)pItem->GetData()) == strLocale)
break;

Expand Down Expand Up @@ -3373,17 +3373,17 @@ void CSettings::SaveData()

// update from gui
bNextWindowed = m_pCheckBoxWindowed->GetSelected();
if (CGUIListItem* pSelected = m_pComboResolution->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pComboResolution->GetSelectedItem())
iNextVidMode = (int)pSelected->GetData();
bNextFSMinimize = m_pCheckBoxMinimize->GetSelected();
if (CGUIListItem* pSelected = m_pFullscreenStyleCombo->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pFullscreenStyleCombo->GetSelectedItem())
iNextFullscreenStyle = (int)pSelected->GetData();
if (CGUIListItem* pSelected = m_pComboAntiAliasing->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pComboAntiAliasing->GetSelectedItem())
iAntiAliasing = (int)pSelected->GetData();
bool bCustomizedSAFilesEnabled = m_pCheckBoxCustomizedSAFiles->GetSelected();
bool bCustomizedSAFilesWasEnabled = GetApplicationSettingInt("customized-sa-files-request") != 0;

if (CGUIListItem* pSelected = m_pPriorityCombo->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pPriorityCombo->GetSelectedItem())
{
int iSelected = (int)pSelected->GetData();
CVARS_SET("process_priority", iSelected);
Expand Down Expand Up @@ -3422,13 +3422,13 @@ void CSettings::SaveData()
CVARS_SET("anisotropic", iAnisotropic);

// Visual FX Quality
if (CGUIListItem* pQualitySelected = m_pComboFxQuality->GetSelectedItem())
if (CGUIStandardItem* pQualitySelected = m_pComboFxQuality->GetSelectedItem())
{
gameSettings->SetFXQuality((int)pQualitySelected->GetData());
}

// Aspect ratio
if (CGUIListItem* pRatioSelected = m_pComboAspectRatio->GetSelectedItem())
if (CGUIStandardItem* pRatioSelected = m_pComboAspectRatio->GetSelectedItem())
{
eAspectRatio aspectRatio = (eAspectRatio)(int)pRatioSelected->GetData();
CVARS_SET("aspect_ratio", aspectRatio);
Expand Down Expand Up @@ -3531,7 +3531,7 @@ void CSettings::SaveData()
gameSettings->SetDynamicPedShadowsEnabled(bDynamicPedShadows);

// Fast clothes loading
if (CGUIListItem* pSelected = m_pFastClothesCombo->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pFastClothesCombo->GetSelectedItem())
{
int iSelected = (int)pSelected->GetData();
CVARS_SET("fast_clothes_loading", iSelected);
Expand All @@ -3543,34 +3543,34 @@ void CSettings::SaveData()
gameSettings->SetRadioAutotuneEnabled(m_pCheckBoxAudioAutotune->GetSelected());
gameSettings->SetUsertrackAutoScan(m_pCheckBoxUserAutoscan->GetSelected());

if (CGUIListItem* pSelected = m_pComboUsertrackMode->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pComboUsertrackMode->GetSelectedItem())
{
gameSettings->SetUsertrackMode((int)pSelected->GetData());
}

// Browser speed
if (CGUIListItem* pSelected = m_pBrowserSpeedCombo->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pBrowserSpeedCombo->GetSelectedItem())
{
int iSelected = (int)pSelected->GetData();
CVARS_SET("browser_speed", iSelected);
}

// Single download
if (CGUIListItem* pSelected = m_pSingleDownloadCombo->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pSingleDownloadCombo->GetSelectedItem())
{
int iSelected = (int)pSelected->GetData();
CVARS_SET("single_download", iSelected);
}

// Packet tag
if (CGUIListItem* pSelected = m_pPacketTagCombo->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pPacketTagCombo->GetSelectedItem())
{
int iSelected = (int)pSelected->GetData();
CVARS_SET("packet_tag", iSelected);
}

// Progress animation
if (CGUIListItem* pSelected = m_pProgressAnimationCombo->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pProgressAnimationCombo->GetSelectedItem())
{
int iSelected = (int)pSelected->GetData();
CVARS_SET("progress_animation", iSelected);
Expand All @@ -3583,21 +3583,21 @@ void CSettings::SaveData()
SetApplicationSettingInt("Win8MouseFix", m_pWin8MouseCheckBox->GetSelected());

// Debug setting
if (CGUIListItem* pSelected = m_pDebugSettingCombo->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pDebugSettingCombo->GetSelectedItem())
{
EDiagnosticDebugType iSelected = (EDiagnosticDebugType)(int)pSelected->GetData();
g_pCore->SetDiagnosticDebug(iSelected);
}

// Update build type
if (CGUIListItem* pSelected = m_pUpdateBuildTypeCombo->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pUpdateBuildTypeCombo->GetSelectedItem())
{
int iSelected = (int)pSelected->GetData();
CVARS_SET("update_build_type", iSelected);
}

// Update auto install
if (CGUIListItem* pSelected = m_pUpdateAutoInstallCombo->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pUpdateAutoInstallCombo->GetSelectedItem())
{
int iSelected = (int)pSelected->GetData();
CVARS_SET("update_auto_install", iSelected);
Expand All @@ -3610,7 +3610,7 @@ void CSettings::SaveData()
CVARS_SET("mapalpha", fMapAlpha);

// Language
CGUIListItem* pItem = m_pInterfaceLanguageSelector->GetSelectedItem();
CGUIStandardItem* pItem = m_pInterfaceLanguageSelector->GetSelectedItem();
if (pItem)
{
const char* szItemText = (const char*)pItem->GetData();
Expand Down Expand Up @@ -3645,17 +3645,17 @@ void CSettings::SaveData()

CVARS_SET("chat_position_offset_x", m_pChatOffsetX->GetText());
CVARS_SET("chat_position_offset_y", m_pChatOffsetY->GetText());
if (CGUIListItem* pSelected = m_pChatHorizontalCombo->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pChatHorizontalCombo->GetSelectedItem())
{
int iSelected = (int)pSelected->GetData();
CVARS_SET("chat_position_horizontal", iSelected);
}
if (CGUIListItem* pSelected = m_pChatVerticalCombo->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pChatVerticalCombo->GetSelectedItem())
{
int iSelected = (int)pSelected->GetData();
CVARS_SET("chat_position_vertical", iSelected);
}
if (CGUIListItem* pSelected = m_pChatTextAlignCombo->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pChatTextAlignCombo->GetSelectedItem())
{
int iSelected = (int)pSelected->GetData();
CVARS_SET("chat_text_alignment", iSelected);
Expand Down Expand Up @@ -3949,7 +3949,7 @@ void CSettings::LoadChatPresets()
CXMLAttribute* pName = pNode->GetAttributes().Find("name");
if (pName && pName->GetValue()[1])
{
CGUIListItem* pItem = m_pChatPresets->AddItem(pName->GetValue().c_str());
CGUIStandardItem* pItem = m_pChatPresets->AddItem(pName->GetValue().c_str());
pItem->SetData(pNode);
}
}
Expand All @@ -3966,7 +3966,7 @@ void CSettings::LoadSkins()

for (std::vector<SString>::iterator it = directories.begin(); it != directories.end(); ++it)
{
CGUIListItem* item = m_pInterfaceSkinSelector->AddItem((*it));
CGUIStandardItem* item = m_pInterfaceSkinSelector->AddItem((*it));
// TODO: add validation of the skin

if (currentSkin == (*it))
Expand Down Expand Up @@ -4012,7 +4012,7 @@ void CSettings::SetMilliseconds(CGUIEdit* pEdit, int iValue)

bool CSettings::OnChatLoadPresetClick(CGUIElement* pElement)
{
CGUIListItem* pItem = m_pChatPresets->GetSelectedItem();
CGUIStandardItem* pItem = m_pChatPresets->GetSelectedItem();
if (!pItem)
return true;

Expand Down Expand Up @@ -4147,7 +4147,7 @@ bool CSettings::OnChatLoadPresetClick(CGUIElement* pElement)

bool CSettings::OnLanguageChanged(CGUIElement* pElement)
{
CGUIListItem* pItem = m_pInterfaceLanguageSelector->GetSelectedItem();
CGUIStandardItem* pItem = m_pInterfaceLanguageSelector->GetSelectedItem();
if (!pItem)
return true;

Expand All @@ -4159,7 +4159,7 @@ bool CSettings::OnLanguageChanged(CGUIElement* pElement)
unsigned int uiIndex = 0;
while (uiIndex != m_pInterfaceLanguageSelector->GetItemCount())
{
CGUIListItem* pItem = m_pInterfaceLanguageSelector->GetItemByIndex(uiIndex);
CGUIStandardItem* pItem = m_pInterfaceLanguageSelector->GetItemByIndex(uiIndex);
if (((const char*)pItem->GetData()) == strLocale)
break;

Expand All @@ -4177,7 +4177,7 @@ bool CSettings::OnLanguageChanged(CGUIElement* pElement)

bool CSettings::OnSkinChanged(CGUIElement* pElement)
{
CGUIListItem* pItem = m_pInterfaceSkinSelector->GetSelectedItem();
CGUIStandardItem* pItem = m_pInterfaceSkinSelector->GetSelectedItem();
if (!pItem)
return true;

Expand Down Expand Up @@ -4429,7 +4429,7 @@ bool CSettings::OnChatAlphaChanged(CGUIElement* pElement)
bool CSettings::OnUpdateButtonClick(CGUIElement* pElement)
{
// Update build type
if (CGUIListItem* pSelected = m_pUpdateBuildTypeCombo->GetSelectedItem())
if (CGUIStandardItem* pSelected = m_pUpdateBuildTypeCombo->GetSelectedItem())
{
int iSelected = (int)pSelected->GetData();
CVARS_SET("update_build_type", iSelected);
Expand All @@ -4449,7 +4449,7 @@ bool CSettings::OnCachePathShowButtonClick(CGUIElement* pElement)

bool CSettings::OnFxQualityChanged(CGUIElement* pElement)
{
CGUIListItem* pItem = m_pComboFxQuality->GetSelectedItem();
CGUIStandardItem* pItem = m_pComboFxQuality->GetSelectedItem();
if (!pItem)
return true;

Expand Down
4 changes: 2 additions & 2 deletions Client/core/CSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct SKeyBindSection
char* szTitle;
char* szOriginalTitle;
int rowCount;
class CGUIListItem* headerItem;
class CGUIGridListItem* headerItem;
};

class CColor;
Expand Down Expand Up @@ -456,7 +456,7 @@ class CSettings
bool m_bMuteMTA;
bool m_bMuteVoice;

CGUIListItem* m_pSelectedBind;
CGUIGridListItem* m_pSelectedBind;

DWORD m_dwFrameCount;
bool m_bShownVolumetricShadowsWarning;
Expand Down
Loading

0 comments on commit bd4cdbf

Please sign in to comment.