-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Narration can now be cancelled on the title screen
- Loading branch information
1 parent
8fde763
commit fa84ac7
Showing
4 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
Change license to MPL-2.0 | ||
Add Russian translation (kyrtion) | ||
Add Russian translation (kyrtion) | ||
Narration can now be cancelled on the title screen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/the_fireplace/audiobook/mixin/ScreenMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package the_fireplace.audiobook.mixin; | ||
|
||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.client.gui.screen.Screen; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
import the_fireplace.audiobook.Audiobook; | ||
import the_fireplace.audiobook.AudiobookLogic; | ||
|
||
@Environment(EnvType.CLIENT) | ||
@Mixin(Screen.class) | ||
public final class ScreenMixin { | ||
|
||
@Inject(at = @At(value="HEAD"), method = "keyPressed") | ||
private void onKeyPressed(int keyCode, int scanCode, int modifiers, CallbackInfoReturnable<Boolean> cir) { | ||
if (Audiobook.stopAudiobookKey.matchesKey(keyCode, scanCode)) { | ||
AudiobookLogic.stopNarration(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters