This commit is contained in:
Nayla Hanegan 2024-12-24 20:48:44 -05:00
commit a662081a1d
923 changed files with 2106 additions and 235968 deletions

View file

@ -5,9 +5,9 @@ endif()
if (MSVC)
if(_M_ARM_64)
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/Externals/Qt/Qt6.7.0/ARM64")
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/Externals/Qt/Qt6.8.0/ARM64")
else()
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/Externals/Qt/Qt6.7.0/x64")
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/Externals/Qt/Qt6.8.0/x64")
endif()
endif()

View file

@ -280,7 +280,6 @@ void GeckoCodeWidget::LoadCodes()
m_add_code->setEnabled(!m_game_id.empty());
m_edit_code->setEnabled(false);
m_remove_code->setEnabled(false);
m_download_codes->setEnabled(!m_game_id.empty());
UpdateList();
}
@ -370,4 +369,4 @@ void GeckoCodeWidget::UpdateList()
}
m_code_list->setDragDropMode(QAbstractItemView::InternalMove);
}
}

View file

@ -51,6 +51,11 @@
<AdditionalManifestFiles>DolphinQt.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
</Manifest>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="AboutDialog.cpp" />
<ClCompile Include="CheatSearchFactoryWidget.cpp" />
@ -494,7 +499,7 @@
<ImportGroup Label="ExtensionTargets" />
<!--Copy Exe, Data directory and DLLs which should be located in the executable directory-->
<ItemGroup>
<DataSysFiles Include="$(DolphinRootDir)Data\**\Extras\**\*.*" />
<!---<DataSysFiles Include="$(DolphinRootDir)Data\**\Extras\**\*.*" />-->
<DataSysFiles Include="$(DolphinRootDir)Data\**\Games\**\*.*" />
<DataSysFiles Include="$(DolphinRootDir)Data\**\Sys\**\*.*" />
<DataUserFiles Include="$(DolphinRootDir)Data\**\Updater\**\*.*" />

View file

@ -162,7 +162,7 @@ void GameList::MakeListView()
m_list->setTabKeyNavigation(false);
m_list->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_list->setSelectionBehavior(QAbstractItemView::SelectRows);
m_list->setAlternatingRowColors(true);
m_list->setAlternatingRowColors(false); // This looks ugly with new QT
m_list->setShowGrid(false);
m_list->setSortingEnabled(true);
m_list->setCurrentIndex(QModelIndex());

View file

@ -67,6 +67,7 @@
#include "Core/State.h"
#include "Core/System.h"
#include "Core/WiiUtils.h"
#include "DiscIO/DirectoryBlob.h"
#include "DiscIO/NANDImporter.h"
#include "DiscIO/RiivolutionPatcher.h"
@ -145,8 +146,6 @@
#undef None
#endif
#include <qprocess.h>
#if defined(__unix__) || defined(__unix) || defined(__APPLE__)
void MainWindow::OnSignal()
{
@ -569,6 +568,8 @@ void MainWindow::ConnectMenuBar()
connect(m_menu_bar, &MenuBar::ImportNANDBackup, this, &MainWindow::OnImportNANDBackup);
connect(m_menu_bar, &MenuBar::PerformOnlineUpdate, this, &MainWindow::PerformOnlineUpdate);
connect(m_menu_bar, &MenuBar::BootWiiSystemMenu, this, &MainWindow::BootWiiSystemMenu);
connect(m_menu_bar, &MenuBar::StartNetPlay, this, &MainWindow::ShowNetPlaySetupDialog);
connect(m_menu_bar, &MenuBar::BrowseNetPlay, this, &MainWindow::ShowNetPlayBrowser);
connect(m_menu_bar, &MenuBar::ShowFIFOPlayer, this, &MainWindow::ShowFIFOPlayer);
connect(m_menu_bar, &MenuBar::ShowSkylanderPortal, this, &MainWindow::ShowSkylanderPortal);
connect(m_menu_bar, &MenuBar::ShowInfinityBase, this, &MainWindow::ShowInfinityBase);
@ -696,9 +697,8 @@ void MainWindow::ConnectToolBar()
connect(m_tool_bar, &ToolBar::ScreenShotPressed, this, &MainWindow::ScreenShot);
connect(m_tool_bar, &ToolBar::SettingsPressed, this, &MainWindow::ShowSettingsWindow);
connect(m_tool_bar, &ToolBar::ControllersPressed, this, &MainWindow::ShowControllersWindow);
connect(m_tool_bar, &ToolBar::GraphicsPressed, this, &MainWindow::ShowGraphicsWindow);
connect(m_tool_bar, &ToolBar::StartNetPlayPressed, this, &MainWindow::ShowNetPlaySetupDialog);
connect(m_tool_bar, &ToolBar::GraphicsPressed, this, &MainWindow::ShowGraphicsWindow);
connect(m_tool_bar, &ToolBar::ViewGeckoCodes, this, &MainWindow::ShowGeckoCodes);
connect(m_tool_bar, &ToolBar::StepPressed, m_code_widget, &CodeWidget::Step);
connect(m_tool_bar, &ToolBar::StepOverPressed, m_code_widget, &CodeWidget::StepOver);
@ -1019,110 +1019,6 @@ bool MainWindow::RequestStop()
return true;
}
bool MainWindow::RequestStopNetplay()
{
if (!Core::IsRunning(Core::System::GetInstance()))
{
Core::QueueHostJob([this](Core::System&) { OnStopComplete(); }, true);
return true;
}
const bool rendered_widget_was_active =
m_render_widget->isActiveWindow() && !m_render_widget->isFullScreen();
QWidget* confirm_parent = (!m_rendering_to_main && rendered_widget_was_active) ?
m_render_widget :
static_cast<QWidget*>(this);
const bool was_cursor_locked = m_render_widget->IsCursorLocked();
if (!m_render_widget->isFullScreen())
m_render_widget_geometry = m_render_widget->saveGeometry();
else
FullScreen();
if (Config::Get(Config::MAIN_CONFIRM_ON_STOP))
{
if (std::exchange(m_stop_confirm_showing, true))
return true;
Common::ScopeGuard confirm_lock([this] { m_stop_confirm_showing = false; });
const Core::State state = Core::GetState(Core::System::GetInstance());
// Only pause the game, if NetPlay is not running
bool pause = !Settings::Instance().GetNetPlayClient();
if (pause)
Core::SetState(Core::System::GetInstance(), Core::State::Paused);
if (rendered_widget_was_active)
{
// We have to do this before creating the message box, otherwise we might receive the window
// activation event before we know we need to lock the cursor again.
m_render_widget->SetCursorLockedOnNextActivation(was_cursor_locked);
}
// This is to avoid any "race conditions" between the "Window Activate" message and the
// message box returning, which could break cursor locking depending on the order
m_render_widget->SetWaitingForMessageBox(true);
auto confirm = ModalMessageBox::question(
confirm_parent, tr("Quitter!"),
m_stop_requested ? tr("A user closed down their game from the netplay lobby. "
"This means the Netplay session has ended! "
"Do you want to stop the current emulation?") :
tr("A user closed down their game from the netplay lobby. "
"This means the Netplay session has ended! "
"Do you want to stop the current emulation?"),
QMessageBox::Yes | QMessageBox::No, QMessageBox::NoButton, Qt::ApplicationModal);
// If a user confirmed stopping the emulation, we do not capture the cursor again,
// even if the render widget will stay alive for a while.
// If a used rejected stopping the emulation, we instead capture the cursor again,
// and let them continue playing as if nothing had happened
// (assuming cursor locking is on).
if (confirm != QMessageBox::Yes)
{
m_render_widget->SetWaitingForMessageBox(false);
if (pause)
Core::SetState(Core::System::GetInstance(), state);
return false;
}
else
{
m_render_widget->SetCursorLockedOnNextActivation(false);
// This needs to be after SetCursorLockedOnNextActivation(false) as it depends on it
m_render_widget->SetWaitingForMessageBox(false);
}
}
OnStopRecording();
// TODO: Add Debugger shutdown
if (!m_stop_requested && UICommon::TriggerSTMPowerEvent())
{
m_stop_requested = true;
// Unpause because gracefully shutting down needs the game to actually request a shutdown.
// TODO: Do not unpause in debug mode to allow debugging until the complete shutdown.
if (Core::GetState(Core::System::GetInstance()) == Core::State::Paused)
Core::SetState(Core::System::GetInstance(), Core::State::Running);
// Tell NetPlay about the power event
if (NetPlay::IsNetPlayRunning())
NetPlay::SendPowerButtonEvent();
return true;
}
ForceStop();
#ifdef Q_OS_WIN
// Allow windows to idle or turn off display again
SetThreadExecutionState(ES_CONTINUOUS);
#endif
return true;
}
void MainWindow::ForceStop()
{
Core::Stop(m_system);
@ -1133,7 +1029,7 @@ void MainWindow::Reset()
auto& movie = m_system.GetMovie();
if (movie.IsRecordingInput())
movie.SetReset(true);
system.GetProcessorInterface().ResetButton_Tap_FromUser();
m_system.GetProcessorInterface().ResetButton_Tap();
}
void MainWindow::FrameAdvance()
@ -1399,7 +1295,7 @@ void MainWindow::ShowSettingsWindow()
InstallHotkeyFilter(m_settings_window);
}
//SetQWidgetWindowDecorations(m_settings_window);
SetQWidgetWindowDecorations(m_settings_window);
m_settings_window->show();
m_settings_window->raise();
m_settings_window->activateWindow();
@ -1634,11 +1530,10 @@ void MainWindow::NetPlayInit()
m_netplay_discord = new DiscordHandler(this);
#endif
connect(m_netplay_dialog, &NetPlayDialog::Stop, this, &MainWindow::RequestStopNetplay);
connect(m_netplay_dialog, &NetPlayDialog::Stop, this, &MainWindow::ForceStop);
connect(m_netplay_dialog, &NetPlayDialog::rejected, this, &MainWindow::NetPlayQuit);
connect(m_netplay_setup_dialog, &NetPlaySetupDialog::Join, this, &MainWindow::NetPlayJoin);
connect(m_netplay_setup_dialog, &NetPlaySetupDialog::Host, this, &MainWindow::NetPlayHost);
connect(m_netplay_setup_dialog, &NetPlaySetupDialog::JoinBrowser, this, &MainWindow::NetPlayJoin);
#ifdef USE_DISCORD_PRESENCE
connect(m_netplay_discord, &DiscordHandler::Join, this, &MainWindow::NetPlayJoin);
@ -2160,7 +2055,6 @@ void MainWindow::ShowGeckoCodes()
m_gecko_dialog = new GeckoDialog(this);
InstallHotkeyFilter(m_gecko_dialog);
}
m_gecko_dialog->show();
m_gecko_dialog->raise();
m_gecko_dialog->activateWindow();

View file

@ -64,7 +64,61 @@ void NetPlayBrowser::CreateWidgets()
{
auto* layout = new QVBoxLayout;
m_table_widget = new QTableWidget;
m_table_widget->setTabKeyNavigation(false);
m_table_widget->setSelectionBehavior(QAbstractItemView::SelectRows);
m_table_widget->setSelectionMode(QAbstractItemView::SingleSelection);
m_table_widget->setWordWrap(false);
m_region_combo = new QComboBox;
m_region_combo->addItem(tr("Any Region"));
for (const auto& region : NetPlayIndex::GetRegions())
{
m_region_combo->addItem(
tr("%1 (%2)").arg(tr(region.second.c_str())).arg(QString::fromStdString(region.first)),
QString::fromStdString(region.first));
}
m_region_combo->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
m_status_label = new QLabel;
m_button_box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
m_button_refresh = new NonDefaultQPushButton(tr("Refresh"));
m_edit_name = new QLineEdit;
m_edit_game_id = new QLineEdit;
m_check_hide_incompatible = new QCheckBox(tr("Hide Incompatible Sessions"));
m_check_hide_ingame = new QCheckBox(tr("Hide In-Game Sessions"));
m_check_hide_incompatible->setChecked(true);
m_radio_all = new QRadioButton(tr("Private and Public"));
m_radio_private = new QRadioButton(tr("Private"));
m_radio_public = new QRadioButton(tr("Public"));
m_radio_all->setChecked(true);
auto* filter_box = new QGroupBox(tr("Filters"));
auto* filter_layout = new QGridLayout;
filter_box->setLayout(filter_layout);
filter_layout->addWidget(new QLabel(tr("Region:")), 0, 0);
filter_layout->addWidget(m_region_combo, 0, 1, 1, -1);
filter_layout->addWidget(new QLabel(tr("Name:")), 1, 0);
filter_layout->addWidget(m_edit_name, 1, 1, 1, -1);
filter_layout->addWidget(new QLabel(tr("Game ID:")), 2, 0);
filter_layout->addWidget(m_edit_game_id, 2, 1, 1, -1);
filter_layout->addWidget(m_radio_all, 3, 1);
filter_layout->addWidget(m_radio_public, 3, 2);
filter_layout->addWidget(m_radio_private, 3, 3);
filter_layout->addItem(new QSpacerItem(4, 1, QSizePolicy::Expanding), 3, 4);
filter_layout->addWidget(m_check_hide_incompatible, 4, 1, 1, -1);
filter_layout->addWidget(m_check_hide_ingame, 5, 1, 1, -1);
layout->addWidget(m_table_widget);
layout->addWidget(filter_box);
layout->addWidget(m_status_label);
layout->addWidget(m_button_box);
@ -166,7 +220,7 @@ void NetPlayBrowser::UpdateList()
m_table_widget->clear();
m_table_widget->setColumnCount(7);
m_table_widget->setHorizontalHeaderLabels({tr("Name"), tr("Password?"),
m_table_widget->setHorizontalHeaderLabels({tr("Region"), tr("Name"), tr("Password?"),
tr("In-Game?"), tr("Game"), tr("Players"),
tr("Version")});
@ -185,20 +239,26 @@ void NetPlayBrowser::UpdateList()
{
const auto& entry = m_sessions[i];
auto* region = new QTableWidgetItem(QString::fromStdString(entry.region));
auto* name = new QTableWidgetItem(QString::fromStdString(entry.name));
auto* password = new QTableWidgetItem(entry.has_password ? tr("Yes") : tr("No"));
auto* in_game = new QTableWidgetItem(entry.in_game ? tr("Yes") : tr("No"));
auto* game_id = new QTableWidgetItem(QString::fromStdString(entry.game_id));
auto* player_count = new QTableWidgetItem(QStringLiteral("%1").arg(entry.player_count));
auto* version = new QTableWidgetItem(QString::fromStdString(entry.version));
const bool enabled = Common::GetScmDescStr() == entry.version;
const bool enabled = true;
for (const auto& item : {name, in_game, game_id, player_count})
for (const auto& item : {region, name, password, in_game, game_id, player_count, version})
item->setFlags(enabled ? Qt::ItemIsEnabled | Qt::ItemIsSelectable : Qt::NoItemFlags);
m_table_widget->setItem(i, 0, region);
m_table_widget->setItem(i, 1, name);
m_table_widget->setItem(i, 2, in_game);
m_table_widget->setItem(i, 3, game_id);
m_table_widget->setItem(i, 4, player_count);
m_table_widget->setItem(i, 2, password);
m_table_widget->setItem(i, 3, in_game);
m_table_widget->setItem(i, 4, game_id);
m_table_widget->setItem(i, 5, player_count);
m_table_widget->setItem(i, 6, version);
}
m_status_label->setText(
@ -318,11 +378,8 @@ void NetPlayBrowser::RestoreSettings()
else if (visibility == QStringLiteral("private"))
m_radio_private->setChecked(true);
m_check_hide_incompatible->setChecked(true);
m_check_hide_ingame->setChecked(true);
/* m_check_hide_incompatible->setChecked(
m_check_hide_incompatible->setChecked(
settings.value(QStringLiteral("netplaybrowser/hide_incompatible"), true).toBool());
m_check_hide_ingame->setChecked(
settings.value(QStringLiteral("netplaybrowser/hide_ingame")).toBool());*/
settings.value(QStringLiteral("netplaybrowser/hide_ingame")).toBool());
}

View file

@ -194,6 +194,10 @@ void NetPlaySetupDialog::CreateMainLayout()
auto* host_widget = new QWidget;
auto* host_layout = new QGridLayout;
m_host_port_box = new QSpinBox;
m_host_port_box->setMinimumWidth(100); // Set minimum width to match new theme
m_host_server_browser = new QCheckBox(tr("Show in Browser"));
m_host_server_browser->setChecked(true);
m_host_chunked_upload_limit_check = new QCheckBox(tr("Limit Chunked Upload Speed:"));
m_host_chunked_upload_limit_box = new QSpinBox;
m_host_server_name = new QLineEdit;
@ -211,10 +215,11 @@ void NetPlaySetupDialog::CreateMainLayout()
host_layout->addWidget(m_host_port_box, 0, 0, Qt::AlignLeft);
#ifdef USE_UPNP
host_layout->addWidget(m_host_upnp, 0, 5, Qt::AlignRight);
host_layout->addWidget(m_host_upnp, 0, 4, Qt::AlignRight);
#endif
host_layout->addWidget(m_host_server_browser, 4, 0, Qt::AlignLeft);
host_layout->addWidget(m_host_games, 2, 0, 1, -1);
host_layout->addWidget(m_host_button, 4, 5, Qt::AlignRight);
host_layout->addWidget(m_host_button, 4, 6, Qt::AlignRight);
host_widget->setLayout(host_layout);
@ -272,6 +277,8 @@ void NetPlaySetupDialog::ConnectWidgets()
connect(m_host_server_name, &QLineEdit::textChanged, this, &NetPlaySetupDialog::SaveSettings);
connect(m_host_server_browser, &QCheckBox::toggled, this, &NetPlaySetupDialog::SaveSettings);
#ifdef USE_UPNP
connect(m_host_upnp, &QCheckBox::stateChanged, this, &NetPlaySetupDialog::SaveSettings);
#endif
@ -318,6 +325,7 @@ void NetPlaySetupDialog::SaveSettings()
Config::SetBaseOrCurrent(Config::NETPLAY_USE_UPNP, m_host_upnp->isChecked());
#endif
Config::SetBaseOrCurrent(Config::NETPLAY_USE_INDEX, m_host_server_browser->isChecked());
Config::SetBaseOrCurrent(Config::NETPLAY_INDEX_REGION, "NA");
Config::SetBaseOrCurrent(Config::NETPLAY_INDEX_NAME, m_nickname_edit->text().toStdString());
Config::SetBaseOrCurrent(Config::NETPLAY_INDEX_PASSWORD, "");
@ -605,5 +613,5 @@ void NetPlaySetupDialog::acceptBrowser()
else
Config::SetBaseOrCurrent(Config::NETPLAY_ADDRESS, server_id);
emit JoinBrowser();
emit Join();
}

View file

@ -99,8 +99,6 @@ void GeneralPane::ConnectLayout()
{
connect(m_checkbox_dualcore, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig);
connect(m_checkbox_cheats, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig);
connect(m_combobox_codehandler, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&GeneralPane::OnCodeHandlerChanged);
connect(m_checkbox_override_region_settings, &QCheckBox::stateChanged, this,
&GeneralPane::OnSaveConfig);
connect(m_checkbox_auto_disc_change, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig);
@ -225,13 +223,30 @@ void GeneralPane::CreateCheats()
auto* code_handler_layout = new QFormLayout();
auto* code_handler_label = new QLabel(tr("Code Handler:"));
m_combobox_codehandler = new QComboBox();
m_combobox_codehandler->addItem(tr("Dolphin (Stock)"), QVariant(0));
m_combobox_codehandler->addItem(tr("MPN (Extended)"), QVariant(1));
m_combobox_codehandler->addItem(tr("MPN (Super Extended)"), QVariant(2));
code_handler_layout->addRow(code_handler_label, m_combobox_codehandler);
code_handler_layout->addRow(code_handler_label, m_combobox_codehandler);
cheats_group_layout->addLayout(code_handler_layout);
// Add a label to inform users about NetPlay settings
auto* netplay_info_label = new QLabel(tr("<b>Note:</b> All players must have matching code handlers when participating in a NetPlay session."));
cheats_group_layout->addWidget(netplay_info_label);
// Add a label to define the different code handlers
auto* code_handler_info_label = new QLabel(tr("<b>Dolphin (Stock)</b>: Compatibility with legacy and non Dolphin-MPN builds <br>(around 3,200 bytes / 400 lines of code.)<br><br>"
"<b>MPN (Extended)</b>: Improved code handler that has more space with some removed irrevalent functions<br>(around 3,200 bytes / 440 lines of code.)<br><br>"
"<b>MPN (Super Extended)</b>: Enhanced code handler that uses hacks to give certain games<br>currently Mario Party 4, 5, 6 and 8 way more code room<br>(around 30,000 bytes / 3,750 lines of codes)."));
code_handler_info_label->setWordWrap(true);
cheats_group_layout->addWidget(code_handler_info_label);
cheats_group_layout->addSpacing(10);
connect(m_combobox_codehandler, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &GeneralPane::OnCodeHandlerChanged);
code_handler_layout->setFormAlignment(Qt::AlignLeft | Qt::AlignTop);
code_handler_layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
}
@ -370,4 +385,4 @@ void GeneralPane::OnCodeHandlerChanged(int index)
int code_handler_value = m_combobox_codehandler->itemData(index).toInt();
Config::SetBaseOrCurrent(Config::MAIN_CODE_HANDLER, code_handler_value);
Config::Save();
}
}