RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
990 stars 175 forks source link

Tuning: fixed managedmats for meshes in addonpart bundles. #3157

Closed ohlidalp closed 1 month ago

ohlidalp commented 1 month ago

Because we do material setup after we load meshes via OGRE, we need a placeholder for every managedmat - if not found, OGRE substitutes them with 'BaseWhite' which breaks subsequent processing.

Problem: placeholders were only created in the vehicle bundle's resource group, not in addonpart's bundle resource group.

Fix: create placeholders also for all addonpart bundles.

ohlidalp commented 1 month ago

Additionally, I added an addonpart conflict check which always runs upon equipping an addonpart (because request may come from 'Browse all' button or script). Screenshot shows the dialog that appears if conflict is found - it's a bit crude but thorough.

obrazek

ohlidalp commented 1 month ago

Added 'OK' button to the conflicts doublecheck dialog.

obrazek

Also extended the GUI_MessageBox.cpp to always reprint the dialog to RoR.log

10:52:00: [RoR|MessageBox] Showing a message box
<MessageBox title> Cannot install addon part, conflicts were detected.
<MessageBox text> Requested addon part: 'Gavril MV4S - Lowered Race Suspension' (file 'MV4_lowered_race.addonpart').
Total conflicts: 8.

[1/8] 'Gavril MV4 - Rally Suspension' (file 'MV4_rally.addonpart') conflicts with 'addonpart_tweak_node' #119.
[2/8] 'Gavril MV4 - Rally Suspension' (file 'MV4_rally.addonpart') conflicts with 'addonpart_tweak_node' #120.
[3/8] 'Gavril MV4 - Rally Suspension' (file 'MV4_rally.addonpart') conflicts with 'addonpart_tweak_node' #121.
[4/8] 'Gavril MV4 - Rally Suspension' (file 'MV4_rally.addonpart') conflicts with 'addonpart_tweak_node' #122.
[5/8] 'Gavril MV4 - Rally Suspension' (file 'MV4_rally.addonpart') conflicts with 'addonpart_tweak_node' #135.
[6/8] 'Gavril MV4 - Rally Suspension' (file 'MV4_rally.addonpart') conflicts with 'addonpart_tweak_node' #136.
[7/8] 'Gavril MV4 - Rally Suspension' (file 'MV4_rally.addonpart') conflicts with 'addonpart_tweak_node' #137.
[8/8] 'Gavril MV4 - Rally Suspension' (file 'MV4_rally.addonpart') conflicts with 'addonpart_tweak_node' #138.'
<MessageBox button> 'OK' (MsgType: MSG_GUI_HIDE_MESSAGE_BOX_REQUESTED)