-
Notifications
You must be signed in to change notification settings - Fork 21
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
Conversation
There was a problem hiding this 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.
var direction = operator.getControlManager().getTargetLocation().rotation.toString(); | ||
var caps = direction.substring(0, 1).toUpperCase() + direction.substring(1); | ||
PlayerUtil.sendMessage(player, Component.translatable(caps), true); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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?
public ConsoleSound throttleEnable; | ||
public ConsoleSound throttleDisable; | ||
public ConsoleSound doorOpen; | ||
public ConsoleSound doorClose; | ||
public ConsoleSound doorLocked; | ||
public ConsoleSound generic; |
There was a problem hiding this comment.
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.
Currently using a generic for all consoles, but can be expanded on later.