X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Ftape.c;h=9f2a61f39bae0069976c9587c3d908289051250f;hp=88f0f5a0300e4e0799ff9abf40cda0e138d3fd51;hb=d442dd6ca65b694c37fbd3c93505644fe8478263;hpb=123c5a87fa9cf6d9759ed7911d3544f05afdd11c diff --git a/src/tape.c b/src/tape.c index 88f0f5a0..9f2a61f3 100644 --- a/src/tape.c +++ b/src/tape.c @@ -1299,10 +1299,8 @@ void UnmapTapeButtons() UnmapGadget(tape_gadget[i]); } -static void HandleTapeButtons(struct GadgetInfo *gi) +static void HandleTapeButtonsExt(int id) { - int id = gi->custom_id; - if (game_status != GAME_MODE_MAIN && game_status != GAME_MODE_PLAYING) return; @@ -1407,3 +1405,24 @@ static void HandleTapeButtons(struct GadgetInfo *gi) break; } } + +static void HandleTapeButtons(struct GadgetInfo *gi) +{ + HandleTapeButtonsExt(gi->custom_id); +} + +void HandleTapeButtonKeys(Key key) +{ + boolean use_extra = (tape.recording || tape.playing); + + if (key == setup.shortcut.tape_eject) + HandleTapeButtonsExt(use_extra ? TAPE_CTRL_ID_EXTRA : TAPE_CTRL_ID_EJECT); + else if (key == setup.shortcut.tape_stop) + HandleTapeButtonsExt(TAPE_CTRL_ID_STOP); + else if (key == setup.shortcut.tape_pause) + HandleTapeButtonsExt(TAPE_CTRL_ID_PAUSE); + else if (key == setup.shortcut.tape_record) + HandleTapeButtonsExt(TAPE_CTRL_ID_RECORD); + else if (key == setup.shortcut.tape_play) + HandleTapeButtonsExt(TAPE_CTRL_ID_PLAY); +}