Handles automatic profile loading (AKA "Fork in the toaster" mod).
| 586 | /// Handles automatic profile loading (AKA "Fork in the toaster" mod). |
| 587 | /// </summary> |
| 588 | void HandleAutoLoadProfile(GameLoopState& state) { |
| 589 | if (Settings::ReturnSettingValue("ForceProfileEnabled") != "on" || |
| 590 | GameState::Menus::IsInMenusWithDisallowedAutoEnter() || |
| 591 | state.forkInToasterNewProfile) { |
| 592 | return; |
| 593 | } |
| 594 | |
| 595 | // Skip UPlay login dialog - depending on the menu it might be necessary to press either ESC or Enter, so just spam both |
| 596 | if (GameState::currentMenu == "SelectionListDialog" || |
| 597 | GameState::currentMenu == "UplayLoginDialog") { |
| 598 | Keyboard::SendEscapeKey(); |
| 599 | Keyboard::AutoEnterGame(); |
| 600 | } |
| 601 | else if (Settings::ReturnSettingValue("ProfileToLoad") != "" && |
| 602 | GameState::currentMenu == "ProfileSelect") { // If the user user says "I want to always load this profile" |
| 603 | HandleSpecificProfileLoad(state); |
| 604 | } |
| 605 | else { // User doesn't care what profile we select, just select the first / top one. |
| 606 | Keyboard::AutoEnterGame(); |
| 607 | } |
| 608 | } |
| 609 | |
| 610 | /// <summary> |
| 611 | /// Loads a specific user profile by name. |
no test coverage detected