Skip to content

Commit

Permalink
Rename "pitch" to "transpose"
Browse files Browse the repository at this point in the history
  • Loading branch information
StavWasPlayZ committed Aug 7, 2023
1 parent 4e7af1f commit fc3e342
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ protected AbstractWidget initOptionsButton(final int vertOffset) {

@Override
public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) {
if (checkPitchInstrumentUp(pKeyCode, pScanCode))
if (checkPitchTransposeUp(pKeyCode, pScanCode))
return true;

final NoteButton note = getNoteByKey(pKeyCode);
Expand All @@ -236,7 +236,7 @@ public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) {
}
@Override
public boolean keyReleased(int pKeyCode, int pScanCode, int pModifiers) {
if (checkPitchInstrumentDown(pKeyCode, pScanCode))
if (checkTransposeDown(pKeyCode, pScanCode))
return true;

unlockFocused();
Expand All @@ -249,27 +249,27 @@ public boolean keyReleased(int pKeyCode, int pScanCode, int pModifiers) {
}

private boolean pitchChanged;
protected boolean checkPitchInstrumentUp(int pKeyCode, int pScanCode) {
if (!pitchChanged && InstrumentKeyMappings.PITCH_UP_MODIFIER.get().matches(pKeyCode, pScanCode)) {
protected boolean checkPitchTransposeUp(int pKeyCode, int pScanCode) {
if (!pitchChanged && InstrumentKeyMappings.TRANSPOSE_UP_MODIFIER.get().matches(pKeyCode, pScanCode)) {
setPitch(getPitch() + 1);
pitchChanged = true;
return true;
}
if (!pitchChanged && InstrumentKeyMappings.PITCH_DOWN_MODIFIER.get().matches(pKeyCode, pScanCode)) {
if (!pitchChanged && InstrumentKeyMappings.TRANSPOSE_DOWN_MODIFIER.get().matches(pKeyCode, pScanCode)) {
setPitch(getPitch() - 1);
pitchChanged = true;
return true;
}

return false;
}
protected boolean checkPitchInstrumentDown(int pKeyCode, int pScanCode) {
if (pitchChanged && InstrumentKeyMappings.PITCH_UP_MODIFIER.get().matches(pKeyCode, pScanCode)) {
protected boolean checkTransposeDown(int pKeyCode, int pScanCode) {
if (pitchChanged && InstrumentKeyMappings.TRANSPOSE_UP_MODIFIER.get().matches(pKeyCode, pScanCode)) {
initPitch(this::setPitch);
pitchChanged = false;
return true;
}
if (pitchChanged && InstrumentKeyMappings.PITCH_DOWN_MODIFIER.get().matches(pKeyCode, pScanCode)) {
if (pitchChanged && InstrumentKeyMappings.TRANSPOSE_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 @@ -41,15 +41,15 @@ public boolean conflicts(IKeyConflictContext other) {
};


public static final Lazy<KeyMapping> PITCH_UP_MODIFIER = Lazy.of(
() -> new KeyMapping(CATEGORY+".pitch_up_modifier",
public static final Lazy<KeyMapping> TRANSPOSE_UP_MODIFIER = Lazy.of(
() -> new KeyMapping(CATEGORY+".transpose_up_modifier",
INSTRUMENT_KEY_CONFLICT_CONTEXT,
InputConstants.Type.KEYSYM,
GLFW.GLFW_KEY_RIGHT_SHIFT
, CATEGORY)
);
public static final Lazy<KeyMapping> PITCH_DOWN_MODIFIER = Lazy.of(
() -> new KeyMapping(CATEGORY+".pitch_down_modifier",
public static final Lazy<KeyMapping> TRANSPOSE_DOWN_MODIFIER = Lazy.of(
() -> new KeyMapping(CATEGORY+".transpose_down_modifier",
INSTRUMENT_KEY_CONFLICT_CONTEXT,
InputConstants.Type.KEYSYM,
GLFW.GLFW_KEY_LEFT_SHIFT
Expand All @@ -59,8 +59,8 @@ public boolean conflicts(IKeyConflictContext other) {

@SubscribeEvent
public static void registerKeybinds(final RegisterKeyMappingsEvent event) {
event.register(PITCH_UP_MODIFIER.get());
event.register(PITCH_DOWN_MODIFIER.get());
event.register(TRANSPOSE_UP_MODIFIER.get());
event.register(TRANSPOSE_DOWN_MODIFIER.get());
}


Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/assets/genshinstrument/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"genshinstrument.keymaps": "Instruments GUI",
"genshinstrument.keymaps.pitch_down_modifier": "Pitch Instrument Down",
"genshinstrument.keymaps.pitch_up_modifier": "Pitch Instrument Up",
"genshinstrument.keymaps.transpose_up_modifier": "Transpose Instrument Up",
"genshinstrument.keymaps.transpose_down_modifier": "Transpose Instrument Down",


"genshinstrument.itemGroup.instruments": "Instruments",
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/assets/genshinstrument/lang/he_il.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"genshinstrument.keymaps": "כלי נגינה",
"genshinstrument.keymaps.pitch_down_modifier": "המנך גובה צליל",
"genshinstrument.keymaps.pitch_up_modifier": "הגבהה גובה צליל",
"genshinstrument.keymaps.transpose_down_modifier": "המנך גובה צליל",
"genshinstrument.keymaps.transpose_up_modifier": "הגבהה גובה צליל",


"genshinstrument.itemGroup.instruments": "כלי נגינה",
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/assets/genshinstrument/lang/ru_ru.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"genshinstrument.keymaps": "инструменты",
"genshinstrument.keymaps.pitch_down_modifier": "Уменьшение высоты инструмента",
"genshinstrument.keymaps.pitch_up_modifier": "Повышение высоты инструмента",
"genshinstrument.keymaps.transpose_up_modifier": "Повышение высоты инструмента",
"genshinstrument.keymaps.transpose_down_modifier": "Уменьшение высоты инструмента",


"genshinstrument.itemGroup.instruments": "инструменты",
Expand Down

0 comments on commit fc3e342

Please sign in to comment.