Use transparent header for game
這個提交存在於:
父節點
a3ce3a76c3
當前提交
92603cbaf7
共有 2 個檔案被更改,包括 19 行新增 和 14 行删除
|
@ -98,6 +98,9 @@ function MainStackComponent(props: {
|
|||
MainStack,
|
||||
GameStartScreen,
|
||||
i18n.t('screens.game.title'),
|
||||
true,
|
||||
null,
|
||||
'transparent',
|
||||
)}
|
||||
<MainStack.Screen
|
||||
name="game-main"
|
||||
|
|
|
@ -384,22 +384,24 @@ class GameStartScreen extends React.Component<PropsType> {
|
|||
recoverGameScore() {
|
||||
const {route} = this.props;
|
||||
this.gameStats = route.params;
|
||||
this.isHighScore =
|
||||
this.scores.length === 0 || this.gameStats.score > this.scores[0];
|
||||
for (let i = 0; i < 3; i += 1) {
|
||||
if (this.scores.length > i && this.gameStats.score > this.scores[i]) {
|
||||
this.scores.splice(i, 0, this.gameStats.score);
|
||||
break;
|
||||
} else if (this.scores.length <= i) {
|
||||
this.scores.push(this.gameStats.score);
|
||||
break;
|
||||
if (this.gameStats.score != null) {
|
||||
this.isHighScore =
|
||||
this.scores.length === 0 || this.gameStats.score > this.scores[0];
|
||||
for (let i = 0; i < 3; i += 1) {
|
||||
if (this.scores.length > i && this.gameStats.score > this.scores[i]) {
|
||||
this.scores.splice(i, 0, this.gameStats.score);
|
||||
break;
|
||||
} else if (this.scores.length <= i) {
|
||||
this.scores.push(this.gameStats.score);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (this.scores.length > 3) this.scores.splice(3, 1);
|
||||
AsyncStorageManager.set(
|
||||
AsyncStorageManager.PREFERENCES.gameScores.key,
|
||||
this.scores,
|
||||
);
|
||||
}
|
||||
if (this.scores.length > 3) this.scores.splice(3, 1);
|
||||
AsyncStorageManager.set(
|
||||
AsyncStorageManager.PREFERENCES.gameScores.key,
|
||||
this.scores,
|
||||
);
|
||||
}
|
||||
|
||||
render(): React.Node {
|
||||
|
|
載入中…
新增問題並參考