52 m_addonpart_entry = entry;
55 Ogre::DataStreamPtr datastream = Ogre::ResourceGroupManager::getSingleton().openResource(entry->
fname, entry->
resource_group);
59 m_document->loadFromDataStream(datastream, options);
62 m_module->origin_addonpart = entry;
65 Keyword block = Keyword::INVALID;
67 while (!m_context->endOfFile())
69 if (m_context->isTokKeyword())
72 if (m_context->getTokKeyword().find(
"addonpart_") != std::string::npos)
74 m_context->seekNextLine();
78 keyword = Parser::IdentifyKeyword(m_context->getTokKeyword());
79 if (
keyword == Keyword::INVALID && m_context->getTokKeyword() ==
"set_managedmaterials_options")
81 keyword = Keyword::SET_MANAGEDMATERIALS_OPTIONS;
83 if (
keyword != Keyword::INVALID)
85 if (
keyword == Keyword::SET_MANAGEDMATERIALS_OPTIONS)
87 this->ProcessDirectiveSetManagedMaterialsOptions();
88 m_context->seekNextLine();
91 else if (
keyword == Keyword::MANAGEDMATERIALS
93 ||
keyword == Keyword::FLEXBODIES
98 m_context->seekNextLine();
105 if (block != Keyword::INVALID && !m_context->isTokComment() && !m_context->isTokLineBreak())
109 case Keyword::MANAGEDMATERIALS: this->ProcessManagedMaterial();
break;
110 case Keyword::PROPS: this->ProcessProp();
break;
111 case Keyword::FLEXBODIES: this->ProcessFlexbody();
break;
112 case Keyword::FLARES: this->ProcessFlare();
break;
113 case Keyword::FLARES2: this->ProcessFlare2();
break;
118 m_context->seekNextLine();
122 catch (Ogre::Exception& e)
126 fmt::format(
"Could not use addonpart: Error parsing file '{}', message: {}",
127 entry->
fname, e.getFullDescription()));
139 m_addonpart_entry = addonpart_entry;
144 Ogre::DataStreamPtr datastream = Ogre::ResourceGroupManager::getSingleton().openResource(addonpart_entry->
fname, addonpart_entry->
resource_group);
148 m_document->loadFromDataStream(datastream, options);
151 while (!m_context->endOfFile())
153 if (m_context->isTokKeyword())
155 if (m_context->getTokKeyword() ==
"addonpart_unwanted_prop" )
156 this->ProcessUnwantedProp();
157 else if (m_context->getTokKeyword() ==
"addonpart_unwanted_flexbody" )
158 this->ProcessUnwantedFlexbody();
159 else if (m_context->getTokKeyword() ==
"addonpart_unwanted_flare" )
160 this->ProcessUnwantedFlare();
161 else if (m_context->getTokKeyword() ==
"addonpart_unwanted_exhaust" )
162 this->ProcessUnwantedExhaust();
163 else if (m_context->getTokKeyword() ==
"addonpart_unwanted_managedmaterial")
164 this->ProcessUnwantedManagedMat();
165 else if (m_context->getTokKeyword() ==
"addonpart_tweak_wheel")
166 this->ProcessTweakWheel();
167 else if (m_context->getTokKeyword() ==
"addonpart_tweak_node")
168 this->ProcessTweakNode();
169 else if (m_context->getTokKeyword() ==
"addonpart_tweak_prop")
170 this->ProcessTweakProp();
171 else if (m_context->getTokKeyword() ==
"addonpart_tweak_flexbody")
172 this->ProcessTweakFlexbody();
173 else if (m_context->getTokKeyword() ==
"addonpart_tweak_managedmaterial")
174 this->ProcessTweakManagedMat();
177 m_context->seekNextLine();
181 catch (Ogre::Exception& e)
185 fmt::format(
"Addonpart unwanted elements check: Error parsing file '{}', message: {}",
186 addonpart_entry->
fname, e.getFullDescription()));
213 int n = m_context->countLineArgs();
216 def.
name = m_context->getStringData(0);
219 std::string str = m_context->getTokString(1);
220 if (str ==
"mesh_standard") def.
type = ManagedMaterialType::MESH_STANDARD;
221 if (str ==
"mesh_transparent") def.
type = ManagedMaterialType::MESH_TRANSPARENT;
222 if (str ==
"flexmesh_standard") def.
type = ManagedMaterialType::FLEXMESH_STANDARD;
223 if (str ==
"flexmesh_transparent") def.
type = ManagedMaterialType::FLEXMESH_TRANSPARENT;
227 if (n > 3) def.
specular_map = m_context->getTokString(3);
234 def.
options = m_managedmaterials_options;
236 m_module->managedmaterials.push_back(def);
241 int n = m_context->countLineArgs();
244 m_managedmaterials_options.double_sided = m_context->getFloatData(1) == 1.f;
251 int n = m_context->countLineArgs();
256 fmt::format(
"Error parsing addonpart file '{}': 'install_prop' has only {} arguments, expected {}",
257 m_addonpart_entry->fname, n, 10));
261 int importflags = Node::Ref::REGULAR_STATE_IS_VALID | Node::Ref::REGULAR_STATE_IS_NUMBERED;
266 def.
offset.x = m_context->getTokFloat(3);
267 def.
offset.y = m_context->getTokFloat(4);
268 def.
offset.z = m_context->getTokFloat(5);
270 def.
rotation.x = m_context->getTokFloat(6);
271 def.
rotation.y = m_context->getTokFloat(7);
272 def.
rotation.z = m_context->getTokFloat(8);
274 def.
mesh_name = m_context->getTokString(9);
279 case SpecialProp::BEACON:
286 m_context->getTokFloat(11), m_context->getTokFloat(12), m_context->getTokFloat(13));
290 case SpecialProp::DASHBOARD_LEFT:
291 case SpecialProp::DASHBOARD_RIGHT:
311 m_module->props.push_back(def);
317 int n = m_context->countLineArgs();
322 fmt::format(
"Error parsing addonpart file '{}': flexbody has only {} arguments, expected {}", m_addonpart_entry->fname, n, 10));
326 int importflags = Node::Ref::REGULAR_STATE_IS_VALID | Node::Ref::REGULAR_STATE_IS_NUMBERED;
331 def.
offset.x = m_context->getTokFloat(3);
332 def.
offset.y = m_context->getTokFloat(4);
333 def.
offset.z = m_context->getTokFloat(5);
335 def.
rotation.x = m_context->getTokFloat(6);
336 def.
rotation.y = m_context->getTokFloat(7);
337 def.
rotation.z = m_context->getTokFloat(8);
339 def.
mesh_name = m_context->getTokString(9);
341 m_context->seekNextLine();
343 if (!m_context->isTokString())
347 fmt::format(
"Error parsing addonpart file '{}': flexbody is not followed by 'forset'!", m_addonpart_entry->fname));
351 Parser::ProcessForsetLine(def, m_context->getTokString());
356 for (
unsigned int i = range.
start.
Num(); i <= range.
end.
Num(); ++i)
358 Node::Ref ref(
"", i, Node::Ref::REGULAR_STATE_IS_VALID | Node::Ref::REGULAR_STATE_IS_NUMBERED, 0);
363 m_module->flexbodies.push_back(def);
368 int n = m_context->countLineArgs();
373 fmt::format(
"Error parsing addonpart file '{}': flare has only {} arguments, expected {}", m_addonpart_entry->fname, n, 5));
378 int importflags = Node::Ref::REGULAR_STATE_IS_VALID | Node::Ref::REGULAR_STATE_IS_NUMBERED;
382 def.
offset.x = m_context->getTokFloat(3);
383 def.
offset.y = m_context->getTokFloat(4);
385 if (n > 5) def.
type = (
FlareType)m_context->getTokString(5)[0];
398 if (n > 8) { def.
size = m_context->getTokFloat(8); }
399 if (n > 9) { def.
material_name = m_context->getTokString(9); }
401 m_module->flares2.push_back(def);
406 int n = m_context->countLineArgs();
411 fmt::format(
"Error parsing addonpart file '{}': flare2 has only {} arguments, expected {}", m_addonpart_entry->fname, n, 6));
416 int importflags = Node::Ref::REGULAR_STATE_IS_VALID | Node::Ref::REGULAR_STATE_IS_NUMBERED;
420 def.
offset.x = m_context->getTokFloat(3);
421 def.
offset.y = m_context->getTokFloat(4);
422 def.
offset.z = m_context->getTokFloat(5);
424 if (n > 6) def.
type = (
FlareType)m_context->getTokString(6)[0];
437 if (n > 9) { def.
size = m_context->getTokFloat(9); }
438 if (n > 10) { def.
material_name = m_context->getTokString(10); }
440 m_module->flares2.push_back(def);
447 ROR_ASSERT(m_context->getTokKeyword() ==
"addonpart_unwanted_prop");
449 if (m_context->isTokFloat(1))
451 if (!m_tuneup->isPropProtected((
PropID_t)m_context->getTokFloat(1)))
453 m_tuneup->unwanted_props.insert((
PropID_t)m_context->getTokFloat(1));
454 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': marking prop '{}' as UNWANTED",
455 m_addonpart_entry->fname, m_context->getTokKeyword(), (
int)m_context->getTokFloat(1)));
459 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': skipping prop '{}' because it's marked PROTECTED",
460 m_addonpart_entry->fname, m_context->getTokKeyword(), m_context->getTokString(1)));
465 this->
Log(
fmt::format(
"[RoR|Addonpart] WARNING: file '{}', directive '{}': bad arguments", m_addonpart_entry->fname, m_context->getTokKeyword()));
471 ROR_ASSERT(m_context->getTokKeyword() ==
"addonpart_unwanted_flexbody");
473 if (m_context->isTokFloat(1))
475 if (!m_tuneup->isFlexbodyProtected((
FlexbodyID_t)m_context->getTokFloat(1)))
477 m_tuneup->unwanted_flexbodies.insert((
FlexbodyID_t)m_context->getTokFloat(1));
478 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': marking flexbody '{}' as UNWANTED",
479 m_addonpart_entry->fname, m_context->getTokKeyword(), (
int)m_context->getTokFloat(1)));
483 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': skipping flexbody '{}' because it's marked PROTECTED",
484 m_addonpart_entry->fname, m_context->getTokKeyword(), m_context->getTokString(1)));
489 this->
Log(
fmt::format(
"[RoR|Addonpart] WARNING: file '{}', directive '{}': bad arguments", m_addonpart_entry->fname, m_context->getTokKeyword()));
495 ROR_ASSERT(m_context->getTokKeyword() ==
"addonpart_unwanted_flare");
497 if (m_context->isTokFloat(1))
499 if (!m_tuneup->isFlareProtected((
FlareID_t)m_context->getTokFloat(1)))
501 m_tuneup->unwanted_flares.insert((
FlareID_t)m_context->getTokFloat(1));
502 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': marking flare '{}' as UNWANTED",
503 m_addonpart_entry->fname, m_context->getTokKeyword(), (
int)m_context->getTokFloat(1)));
507 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': skipping flare '{}' because it's marked PROTECTED",
508 m_addonpart_entry->fname, m_context->getTokKeyword(), m_context->getTokString(1)));
513 this->
Log(
fmt::format(
"[RoR|Addonpart] WARNING: file '{}', directive '{}': bad arguments", m_addonpart_entry->fname, m_context->getTokKeyword()));
519 ROR_ASSERT(m_context->getTokKeyword() ==
"addonpart_unwanted_exhaust");
521 if (m_context->isTokFloat(1))
523 if (!m_tuneup->isExhaustProtected((
ExhaustID_t)m_context->getTokFloat(1)))
525 m_tuneup->unwanted_exhausts.insert((
ExhaustID_t)m_context->getTokFloat(1));
526 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': marking exhaust '{}' as UNWANTED",
527 m_addonpart_entry->fname, m_context->getTokKeyword(), (
int)m_context->getTokFloat(1)));
531 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': skipping exhaust '{}' because it's marked PROTECTED",
532 m_addonpart_entry->fname, m_context->getTokKeyword(), m_context->getTokString(1)));
537 this->
Log(
fmt::format(
"[RoR|Addonpart] WARNING: file '{}', directive '{}': bad arguments", m_addonpart_entry->fname, m_context->getTokKeyword()));
543 ROR_ASSERT(m_context->getTokKeyword() ==
"addonpart_unwanted_managedmaterial");
545 if (m_context->isTokString(1))
547 std::string mat_name = m_context->getTokString(1);
548 if (!m_tuneup->isManagedMatProtected(mat_name))
550 m_tuneup->unwanted_managedmats.insert(mat_name);
551 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': marking managedmaterial '{}' as UNWANTED",
552 m_addonpart_entry->fname, m_context->getTokKeyword(), mat_name));
556 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': skipping managedmaterial '{}' because it's marked PROTECTED",
557 m_addonpart_entry->fname, m_context->getTokKeyword(), mat_name));
562 this->
Log(
fmt::format(
"[RoR|Addonpart] WARNING: file '{}', directive '{}': bad arguments", m_addonpart_entry->fname, m_context->getTokKeyword()));
568 ROR_ASSERT(m_context->getTokKeyword() ==
"addonpart_tweak_wheel");
570 if (m_context->isTokFloat(1) && m_context->isTokString(2))
572 const int wheel_id = (int)m_context->getTokFloat(1);
573 if (!m_tuneup->isWheelProtected(wheel_id))
575 if (m_tuneup->wheel_tweaks.find(wheel_id) == m_tuneup->wheel_tweaks.end())
581 data.
twt_media[0] = m_context->getTokString(2);
582 if (!stop && m_context->isTokString(3)) { data.
twt_media[1] = m_context->getTokString(3); }
else { stop=
true; }
584 if (!stop && m_context->isTokFloat(5)) { data.
twt_tire_radius = m_context->getTokFloat(5); }
else { stop=
true; }
585 if (!stop && m_context->isTokFloat(6)) { data.
twt_rim_radius = m_context->getTokFloat(6); }
else { stop=
true; }
586 m_tuneup->wheel_tweaks.insert(std::make_pair(wheel_id, data));
588 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': Sheduling tweak for wheel '{}'"
589 " with params {{ media1={}, media2={}, side={}, tire_radius={}, rim_radius={} }}",
590 m_addonpart_entry->fname, m_context->getTokKeyword(), wheel_id,
593 else if (m_tuneup->wheel_tweaks[wheel_id].twt_origin != m_addonpart_entry->fname)
595 this->
Log(
fmt::format(
"[RoR|Addonpart] WARNING: file '{}', directive '{}': Resetting tweaks for wheel '{}' due to conflict with '{}'",
596 m_addonpart_entry->fname, m_context->getTokKeyword(), wheel_id,
597 m_tuneup->wheel_tweaks[wheel_id].twt_origin));
599 m_tuneup->wheel_tweaks.erase(wheel_id);
604 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': skipping wheel '{}' because it's marked PROTECTED",
605 m_addonpart_entry->fname, m_context->getTokKeyword(), (
int)m_context->getTokFloat(1)));
610 this->
Log(
fmt::format(
"[RoR|Addonpart] WARNING: file '{}', directive '{}': bad arguments", m_addonpart_entry->fname, m_context->getTokKeyword()));
616 ROR_ASSERT(m_context->getTokKeyword() ==
"addonpart_tweak_node");
618 if (m_context->isTokFloat(1) && m_context->isTokFloat(1) && m_context->isTokFloat(2) && m_context->isTokFloat(3))
621 if (!m_tuneup->isNodeProtected(nodenum))
623 if (m_tuneup->node_tweaks.find(nodenum) == m_tuneup->node_tweaks.end())
628 data.
tnt_pos.x = m_context->getTokFloat(2);
629 data.
tnt_pos.y = m_context->getTokFloat(3);
630 data.
tnt_pos.z = m_context->getTokFloat(4);
631 m_tuneup->node_tweaks.insert(std::make_pair(nodenum, data));
633 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': Scheduling tweak for node '{}'"
634 " with params {{ x={}, y={}, z={} }}",
635 m_addonpart_entry->fname, m_context->getTokKeyword(), nodenum,
638 else if (m_tuneup->node_tweaks[nodenum].tnt_origin != m_addonpart_entry->fname)
640 this->
Log(
fmt::format(
"[RoR|Addonpart] WARNING: file '{}', directive '{}': Resetting tweaks for node '{}' due to conflict with '{}'",
641 m_addonpart_entry->fname, m_context->getTokKeyword(), nodenum,
642 m_tuneup->node_tweaks[nodenum].tnt_origin));
644 m_tuneup->node_tweaks.erase(nodenum);
649 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': skipping node '{}' because it's marked PROTECTED",
650 m_addonpart_entry->fname, m_context->getTokKeyword(), nodenum));
655 this->
Log(
fmt::format(
"[RoR|Addonpart] WARNING: file '{}', directive '{}': bad arguments", m_addonpart_entry->fname, m_context->getTokKeyword()));
661 ROR_ASSERT(m_context->getTokKeyword() ==
"addonpart_tweak_flexbody");
664 if (m_context->isTokFloat(1) &&
665 m_context->isTokFloat(2) && m_context->isTokFloat(3) && m_context->isTokFloat(4) &&
666 m_context->isTokFloat(5) && m_context->isTokFloat(6) && m_context->isTokFloat(7) &&
667 m_context->isTokString(8))
669 const int flexbody_id = (int)m_context->getTokFloat(1);
670 if (!m_tuneup->isFlexbodyProtected(flexbody_id))
672 if (m_tuneup->flexbody_tweaks.find(flexbody_id) == m_tuneup->flexbody_tweaks.end())
677 data.
tft_offset.x = m_context->getTokFloat(2);
678 data.
tft_offset.y = m_context->getTokFloat(3);
679 data.
tft_offset.z = m_context->getTokFloat(4);
683 data.
tft_media = m_context->getTokString(8);
684 m_tuneup->flexbody_tweaks.insert(std::make_pair(flexbody_id, data));
686 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': Scheduling tweak for flexbody '{}'"
687 " with params {{ offsetX={}, offsetY={}, offsetZ={}, rotX={}, rotY={}, rotZ={}, media={} }}",
688 m_addonpart_entry->fname, m_context->getTokKeyword(), flexbody_id,
692 else if (m_tuneup->flexbody_tweaks[flexbody_id].tft_origin != m_addonpart_entry->fname)
694 this->
Log(
fmt::format(
"[RoR|Addonpart] WARNING: file '{}', directive '{}': Resetting tweaks for flexbody '{}' due to conflict with '{}'",
695 m_addonpart_entry->fname, m_context->getTokKeyword(), flexbody_id,
696 m_tuneup->flexbody_tweaks[flexbody_id].tft_origin));
698 m_tuneup->flexbody_tweaks.erase(flexbody_id);
703 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': skipping flexbody '{}' because it's marked PROTECTED",
704 m_addonpart_entry->fname, m_context->getTokKeyword(), (
int)m_context->getTokFloat(1)));
709 this->
Log(
fmt::format(
"[RoR|Addonpart] WARNING: file '{}', directive '{}': bad arguments", m_addonpart_entry->fname, m_context->getTokKeyword()));
715 ROR_ASSERT(m_context->getTokKeyword() ==
"addonpart_tweak_prop");
718 if (m_context->isTokFloat(1) &&
719 m_context->isTokFloat(2) && m_context->isTokFloat(3) && m_context->isTokFloat(4) &&
720 m_context->isTokFloat(5) && m_context->isTokFloat(6) && m_context->isTokFloat(7) &&
721 m_context->isTokString(8))
723 const int prop_id = (int)m_context->getTokFloat(1);
724 if (!m_tuneup->isPropProtected(prop_id))
726 if (m_tuneup->prop_tweaks.find(prop_id) == m_tuneup->prop_tweaks.end())
732 data.
tpt_offset.x = m_context->getTokFloat(2);
733 data.
tpt_offset.y = m_context->getTokFloat(3);
734 data.
tpt_offset.z = m_context->getTokFloat(4);
738 data.
tpt_media[0] = m_context->getTokString(8);
739 if (m_context->isTokString(9)) data.
tpt_media[1] = m_context->getTokString(9);
740 m_tuneup->prop_tweaks.insert(std::make_pair(prop_id, data));
742 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': Scheduling tweak for prop '{}'"
743 " with params {{ media1={}, offsetX={}, offsetY={}, offsetZ={}, rotX={}, rotY={}, rotZ={}, media2={} }}",
744 m_addonpart_entry->fname, m_context->getTokKeyword(), prop_id, data.
tpt_media[0],
749 else if (m_tuneup->prop_tweaks[prop_id].tpt_origin != m_addonpart_entry->fname)
751 this->
Log(
fmt::format(
"[RoR|Addonpart] WARNING: file '{}', directive '{}': Resetting tweaks for prop '{}' due to conflict with '{}'",
752 m_addonpart_entry->fname, m_context->getTokKeyword(), prop_id,
753 m_tuneup->prop_tweaks[prop_id].tpt_origin));
755 m_tuneup->prop_tweaks.erase(prop_id);
760 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': skipping prop '{}' because it's marked PROTECTED",
761 m_addonpart_entry->fname, m_context->getTokKeyword(), (
int)m_context->getTokFloat(1)));
766 this->
Log(
fmt::format(
"[RoR|Addonpart] WARNING: file '{}', directive '{}': bad arguments", m_addonpart_entry->fname, m_context->getTokKeyword()));
772 ROR_ASSERT(m_context->getTokKeyword() ==
"addonpart_tweak_managedmaterial");
774 if (m_context->isTokString(1) && m_context->isTokString(2))
776 const std::string& mat_name = m_context->getTokString(1);
777 if (!m_tuneup->isManagedMatProtected(mat_name))
779 if (m_tuneup->managedmat_tweaks.find(mat_name) == m_tuneup->managedmat_tweaks.end())
785 data.
tmt_type = m_context->getTokString(2);
786 if (!stop && m_context->isTokString(3)) { data.
tmt_media[0] = m_context->getTokString(3); }
else {stop=
true;}
787 if (!stop && m_context->isTokString(4)) { data.
tmt_media[1] = m_context->getTokString(4); }
else {stop=
true;}
788 if (!stop && m_context->isTokString(5)) { data.
tmt_media[2] = m_context->getTokString(5); }
else {stop=
true;}
789 m_tuneup->managedmat_tweaks.insert(std::make_pair(mat_name, data));
791 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': Scheduling tweak for managed material '{}'"
792 " with params {{ type={}, media1={}, media2={}, media3={} }}",
795 else if (m_tuneup->managedmat_tweaks[mat_name].tmt_origin != m_addonpart_entry->fname)
797 this->
Log(
fmt::format(
"[RoR|Addonpart] WARNING: file '{}', directive '{}': Resetting tweaks for managed material '{}' due to conflict with '{}'",
798 m_addonpart_entry->fname, m_context->getTokKeyword(), mat_name,
799 m_tuneup->managedmat_tweaks[mat_name].tmt_origin));
801 m_tuneup->managedmat_tweaks.erase(mat_name);
806 this->
Log(
fmt::format(
"[RoR|Addonpart] INFO: file '{}', directive '{}': skipping managed material '{}' because it's marked PROTECTED",
807 m_addonpart_entry->fname, m_context->getTokKeyword(), mat_name));
814 LOG(
fmt::format(
"[RoR|Addonpart] -- Performing `RecordAddonpartConflicts()` between '{}' and '{}' ~ this involves generating dummy tuneups (hence messages below) --", addonpart1->
fname, addonpart2->
fname));
836 NodeNum_t suspect = i_pair.second.tnt_nodenum;
840 conflicts.push_back(
AddonPartConflict{addonpart1, addonpart2,
"addonpart_tweak_node", (int)suspect});
841 LOG(
fmt::format(
"[RoR|Addonpart] Found conflict between '{}' and '{}' - node {} is tweaked by both", addonpart1->
fname, addonpart2->
fname, (
int)suspect));
848 WheelID_t suspect = i_pair.second.twt_wheel_id;
852 conflicts.push_back(
AddonPartConflict{addonpart1, addonpart2,
"addonpart_tweak_wheel", (int)suspect});
853 LOG(
fmt::format(
"[RoR|Addonpart] Found conflict between '{}' and '{}' - wheel {} is tweaked by both", addonpart1->
fname, addonpart2->
fname, (
int)suspect));
860 PropID_t suspect = i_pair.second.tpt_prop_id;
864 conflicts.push_back(
AddonPartConflict{addonpart1, addonpart2,
"addonpart_tweak_prop", (int)suspect});
865 LOG(
fmt::format(
"[RoR|Addonpart] Found conflict between '{}' and '{}' - prop {} is tweaked by both", addonpart1->
fname, addonpart2->
fname, (
int)suspect));
876 conflicts.push_back(
AddonPartConflict{addonpart1, addonpart2,
"addonpart_tweak_flexbody", (int)suspect});
877 LOG(
fmt::format(
"[RoR|Addonpart] Found conflict between '{}' and '{}' - flexbody {} is tweaked by both", addonpart1->
fname, addonpart2->
fname, (
int)suspect));
881 LOG(
fmt::format(
"[RoR|Addonpart] -- Done with `RecordAddonpartConflicts()` between '{}' and '{}' --", addonpart1->
fname, addonpart2->
fname));
886 if (!addonpart1 || !addonpart2)
893 if ((conflict.atc_addonpart1 == addonpart1 && conflict.atc_addonpart2 == addonpart2) ||
894 (conflict.atc_addonpart1 == addonpart2 && conflict.atc_addonpart2 == addonpart1))
922 if (conflicts.size() > 0)
927 dialog->
mbc_title =
_LC(
"Tuning",
"Cannot install addon part, conflicts were detected.");
932 for (
size_t i=0; i < conflicts.size(); i++)
936 i+1, conflicts.size(),
937 conflicts[i].atc_addonpart2->dname, conflicts[i].atc_addonpart2->fname,
938 conflicts[i].atc_keyword, conflicts[i].atc_element_id);
950 return conflicts.size() > 0;