MCPcopy Create free account
hub / github.com/Norbyte/bg3se / ExtendStoryHeader

Method ExtendStoryHeader

BG3Extender/Osiris/Shared/CustomFunctions.cpp:672–694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670}
671
672void CustomFunctionInjector::ExtendStoryHeader(std::wstring const & headerPath)
673{
674 extendingStory_ = true;
675
676#if 0
677 DEBUG("CustomFunctionInjector::ExtendStoryHeader(): Appending to header:\r\n");
678 OutputDebugStringA(headers.c_str());
679 std::cout << headers << std::endl;
680#endif
681
682 auto headers = functions_.GenerateHeaders();
683 std::ofstream wf(headerPath.c_str(), std::ios::out | std::ios::binary | std::ios::app);
684 wf.write(headers.data(), headers.size());
685 wf.close();
686
687#if !defined(OSI_EOCAPP)
688 // Workaround to Windows Defender keeping the file open while
689 // the editor is trying to read the generated headers
690 Sleep(100);
691#endif
692
693 extendingStory_ = false;
694}
695
696void CustomFunctionInjector::AddJunkToStory(std::wstring const& storyPath)
697{

Callers

nothing calls this directly

Calls 4

SleepClass · 0.85
GenerateHeadersMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected