Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ All notable changes to the "ege" extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## 1.0.0

- 大版本更新: 内置的 EGE 升级至 25.11
- 新增 Visual Studio 2026 支持
- 新增配置项 `ege.downloadFromOfficial`:支持配置是否从官网下载 EGE(默认使用内置版本)
- 移除安装时的版本选择弹窗,默认使用内置版本,提升用户体验
- EGE 25.11 新特性:
- 新增颜色类型 `color_type` 枚举,支持 PRGB32/ARGB32/RGB32
- 新增 `image_convertcolor()` 函数用于图像颜色类型转换
- 新增 `keypress()`/`keyrelease()`/`keyrepeat()` 键盘输入查询函数
- 相机模块增强:支持查询设备支持的分辨率
- 图像处理改用预乘 alpha 格式提升渲染性能

## 0.7.0

- 将 ege 更新为更新的 2025 版本, 带来了相机相关 feature.
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A VSCode plugin to help the configuration of [ege](https://xege.org). Enjoy it!

## Deps

- Windows: Visual Studio `2017`/`2019`/`2022`/`20XX+`
- Windows: Visual Studio `2017`/`2019`/`2022`/`2026+`
- MacOS: `mingw-w64`, `wine-stable` (wine64)
- You can install via `brew install mingw-w64 wine-stable`
- Linux: `mingw-w64`, `wine64`
Expand All @@ -36,9 +36,14 @@ You can define some options like below:
"ege.update_url": "",
"ege.showEditorContextMenu": true, // Show 'ege' in editor context menu
"ege.explorerContextMenu": true, // Show 'ege' in explorer context menu
"ege.downloadFromOfficial": false // Download EGE from official website instead of using the builtin version
}
```

### Configuration Details

- **`ege.downloadFromOfficial`**: By default, the plugin uses the builtin EGE library (tested and stable). If you want to download the latest version from the official website (<https://xege.org>), set this option to `true`. Note that the official download may not always be stable or compatible with the plugin.

## MileStone

- Install:
Expand Down
9 changes: 7 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

## 依赖项

- Windows: Visual Studio `2017`/`2019`/`2022`/`20XX+`
- Windows: Visual Studio `2017`/`2019`/`2022`/`2026+`
- MacOS: `mingw-w64`, `wine-stable` (wine64)
- 您可以通过 `brew install mingw-w64 wine-stable` 安装
- Linux: `mingw-w64`, `wine64`
Expand All @@ -34,10 +34,15 @@
{
"ege.update_url": "https://xege.org/download/ege-latest-version",
"ege.showEditorContextMenu": true,
"ege.explorerContextMenu": true
"ege.explorerContextMenu": true,
"ege.downloadFromOfficial": false // 从官网下载 EGE 而不是使用内置版本
}
```

### 配置说明

- **`ege.downloadFromOfficial`**: 默认情况下,插件使用内置的 EGE 库(经过测试且稳定)。如果您想从官网 (<https://xege.org>) 下载最新版本,请将此选项设置为 `true`。注意:官网下载的版本可能不总是稳定或与插件兼容。

## 命令

此扩展提供以下命令:
Expand Down
3 changes: 0 additions & 3 deletions bundle/ege_bundle/lib/vs2026/vs2026/x64/graphics.lib

This file was deleted.

3 changes: 0 additions & 3 deletions bundle/ege_bundle/lib/vs2026/vs2026/x86/graphics.lib

This file was deleted.

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ege",
"displayName": "ege",
"description": "Auto configuration for ege (https://xege.org)",
"version": "0.7.0",
"version": "1.0.0",
"icon": "images/logo.png",
"publisher": "wysaid",
"repository": {
Expand Down Expand Up @@ -73,6 +73,12 @@
"default": true,
"description": "%config.explorerContextMenu.description%",
"scope": "resource"
},
"ege.downloadFromOfficial": {
"type": "boolean",
"default": false,
"description": "%config.downloadFromOfficial.description%",
"scope": "resource"
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"title.egeConfiguration": "ege configuration",
"config.updateUrl.description": "An url to get latest version of EGE (default: https://xege.org/download/ege-latest-version)",
"config.showEditorContextMenu.description": "Show 'ege' in editor context menu",
"config.explorerContextMenu.description": "Show 'ege' in explorer context menu"
"config.explorerContextMenu.description": "Show 'ege' in explorer context menu",
"config.downloadFromOfficial.description": "Download EGE from official website (https://xege.org) instead of using the builtin version. Enable this option only if you need the latest version from the official website."
}
3 changes: 2 additions & 1 deletion package.nls.zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"title.egeConfiguration": "ege 配置",
"config.updateUrl.description": "获取最新版本 EGE 的 URL(默认:https://xege.org/download/ege-latest-version)",
"config.showEditorContextMenu.description": "在编辑器上下文菜单中显示 'ege'",
"config.explorerContextMenu.description": "在资源管理器上下文菜单中显示 'ege'"
"config.explorerContextMenu.description": "在资源管理器上下文菜单中显示 'ege'",
"config.downloadFromOfficial.description": "从官网 (https://xege.org) 下载 EGE 而不是使用内置版本。仅当你需要官网最新版本时才启用此选项。"
}
19 changes: 13 additions & 6 deletions src/buildSingleFileWin32.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,28 @@ export class SingleFileBuilderWin32 extends SingleFileBuilder {
let extraIncludeDir = null;
let extraLibsDir: string | null = null;

// version 通常是年份 (2015, 2017, 2019, 2022),但 VS2026 的安装目录名是 "18"
// 所以 VS2026 的 version 值是 18,而不是 2026
const vsVersion = compilerItem.version;
let cppStandard = 'c++11';
if (compilerItem.version >= 2019) {
/// vs2019, vs2022
if (vsVersion >= 2017 || vsVersion === 18) {
/// vs2017, vs2019, vs2022, vs2026 (version=18)
cppStandard = 'c++17';
} else if (compilerItem.version >= 2015) {
} else if (vsVersion >= 2015) {
/// vs2015
cppStandard = 'c++14';
}

// 将 version 映射到 lib 目录名(VS2026 的 version 是 18,但 lib 目录是 vs2026)
const libDirVersion = vsVersion === 18 ? 2026 : vsVersion;

if (compilerItem.version > 0) {
extraIncludeDir = path.join(installerDir, 'include');
const libDir = path.join(installerDir, 'lib');
extraLibsDir = path.join(libDir, `vs${compilerItem.version}`);
extraLibsDir = path.join(libDir, `vs${libDirVersion}`);
if (!fs.existsSync(extraLibsDir)) {
console.log(`EGE: path "${extraLibsDir}" does not exist, set to default`);
extraLibsDir = path.join(libDir, 'vs2019'); // 目前最新是这个.
extraLibsDir = path.join(libDir, 'vs2022'); // fallback 到 vs2022
}
}

Expand Down Expand Up @@ -108,7 +115,7 @@ export class SingleFileBuilderWin32 extends SingleFileBuilder {
let executionCharset = ''; // ANSI (Unuse)
let executionCharsetCommand = ''; // '/execution-charset:' + executionCharset;

const buildCommand = `call "${cmdTool}" ${arch} && cl /nodefaultlib:"MSVCRT" /MDd ${defineConsole} ${extraIncludeCommand} /std:${cppStandard} ${sourceCharsetCommand} ${executionCharsetCommand} /EHsc "${filePath}" /link ${extraLibsCommand}`;
const buildCommand = `call "${cmdTool}" ${arch} && cl /nodefaultlib:"MSVCRT" /MDd ${defineConsole} ${extraIncludeCommand} /std:${cppStandard} /Zc:__cplusplus ${sourceCharsetCommand} ${executionCharsetCommand} /EHsc "${filePath}" /link ${extraLibsCommand}`;

const logMsg = `执行编译指令: ${buildCommand}`;
ege.printWarning(logMsg);
Expand Down
2 changes: 2 additions & 0 deletions src/compilers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const TYPE_VS2015 = 'vs2015';
const TYPE_VS2017 = 'vs2017';
const TYPE_VS2019 = 'vs2019';
const TYPE_VS2022 = 'vs2022';
const TYPE_VS2026 = 'vs2026';

/// will try auto detect.
const TYPE_LATEST_VISUAL_STUDIO = 'vs_latest';
Expand Down Expand Up @@ -272,6 +273,7 @@ export class Compilers {
case TYPE_VS2017:
case TYPE_VS2019:
case TYPE_VS2022:
case TYPE_VS2026:
case TYPE_LATEST_VISUAL_STUDIO:
this.performInstallVisualStudio(installationPath);
break;
Expand Down
45 changes: 12 additions & 33 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,46 +62,25 @@ export class EGEInstaller {
}

async performInstall(needDownload?: boolean): Promise<boolean | undefined> {
// 检查是否配置了从官网下载
const config = vscode.workspace.getConfiguration('ege');
const downloadFromOfficial = config.get<boolean>('downloadFromOfficial', false);

// 如果已有安装,清理后重新安装
if (fs.existsSync(this.egeInstallerDir)) {
if (isWindows()) {
const quickPicks = [
{
label: "Use builtin EGE(24.04)",
description: "使用本插件内置的EGE(24.04)完成安装 (推荐)",
picked: true
},
{
label: "Download the latest version from https://xege.org",
description: "从官网下载最新版本并安装",
picked: false
}];

const value = await vscode.window.showQuickPick(quickPicks, {
title: "EGE: Existing installation detected, choose actions you want",
canPickMany: false
});

if (value) {
const index = quickPicks.indexOf(value);

if (index >= 0) {
this.clearPluginCache();

/// pass true to trigger download.
await this.performInstall(index === 1);
} else {
console.log("EGE: PerformInstall cancelled");
return;
}
} else {
ege.showInfoBox("EGE: 安装已取消!");
}
return;
this.clearPluginCache();
// 根据配置决定下载源,不再递归调用
} else {
ege.printInfo("正在非 Windows 系统上执行编译...");
}
}

// 如果 needDownload 未指定,则使用配置决定
if (needDownload === undefined) {
needDownload = downloadFromOfficial;
}

if (this.progressHandle && this.progressHandle.progressInstance) {
ege.showErrorBox("安装流程执行中, 请耐心等待... 如果等待时间过长, 也可以考虑重启vscode再试试.", "OK");
return;
Expand Down