Tidyups and Review changes

This commit is contained in:
Joshua de Reeper 2026-05-20 22:06:16 +02:00 committed by deReeperJosh
parent dc1ef5d844
commit 85fe88bcc8
8 changed files with 16 additions and 12 deletions

View File

@ -558,7 +558,7 @@ void sky_portal::get_status(u8* reply_buf)
u16 status = 0;
for (int i = 7; i >= 0; i--)
for (int i = MAX_SKYLANDERS - 1; i >= 0; i--)
{
auto& s = skylanders[i];
@ -680,7 +680,7 @@ u8 sky_portal::load_skylander(u8 ui_slot, u8* buf, fs::file in_file)
std::optional<std::tuple<u8, u16, u16>> sky_portal::get_skylander(u8 ui_slot) const
{
//std::lock_guard lock(sky_mutex);
std::lock_guard lock(sky_mutex);
return ::at32(ui_skylanders, ui_slot);
}

View File

@ -38,7 +38,7 @@ public:
bool is_active() const { return activated; }
protected:
shared_mutex sky_mutex;
mutable shared_mutex sky_mutex;
bool activated = false;
u8 interrupt_counter = 0;

View File

@ -203,12 +203,12 @@ namespace rsx
}
else
{
entries.emplace_back(std::make_unique<skylander_list_entry>(fmt::format("Unknown (Id:%d Var:%d)", sky_id, sky_var)));
entries.emplace_back(std::make_unique<skylander_list_entry>(get_localized_string(localized_string_id::HOME_MENU_SETTINGS_SKYLANDER_UNKNOWN) + fmt::format(" (Id:%d Var:%d)", sky_id, sky_var)));
}
}
else
{
entries.emplace_back(std::make_unique<skylander_list_entry>("None"));
entries.emplace_back(std::make_unique<skylander_list_entry>(get_localized_string(localized_string_id::HOME_MENU_SETTINGS_SKYLANDER_NO_SKYLANDER)));
}
}
@ -359,7 +359,7 @@ namespace rsx
}
else if (selected_entry->get_type() == skylander_file_type::file)
{
std::string full_path = last_skylander_path + selected_entry->get_file_name();
const std::string full_path = last_skylander_path + selected_entry->get_file_name();
rsx_log.notice("Loading skylander from file: %s", full_path);
fs::file sky_file(full_path, fs::read + fs::write + fs::lock);
if (!sky_file)

View File

@ -60,7 +60,7 @@ namespace rsx
public:
skylander_file_list_entry(skylander_file_type type, const std::string& file_name);
const std::string get_file_name() const
const std::string& get_file_name() const
{
return file_name;
}

View File

@ -281,6 +281,8 @@ enum class localized_string_id
HOME_MENU_SETTINGS_SKYLANDER_LOAD,
HOME_MENU_SETTINGS_SKYLANDER_LOAD_FILE,
HOME_MENU_SETTINGS_SKYLANDER_MANAGER,
HOME_MENU_SETTINGS_SKYLANDER_NO_SKYLANDER,
HOME_MENU_SETTINGS_SKYLANDER_UNKNOWN,
HOME_MENU_SETTINGS_DEBUG,
HOME_MENU_SETTINGS_DEBUG_OVERLAY,
HOME_MENU_SETTINGS_DEBUG_INPUT_OVERLAY,

View File

@ -300,6 +300,8 @@ private:
case localized_string_id::HOME_MENU_SETTINGS_SKYLANDER_LOAD: return tr("Load Skylander");
case localized_string_id::HOME_MENU_SETTINGS_SKYLANDER_LOAD_FILE: return tr("Select Skylander File");
case localized_string_id::HOME_MENU_SETTINGS_SKYLANDER_MANAGER: return tr("Skylander Manager");
case localized_string_id::HOME_MENU_SETTINGS_SKYLANDER_NO_SKYLANDER: return tr("None");
case localized_string_id::HOME_MENU_SETTINGS_SKYLANDER_UNKNOWN: return tr("Unknown");
case localized_string_id::HOME_MENU_SETTINGS_DEBUG: return tr("Debug");
case localized_string_id::HOME_MENU_SETTINGS_DEBUG_OVERLAY: return tr("Debug Overlay", "Debug");
case localized_string_id::HOME_MENU_SETTINGS_DEBUG_INPUT_OVERLAY: return tr("Input Debug Overlay", "Debug");

View File

@ -220,8 +220,8 @@ skylander_dialog::skylander_dialog(QWidget* parent)
QHBoxLayout* hbox_skylander = new QHBoxLayout();
QLabel* label_skyname = new QLabel(QString(tr("Skylander %1")).arg(i + 1));
edit_skylanders[i] = new QLineEdit();
edit_skylanders[i]->setEnabled(false);
::at32(edit_skylanders, i) = new QLineEdit();
::at32(edit_skylanders, i)->setEnabled(false);
QPushButton* clear_btn = new QPushButton(tr("Clear"));
QPushButton* create_btn = new QPushButton(tr("Create"));
@ -232,7 +232,7 @@ skylander_dialog::skylander_dialog(QWidget* parent)
connect(load_btn, &QAbstractButton::clicked, this, [this, i]() { load_skylander(i); });
hbox_skylander->addWidget(label_skyname);
hbox_skylander->addWidget(edit_skylanders[i]);
hbox_skylander->addWidget(::at32(edit_skylanders, i));
hbox_skylander->addWidget(clear_btn);
hbox_skylander->addWidget(create_btn);
hbox_skylander->addWidget(load_btn);
@ -344,6 +344,6 @@ void skylander_dialog::update_edits()
display_string = tr("None");
}
edit_skylanders[i]->setText(display_string);
::at32(edit_skylanders, i)->setText(display_string);
}
}

View File

@ -39,7 +39,7 @@ protected:
void update_edits();
protected:
QLineEdit* edit_skylanders[MAX_SKYLANDERS]{};
std::array<QLineEdit*, MAX_SKYLANDERS> edit_skylanders{};
private:
static skylander_dialog* inst;