CheatSearch: Update Current Values at end of frame

At the end of each frame automatically update the Current Value for
visible table rows in the selected and visible CheatSearchWidget (if
any). Also update all Current Values in all CheatSearchWidgets when the
State changes to Paused.

Only updating visible table rows serves to minimize the performance cost
of this feature. If the user scrolls to an un-updated cell it will
promptly be updated by either the next VIEndFieldEvent or the State
transitioning to Paused.
This commit is contained in:
Dentomologist
2023-10-28 16:30:22 -07:00
parent 7dfb23d38c
commit fdb7328c73
6 changed files with 120 additions and 23 deletions

View File

@ -39,6 +39,9 @@ public:
explicit CheatSearchWidget(std::unique_ptr<Cheats::CheatSearchSessionBase> session);
~CheatSearchWidget() override;
bool UpdateTableAllCurrentValues();
void UpdateTableVisibleCurrentValues();
signals:
void ActionReplayCodeGenerated(const ActionReplay::ARCode& ar_code);
void RequestWatch(QString name, u32 address);
@ -56,11 +59,13 @@ private:
void OnValueSourceChanged();
void OnDisplayHexCheckboxStateChanged();
bool RefreshValues();
void RefreshCurrentValueTableItem(QTableWidgetItem* current_value_table_item);
void RefreshGUICurrentValues();
void RefreshGUICurrentValues(size_t begin_index, size_t end_index);
bool UpdateTableRows(const Core::CPUThreadGuard& guard, size_t begin_index, size_t end_index);
void RecreateGUITable();
void GenerateARCode();
int GetVisibleRowsBeginIndex() const;
int GetVisibleRowsEndIndex() const;
std::unique_ptr<Cheats::CheatSearchSessionBase> m_session;