MCPcopy
hub / github.com/ollm/OpenComic / changeButton

Function changeButton

scripts/settings.js:870–914  ·  view source on GitHub ↗
(action, current, This)

Source from the content-addressed store, hash-verified

868}
869
870function changeButton(action, current, This)
871{
872 if(recording) return;
873
874 recording = true;
875
876 dom.this(template._contentRight()).find('table tbody td').removeClass('active');
877 This.classList.add('active');
878
879 shortcuts.record(function(shortcut){
880
881 gamepad.reset('record');
882
883 This.classList.remove('active');
884
885 events.snackbar({
886 key: 'useGamepad',
887 text: language.settings.shortcuts.useGamepad,
888 duration: 6,
889 update: true,
890 buttons: [
891 {
892 text: language.buttons.dismiss,
893 function: 'events.closeSnackbar();',
894 },
895 ],
896 });
897
898 setTimeout(function(){recording = false}, 100);
899
900 });
901
902 gamepad.setButtonEvent('record', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], function(key, button){
903
904 gamepad.reset('record');
905 shortcuts.stopRecord();
906
907 shortcuts.changeGamepad('reading', action, current, gamepad.buttonName(key));
908
909 generateShortcutsTable(gamepad.currentHighlightItem());
910
911 setTimeout(function(){recording = false}, 100);
912
913 });
914}
915
916function removeButton(action, current)
917{

Callers

nothing calls this directly

Calls 3

generateShortcutsTableFunction · 0.85
recordMethod · 0.80
resetMethod · 0.80

Tested by

no test coverage detected