dolphin/Source/Core/DolphinQt/Config/FreeLookWindow.cpp
LillyJadeKatrin 0abfa94bc8 Disable Freelook in hardcore mode
The player getting a better view of their surroundings than the game would normally allow could possibly give the player an advantage over the original hardware, so Freelook is disabled in hardcore mode. To do this, I disable the config flag for Freelook when it is accessed, to make sure that it is disabled whether it was enabled before or after hardcore mode was enabled.
2023-12-02 16:41:16 -05:00

48 lines
1.3 KiB
C++

// Copyright 2020 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "DolphinQt/Config/FreeLookWindow.h"
#include <QDialogButtonBox>
#include <QLabel>
#include <QTabWidget>
#include <QVBoxLayout>
#include "DolphinQt/Config/FreeLookWidget.h"
#include "DolphinQt/Config/HardcoreWarningWidget.h"
FreeLookWindow::FreeLookWindow(QWidget* parent) : QDialog(parent)
{
CreateMainLayout();
ConnectWidgets();
setWindowTitle(tr("Free Look Settings"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
}
void FreeLookWindow::CreateMainLayout()
{
#ifdef USE_RETRO_ACHIEVEMENTS
m_hc_warning = new HardcoreWarningWidget(this);
#endif // USE_RETRO_ACHIEVEMENTS
m_button_box = new QDialogButtonBox(QDialogButtonBox::Close);
connect(m_button_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
auto* main_layout = new QVBoxLayout();
#ifdef USE_RETRO_ACHIEVEMENTS
main_layout->addWidget(m_hc_warning);
#endif // USE_RETRO_ACHIEVEMENTS
main_layout->addWidget(new FreeLookWidget(this));
main_layout->addWidget(m_button_box);
setLayout(main_layout);
}
void FreeLookWindow::ConnectWidgets()
{
#ifdef USE_RETRO_ACHIEVEMENTS
connect(m_hc_warning, &HardcoreWarningWidget::OpenAchievementSettings, this,
&FreeLookWindow::OpenAchievementSettings);
#endif // USE_RETRO_ACHIEVEMENTS
}