Compare commits

..

7 Commits

Author SHA1 Message Date
hyde zhou f567861ff6 bump version to 4.0.0-alpha.19 (#143) 2026-05-25 14:33:54 +08:00
hyde zhou a7a20b64ab bump version to 4.0.0-alpha.18 (#137) 2026-05-19 23:40:06 +08:00
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
6 changed files with 20 additions and 17 deletions
+3 -3
View File
@@ -39,9 +39,9 @@ module.exports = {
newRenderTexture: 'Render Texture',
newScene: 'Scene',
newScene:{
'2d': '2D',
'3d': '3D',
quality: 'Quality',
'2d': '2D Scene',
'3d': '3D Scene',
quality: 'High Quality Scene',
},
newPrefab: 'Node Prefab',
newMaterial: 'Material',
+3 -3
View File
@@ -38,9 +38,9 @@ module.exports = {
newCubeMap: '立方体贴图',
newScene: '场景',
newScene:{
'2d': '2D',
'3d': '3D',
quality: '质量',
'2d': '2D 场景',
'3d': '3D 场景',
quality: '高质量场景',
},
newPrefab: '预制 (Prefab)',
newRenderTexture: '渲染纹理 (Render Texture)',
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "cocos-creator",
"version": "4.0.0-alpha.15",
"version": "4.0.0-alpha.19",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "cocos-creator",
"version": "4.0.0-alpha.15",
"version": "4.0.0-alpha.19",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cocos-creator",
"version": "4.0.0-alpha.15",
"version": "4.0.0-alpha.19",
"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;