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

POC: ConsoleTheme sounds for controls. #79

Merged
merged 3 commits into from
Jan 29, 2023
Merged

Conversation

CommandrMoose
Copy link
Collaborator

Currently using a generic for all consoles, but can be expanded on later.

Copy link
Member

@50ap5ud5 50ap5ud5 left a comment

Choose a reason for hiding this comment

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

A good start, needs refining and documentation.

Comment on lines 28 to 30
var direction = operator.getControlManager().getTargetLocation().rotation.toString();
var caps = direction.substring(0, 1).toUpperCase() + direction.substring(1);
PlayerUtil.sendMessage(player, Component.translatable(caps), true);
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to add a comment on what this does.

@@ -42,10 +44,11 @@ public void onRightClick(TardisLevelOperator operator, ControlEntity controlEnti
}

PlayerUtil.sendMessage(player, Component.translatable(operator.getControlManager().getTargetLocation().position.toShortString()), true);
playGenericClick(operator, theme, controlEntity, false, false);
Copy link
Member

Choose a reason for hiding this comment

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

If this method needs to be called for every child class, it would be better to make a new abstract class that provides default implementations of the methods. Then we can extend all our controls off this abstract class and call the super method when we need to call on the default behaviour.

this.rightClick = rightClick;
}

public PitchedSound getLeftClick() {
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to clarify if these PitchedSound parameters are nullable. There are some ConsoleSoundProfiles that don't have a leftClick PitchedSound defined.

Is there any consequences of not defining a left click or right click sound?

Comment on lines 5 to 10
public ConsoleSound throttleEnable;
public ConsoleSound throttleDisable;
public ConsoleSound doorOpen;
public ConsoleSound doorClose;
public ConsoleSound doorLocked;
public ConsoleSound generic;
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps use getters and/or setters rather than expose the raw fields if these are meant to be pre-defined instances.

@CommandrMoose CommandrMoose merged commit 09bd908 into master Jan 29, 2023
@CommandrMoose CommandrMoose deleted the feature/console-sounds branch February 25, 2023 23:13
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

2 participants