Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SA342: LASER_POWER should be VCB_POWER or BCV_POWER #484

Closed
JDeeth opened this issue Oct 26, 2023 · 7 comments · Fixed by #514
Closed

SA342: LASER_POWER should be VCB_POWER or BCV_POWER #484

JDeeth opened this issue Oct 26, 2023 · 7 comments · Fixed by #514

Comments

@JDeeth
Copy link

JDeeth commented Oct 26, 2023

Thanks for the superb work!

I've found a mislabelled identifier - LASER_POWER is the power switch for the video control box. Can you introduce a duplicate identifier as VCB_POWER or BCV_POWER (Video Control Box / Boitier de Commande Video) without breaking backwards compatibility? As far as I know there's not a separate power switch for the laser rangefinder.

SA342:defineToggleSwitch("LASER_POWER", 36, 3286, 367, "PE", "Laser Power")

@JDeeth
Copy link
Author

JDeeth commented Oct 27, 2023

Also on a tangential note - is there a reason not to make the various switch covers defineToggleSwitchToggleOnly? At the moment, repeatedly sending MISSILE_LAUNCH_COVER 1 or MISSILE_LAUNCH_COVER INC will flip the cover up and down. Changing the .lua myself from defineToggleSwitch to defineToggleSwitchToggleOnly and the 1/INC and 0/DEC arguments are idempotent and the TOGGLE argument is still available

@charliefoxtwo
Copy link
Member

I haven't tested myself yet, but this seems like a case where defineToggleSwitchToggleOnly makes sense. If it functions as you describe, then imo it should definitely be ToggleOnly.

Duplicate identifiers can be added, but we generally try to avoid them and just encourage users to use the new ids. @WarLord211 might know more about how many people are building Gazelle pits and could say more about who this might affect.

@JDeeth
Copy link
Author

JDeeth commented Oct 27, 2023

I'd be delighted to know if anyone is making a Gazelle pit... I changed them over to ToggleOnly and they worked as expected with brief testing. If anyone is expecting e.g. MISSILE_LAUNCH_COVER 1 to act as a toggle... they could change the lua back or change their code to MISSILE_LAUNCH_COVER TOGGLE

@charliefoxtwo
Copy link
Member

If anyone is expecting e.g. MISSILE_LAUNCH_COVER 1 to act as a toggle... they could change the lua back or change their code to MISSILE_LAUNCH_COVER TOGGLE

I agree. I'm not concerned about breaking behavior here.

@jdahlblom
Copy link
Contributor

Was this made already?

@charliefoxtwo
Copy link
Member

It doesn't appear so. I don't really have any experience with the gazelle so I was hesitant to make the change, but I can take a look if you'd like.

@charliefoxtwo
Copy link
Member

charliefoxtwo commented Jan 1, 2024

I went through and tested all the other covers and the missile cover was the only one I found which needed ToggleOnly - the others all seemed to function as expected.

I also renamed the existing LASER_POWER control to VCB_POWER (this is what the tooltip in the game says), and added a new (deprecated control) at the end with the LASER_POWER id. This should preserve backwards compatibility for now but allow us to delete it eventually with minimal user impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants