Skip to content

Commit

Permalink
Rename KeyMappings to InstrumentKeyMappings
Browse files Browse the repository at this point in the history
  • Loading branch information
StavWasPlayZ committed Aug 7, 2023
1 parent 28b4dd3 commit 4e7af1f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.cstav.genshinstrument.client.gui.screens.instrument.partial.note.NoteButton;
import com.cstav.genshinstrument.client.gui.screens.instrument.partial.note.label.INoteLabel;
import com.cstav.genshinstrument.client.gui.screens.instrument.partial.note.label.NoteLabelSupplier;
import com.cstav.genshinstrument.client.keyMaps.KeyMappings.DrumKeys;
import com.cstav.genshinstrument.client.keyMaps.InstrumentKeyMappings.DrumKeys;

import net.minecraft.network.chat.Component;
import net.minecraftforge.api.distmarker.Dist;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.cstav.genshinstrument.client.gui.screens.instrument.partial.note.label.NoteLabelSupplier;
import com.cstav.genshinstrument.client.gui.screens.instrument.partial.notegrid.AbstractGridInstrumentScreen;
import com.cstav.genshinstrument.client.gui.screens.instrument.partial.notegrid.NoteGridButton;
import com.cstav.genshinstrument.client.keyMaps.KeyMappings;
import com.cstav.genshinstrument.client.keyMaps.InstrumentKeyMappings;
import com.cstav.genshinstrument.util.LabelUtil;

import net.minecraft.network.chat.Component;
Expand All @@ -17,7 +17,7 @@
*/
public enum NoteGridLabel implements INoteLabel {
KEYBOARD_LAYOUT((note) -> INoteLabel.upperComponent(
KeyMappings.GRID_INSTRUMENT_MAPPINGS[ng(note).column][ng(note).row].getDisplayName()
InstrumentKeyMappings.GRID_INSTRUMENT_MAPPINGS[ng(note).column][ng(note).row].getDisplayName()
)),
NOTE_NAME((note) -> Component.literal(
LabelUtil.getCutNoteName(ng(note))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.cstav.genshinstrument.client.gui.screens.instrument.drum;

import com.cstav.genshinstrument.client.gui.screens.instrument.partial.note.label.INoteLabel;
import com.cstav.genshinstrument.client.keyMaps.KeyMappings;
import com.cstav.genshinstrument.client.keyMaps.KeyMappings.DrumKeys;
import com.cstav.genshinstrument.client.keyMaps.InstrumentKeyMappings;
import com.cstav.genshinstrument.client.keyMaps.InstrumentKeyMappings.DrumKeys;
import com.cstav.genshinstrument.sound.ModSounds;
import com.cstav.genshinstrument.sound.NoteSound;

Expand Down Expand Up @@ -35,7 +35,7 @@ public String getTransKey() {
// Seperated for server compatibility
@OnlyIn(Dist.CLIENT)
public DrumKeys getKeys() {
return (this == DON) ? KeyMappings.DON : KeyMappings.KA;
return (this == DON) ? InstrumentKeyMappings.DON : InstrumentKeyMappings.KA;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import com.cstav.genshinstrument.client.gui.screens.instrument.GenshinConsentScreen;
import com.cstav.genshinstrument.client.gui.screens.instrument.partial.note.NoteButton;
import com.cstav.genshinstrument.client.gui.screens.options.instrument.AbstractInstrumentOptionsScreen;
import com.cstav.genshinstrument.client.keyMaps.KeyMappings;
import com.cstav.genshinstrument.client.keyMaps.InstrumentKeyMappings;
import com.cstav.genshinstrument.networking.ModPacketHandler;
import com.cstav.genshinstrument.networking.buttonidentifier.NoteButtonIdentifier;
import com.cstav.genshinstrument.networking.packet.instrument.CloseInstrumentPacket;
Expand Down Expand Up @@ -250,12 +250,12 @@ public boolean keyReleased(int pKeyCode, int pScanCode, int pModifiers) {

private boolean pitchChanged;
protected boolean checkPitchInstrumentUp(int pKeyCode, int pScanCode) {
if (!pitchChanged && KeyMappings.PITCH_UP_MODIFIER.get().matches(pKeyCode, pScanCode)) {
if (!pitchChanged && InstrumentKeyMappings.PITCH_UP_MODIFIER.get().matches(pKeyCode, pScanCode)) {
setPitch(getPitch() + 1);
pitchChanged = true;
return true;
}
if (!pitchChanged && KeyMappings.PITCH_DOWN_MODIFIER.get().matches(pKeyCode, pScanCode)) {
if (!pitchChanged && InstrumentKeyMappings.PITCH_DOWN_MODIFIER.get().matches(pKeyCode, pScanCode)) {
setPitch(getPitch() - 1);
pitchChanged = true;
return true;
Expand All @@ -264,12 +264,12 @@ protected boolean checkPitchInstrumentUp(int pKeyCode, int pScanCode) {
return false;
}
protected boolean checkPitchInstrumentDown(int pKeyCode, int pScanCode) {
if (pitchChanged && KeyMappings.PITCH_UP_MODIFIER.get().matches(pKeyCode, pScanCode)) {
if (pitchChanged && InstrumentKeyMappings.PITCH_UP_MODIFIER.get().matches(pKeyCode, pScanCode)) {
initPitch(this::setPitch);
pitchChanged = false;
return true;
}
if (pitchChanged && KeyMappings.PITCH_DOWN_MODIFIER.get().matches(pKeyCode, pScanCode)) {
if (pitchChanged && InstrumentKeyMappings.PITCH_DOWN_MODIFIER.get().matches(pKeyCode, pScanCode)) {
initPitch(this::setPitch);
pitchChanged = false;
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.cstav.genshinstrument.client.gui.screens.instrument.partial.note.NoteButton;
import com.cstav.genshinstrument.client.gui.screens.options.instrument.AbstractInstrumentOptionsScreen;
import com.cstav.genshinstrument.client.gui.screens.options.instrument.GridInstrumentOptionsScreen;
import com.cstav.genshinstrument.client.keyMaps.KeyMappings;
import com.cstav.genshinstrument.client.keyMaps.InstrumentKeyMappings;
import com.cstav.genshinstrument.networking.buttonidentifier.NoteButtonIdentifier;
import com.cstav.genshinstrument.networking.buttonidentifier.NoteGridButtonIdentifier;
import com.cstav.genshinstrument.sound.NoteSound;
Expand Down Expand Up @@ -118,7 +118,7 @@ public NoteGrid initNoteGrid() {

public final NoteGrid noteGrid = initNoteGrid();

private final Map<Key, NoteButton> noteMap = noteGrid.genKeyboardMap(KeyMappings.GRID_INSTRUMENT_MAPPINGS);
private final Map<Key, NoteButton> noteMap = noteGrid.genKeyboardMap(InstrumentKeyMappings.GRID_INSTRUMENT_MAPPINGS);
@Override
public Map<Key, NoteButton> noteMap() {
return noteMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

@OnlyIn(Dist.CLIENT)
@EventBusSubscriber(bus = Bus.MOD, modid = GInstrumentMod.MODID, value = Dist.CLIENT)
public class KeyMappings {
public class InstrumentKeyMappings {
public static final String CATEGORY = GInstrumentMod.MODID+".keymaps";

public static final IKeyConflictContext INSTRUMENT_KEY_CONFLICT_CONTEXT = new IKeyConflictContext() {
Expand Down

0 comments on commit 4e7af1f

Please sign in to comment.