-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CheatsManager: Create Action Replay and Gecko code widgets only once #12966
CheatsManager: Create Action Replay and Gecko code widgets only once #12966
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds/looks good. Untested.
I can confirm the issue wherein the The issue wherein a code edit window open during shutdown causes a crash (abort due to Saving a cheat code when no software is running doesn't make much sense in the first place—it would probably write to an INI for the default GameID, 00000000—so I think this action should be made inaccessible in the UI if possible. The modality of the code edit window and the current limitations on |
b687acf
to
ded8e3e
Compare
I've pushed an update. The most important change is that when the game changes, the CheatCodeEditor in Cheats Manager's ARCodeWidget and GeckoCodeWidget are rejected and so can't be used to save a code in an invalid context. The widgets in a game's Properties window stay open and continue working correctly. A few other changes that I made either out of necessity or because they were right there:
|
Also some minor refactoring of nearby/related code: * Make non-obvious variable types explicit instead of auto. * Throw some consts around. * Use setDisabled(empty) instead of setEnabled(!empty).
Create ARCodeWidget and GeckoCodeWidget once on startup rather than every time a game is launched or shutdown. In addition to losing focus on the tab (since the previous widget and tab no longer existed), the behavior prior to this commit could cause a crash if the user initiated a game shutdown and then opened a code edit window since the AR/GeckoCodeWidget would get deleted in the meantime.
Before the call to OnSelectionChange, m_code_edit and m_code_remove are disabled and UpdateList calls m_code_list->clear(), thereby deselecting any selected items. When no items are selected, OnSelectionChange disables m_code_edit and m_code_remove and then returns. Since that was already done, the call doesn't change anything and can be removed.
ded8e3e
to
9e6a4e9
Compare
I believe the too-small window was a result of my attempts to avoid having to call My testing of the removal of Since I can't test it myself, let me know if the theme is being properly applied now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The title bar issue is fixed, and the two resolved reviews I left were my only concerns.
I was just using cheat search a few days ago and these are some welcome improvements. |
Create CheatsManager's ARCodeWidget and GeckoCodeWidget once on startup (in CheatsManager's constructor), and trigger updates to their contents when the current game changes.
Previously, ARCodeWidget and GeckoCodeWidget would be recreated every time a game was started or shutdown. If either of these widgets was the visible tab this would cause the tab to switch to CheatSearchFactoryWidget (since the other tabs temporarily didn't exist), and also could cause a crash if the user initiated a game shutdown and then opened a code edit window before the shutdown finished.