rigs-of-rods
rigs-of-rods copied to clipboard
Fixing and improving the Tuning menu.
Highlights:
- Addonpart file format: added directive
addonpart_filename <foo.truck>
to whitelist only some vehicles if GUID is too broad. - Tuning UI: Added sections Exhausts, Flares and Managed Materials
- Tuning UI: Added anti-conflict system: if 2 addonparts tweak the same element, they cannot be installed together.
- Gray X marker = conflict with installed addonpart.
- Red [ ] marker = conflict with mouse-hovered addonpart (regardless of being installed or not)
Changes made so far:
- Fixed crash when multiple addonparts try to tweak the same node. previously, whenever 2 addonparts conflicted, I actually by mistake inserted a zeroed-out tweak to the schedule. That happened in the logging code.
- INFO log about adding tweak from addonpart to tuneup was changed from "tweaking *** with params" to "Scheduling tweak for *** with params" to clarify it's not applied yet.
- INFO log about withdrawing tweak from tuneup due to another addonpart trying to tweak the same element was changed from "conflict of tweaks at ***" to WARNING "Resetting tweaks for *** due to conflict"
- Fixed FlexbodyDebug UI 'hide other' not working for flexbodies. Broken in 9551d053bfb2cc4527c87213ab95b43fc044993b - since this commit flexbodies got a dynamic visibility control, exactly the same as props. From user (truck fileformat) perspective, it was the same already but the update pattern was different, and this commit unified it. The FlexbodyDebug UI didn't reflect this however.
- Fixed addonpart conflict handling. The tuning menu now evaluates conflicts between addonparts (each element like wheel or node can be tweaked only by 1 addonpart) and shows markers on conflict:
- Gray X = conflict with installed addonpart.
- Red [ ] = conflict with mouse-hovered addonpart (regardless of being installed or not)
- Modcache query system: fixed the GUID filtering being case-sensitive in all cases (trucks, skins, addonparts), even though the search string is always case-insensitive.
- Added flares to tuning system:
flare/flare2/addonpart_unwanted_flare
in .addonpart, protected/forceremoved states in .tuneup, including UI. Tweaks were omitted. - Added exhausts to tuning system:
addonpart_unwanted_exhausts
in .addonpart, protectd/forceremoved states in .tuneup, including UI. Tweaks and defining new exhausts in .addonpart were omitted. - Fixed a bug in
GenericDocument
tokenizer - IfOPTION_ALLOW_NAKED_STRINGS
was used, strings starting liketrue/false
, for examplef
ort
alone, would get discarded. - UI touch: right-aligned addonpart [Reload] buttons.
- Tuneup format + UI: Added managed materials tweaks.
Additional discovered issues:
- [Fixed] ~The idea was that 2 or more addonparts cannot tweak the same element. There is a flaw in this logic though: if there are 3 conflicting addonparts, the second one will reset the first one, but the third one will pass. And so on.~
I'm fixing the addonpart conflicts - I figured I need to block the user from selecting conflicting addonparts at all, preferably with some visual markers. This is what I have right now - the graphics are not final and there's a huge lag when opening the menu. To be improved.
Markers are finished:
- Gray X = conflict with installed addonpart.
- Red [ ] = conflict with mouse-hovered addonpart (regardless of being installed or not)
Added addonpart_filename
directive (optional whitelist)
The modder can add any number of addonpart_filename <foo.truck>
directives (case-insensitive). If none are specified, any filename goes.
Matching by GUID is still the primary method, this only helps in cases where the GUID is shared by too many trucks (not uncommon).
Unfortunately adding flares doesn't seem to work for me:
MV4_PolicePackage.zip
Adding the flares after flexbodies introduces the flexbody errors.
Expected result:
https://github.com/RigsOfRods/rigs-of-rods/assets/46073351/28546f74-ec4a-4fd8-969b-f6280f8411a0
CTRL+2
activates the lightbar and CTRL+3
for the front/rear flashers.
I fixed the discarding incomplete boolean token 'f'
warnings - it was a tokenizer bug.
EDIT: Another fix - I forgot to update the condition around block = keyword;
, causing the parser to interpret all flare lines as whatever was before (flexbodies in this case).
Finally I fixed the case where the flare used material from the addonpart ZIP - same story as with props and flexbodies, I just forgot to handle it the first time.
Added managed materials tweaks:
I fixed the remaining 2 glitches:
- Cannot load flat files from '/projects' dir - turned out to be an exception due to 'readOnly' flag in OGRE archives.
- When actor has no guid, the 'saved tuneups' list show tuneups for all actors - fixed by adding 'filename' directive to .tuneup file, allowing to filter by filename.