Compare commits
No commits in common. "2b922647abc639e0283f27dcfc1a8f9722ce413a" and "d3d4a5b29fad0ef57c31f7530fd9efa6fa63c1cc" have entirely different histories.
2b922647ab
...
d3d4a5b29f
@ -6,7 +6,7 @@ minecraft_version=1.21.4
|
||||
yarn_mappings=1.21.4+build.8
|
||||
loader_version=0.16.10
|
||||
# Mod Properties
|
||||
mod_version=1.14.514.045
|
||||
mod_version=1.14.514.043
|
||||
maven_group=semmiedev
|
||||
archives_base_name=disc_jockey_revive
|
||||
# Dependencies
|
||||
|
@ -32,7 +32,7 @@ public class DebugLogger {
|
||||
}
|
||||
|
||||
public static void sendMessage(String message) {
|
||||
if (Main.config != null && Main.config.debugModeChatMessages) {
|
||||
if (Main.config != null && Main.config.debugModeEnabled) {
|
||||
MinecraftClient.getInstance().inGameHud.getChatHud().addMessage(Text.of("[DiscJockeyRevive-调试]"+message.formatted(Formatting.GRAY)));
|
||||
}
|
||||
}
|
||||
|
@ -12,9 +12,6 @@ public class ModConfig implements ConfigData {
|
||||
@ConfigEntry.Gui.Tooltip(count = 2) public boolean disableAsyncPlayback;
|
||||
@ConfigEntry.Gui.Tooltip(count = 2) public boolean omnidirectionalNoteBlockSounds = true;
|
||||
|
||||
@ConfigEntry.Gui.Tooltip(count = 1)
|
||||
public boolean forceOmnidirectionalNoteBlockSounds = false;
|
||||
|
||||
@ConfigEntry.Gui.Excluded
|
||||
public String currentFolderPath = "";
|
||||
|
||||
@ -65,7 +62,4 @@ public class ModConfig implements ConfigData {
|
||||
|
||||
@ConfigEntry.Gui.Tooltip(count = 1)
|
||||
public boolean debugModeEnabled = false;
|
||||
|
||||
@ConfigEntry.Gui.Tooltip(count = 1)
|
||||
public boolean debugModeChatMessages = false;
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package semmiedev.disc_jockey_revive.gui.screen;
|
||||
|
||||
import me.shedaniel.autoconfig.AutoConfig;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.ConfirmScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
@ -31,7 +30,7 @@ import semmiedev.disc_jockey_revive.SongPlayer.PlayMode;
|
||||
import static net.minecraft.client.toast.TutorialToast.PROGRESS_BAR_WIDTH;
|
||||
|
||||
public class DiscJockeyScreen extends Screen {
|
||||
public static final MutableText
|
||||
private static final MutableText
|
||||
SELECT_SONG = Text.translatable(Main.MOD_ID+".screen.select_song"),
|
||||
PLAY = Text.translatable(Main.MOD_ID+".screen.play"),
|
||||
PLAY_STOP = Text.translatable(Main.MOD_ID+".screen.play.stop").formatted(Formatting.YELLOW),
|
||||
@ -40,12 +39,12 @@ public class DiscJockeyScreen extends Screen {
|
||||
DROP_HINT = Text.translatable(Main.MOD_ID+".screen.drop_hint").formatted(Formatting.GRAY)
|
||||
;
|
||||
|
||||
public SongListWidget songListWidget;
|
||||
public ButtonWidget playButton, previewButton;
|
||||
private SongListWidget songListWidget;
|
||||
private ButtonWidget playButton, previewButton;
|
||||
public boolean shouldFilter;
|
||||
public String query = "";
|
||||
private String query = "";
|
||||
|
||||
public static final MutableText
|
||||
private static final MutableText
|
||||
FOLDER_UP = Text.literal("↑"),
|
||||
CURRENT_FOLDER = Text.translatable(Main.MOD_ID+".screen.current_folder"),
|
||||
PLAY_MODE = Text.translatable(Main.MOD_ID+".screen.play_mode"),
|
||||
@ -54,21 +53,19 @@ public class DiscJockeyScreen extends Screen {
|
||||
MODE_RANDOM = Text.translatable(Main.MOD_ID+".screen.mode_random"),
|
||||
MODE_STOP = Text.translatable(Main.MOD_ID+".screen.mode_stop");
|
||||
|
||||
public static final MutableText
|
||||
private static final MutableText
|
||||
OPEN_FOLDER = Text.translatable(Main.MOD_ID+".screen.open_folder"),
|
||||
RELOAD = Text.translatable(Main.MOD_ID+".screen.reload"),
|
||||
LIVE_DJ = Text.translatable(Main.MOD_ID+".screen.live_dj").formatted(Formatting.GOLD);
|
||||
|
||||
public ButtonWidget folderUpButton, playModeButton;
|
||||
private ButtonWidget folderUpButton, playModeButton;
|
||||
public SongFolder currentFolder;
|
||||
public PlayMode currentPlayMode = PlayMode.STOP_AFTER;
|
||||
private PlayMode currentPlayMode = PlayMode.STOP_AFTER;
|
||||
|
||||
public ProgressBarRenderer progressBarRenderer;
|
||||
private ProgressBarRenderer progressBarRenderer;
|
||||
|
||||
public CustomSliderWidget speedSlider;
|
||||
|
||||
public ButtonWidget configButton;
|
||||
|
||||
public DiscJockeyScreen() {
|
||||
super(Main.NAME);
|
||||
this.progressBarRenderer = new ProgressBarRenderer();
|
||||
@ -148,18 +145,8 @@ public class DiscJockeyScreen extends Screen {
|
||||
Main.SONG_PLAYER.speed = newSpeed;
|
||||
DebugLogger.log("播放速度设置为: {:.2f}x", newSpeed);
|
||||
}
|
||||
}; if (isLargeScreen) addDrawableChild(speedSlider);
|
||||
|
||||
// 配置按钮
|
||||
int configButtonSize = 20;
|
||||
int configButtonX = width - 120 - sliderWidth - configButtonSize - 10;
|
||||
int configButtonY = 10;
|
||||
if (!isLargeScreen) configButtonX = width - 120 - configButtonSize - 10;
|
||||
configButton = ButtonWidget.builder(Text.literal("⚙"), button -> {
|
||||
Screen configScreen = AutoConfig.getConfigScreen(ModConfig.class, this).get();
|
||||
client.setScreen(configScreen);
|
||||
}).dimensions(configButtonX, configButtonY, configButtonSize, configButtonSize).build();
|
||||
addDrawableChild(configButton);
|
||||
};
|
||||
addDrawableChild(speedSlider);
|
||||
|
||||
int buttonY;
|
||||
if (isLargeScreen){
|
||||
@ -361,10 +348,6 @@ public class DiscJockeyScreen extends Screen {
|
||||
);
|
||||
}
|
||||
|
||||
if (configButton != null && configButton.isMouseOver(mouseX, mouseY)) {
|
||||
context.drawTooltip(textRenderer, Text.translatable(Main.MOD_ID + ".screen.open_config"), mouseX, mouseY);
|
||||
}
|
||||
|
||||
|
||||
// DebugLogger.log("DiscJockeyScreen: 初始化界面完成");
|
||||
}
|
||||
|
@ -32,28 +32,11 @@ public class ClientWorldMixin {
|
||||
boolean useDistance, long seed,
|
||||
CallbackInfo ci
|
||||
) {
|
||||
boolean isNoteBlockSound = event.id().getPath().startsWith("block.note_block");
|
||||
|
||||
if (Main.config.forceOmnidirectionalNoteBlockSounds && isNoteBlockSound) {
|
||||
ci.cancel();
|
||||
playOmnidirectionalSound(event, category, volume, pitch, seed);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Main.config.omnidirectionalNoteBlockSounds &&
|
||||
(Main.SONG_PLAYER.running || Main.PREVIEWER.running) &&
|
||||
isNoteBlockSound) {
|
||||
ci.cancel();
|
||||
playOmnidirectionalSound(event, category, volume, pitch, seed);
|
||||
}
|
||||
}
|
||||
|
||||
private void playOmnidirectionalSound(
|
||||
SoundEvent event,
|
||||
SoundCategory category,
|
||||
float volume, float pitch,
|
||||
long seed
|
||||
if (
|
||||
((Main.config.omnidirectionalNoteBlockSounds && Main.SONG_PLAYER.running) || Main.PREVIEWER.running) &&
|
||||
event.id().getPath().startsWith("block.note_block")
|
||||
) {
|
||||
ci.cancel();
|
||||
client.getSoundManager().play(
|
||||
new PositionedSoundInstance(
|
||||
event.id(),
|
||||
@ -70,3 +53,4 @@ public class ClientWorldMixin {
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -96,20 +96,14 @@
|
||||
"text.autoconfig.disc_jockey_revive.option.debugModeEnabled.@Tooltip": "Enable detailed logging for debugging.\nKeep it off unless troubleshooting.\nOf course, many debug parts have been removed.\nEnabling this may cause the log file to be too large.\nHonestly, it's not really helpful for you.",
|
||||
"disc_jockey_revive.screen.speed": "Speed",
|
||||
"disc_jockey_revive.screen.speed_value": "Speed: %.2fx",
|
||||
"disc_jockey_revive.screen.speed.@Tooltip": "Drag to adjust playback speed\n0.25~4",
|
||||
|
||||
"text.autoconfig.disc_jockey_revive.option.playbackFailureAction": "On Playback Failure",
|
||||
"text.autoconfig.disc_jockey_revive.option.playbackFailureAction.@Tooltip": "Action when playback fails due to missing note blocks\nOptions: Stop (default) or Play Next Song",
|
||||
"text.autoconfig.disc_jockey_revive.option.playbackFailureAction.@Tooltip[0]": "Action when playback fails due to missing note blocks\nOptions: Stop (default) or Play Next Song",
|
||||
|
||||
"disc_jockey_revive.playback_failure.stop": "Stop playback",
|
||||
"disc_jockey_revive.playback_failure.next": "Play next song",
|
||||
"disc_jockey_revive.playback_failure.next_message": "Playback failure handling: Play next song.",
|
||||
|
||||
"command.failure_action.set": "Playback failure action set to: %s",
|
||||
|
||||
"text.autoconfig.disc_jockey_revive.option.forceOmnidirectionalNoteBlockSounds": "Force Omnidirectional Note Blocks",
|
||||
"text.autoconfig.disc_jockey_revive.option.forceOmnidirectionalNoteBlockSounds.@Tooltip": "Forces all note block sounds to be omnidirectional at all times.\nOverrides the regular omnidirectional setting.",
|
||||
"disc_jockey_revive.screen.open_config": "Open Mod Settings",
|
||||
|
||||
"text.autoconfig.disc_jockey_revive.option.debugModeChatMessages": "Debug mode chat messages",
|
||||
"text.autoconfig.disc_jockey_revive.option.debugModeChatMessages.@Tooltip": "Enable detailed logging output to chat\nPlease enable debug mode first"
|
||||
"command.failure_action.set": "Playback failure action set to: %s"
|
||||
}
|
||||
|
@ -96,20 +96,14 @@
|
||||
"text.autoconfig.disc_jockey_revive.option.debugModeEnabled.@Tooltip": "启用详细日志输出以进行调试。\n除非排查问题,否则请保持关闭。\n当然,很多调试用的部分已经移除。\n开启这个可能会导致日志文件占用过大\n老实说,其实这对你并没有什么帮助",
|
||||
"disc_jockey_revive.screen.speed": "速度",
|
||||
"disc_jockey_revive.screen.speed_value": "速度: %.2fx",
|
||||
"disc_jockey_revive.screen.speed.@Tooltip": "拖动调整播放速度\n0.25~4",
|
||||
|
||||
"text.autoconfig.disc_jockey_revive.option.playbackFailureAction": "播放失败处理",
|
||||
"text.autoconfig.disc_jockey_revive.option.playbackFailureAction.@Tooltip": "当因缺少音符盒导致播放失败时的处理方式\n选项: 停止播放(默认) 或 播放下一首",
|
||||
"text.autoconfig.disc_jockey_revive.option.playbackFailureAction.@Tooltip[0]": "当因缺少音符盒导致播放失败时的处理方式\n选项: 停止播放(默认) 或 播放下一首",
|
||||
|
||||
"disc_jockey_revive.playback_failure.stop": "停止播放",
|
||||
"disc_jockey_revive.playback_failure.next": "播放下一首",
|
||||
"disc_jockey_revive.playback_failure.next_message": "播放失败处理:播放下一首",
|
||||
|
||||
"command.failure_action.set": "播放失败处理方式已设置为: %s",
|
||||
|
||||
"text.autoconfig.disc_jockey_revive.option.forceOmnidirectionalNoteBlockSounds": "强制全向音符盒音效",
|
||||
"text.autoconfig.disc_jockey_revive.option.forceOmnidirectionalNoteBlockSounds.@Tooltip": "强制所有音符盒音效始终保持全向传播\n会覆盖常规的全向音符盒设置",
|
||||
"disc_jockey_revive.screen.open_config": "打开模组设置",
|
||||
|
||||
"text.autoconfig.disc_jockey_revive.option.debugModeChatMessages": "调试模式聊天框消息",
|
||||
"text.autoconfig.disc_jockey_revive.option.debugModeChatMessages.@Tooltip": "启用将详细日志输出到聊天框\n请先启用调试模式"
|
||||
"command.failure_action.set": "播放失败处理方式已设置为: %s"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user