Skip to content

Commit

Permalink
dynamic throw > throw ball with mouse
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke-G-Cordova committed Nov 20, 2022
1 parent 9a47934 commit 8bd5049
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion media/main-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ function petPanelApp(basePetUri, theme, themeKind, petColor, petSize, petType, s
window.addEventListener('message', (event) => {
const message = event.data; // The json data that the extension sent
switch (message.command) {
case 'toggle-dynamic-throw':
case 'throw-with-mouse':
if (dynamicThrowToggle) {
dynamicThrowOff();
dynamicThrowToggle = false;
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"icon": "icon.png",
"activationEvents": [
"onCommand:vscode-pets.start",
"onCommand:vscode-pets.toggle-dynamic-throw",
"onCommand:vscode-pets.throw-with-mouse",
"onCommand:vscode-pets.throw-ball",
"onCommand:vscode-pets.spawn-pet",
"onCommand:vscode-pets.delete-pet",
Expand Down Expand Up @@ -79,8 +79,8 @@
"icon": "media/dog.svg"
},
{
"command": "vscode-pets.toggle-dynamic-throw",
"title": "Toggle Dynamic Throwing",
"command": "vscode-pets.throw-with-mouse",
"title": "Throw ball with mouse",
"category": "Pet Coding",
"icon": {
"dark": "media/icon/dark-throw-outline.svg",
Expand Down
17 changes: 7 additions & 10 deletions src/extension/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,12 @@ export function activate(context: vscode.ExtensionContext) {
);

context.subscriptions.push(
vscode.commands.registerCommand(
'vscode-pets.toggle-dynamic-throw',
() => {
const panel = getPetPanel();
if (panel !== undefined) {
panel.toggleDynamicThrow();
}
},
),
vscode.commands.registerCommand('vscode-pets.throw-with-mouse', () => {
const panel = getPetPanel();
if (panel !== undefined) {
panel.toggleDynamicThrow();
}
}),
);

context.subscriptions.push(
Expand Down Expand Up @@ -774,7 +771,7 @@ class PetWebviewContainer implements IPetPanel {

public toggleDynamicThrow(): void {
this.getWebview().postMessage({
command: 'toggle-dynamic-throw',
command: 'throw-with-mouse',
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/panel/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ export function petPanelApp(
window.addEventListener('message', (event): void => {
const message = event.data; // The json data that the extension sent
switch (message.command) {
case 'toggle-dynamic-throw':
case 'throw-with-mouse':
if (dynamicThrowToggle) {
dynamicThrowOff();
dynamicThrowToggle = false;
Expand Down

0 comments on commit 8bd5049

Please sign in to comment.