Skip to content

Commit

Permalink
Merge pull request #11907 from lioncash/pragma
Browse files Browse the repository at this point in the history
DolphinQt/InfinityBaseWindow: Minor changes
  • Loading branch information
AdmiralCurtiss committed Jun 8, 2023
2 parents d9c33ad + fae5ca3 commit f53b121
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
29 changes: 17 additions & 12 deletions Source/Core/DolphinQt/InfinityBase/InfinityBaseWindow.cpp
Expand Up @@ -3,6 +3,8 @@

#include "DolphinQt/InfinityBase/InfinityBaseWindow.h"

#include <string>

#include <QCheckBox>
#include <QComboBox>
#include <QCompleter>
Expand All @@ -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"
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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
{
Expand Down
13 changes: 9 additions & 4 deletions Source/Core/DolphinQt/InfinityBase/InfinityBaseWindow.h
@@ -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
{
Expand Down

0 comments on commit f53b121

Please sign in to comment.