MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / Reload

Method Reload

Source/Internal/modloading.cpp:644–1392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

642}
643
644void ModInstance::Reload() {
645 LOGD << "Reloading mod data" << std::endl;
646 valid = kValidityValid;
647
648 bool load_from_disk = false;
649
650 id.set("");
651 name.set("");
652 category.set("");
653 version.set("");
654 author.set("");
655 description.set("");
656 thumbnail.set("");
657
658 campaigns.clear();
659 tags.clear();
660 preview_images.clear();
661 supported_versions.clear();
662 level_hook_files.clear();
663 mod_dependencies.clear();
664 main_menu_items.clear();
665 items.clear();
666 levels.clear();
667 invalid_item_paths.clear();
668 poses.clear();
669
670 overload_files.clear();
671 manifest.clear();
672
673 if (modsource == ModSourceSteamworks) {
674#if ENABLE_STEAMWORKS
675 SteamworksUGC* ugc = Steamworks::Instance()->GetUGC();
676 if (ugc) {
677 std::vector<SteamworksUGCItem*>::iterator ugc_it = ugc->GetItem(ugc_id);
678 if (ugc_it != ugc->GetItemEnd()) {
679 if ((*ugc_it)->IsSubscribed()) {
680 if ((*ugc_it)->IsInstalled()) {
681 path = (*ugc_it)->GetPath();
682 load_from_disk = true;
683 } else {
684 PARSE_ERROR(NULL, kValidityNotInstalled);
685 }
686 } else {
687 PARSE_ERROR(NULL, kValidityNotSubscribed);
688 }
689
690 LOGD << "Getting base data from ugc" << std::endl;
691 id.set((*ugc_it)->id);
692 version.set((*ugc_it)->version);
693 name.set((*ugc_it)->name);
694 author.set((*ugc_it)->author);
695 description.set((*ugc_it)->description);
696 append(tags, (*ugc_it)->tags);
697 } else {
698 LOGE << "Unable to find mod item with ugcid: " << ugc_id << std::endl;
699 PARSE_ERROR(NULL, kValiditySteamworksError);
700 }
701 } else {

Callers 1

ReloadModMethod · 0.45

Calls 15

GenerateManifestFunction · 0.85
FindFilePathFunction · 0.85
AssemblePathFunction · 0.85
strcontFunction · 0.85
strmtchFunction · 0.85
saysTrueFunction · 0.85
GetVersionMajorFunction · 0.85
GetVersionMinorFunction · 0.85
GetVersionPatchFunction · 0.85
GetShortBuildTagFunction · 0.85
GetBuildVersionFunction · 0.85
GetWritePathFunction · 0.85

Tested by

no test coverage detected