mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a7a20b64ab | |||
| 7c75834010 | |||
| 8fd985af75 | |||
| cc97bc8af4 | |||
| 92124590fe | |||
| 822ac6026c |
@@ -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',
|
||||
|
||||
@@ -38,9 +38,9 @@ module.exports = {
|
||||
newCubeMap: '立方体贴图',
|
||||
newScene: '场景',
|
||||
newScene:{
|
||||
'2d': '2D',
|
||||
'3d': '3D',
|
||||
quality: '质量',
|
||||
'2d': '2D 场景',
|
||||
'3d': '3D 场景',
|
||||
quality: '高质量场景',
|
||||
},
|
||||
newPrefab: '预制 (Prefab)',
|
||||
newRenderTexture: '渲染纹理 (Render Texture)',
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "cocos-creator",
|
||||
"version": "4.0.0-alpha.15",
|
||||
"version": "4.0.0-alpha.18",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "cocos-creator",
|
||||
"version": "4.0.0-alpha.15",
|
||||
"version": "4.0.0-alpha.18",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cocos-creator",
|
||||
"version": "4.0.0-alpha.15",
|
||||
"version": "4.0.0-alpha.18",
|
||||
"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",
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user