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

Add new settings and missing translatables #1248

Merged
merged 2 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/src/main/java/tc/oc/pgm/api/setting/SettingKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public enum SettingKey implements Aliased {
Material.LEATHER_HELMET,
PICKER_AUTO,
PICKER_ON,
PICKER_OFF), // Changes when the picker is displayed
PICKER_OFF,
PICKER_MANUAL), // Changes when the picker is displayed
JOIN(
Arrays.asList("join", "jms"),
Material.WOOD_DOOR,
Expand Down Expand Up @@ -64,6 +65,7 @@ public void update(MatchPlayer player) {
"sounds",
Material.NOTE_BLOCK,
SOUNDS_ALL,
SOUNDS_CHAT,
SOUNDS_DM,
SOUNDS_NONE), // Changes when sounds are played
VOTE(
Expand Down
9 changes: 6 additions & 3 deletions core/src/main/java/tc/oc/pgm/api/setting/SettingValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public enum SettingValue {
DEATH_FRIENDS(
"death", "friends", DyeColor.GREEN), // Only send death messages involving yourself or friends

PICKER_AUTO("picker", "auto", DyeColor.ORANGE), // Display after cycle, or with permissions.
PICKER_AUTO("picker", "auto", DyeColor.ORANGE), // Display after cycle, or with permissions
PICKER_ON("picker", "on", DyeColor.GREEN), // Display the picker GUI always
PICKER_OFF("picker", "off", DyeColor.RED), // Never display the picker GUI

Expand All @@ -36,7 +36,7 @@ public enum SettingValue {
OBSERVERS_OFF("observers", "none", DyeColor.RED), // Hide observers

SOUNDS_ALL("sounds", "all", DyeColor.GREEN), // Play all sounds
SOUNDS_DM("sounds", "messages", DyeColor.ORANGE), // Only play DM sounds
SOUNDS_DM("sounds", "messages", DyeColor.YELLOW), // Only play DM sounds
SOUNDS_NONE("sounds", "none", DyeColor.RED), // Never play sounds

VOTE_ON("vote", "on", DyeColor.GREEN), // Show the vote book on cycle
Expand All @@ -50,7 +50,10 @@ public enum SettingValue {

TIME_AUTO("time", "auto", DyeColor.ORANGE), // Player time is in sync
TIME_DARK("time", "dark", DyeColor.GRAY), // Player time is always set to midday
TIME_LIGHT("time", "light", DyeColor.WHITE); // Player time is always set to midnight
TIME_LIGHT("time", "light", DyeColor.WHITE), // Player time is always set to midnight

PICKER_MANUAL("picker", "manual", DyeColor.WHITE), // Only display the picker GUI if right clicked
SOUNDS_CHAT("sounds", "chat", DyeColor.ORANGE); // Only play DM and admin sounds

private final String key;
private final String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ public static void broadcastAdminChatMessage(
public static void playSound(MatchPlayer player, Sound sound) {
SettingValue value = player.getSettings().getValue(SettingKey.SOUNDS);
if (value.equals(SettingValue.SOUNDS_ALL)
|| value.equals(SettingValue.SOUNDS_CHAT)
|| (sound.equals(DM_SOUND) && value.equals(SettingValue.SOUNDS_DM))) {
player.playSound(sound);
}
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/tc/oc/pgm/picker/PickerMatchModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ protected boolean settingEnabled(MatchPlayer player, boolean playerTriggered) {
return false;
case PICKER_ON: // When on always show the GUI
return true;
case PICKER_MANUAL: // Only show the GUI when right clicked
return playerTriggered;
default: // Display after map cycle, but check perms when clicking button.
return !playerTriggered || hasPermission || hasClasses;
}
Expand Down
12 changes: 12 additions & 0 deletions util/src/main/i18n/templates/ui.properties
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ settings.death.all = View all death messages

settings.death.own = View own death messages only

settings.death.friends = Only view death messages from friends

settings.picker = Changes when the picker is displayed

settings.picker.auto = Automatically display picker based on match
Expand All @@ -83,28 +85,38 @@ settings.picker.on = Always display the picker

settings.picker.off = Never display the picker

settings.picker.manual = Only display the picker when right clicked

settings.join = Changes when join messages are sent

settings.join.on = View all join messages

settings.join.friends = Only view join messages from friends

settings.join.off = Hide all join messages

settings.message = Changes if private messages are accepted

settings.message.on = Accept all private messages

settings.message.friend = Only accept private messages from friends

settings.message.off = Reject all private messages

settings.observers = Changes if observers are visible

settings.observers.on = Show all observers

settings.observers.friend = Only show observer friends

settings.observers.off = Hide other observers

settings.sounds = Changes when sounds are played

settings.sounds.all = Hear all match sounds

settings.sounds.chat = Only hear chat-related sounds

settings.sounds.dm = Only hear sounds from direct messages

settings.sounds.none = Mute all match sounds
Expand Down