Skip to content
Open
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
2 changes: 1 addition & 1 deletion pal/minigame/wechat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

// This interface is not supported in versions below 2.25.3.
if (minigame.getSystemSetting === undefined) {
minigame.getSystemSetting = function (): SystemSetting {

Check warning on line 48 in pal/minigame/wechat.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
const systemInfo = minigame.getSystemInfoSync();
return {
bluetoothEnabled: systemInfo.bluetoothEnabled,
Expand All @@ -57,7 +57,7 @@
}

if (minigame.getAppAuthorizeSetting === undefined) {
minigame.getAppAuthorizeSetting = function (): AppAuthorizeSetting {

Check warning on line 60 in pal/minigame/wechat.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
const systemInfo = minigame.getSystemInfoSync();
return {
albumAuthorized: systemInfo.albumAuthorized === undefined ? undefined : ((systemInfo.albumAuthorized) ? 'authorized' : 'denied'),
Expand Down Expand Up @@ -85,7 +85,7 @@
}

if (minigame.getDeviceInfo === undefined) {
minigame.getDeviceInfo = function (): DeviceInfo {

Check warning on line 88 in pal/minigame/wechat.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
const systemInfo = minigame.getSystemInfoSync();
return {
abi: systemInfo.abi,
Expand All @@ -102,7 +102,7 @@
}

if (minigame.getWindowInfo === undefined) {
minigame.getWindowInfo = function (): WindowInfo {

Check warning on line 105 in pal/minigame/wechat.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
const systemInfo = minigame.getSystemInfoSync();
return {
pixelRatio: systemInfo.pixelRatio,
Expand All @@ -118,7 +118,7 @@
}

if (minigame.getAppBaseInfo === undefined) {
minigame.getAppBaseInfo = function (): AppBaseInfo {

Check warning on line 121 in pal/minigame/wechat.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
const systemInfo = minigame.getSystemInfoSync();
return {
SDKVersion: systemInfo.SDKVersion,
Expand Down Expand Up @@ -150,7 +150,7 @@
});
// init landscapeOrientation as LANDSCAPE_RIGHT
let landscapeOrientation = Orientation.LANDSCAPE_RIGHT;
if (devideInfo.platform.toLocaleLowerCase() !== 'android') {
if (devideInfo.platform.toLocaleLowerCase() !== 'android' && !globalThis.runOnPlayableMode) {
// onDeviceOrientationChange doesn't work well on Android.
// see this issue: https://developers.weixin.qq.com/community/minigame/doc/000482138dc460e56cfaa5cb15bc00
wx.onDeviceOrientationChange((res) => {
Expand All @@ -170,7 +170,7 @@

// #region Accelerometer
let _accelerometerCb: AccelerometerChangeCallback | undefined;
minigame.onAccelerometerChange = function (cb: AccelerometerChangeCallback): void {

Check warning on line 173 in pal/minigame/wechat.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
minigame.offAccelerometerChange();
// onAccelerometerChange would start accelerometer
// so we won't call this method here
Expand All @@ -192,13 +192,13 @@
cb(resClone);
};
};
minigame.offAccelerometerChange = function (cb?: AccelerometerChangeCallback): void {

Check warning on line 195 in pal/minigame/wechat.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
if (_accelerometerCb) {
wx.offAccelerometerChange(_accelerometerCb);
_accelerometerCb = undefined;
}
};
minigame.startAccelerometer = function (res: any): void {

Check warning on line 201 in pal/minigame/wechat.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
if (_accelerometerCb) {
wx.onAccelerometerChange(_accelerometerCb);
}
Expand All @@ -215,7 +215,7 @@

// #region SafeArea
// FIX_ME: wrong safe area when orientation is landscape left
minigame.getSafeArea = function (): SafeArea {

Check warning on line 218 in pal/minigame/wechat.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
const windowInfo: WindowInfo = minigame.getWindowInfo();
let safeArea = windowInfo.safeArea;
if (!safeArea) {
Expand All @@ -241,7 +241,7 @@
if (locCanvas) {
const webglRC = locCanvas.getContext('webgl');
const originalUseProgram = webglRC.useProgram.bind(webglRC);
webglRC.useProgram = function (program): void {

Check warning on line 244 in pal/minigame/wechat.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
if (program) {
originalUseProgram(program);
}
Expand Down
4 changes: 3 additions & 1 deletion pal/system-info/minigame/system-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ class SystemInfo extends EventTarget {

this._initPromise.push(this._supportsWebpPromise());

this._registerEvent();
if (!globalThis.runOnPlayableMode) {
this._registerEvent();
}
}

private _supportsWebpPromise (): Promise<void> {
Expand Down
Loading