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

Play Sound Instruction for World Logic #9736

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

Mythril382
Copy link
Contributor

I don't know how to implement loop sounds, so leave suggestions if possible.

If your pull request is not translation or serverlist-related, read the list of requirements below and check each box:

  • I have read the contribution guidelines.
  • I have ensured that my code compiles, if applicable.
  • I have ensured that any new features in this PR function correctly in-game, if applicable.

@Mythril382 Mythril382 changed the title PlaySound Instruction for World Logic Play Sound Instruction for World Logic Apr 12, 2024
@JasonP01
Copy link
Contributor

The commit names are so real

import arc.audio.*;
import mindustry.gen.*;

public enum LogicSound{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a good idea. It's just a re-definition of Sounds, and will require maintenance any time a sound is changed or added.

A better alternative would be to have Sounds.java generate a String[] of sound names, and a map of name to sound object.

Or, one could use Core.assets.getAll(Sound.class, ...) for the same purpose. This would be messier, but would not require modifying codegen.

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 this pull request may close these issues.

None yet

3 participants