Merge pull request #11907 from lioncash/pragma
DolphinQt/InfinityBaseWindow: Minor changes
This commit is contained in:
commit
f53b1216da
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include "DolphinQt/InfinityBase/InfinityBaseWindow.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QCompleter>
|
||||
|
@ -19,6 +21,8 @@
|
|||
#include "Common/IOFile.h"
|
||||
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/IOS/USB/Emulated/Infinity.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include "DolphinQt/QtUtils/DolphinFileDialog.h"
|
||||
|
@ -55,7 +59,7 @@ void InfinityBaseWindow::CreateMainWindow()
|
|||
checkbox_layout->setAlignment(Qt::AlignHCenter);
|
||||
m_checkbox = new QCheckBox(tr("Emulate Infinity Base"), this);
|
||||
m_checkbox->setChecked(Config::Get(Config::MAIN_EMULATE_INFINITY_BASE));
|
||||
connect(m_checkbox, &QCheckBox::toggled, [=](bool checked) { EmulateBase(checked); });
|
||||
connect(m_checkbox, &QCheckBox::toggled, this, &InfinityBaseWindow::EmulateBase);
|
||||
checkbox_layout->addWidget(m_checkbox);
|
||||
checkbox_group->setLayout(checkbox_layout);
|
||||
main_layout->addWidget(checkbox_group);
|
||||
|
@ -71,19 +75,19 @@ void InfinityBaseWindow::CreateMainWindow()
|
|||
auto* vbox_group = new QVBoxLayout();
|
||||
auto* scroll_area = new QScrollArea();
|
||||
|
||||
AddFigureSlot(vbox_group, QString(tr("Play Set/Power Disc")), 0);
|
||||
AddFigureSlot(vbox_group, tr("Play Set/Power Disc"), 0);
|
||||
add_line(vbox_group);
|
||||
AddFigureSlot(vbox_group, QString(tr("Player One")), 1);
|
||||
AddFigureSlot(vbox_group, tr("Player One"), 1);
|
||||
add_line(vbox_group);
|
||||
AddFigureSlot(vbox_group, QString(tr("Player One Ability One")), 3);
|
||||
AddFigureSlot(vbox_group, tr("Player One Ability One"), 3);
|
||||
add_line(vbox_group);
|
||||
AddFigureSlot(vbox_group, QString(tr("Player One Ability Two")), 5);
|
||||
AddFigureSlot(vbox_group, tr("Player One Ability Two"), 5);
|
||||
add_line(vbox_group);
|
||||
AddFigureSlot(vbox_group, QString(tr("Player Two")), 2);
|
||||
AddFigureSlot(vbox_group, tr("Player Two"), 2);
|
||||
add_line(vbox_group);
|
||||
AddFigureSlot(vbox_group, QString(tr("Player Two Ability One")), 4);
|
||||
AddFigureSlot(vbox_group, tr("Player Two Ability One"), 4);
|
||||
add_line(vbox_group);
|
||||
AddFigureSlot(vbox_group, QString(tr("Player Two Ability Two")), 6);
|
||||
AddFigureSlot(vbox_group, tr("Player Two Ability Two"), 6);
|
||||
|
||||
m_group_figures->setLayout(vbox_group);
|
||||
scroll_area->setWidget(m_group_figures);
|
||||
|
@ -199,8 +203,9 @@ CreateFigureDialog::CreateFigureDialog(QWidget* parent, u8 slot) : QDialog(paren
|
|||
((slot == 3 || slot == 4 || slot == 5 || slot == 6) &&
|
||||
(figure > 0x2DC6C0 && figure < 0x3D08FF)))
|
||||
{
|
||||
combo_figlist->addItem(QString::fromStdString(entry.first), QVariant(figure));
|
||||
filterlist << QString::fromStdString(entry.first);
|
||||
const auto figure_name = QString::fromStdString(entry.first);
|
||||
combo_figlist->addItem(figure_name, QVariant(figure));
|
||||
filterlist << figure_name;
|
||||
if (first_entry == 0)
|
||||
{
|
||||
first_entry = figure;
|
||||
|
@ -226,7 +231,7 @@ CreateFigureDialog::CreateFigureDialog(QWidget* parent, u8 slot) : QDialog(paren
|
|||
|
||||
auto* hbox_idvar = new QHBoxLayout();
|
||||
auto* label_id = new QLabel(tr("Figure Number:"));
|
||||
auto* edit_num = new QLineEdit(QString::fromStdString(std::to_string(first_entry)));
|
||||
auto* edit_num = new QLineEdit(QString::number(first_entry));
|
||||
auto* rxv = new QRegularExpressionValidator(QRegularExpression(QStringLiteral("\\d*")), this);
|
||||
edit_num->setValidator(rxv);
|
||||
hbox_idvar->addWidget(label_id);
|
||||
|
@ -263,7 +268,7 @@ CreateFigureDialog::CreateFigureDialog(QWidget* parent, u8 slot) : QDialog(paren
|
|||
const auto found_fig = system.GetInfinityBase().FindFigure(char_number);
|
||||
if (!found_fig.empty())
|
||||
{
|
||||
predef_name += QString::fromStdString(std::string(found_fig) + ".bin");
|
||||
predef_name += QString::fromStdString(found_fig + ".bin");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1,19 +1,24 @@
|
|||
// Copyright 2023 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <string>
|
||||
|
||||
#include <QDialog>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
#include "Core/Core.h"
|
||||
#include "Core/IOS/USB/Emulated/Infinity.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
class QCheckBox;
|
||||
class QGroupBox;
|
||||
class QLineEdit;
|
||||
class QVBoxLayout;
|
||||
|
||||
namespace Core
|
||||
{
|
||||
enum class State;
|
||||
}
|
||||
|
||||
class InfinityBaseWindow : public QWidget
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue