| 642 | } |
| 643 | |
| 644 | void 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 { |
no test coverage detected