Repository navigation
Compatibility note regarding getSwitchIndex(positionName)
#3808
raphaelcoeffic
started this conversation in
LUA
Replies: 1 comment
|
I believe one should not use |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
As many things related to switches have changed in
mainpost2.9, I checked howgetSwitchIndex(positionName)used to work, and how it works now.I noticed the following regarding versions up to
2.9, which are more or less the same inmain, and make certain uses ofgetSwitchIndex()fundamentally flawed:getSwitchPositionName()is used, which computes a string that is dependent on custom switch names. This means that when usinggetSwitchIndex()to grab the index of a known switch, it won't work if a custom name has been defined for that switch.CHAR_TRIM.."Rl"; in French that would beCHAR_TRIM.."Dg")Post
2.9(main),getSwitchIndex()works the same with the exception of trims which use a different string:Rud-/Rud+(English; French translation usesDir-/Dir+)IMHO, there is little value in reproducing the same behaviour in
mainas it was in2.9because of the different strings based on the language used.All reactions