Skip to content

Commit

Permalink
Toggle Slider for Throwing the Ball with the Mouse.
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-Hopkinson committed Jun 5, 2024
1 parent 61374a6 commit 7b9ed66
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
12 changes: 1 addition & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,8 @@
"license": "MIT",
"icon": "icon.png",
"activationEvents": [
"onCommand:vscode-pets.start",
"onCommand:vscode-pets.throw-with-mouse",
"onCommand:vscode-pets.throw-ball",
"onCommand:vscode-pets.spawn-pet",
"onCommand:vscode-pets.delete-pet",
"onCommand:vscode-pets.remove-all-pets",
"onCommand:vscode-pets.roll-call",
"onCommand:vscode-pets.export-pet-list",
"onCommand:vscode-pets.import-pet-list",
"onWebviewPanel:petCoding",
"onView:explorer",
"onView:petsView",
"onStartupFinished"
],
"main": "./out/extension/extension.js",
Expand Down Expand Up @@ -85,7 +75,7 @@
"icon": "media/dog.svg"
},
{
"command": "vscode-pets.throw-with-mouse",
"command": "vscode-pets.throwBallWithMouse",
"title": "Throw ball with mouse",
"category": "Pet Coding",
"icon": {
Expand Down
21 changes: 21 additions & 0 deletions src/extension/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,27 @@ export function activate(context: vscode.ExtensionContext) {
}),
);

context.subscriptions.push(
vscode.commands.registerCommand(
'vscode-pets.throwBallWithMouse',
() => {
const config = vscode.workspace.getConfiguration('vscode-pets');
config.update(

Check warning on line 375 in src/extension/extension.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 375 in src/extension/extension.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
'throwBallWithMouse',
!getThrowWithMouseConfiguration(),
vscode.ConfigurationTarget.Global,
);

vscode.window.showInformationMessage(

Check warning on line 381 in src/extension/extension.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 381 in src/extension/extension.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
vscode.l10n.t(
'Throw ball with mouse is now {0}.',
getThrowWithMouseConfiguration() ? 'off' : 'on',
),
);
},
),
);

context.subscriptions.push(
vscode.commands.registerCommand('vscode-pets.delete-pet', async () => {
const panel = getPetPanel();
Expand Down

0 comments on commit 7b9ed66

Please sign in to comment.