You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This implements proactive scanning for addonpart conflicts when the menu is refreshed. This incurs a big lag when opening the menu and likely a lot of spam in RoR.log, but it works. Currently it only displays red squares as conflict markers when one addonpart is hovered.
The original conflict resolution logic is still present in `ResolveUnwantedAndTweakedElements()` - when a conflict is found, tweeaks for that elements are reset. But this is flawed, if there's an odd number of conflicting tweaks, the last one will pass. I'll remove it in next commits.
Copy file name to clipboardexpand all lines: source/main/gui/panels/GUI_TopMenubar.h
+4-1
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@
25
25
26
26
#pragma once
27
27
28
+
#include"AddonPartFileFormat.h"
28
29
#include"CacheSystem.h"
29
30
#include"RoRnet.h"
30
31
@@ -109,7 +110,8 @@ class TopMenubar
109
110
110
111
// Tuning menu
111
112
ActorPtr tuning_actor; //!< Detecting actor change to update cached values.
112
-
std::vector<CacheEntryPtr> tuning_addonparts; //!< Addonparts of current actor, both matched by GUID and force-installed by user via [browse all] button.
113
+
std::vector<CacheEntryPtr> tuning_addonparts; //!< Addonparts eligible for current actor, both matched by GUID and force-installed by user via [browse all] button.
114
+
AddonPartConflictVec tuning_conflicts; //!< Conflicts between eligible addonparts tweaking the same element.
113
115
CacheQuery tuning_saves; //!< Tuneups saved by user, with category ID `RoR::CID_AddonpartUser`
114
116
Str<200> tuning_savebox_buf; //!< Buffer for tuneup name to be saved
115
117
bool tuning_savebox_visible = false; //!< User pressed 'save active' to open savebox.
@@ -118,6 +120,7 @@ class TopMenubar
118
120
constfloat TUNING_HOLDTOCONFIRM_TIMELIMIT = 1.5f; //!< Delete button must be held for several sec to confirm.
119
121
bool tuning_force_refresh = false;
120
122
float tuning_rwidget_cursorx_min = 0.f; //!< Avoid drawing right-side widgets ('Delete' button or 'Protected' chk) over saved tuneup names.
LOG(fmt::format("[RoR|Addonpart] Found conflict between '{}' and '{}' - node {} is tweaked by both", addonpart1->fname, addonpart2->fname, (int)suspect));
595
+
}
596
+
}
597
+
598
+
// WHEEL TWEAKS:
599
+
for (size_t i = 0; i < dummy_t1->wheel_tweaks.size(); i++)
LOG(fmt::format("[RoR|Addonpart] Found conflict between '{}' and '{}' - wheel {} is tweaked by both", addonpart1->fname, addonpart2->fname, (int)suspect));
607
+
}
608
+
}
609
+
610
+
// PROP TWEAKS:
611
+
for (size_t i = 0; i < dummy_t1->prop_tweaks.size(); i++)
LOG(fmt::format("[RoR|Addonpart] Found conflict between '{}' and '{}' - prop {} is tweaked by both", addonpart1->fname, addonpart2->fname, (int)suspect));
619
+
}
620
+
}
621
+
622
+
// FLEXBODY TWEAKS:
623
+
for (size_t i = 0; i < dummy_t1->flexbody_tweaks.size(); i++)
LOG(fmt::format("[RoR|Addonpart] Found conflict between '{}' and '{}' - flexbody {} is tweaked by both", addonpart1->fname, addonpart2->fname, (int)suspect));
631
+
}
632
+
}
633
+
634
+
LOG(fmt::format("[RoR|Addonpart] -- Done with `RecordAddonpartConflicts()` between '{}' and '{}' --", addonpart1->fname, addonpart2->fname));
0 commit comments