VisualPinball.Engine icon indicating copy to clipboard operation
VisualPinball.Engine copied to clipboard

Additionally map string-parsed IDs when mapping coils

Open freezy opened this issue 3 years ago • 3 comments

There was a regression introduced when we cleared internal (int) IDs in the GLE in favor of purely string-based IDs.

The coil player currently blindly looks up the ID it gets from the GLE, which in the case of PinMAME, is a stringified integer. However, we often prefix coil IDs with "0" to get proper sorting, and it's also how they are named in the manual. So a "04" coil mapping won't match a "4" event from the GLE.

This patch additionally maps coils to their stringified integer, if it's not the same as the original name.

There will be another problem, the other way around, for switches. I will update this PR with a fix for that too, when I can reproduce.

I'll also do the same for lamps. @jsm174 let me know your thoughts already.

freezy avatar Aug 20 '22 23:08 freezy

Also need to check whether that doesn't screw up the coil statuses, because CoilStatuses is not distinct anymore.

freezy avatar Aug 20 '22 23:08 freezy

However, we often prefix coil IDs with "0" to get proper sorting

The treeview control used for switch and coil managers was update to support sorting by number here:

https://github.com/freezy/VisualPinball.Engine/commit/58c77cf90fc1f3ddbc73d959cb6ec317516ad68e

jsm174 avatar Aug 21 '22 02:08 jsm174

Ah, cool. Still want to support people prefixing names with "0" though.

freezy avatar Aug 21 '22 10:08 freezy