mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-03 14:49:22 +00:00
Merge branch 'dolphin-emu:master' into master
This commit is contained in:
commit
287b7b7ce5
2 changed files with 21 additions and 2 deletions
|
@ -10,6 +10,7 @@
|
||||||
#include "AudioCommon/AudioCommon.h"
|
#include "AudioCommon/AudioCommon.h"
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
#include "Common/Event.h"
|
#include "Common/Event.h"
|
||||||
|
#include "Common/Thread.h"
|
||||||
#include "Common/Timer.h"
|
#include "Common/Timer.h"
|
||||||
#include "Core/CPUThreadConfigCallback.h"
|
#include "Core/CPUThreadConfigCallback.h"
|
||||||
#include "Core/Config/MainSettings.h"
|
#include "Core/Config/MainSettings.h"
|
||||||
|
@ -69,6 +70,8 @@ void CPUManager::ExecutePendingJobs(std::unique_lock<std::mutex>& state_lock)
|
||||||
|
|
||||||
void CPUManager::StartTimePlayedTimer()
|
void CPUManager::StartTimePlayedTimer()
|
||||||
{
|
{
|
||||||
|
Common::SetCurrentThreadName("Play Time Tracker");
|
||||||
|
|
||||||
// Steady clock for greater accuracy of timing
|
// Steady clock for greater accuracy of timing
|
||||||
std::chrono::steady_clock timer;
|
std::chrono::steady_clock timer;
|
||||||
auto prev_time = timer.now();
|
auto prev_time = timer.now();
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#include "DolphinQt/Config/CheatCodeEditor.h"
|
#include "DolphinQt/Config/CheatCodeEditor.h"
|
||||||
|
|
||||||
|
#include <regex>
|
||||||
|
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QFontDatabase>
|
#include <QFontDatabase>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
|
@ -251,12 +253,26 @@ bool CheatCodeEditor::AcceptGecko()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_gecko_code->name = name.toStdString();
|
m_gecko_code->name = name.trimmed().toStdString();
|
||||||
m_gecko_code->creator = m_creator_edit->text().toStdString();
|
m_gecko_code->creator = m_creator_edit->text().trimmed().toStdString();
|
||||||
m_gecko_code->codes = std::move(entries);
|
m_gecko_code->codes = std::move(entries);
|
||||||
m_gecko_code->notes = SplitString(m_notes_edit->toPlainText().toStdString(), '\n');
|
m_gecko_code->notes = SplitString(m_notes_edit->toPlainText().toStdString(), '\n');
|
||||||
m_gecko_code->user_defined = true;
|
m_gecko_code->user_defined = true;
|
||||||
|
|
||||||
|
{
|
||||||
|
// The creator name is not expected to be present in the cheat code name. It will be extracted
|
||||||
|
// and moved into its dedicated "creator" field.
|
||||||
|
std::smatch matches;
|
||||||
|
if (std::regex_match(m_gecko_code->name, matches, std::regex{R"(^(.*)\[(.*)\]$)"}))
|
||||||
|
{
|
||||||
|
m_gecko_code->name = StripWhitespace(matches[1].str());
|
||||||
|
if (m_gecko_code->creator.empty())
|
||||||
|
{
|
||||||
|
m_gecko_code->creator = StripWhitespace(matches[2].str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue