Skip to content

Commit

Permalink
在任务栏中显示启动和附加按钮
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed May 10, 2024
1 parent 9f0ab45 commit 63fbf1e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@
"ignoreSync": true,
"pattern": "(^.*[\\\\/]Editor.exe$)|(^$)"
},
"Y3-Helper.ShowStatusBarItem": {
"title": "显示状态栏按钮",
"description": "在状态栏中显示“启动”和“附加”按钮",
"type": "boolean",
"default": true
},
"Y3-Helper.editorTablceDataExcelFolder": {
"title": "存放物编数据的Excel表格所在的文件夹的相对路径",
"description": "注意:Execl表中的物编数据会按此相对路径下的importRules.mjs代码所实现的导入规则来导入,生成Excel物编数据模板时也会生成到此文件夹下",
Expand Down
25 changes: 25 additions & 0 deletions src/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,31 @@ export function init(context: vscode.ExtensionContext) {
env.onDidChange(() => {
update_debugger_path();
});

let launch = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
launch.text = '✨启动';
launch.tooltip = '启动游戏并附加调试器';
launch.command = 'y3-helper.launchGameAndAttach';

let attach = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
attach.text = '💡附加';
attach.tooltip = '附加调试器';
attach.command = 'y3-helper.attach';

function update_items() {
if (vscode.workspace.getConfiguration('Y3-Helper').get('ShowStatusBarItem')) {
launch.show();
attach.show();
} else {
launch.hide();
attach.hide();
}
}

update_items();
vscode.workspace.onDidChangeConfiguration(() => {
update_items();
});
}

export async function attach() {
Expand Down

0 comments on commit 63fbf1e

Please sign in to comment.