Compare commits

..

9 Commits

Author SHA1 Message Date
hyde zhou 7c75834010 bump version to 4.0.0-alpha.17 (#135) 2026-05-11 23:18:35 +08:00
hyde zhou 8fd985af75 bump version to 4.0.0-alpha.16 (#134) 2026-05-07 15:35:41 +08:00
qiuguohua cc97bc8af4 V4.0.0 fix get window info cache (#123) 2026-05-07 15:16:18 +08:00
tangkai 92124590fe update (#131) 2026-04-29 16:10:42 +08:00
tangkai 822ac6026c update assets.js (#129) 2026-04-29 13:04:48 +08:00
hyde zhou 4a6f83bd6d Revert "refactor platforms (#126)" (#128) 2026-04-28 23:12:10 +08:00
tangkai 04f063eb2b add key value to assets.js (#127) 2026-04-28 23:09:53 +08:00
hyde zhou 910865bd8b refactor platforms (#126) 2026-04-28 18:53:46 +08:00
hyde zhou e384f54ed2 bump version to 4.0.0-alpha.15 (#125) 2026-04-28 16:46:44 +08:00
6 changed files with 24 additions and 11 deletions
+5
View File
@@ -38,6 +38,11 @@ module.exports = {
newCubeMap: 'CubeMap',
newRenderTexture: 'Render Texture',
newScene: 'Scene',
newScene:{
'2d': '2D Scene',
'3d': '3D Scene',
quality: 'High Quality Scene',
},
newPrefab: 'Node Prefab',
newMaterial: 'Material',
newPhysicsMaterial: 'Physics Material',
+5
View File
@@ -37,6 +37,11 @@ module.exports = {
newTypeScript: '脚本 (TypeScript)',
newCubeMap: '立方体贴图',
newScene: '场景',
newScene:{
'2d': '2D 场景',
'3d': '3D 场景',
quality: '高质量场景',
},
newPrefab: '预制 (Prefab)',
newRenderTexture: '渲染纹理 (Render Texture)',
newMaterial: '材质',
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "cocos-creator",
"version": "4.0.0-alpha.14",
"version": "4.0.0-alpha.17",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "cocos-creator",
"version": "4.0.0-alpha.14",
"version": "4.0.0-alpha.17",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cocos-creator",
"version": "4.0.0-alpha.14",
"version": "4.0.0-alpha.17",
"description": "Cocos Creator is a cross-platform 2D & 3D game engine written in C++ and TypeScript, licensed under MIT.",
"homepage": "http://www.cocos.com",
"license": "MIT",
-7
View File
@@ -124,13 +124,6 @@ minigame.createInnerAudioContext = createInnerAudioContextPolyfill(wx, {
onSeek: false,
}, true);
let _cachedSystemInfo: SystemInfo = wx.getWindowInfo();
minigame.onWindowResize?.((): void => {
// update cached system info
_cachedSystemInfo = wx.getWindowInfo() as SystemInfo;
});
minigame.getWindowInfo = (): SystemInfo => _cachedSystemInfo;
// #region SafeArea
// FIX_ME: wrong safe area when orientation is landscape left
minigame.getSafeArea = (): SafeArea => {
+11 -1
View File
@@ -24,7 +24,7 @@
*/
import { ALIPAY, BYTEDANCE, HUAWEI, OPPO, RUNTIME_BASED, SUD, SUDV2, VIVO, MIGU, HONOR, WECHAT, XIAOMI, DEBUG, TEST, TAOBAO, TAOBAO_MINIGAME, WECHAT_MINI_PROGRAM } from 'internal:constants';
import { minigame, SystemInfo as MinigameSystemInfo } from 'pal/minigame';
import { minigame, SystemInfo as MinigameSystemInfo, WindowInfo } from 'pal/minigame';
import { IFeatureMap } from 'pal/system-info';
import { EventTarget } from '../../../cocos/core/event';
import { checkPalIntegrity, withImpl } from '../../integrity-check';
@@ -100,7 +100,10 @@ if (BYTEDANCE) {
}
const originalGetSystemInfoSync = minigame.getSystemInfoSync;
// Some platforms may not have this interface(getWindowInfo).
const originalGetWindowInfo = minigame.getWindowInfo;
let _cachedSystemInfo: MinigameSystemInfo = originalGetSystemInfoSync.call(minigame);
let _cachedWindowInfo: WindowInfo | undefined = originalGetWindowInfo?.call(minigame);
function testAndUpdateSystemInfoCache (testAmount: number, testInterval: number): void {
let successfullyTestTimes = 0;
@@ -127,12 +130,19 @@ if (WECHAT && versionCompare(minigame.getAppBaseInfo().SDKVersion, '2.25.3') < 0
minigame.onWindowResize?.(() => {
// update cached system info
_cachedSystemInfo = originalGetSystemInfoSync.call(minigame);
_cachedWindowInfo = originalGetWindowInfo?.call(minigame);
});
minigame.getSystemInfoSync = function (): MinigameSystemInfo {
return _cachedSystemInfo;
};
if (originalGetWindowInfo !== undefined) {
minigame.getWindowInfo = function (): WindowInfo {
return _cachedWindowInfo!;
};
}
class SystemInfo extends EventTarget {
public declare readonly networkType: NetworkType;
public declare readonly isNative: boolean;