0x0047285C
| 732 | |
| 733 | // 0x0047285C |
| 734 | static bool installObject(const ObjectHeader& objectHeader) |
| 735 | { |
| 736 | // Prepare progress bar |
| 737 | char caption[512]; |
| 738 | auto* str = StringManager::formatString(caption, sizeof(caption), StringIds::installing_new_data); |
| 739 | // Convert object name to string so it is properly terminated |
| 740 | std::string objectname(objectHeader.getName()); |
| 741 | strcat(str, objectname.c_str()); |
| 742 | Ui::ProgressBar::begin(caption); |
| 743 | Ui::ProgressBar::setProgress(50); |
| 744 | Input::processMessagesMini(); |
| 745 | |
| 746 | // Get new file path |
| 747 | std::string filename = objectname; |
| 748 | sanatiseObjectFilename(filename); |
| 749 | const auto objPath = findCustomObjectPath(filename); |
| 750 | |
| 751 | // Create new file and output object file |
| 752 | Ui::ProgressBar::setProgress(180); |
| 753 | FileStream fs(objPath, StreamMode::write); |
| 754 | SawyerStreamWriter stream(fs); |
| 755 | writePackedObjects(stream, { objectHeader }); |
| 756 | |
| 757 | Ui::ProgressBar::setProgress(240); |
| 758 | Ui::ProgressBar::setProgress(255); |
| 759 | Ui::ProgressBar::end(); |
| 760 | return true; |
| 761 | } |
| 762 | |
| 763 | // 0x00472687 based on |
| 764 | bool tryInstallObject(const ObjectHeader& objectHeader, std::span<const std::byte> data) |
no test coverage detected