UI: Relocate tas menu and add brief description

This commit is contained in:
german77
2021-07-25 20:52:19 -05:00
committed by MonsterDruide1
parent 5401cf6eb5
commit 75d8ec1e9f
10 changed files with 150 additions and 70 deletions

View File

@ -55,7 +55,7 @@ void ConfigureTasDialog::SetDirectory(DirectoryTarget target, QLineEdit* edit) {
QString str = QFileDialog::getExistingDirectory(this, caption, edit->text());
if (str.isNull() || str.isEmpty()) {
if (str.isEmpty()) {
return;
}

View File

@ -19,7 +19,50 @@
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>TAS Settings</string>
<string>TAS</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="1">
<widget class="QLabel" name="label_1">
<property name="text">
<string>Reads controller input from scripts in the same format as TAS-nx scripts. For a more detailed explanation please consult the FAQ on the yuzu website.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="1">
<widget class="QLabel" name="label_2">
<property name="text">
<string>To check which hotkeys control the playback/recording, please refer to the Hotkey settings (General -> Hotkeys).</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" colspan="1">
<widget class="QLabel" name="label_2">
<property name="text">
<string>WARNING: This is an experimental feature. It will not play back scripts frame perfectly with the current, imperfect syncing method.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="4">
@ -63,7 +106,7 @@
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>TAS Directories</string>
<string>Script Directory</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">

View File

@ -99,7 +99,7 @@ void ConfigureVibration::SetVibrationDevices(std::size_t player_index) {
const auto guid = param.Get("guid", "");
const auto port = param.Get("port", "");
if (engine.empty() || engine == "keyboard" || engine == "mouse") {
if (engine.empty() || engine == "keyboard" || engine == "mouse" || engine == "tas") {
continue;
}

View File

@ -78,7 +78,7 @@ void ControllerDialog::InputController(ControllerInput input) {
u32 buttons = 0;
int index = 0;
for (bool btn : input.button_values) {
buttons += (btn ? 1 : 0) << index;
buttons |= (btn ? 1U : 0U) << index;
index++;
}
input_subsystem->GetTas()->RecordInput(buttons, input.axis_values);

View File

@ -1022,18 +1022,25 @@ void GMainWindow::InitializeHotkeys() {
}
});
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("TAS Start/Stop"), this),
&QShortcut::activated, this, [&] { input_subsystem->GetTas()->StartStop(); });
&QShortcut::activated, this, [&] {
if (!emulation_running) {
return;
}
input_subsystem->GetTas()->StartStop();
});
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("TAS Reset"), this),
&QShortcut::activated, this, [&] { input_subsystem->GetTas()->Reset(); });
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("TAS Record"), this),
&QShortcut::activated, this, [&] {
if (!emulation_running) {
return;
}
bool is_recording = input_subsystem->GetTas()->Record();
if (!is_recording) {
QMessageBox::StandardButton reply;
reply = QMessageBox::question(this, tr("TAS Recording"),
tr("Overwrite file of player 1?"),
QMessageBox::Yes | QMessageBox::No);
input_subsystem->GetTas()->SaveRecording(reply == QMessageBox::Yes);
const auto res = QMessageBox::question(this, tr("TAS Recording"),
tr("Overwrite file of player 1?"),
QMessageBox::Yes | QMessageBox::No);
input_subsystem->GetTas()->SaveRecording(res == QMessageBox::Yes);
}
});
}
@ -1487,6 +1494,8 @@ void GMainWindow::ShutdownGame() {
game_list->show();
}
game_list->SetFilterFocus();
tas_label->clear();
input_subsystem->GetTas()->Stop();
render_window->removeEventFilter(render_window);
render_window->setAttribute(Qt::WA_Hover, false);

View File

@ -320,7 +320,7 @@ private:
QLabel* emu_speed_label = nullptr;
QLabel* game_fps_label = nullptr;
QLabel* emu_frametime_label = nullptr;
QLabel* TASlabel;
QLabel* tas_label = nullptr;
QPushButton* gpu_accuracy_button = nullptr;
QPushButton* renderer_status_button = nullptr;
QPushButton* dock_status_button = nullptr;

View File

@ -72,7 +72,6 @@
<addaction name="action_Restart"/>
<addaction name="separator"/>
<addaction name="action_Configure"/>
<addaction name="action_Configure_Tas"/>
<addaction name="action_Configure_Current_Game"/>
</widget>
<widget class="QMenu" name="menu_View">
@ -101,6 +100,7 @@
<addaction name="action_Rederive"/>
<addaction name="separator"/>
<addaction name="action_Capture_Screenshot"/>
<addaction name="action_Configure_Tas"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">