@@ -1817,47 +1817,30 @@ void CacheSystem::ModifyProject(ModifyProjectRequest* request)
1817
1817
case ModifyProjectRequestType::TUNEUP_USE_ADDONPART_SET:
1818
1818
{
1819
1819
request->mpr_target_actor ->ensureWorkingTuneupDef ();
1820
- if (request->mpr_target_actor ->getWorkingTuneupDef ()->use_addonparts .count (request->mpr_subject ) = = 0 )
1820
+ if (request->mpr_target_actor ->getWorkingTuneupDef ()->use_addonparts .count (request->mpr_subject ) ! = 0 )
1821
1821
{
1822
- // Re-check conflicts (request may come from 'Browse all' button or script).
1823
- CacheEntryPtr subject_entry = this ->FindEntryByFilename (LT_AddonPart, /* partial=*/ false , request->mpr_subject );
1824
- AddonPartConflictVec conflicts;
1825
- for (const std::string& use_addonpart: request->mpr_target_actor ->getWorkingTuneupDef ()->use_addonparts )
1826
- {
1827
- CacheEntryPtr use_entry = this ->FindEntryByFilename (LT_AddonPart, /* partial=*/ false , use_addonpart);
1828
- AddonPartUtility::RecordAddonpartConflicts (subject_entry, use_entry, conflicts);
1829
- }
1830
- if (conflicts.size () == 0 )
1831
- {
1832
- request->mpr_target_actor ->getWorkingTuneupDef ()->use_addonparts .insert (request->mpr_subject );
1833
- }
1834
- else
1835
- {
1836
- GUI::MessageBoxConfig* dialog = new GUI::MessageBoxConfig;
1837
- dialog->mbc_allow_close = true ;
1838
- dialog->mbc_content_width = 700 .f ;
1839
- dialog->mbc_title = fmt::format (_LC (" Tuning" , " Cannot install addon part, conflicts were detected." ), request->mpr_subject );
1840
- dialog->mbc_text = fmt::format (_LC (" Tuning" , " Requested addon part: '{}' (file '{}')." ), subject_entry->dname , subject_entry->fname );
1841
- dialog->mbc_text += " \n " ;
1842
- dialog->mbc_text += fmt::format (_LC (" Tuning" , " Total conflicts: {}." ), conflicts.size ());
1843
- dialog->mbc_text += " \n " ;
1844
- for (size_t i=0 ; i < conflicts.size (); i++)
1845
- {
1846
- dialog->mbc_text += " \n " ;
1847
- dialog->mbc_text += fmt::format (_LC (" Tuning" , " [{}/{}] '{}' (file '{}') conflicts with '{}' #{}." ),
1848
- i+1 , conflicts.size (),
1849
- conflicts[i].atc_addonpart2 ->dname , conflicts[i].atc_addonpart2 ->fname ,
1850
- conflicts[i].atc_keyword , conflicts[i].atc_element_id );
1851
- }
1852
- App::GetGameContext ()->PushMessage (Message (MSG_GUI_SHOW_MESSAGE_BOX_REQUESTED, (void *)dialog));
1853
- }
1822
+ App::GetConsole ()->putMessage (Console::CONSOLE_MSGTYPE_ACTOR, Console::CONSOLE_SYSTEM_WARNING,
1823
+ fmt::format (_LC (" Tuning" , " Addon part '{}' is already equipped." ), request->mpr_subject ));
1824
+ return ; // Nothing to do!
1854
1825
}
1855
- else
1826
+
1827
+ CacheEntryPtr subject_entry = this ->FindEntryByFilename (LT_AddonPart, /* partial=*/ false , request->mpr_subject );
1828
+ if (!subject_entry)
1856
1829
{
1857
1830
App::GetConsole ()->putMessage (Console::CONSOLE_MSGTYPE_ACTOR, Console::CONSOLE_SYSTEM_WARNING,
1858
- fmt::format (_LC (" Tuning" , " Addon part '{}' is already installed." ), request->mpr_subject ));
1831
+ fmt::format (_LC (" Tuning" , " Addon part '{}' was not found in mod cache (probably not installed)." ), request->mpr_subject ));
1832
+ return ; // Nothing to do!
1859
1833
}
1860
-
1834
+
1835
+ if (AddonPartUtility::DoubleCheckForAddonpartConflict (request->mpr_target_actor , subject_entry))
1836
+ {
1837
+ return ; // Error message box already shown
1838
+ }
1839
+ else
1840
+ {
1841
+ request->mpr_target_actor ->getWorkingTuneupDef ()->use_addonparts .insert (request->mpr_subject );
1842
+ }
1843
+
1861
1844
break ;
1862
1845
}
1863
1846
0 commit comments