Add config-driven game host updates
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
import { MapEngine, type MapEngineStageRect, type MapEngineViewState } from '../../engine/map/mapEngine'
|
||||
import {
|
||||
MapEngine,
|
||||
type MapEngineGameInfoRow,
|
||||
type MapEngineGameInfoSnapshot,
|
||||
type MapEngineStageRect,
|
||||
type MapEngineViewState,
|
||||
} from '../../engine/map/mapEngine'
|
||||
import { loadRemoteMapConfig } from '../../utils/remoteMapConfig'
|
||||
type CompassTickData = {
|
||||
angle: number
|
||||
@@ -13,13 +19,20 @@ type CompassLabelData = {
|
||||
className: string
|
||||
}
|
||||
type SideButtonMode = 'all' | 'left' | 'right' | 'hidden'
|
||||
type SideActionButtonState = 'muted' | 'default' | 'active'
|
||||
type MapPageData = MapEngineViewState & {
|
||||
showDebugPanel: boolean
|
||||
showGameInfoPanel: boolean
|
||||
statusBarHeight: number
|
||||
topInsetHeight: number
|
||||
hudPanelIndex: number
|
||||
configSourceText: string
|
||||
mockBridgeUrlDraft: string
|
||||
mockHeartRateBridgeUrlDraft: string
|
||||
gameInfoTitle: string
|
||||
gameInfoSubtitle: string
|
||||
gameInfoLocalRows: MapEngineGameInfoRow[]
|
||||
gameInfoGlobalRows: MapEngineGameInfoRow[]
|
||||
panelTimerText: string
|
||||
panelMileageText: string
|
||||
panelDistanceValueText: string
|
||||
@@ -28,12 +41,17 @@ type MapPageData = MapEngineViewState & {
|
||||
compassTicks: CompassTickData[]
|
||||
compassLabels: CompassLabelData[]
|
||||
sideButtonMode: SideButtonMode
|
||||
sideToggleIconSrc: string
|
||||
sideButton4Class: string
|
||||
sideButton11Class: string
|
||||
sideButton16Class: string
|
||||
showLeftButtonGroup: boolean
|
||||
showRightButtonGroups: boolean
|
||||
showBottomDebugButton: boolean
|
||||
}
|
||||
const INTERNAL_BUILD_VERSION = 'map-build-196'
|
||||
const REMOTE_GAME_CONFIG_URL = 'https://oss-mbh5.colormaprun.com/wxmini/test/game.json'
|
||||
const INTERNAL_BUILD_VERSION = 'map-build-207'
|
||||
const CLASSIC_REMOTE_GAME_CONFIG_URL = 'https://oss-mbh5.colormaprun.com/gotomars/event/classic-sequential.json'
|
||||
const SCORE_O_REMOTE_GAME_CONFIG_URL = 'https://oss-mbh5.colormaprun.com/gotomars/event/score-o.json'
|
||||
let mapEngine: MapEngine | null = null
|
||||
let stageCanvasAttached = false
|
||||
function buildSideButtonVisibility(mode: SideButtonMode) {
|
||||
@@ -93,12 +111,66 @@ function getFallbackStageRect(): MapEngineStageRect {
|
||||
}
|
||||
}
|
||||
|
||||
function getSideToggleIconSrc(mode: SideButtonMode): string {
|
||||
if (mode === 'left') {
|
||||
return '../../assets/btn_more2.png'
|
||||
}
|
||||
if (mode === 'hidden') {
|
||||
return '../../assets/btn_more1.png'
|
||||
}
|
||||
return '../../assets/btn_more3.png'
|
||||
}
|
||||
|
||||
function getSideActionButtonClass(state: SideActionButtonState): string {
|
||||
if (state === 'muted') {
|
||||
return 'map-side-button map-side-button--muted'
|
||||
}
|
||||
if (state === 'active') {
|
||||
return 'map-side-button map-side-button--active'
|
||||
}
|
||||
return 'map-side-button map-side-button--default'
|
||||
}
|
||||
|
||||
function buildSideButtonState(data: Pick<MapPageData, 'sideButtonMode' | 'showGameInfoPanel' | 'skipButtonEnabled' | 'gameSessionStatus'>) {
|
||||
const sideButton4State: SideActionButtonState = data.gameSessionStatus === 'idle' ? 'default' : 'active'
|
||||
const sideButton11State: SideActionButtonState = data.showGameInfoPanel ? 'active' : 'default'
|
||||
const sideButton16State: SideActionButtonState = data.skipButtonEnabled ? 'default' : 'muted'
|
||||
|
||||
return {
|
||||
sideToggleIconSrc: getSideToggleIconSrc(data.sideButtonMode),
|
||||
sideButton4Class: getSideActionButtonClass(sideButton4State),
|
||||
sideButton11Class: getSideActionButtonClass(sideButton11State),
|
||||
sideButton16Class: getSideActionButtonClass(sideButton16State),
|
||||
}
|
||||
}
|
||||
|
||||
function buildEmptyGameInfoSnapshot(): MapEngineGameInfoSnapshot {
|
||||
return {
|
||||
title: '当前游戏',
|
||||
subtitle: '未开始',
|
||||
localRows: [],
|
||||
globalRows: [
|
||||
{ label: '全球积分', value: '未接入' },
|
||||
{ label: '全球排名', value: '未接入' },
|
||||
{ label: '在线人数', value: '未接入' },
|
||||
{ label: '队伍状态', value: '未接入' },
|
||||
{ label: '实时广播', value: '未接入' },
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
Page({
|
||||
data: {
|
||||
showDebugPanel: false,
|
||||
showGameInfoPanel: false,
|
||||
statusBarHeight: 0,
|
||||
topInsetHeight: 12,
|
||||
hudPanelIndex: 0,
|
||||
configSourceText: '顺序赛配置',
|
||||
gameInfoTitle: '当前游戏',
|
||||
gameInfoSubtitle: '未开始',
|
||||
gameInfoLocalRows: [],
|
||||
gameInfoGlobalRows: buildEmptyGameInfoSnapshot().globalRows,
|
||||
panelTimerText: '00:00:00',
|
||||
panelMileageText: '0m',
|
||||
panelActionTagText: '目标',
|
||||
@@ -142,6 +214,7 @@ Page({
|
||||
panelAccuracyUnitText: '',
|
||||
punchButtonText: '打点',
|
||||
punchButtonEnabled: false,
|
||||
skipButtonEnabled: false,
|
||||
punchHintText: '等待进入检查点范围',
|
||||
punchFeedbackVisible: false,
|
||||
punchFeedbackText: '',
|
||||
@@ -161,6 +234,12 @@ Page({
|
||||
compassTicks: buildCompassTicks(),
|
||||
compassLabels: buildCompassLabels(),
|
||||
...buildSideButtonVisibility('left'),
|
||||
...buildSideButtonState({
|
||||
sideButtonMode: 'left',
|
||||
showGameInfoPanel: false,
|
||||
skipButtonEnabled: false,
|
||||
gameSessionStatus: 'idle',
|
||||
}),
|
||||
} as unknown as MapPageData,
|
||||
|
||||
onLoad() {
|
||||
@@ -190,16 +269,34 @@ Page({
|
||||
nextData.mockHeartRateBridgeUrlDraft = nextPatch.mockHeartRateBridgeUrlText
|
||||
}
|
||||
|
||||
this.setData(nextData)
|
||||
const mergedData = {
|
||||
...this.data,
|
||||
...nextData,
|
||||
} as MapPageData
|
||||
|
||||
this.setData({
|
||||
...nextData,
|
||||
...buildSideButtonState(mergedData),
|
||||
})
|
||||
|
||||
if (this.data.showGameInfoPanel) {
|
||||
this.syncGameInfoPanelSnapshot()
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
this.setData({
|
||||
...mapEngine.getInitialData(),
|
||||
showDebugPanel: false,
|
||||
showGameInfoPanel: false,
|
||||
statusBarHeight,
|
||||
topInsetHeight: Math.max(statusBarHeight + 12, menuButtonBottom + 20),
|
||||
hudPanelIndex: 0,
|
||||
configSourceText: '顺序赛配置',
|
||||
gameInfoTitle: '当前游戏',
|
||||
gameInfoSubtitle: '未开始',
|
||||
gameInfoLocalRows: [],
|
||||
gameInfoGlobalRows: buildEmptyGameInfoSnapshot().globalRows,
|
||||
panelTimerText: '00:00:00',
|
||||
panelMileageText: '0m',
|
||||
panelActionTagText: '目标',
|
||||
@@ -241,6 +338,7 @@ Page({
|
||||
panelAccuracyUnitText: '',
|
||||
punchButtonText: '打点',
|
||||
punchButtonEnabled: false,
|
||||
skipButtonEnabled: false,
|
||||
punchHintText: '等待进入检查点范围',
|
||||
punchFeedbackVisible: false,
|
||||
punchFeedbackText: '',
|
||||
@@ -260,13 +358,19 @@ Page({
|
||||
compassTicks: buildCompassTicks(),
|
||||
compassLabels: buildCompassLabels(),
|
||||
...buildSideButtonVisibility('left'),
|
||||
...buildSideButtonState({
|
||||
sideButtonMode: 'left',
|
||||
showGameInfoPanel: false,
|
||||
skipButtonEnabled: false,
|
||||
gameSessionStatus: 'idle',
|
||||
}),
|
||||
})
|
||||
},
|
||||
|
||||
onReady() {
|
||||
stageCanvasAttached = false
|
||||
this.measureStageAndCanvas()
|
||||
this.loadMapConfigFromRemote()
|
||||
this.loadMapConfigFromRemote(CLASSIC_REMOTE_GAME_CONFIG_URL, '顺序赛配置')
|
||||
},
|
||||
|
||||
onShow() {
|
||||
@@ -289,13 +393,18 @@ Page({
|
||||
stageCanvasAttached = false
|
||||
},
|
||||
|
||||
loadMapConfigFromRemote() {
|
||||
loadMapConfigFromRemote(configUrl: string, configLabel: string) {
|
||||
const currentEngine = mapEngine
|
||||
if (!currentEngine) {
|
||||
return
|
||||
}
|
||||
|
||||
loadRemoteMapConfig(REMOTE_GAME_CONFIG_URL)
|
||||
this.setData({
|
||||
configSourceText: configLabel,
|
||||
configStatusText: `加载中: ${configLabel}`,
|
||||
})
|
||||
|
||||
loadRemoteMapConfig(configUrl)
|
||||
.then((config) => {
|
||||
if (mapEngine !== currentEngine) {
|
||||
return
|
||||
@@ -605,16 +714,41 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
handleSetClassicMode() {
|
||||
handleLoadClassicConfig() {
|
||||
this.loadMapConfigFromRemote(CLASSIC_REMOTE_GAME_CONFIG_URL, '顺序赛配置')
|
||||
},
|
||||
|
||||
handleLoadScoreOConfig() {
|
||||
this.loadMapConfigFromRemote(SCORE_O_REMOTE_GAME_CONFIG_URL, '积分赛配置')
|
||||
},
|
||||
|
||||
handleForceExitGame() {
|
||||
if (mapEngine) {
|
||||
mapEngine.handleSetGameMode('classic-sequential')
|
||||
mapEngine.handleForceExitGame()
|
||||
}
|
||||
},
|
||||
|
||||
handleSetScoreOMode() {
|
||||
if (mapEngine) {
|
||||
mapEngine.handleSetGameMode('score-o')
|
||||
handleSkipAction() {
|
||||
if (!mapEngine || !this.data.skipButtonEnabled) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!mapEngine.shouldConfirmSkipAction()) {
|
||||
mapEngine.handleSkipAction()
|
||||
return
|
||||
}
|
||||
|
||||
wx.showModal({
|
||||
title: '确认跳点',
|
||||
content: '确认跳过当前检查点并切换到下一个目标点?',
|
||||
confirmText: '确认跳过',
|
||||
cancelText: '取消',
|
||||
success: (result) => {
|
||||
if (result.confirm && mapEngine) {
|
||||
mapEngine.handleSkipAction()
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
handleClearMapTestArtifacts() {
|
||||
@@ -623,6 +757,48 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
syncGameInfoPanelSnapshot() {
|
||||
if (!mapEngine) {
|
||||
return
|
||||
}
|
||||
|
||||
const snapshot = mapEngine.getGameInfoSnapshot()
|
||||
this.setData({
|
||||
gameInfoTitle: snapshot.title,
|
||||
gameInfoSubtitle: snapshot.subtitle,
|
||||
gameInfoLocalRows: snapshot.localRows,
|
||||
gameInfoGlobalRows: snapshot.globalRows,
|
||||
})
|
||||
},
|
||||
|
||||
handleOpenGameInfoPanel() {
|
||||
this.syncGameInfoPanelSnapshot()
|
||||
this.setData({
|
||||
showDebugPanel: false,
|
||||
showGameInfoPanel: true,
|
||||
...buildSideButtonState({
|
||||
sideButtonMode: this.data.sideButtonMode,
|
||||
showGameInfoPanel: true,
|
||||
skipButtonEnabled: this.data.skipButtonEnabled,
|
||||
gameSessionStatus: this.data.gameSessionStatus,
|
||||
}),
|
||||
})
|
||||
},
|
||||
|
||||
handleCloseGameInfoPanel() {
|
||||
this.setData({
|
||||
showGameInfoPanel: false,
|
||||
...buildSideButtonState({
|
||||
sideButtonMode: this.data.sideButtonMode,
|
||||
showGameInfoPanel: false,
|
||||
skipButtonEnabled: this.data.skipButtonEnabled,
|
||||
gameSessionStatus: this.data.gameSessionStatus,
|
||||
}),
|
||||
})
|
||||
},
|
||||
|
||||
handleGameInfoPanelTap() {},
|
||||
|
||||
handleOverlayTouch() {},
|
||||
|
||||
handlePunchAction() {
|
||||
@@ -648,7 +824,16 @@ Page({
|
||||
},
|
||||
|
||||
handleCycleSideButtons() {
|
||||
this.setData(buildSideButtonVisibility(getNextSideButtonMode(this.data.sideButtonMode)))
|
||||
const nextMode = getNextSideButtonMode(this.data.sideButtonMode)
|
||||
this.setData({
|
||||
...buildSideButtonVisibility(nextMode),
|
||||
...buildSideButtonState({
|
||||
sideButtonMode: nextMode,
|
||||
showGameInfoPanel: this.data.showGameInfoPanel,
|
||||
skipButtonEnabled: this.data.skipButtonEnabled,
|
||||
gameSessionStatus: this.data.gameSessionStatus,
|
||||
}),
|
||||
})
|
||||
},
|
||||
handleToggleMapRotateMode() {
|
||||
if (!mapEngine) {
|
||||
@@ -665,12 +850,25 @@ Page({
|
||||
handleToggleDebugPanel() {
|
||||
this.setData({
|
||||
showDebugPanel: !this.data.showDebugPanel,
|
||||
showGameInfoPanel: false,
|
||||
...buildSideButtonState({
|
||||
sideButtonMode: this.data.sideButtonMode,
|
||||
showGameInfoPanel: false,
|
||||
skipButtonEnabled: this.data.skipButtonEnabled,
|
||||
gameSessionStatus: this.data.gameSessionStatus,
|
||||
}),
|
||||
})
|
||||
},
|
||||
|
||||
handleCloseDebugPanel() {
|
||||
this.setData({
|
||||
showDebugPanel: false,
|
||||
...buildSideButtonState({
|
||||
sideButtonMode: this.data.sideButtonMode,
|
||||
showGameInfoPanel: this.data.showGameInfoPanel,
|
||||
skipButtonEnabled: this.data.skipButtonEnabled,
|
||||
gameSessionStatus: this.data.gameSessionStatus,
|
||||
}),
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
@@ -68,23 +68,21 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<cover-view class="map-side-toggle" wx:if="{{!showDebugPanel}}" style="top: {{topInsetHeight}}px;" bindtap="handleCycleSideButtons">
|
||||
<cover-view class="map-side-toggle" wx:if="{{!showDebugPanel && !showGameInfoPanel}}" style="top: {{topInsetHeight}}px;" bindtap="handleCycleSideButtons">
|
||||
<cover-view class="map-side-button map-side-button--icon">
|
||||
<cover-image wx:if="{{sideButtonMode === 'left'}}" class="map-side-button__image" src="../../assets/btn_more2.png"></cover-image>
|
||||
<cover-image wx:elif="{{sideButtonMode === 'hidden'}}" class="map-side-button__image" src="../../assets/btn_more1.png"></cover-image>
|
||||
<cover-image wx:else class="map-side-button__image" src="../../assets/btn_more3.png"></cover-image>
|
||||
<cover-image class="map-side-button__image" src="{{sideToggleIconSrc}}"></cover-image>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
|
||||
<cover-view class="map-side-column map-side-column--left map-side-column--left-group" wx:if="{{!showDebugPanel && showLeftButtonGroup}}" style="top: {{topInsetHeight}}px;">
|
||||
<cover-view class="map-side-column map-side-column--left map-side-column--left-group" wx:if="{{!showDebugPanel && !showGameInfoPanel && showLeftButtonGroup}}" style="top: {{topInsetHeight}}px;">
|
||||
<cover-view class="map-side-button map-side-button--icon" bindtap="handleToggleMapRotateMode"><cover-image class="map-side-button__rotate-image {{orientationMode === 'heading-up' ? 'map-side-button__rotate-image--active' : ''}}" src="../../assets/btn_map_rotate_cropped.png"></cover-image></cover-view>
|
||||
<cover-view class="map-side-button map-side-button--muted"><cover-view class="map-side-button__text">1</cover-view></cover-view>
|
||||
<cover-view class="map-side-button"><cover-view class="map-side-button__text">2</cover-view></cover-view>
|
||||
<cover-view class="map-side-button map-side-button--active"><cover-view class="map-side-button__text">3</cover-view></cover-view>
|
||||
<cover-view class="map-side-button"><cover-view class="map-side-button__text">4</cover-view></cover-view>
|
||||
<cover-view class="{{sideButton4Class}}" bindtap="handleForceExitGame"><cover-image class="map-side-button__action-image" src="../../assets/btn_exit.png"></cover-image></cover-view>
|
||||
</cover-view>
|
||||
|
||||
<cover-view class="map-side-column map-side-column--right-main" wx:if="{{!showDebugPanel && showRightButtonGroups}}" style="top: {{topInsetHeight}}px;">
|
||||
<cover-view class="map-side-column map-side-column--right-main" wx:if="{{!showDebugPanel && !showGameInfoPanel && showRightButtonGroups}}" style="top: {{topInsetHeight}}px;">
|
||||
<cover-view class="map-side-button"><cover-view class="map-side-button__text">5</cover-view></cover-view>
|
||||
<cover-view class="map-side-button map-side-button--active"><cover-view class="map-side-button__text">6</cover-view></cover-view>
|
||||
<cover-view class="map-side-button"><cover-view class="map-side-button__text">7</cover-view></cover-view>
|
||||
@@ -93,24 +91,24 @@
|
||||
<cover-view class="map-side-button map-side-button--active"><cover-view class="map-side-button__text">10</cover-view></cover-view>
|
||||
</cover-view>
|
||||
|
||||
<cover-view class="map-side-column map-side-column--right-sub" wx:if="{{!showDebugPanel && showRightButtonGroups}}" style="top: {{topInsetHeight}}px;">
|
||||
<cover-view class="map-side-button"><cover-view class="map-side-button__text">11</cover-view></cover-view>
|
||||
<cover-view class="map-side-column map-side-column--right-sub" wx:if="{{!showDebugPanel && !showGameInfoPanel && showRightButtonGroups}}" style="top: {{topInsetHeight}}px;">
|
||||
<cover-view class="{{sideButton11Class}}" bindtap="handleOpenGameInfoPanel"><cover-image class="map-side-button__action-image" src="../../assets/btn_info.png"></cover-image></cover-view>
|
||||
<cover-view class="map-side-button"><cover-view class="map-side-button__text">12</cover-view></cover-view>
|
||||
<cover-view class="map-side-button"><cover-view class="map-side-button__text">13</cover-view></cover-view>
|
||||
<cover-view class="map-side-button"><cover-view class="map-side-button__text">14</cover-view></cover-view>
|
||||
<cover-view class="map-side-button"><cover-view class="map-side-button__text">15</cover-view></cover-view>
|
||||
<cover-view class="map-side-button"><cover-view class="map-side-button__text">16</cover-view></cover-view>
|
||||
<cover-view class="{{sideButton16Class}}" bindtap="handleSkipAction"><cover-image class="map-side-button__action-image" src="../../assets/btn_skip_cp.png"></cover-image></cover-view>
|
||||
</cover-view>
|
||||
|
||||
<cover-view class="map-punch-button {{punchButtonEnabled ? 'map-punch-button--active' : ''}} {{punchButtonFxClass}}" wx:if="{{!showDebugPanel}}" bindtap="handlePunchAction">
|
||||
<cover-view class="map-punch-button {{punchButtonEnabled ? 'map-punch-button--active' : ''}} {{punchButtonFxClass}}" wx:if="{{!showDebugPanel && !showGameInfoPanel}}" bindtap="handlePunchAction">
|
||||
<cover-view class="map-punch-button__text">{{punchButtonText}}</cover-view>
|
||||
</cover-view>
|
||||
|
||||
<cover-view class="screen-button-layer screen-button-layer--start-left" wx:if="{{!showDebugPanel && showBottomDebugButton && gameSessionStatus === 'idle'}}" bindtap="handleStartGame">
|
||||
<cover-view class="screen-button-layer screen-button-layer--start-left" wx:if="{{!showDebugPanel && !showGameInfoPanel && showBottomDebugButton && gameSessionStatus === 'idle'}}" bindtap="handleStartGame">
|
||||
<cover-view class="screen-button-layer__text screen-button-layer__text--start">开始</cover-view>
|
||||
</cover-view>
|
||||
|
||||
<cover-view class="screen-button-layer screen-button-layer--bottom-left" wx:if="{{!showDebugPanel && showBottomDebugButton}}" bindtap="handleToggleDebugPanel">
|
||||
<cover-view class="screen-button-layer screen-button-layer--bottom-left" wx:if="{{!showDebugPanel && !showGameInfoPanel && showBottomDebugButton}}" bindtap="handleToggleDebugPanel">
|
||||
<cover-view class="screen-button-layer__icon">
|
||||
<cover-view class="screen-button-layer__line"></cover-view>
|
||||
<cover-view class="screen-button-layer__stand"></cover-view>
|
||||
@@ -118,7 +116,7 @@
|
||||
<cover-view class="screen-button-layer__text">调试</cover-view>
|
||||
</cover-view>
|
||||
|
||||
<swiper class="race-panel-swiper" current="{{hudPanelIndex}}" bindchange="handleHudPanelChange" duration="220" easing-function="easeOutCubic">
|
||||
<swiper wx:if="{{!showGameInfoPanel}}" class="race-panel-swiper" current="{{hudPanelIndex}}" bindchange="handleHudPanelChange" duration="220" easing-function="easeOutCubic">
|
||||
<swiper-item>
|
||||
<view class="race-panel race-panel--tone-{{panelTelemetryTone}}">
|
||||
<view class="race-panel__tag race-panel__tag--top-left">{{panelActionTagText}}</view>
|
||||
@@ -223,11 +221,50 @@
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view class="race-panel-pager" wx:if="{{!showDebugPanel}}">
|
||||
<view class="race-panel-pager" wx:if="{{!showDebugPanel && !showGameInfoPanel}}">
|
||||
<view class="race-panel-pager__dot {{hudPanelIndex === 0 ? 'race-panel-pager__dot--active' : ''}}"></view>
|
||||
<view class="race-panel-pager__dot {{hudPanelIndex === 1 ? 'race-panel-pager__dot--active' : ''}}"></view>
|
||||
</view>
|
||||
|
||||
<view class="game-info-modal" wx:if="{{showGameInfoPanel}}" bindtap="handleCloseGameInfoPanel">
|
||||
<view class="game-info-modal__dialog" catchtap="handleGameInfoPanelTap">
|
||||
<view class="game-info-modal__header">
|
||||
<view class="game-info-modal__header-main">
|
||||
<view class="game-info-modal__eyebrow">GAME INFO</view>
|
||||
<view class="game-info-modal__title">{{gameInfoTitle}}</view>
|
||||
<view class="game-info-modal__subtitle">{{gameInfoSubtitle}}</view>
|
||||
</view>
|
||||
<view class="game-info-modal__header-actions">
|
||||
<view class="game-info-modal__close" bindtap="handleCloseGameInfoPanel">关闭</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view class="game-info-modal__content" scroll-y enhanced show-scrollbar="true">
|
||||
<view class="debug-section debug-section--info">
|
||||
<view class="debug-section__header">
|
||||
<view class="debug-section__title">Local</view>
|
||||
<view class="debug-section__desc">当前设备、本地玩法与实时运行状态</view>
|
||||
</view>
|
||||
<view class="info-panel__row" wx:for="{{gameInfoLocalRows}}" wx:key="label">
|
||||
<text class="info-panel__label">{{item.label}}</text>
|
||||
<text class="info-panel__value">{{item.value}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="debug-section debug-section--info">
|
||||
<view class="debug-section__header">
|
||||
<view class="debug-section__title">Global</view>
|
||||
<view class="debug-section__desc">联网后接入全局赛事数据,这里先占位</view>
|
||||
</view>
|
||||
<view class="info-panel__row" wx:for="{{gameInfoGlobalRows}}" wx:key="label">
|
||||
<text class="info-panel__label">{{item.label}}</text>
|
||||
<text class="info-panel__value">{{item.value}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="debug-modal" wx:if="{{showDebugPanel}}" bindtap="handleCloseDebugPanel">
|
||||
<view class="debug-modal__dialog" catchtap="handleDebugPanelTap">
|
||||
<view class="debug-modal__header">
|
||||
@@ -250,6 +287,10 @@
|
||||
<text class="info-panel__label">Mode</text>
|
||||
<text class="info-panel__value">{{gameModeText}}</text>
|
||||
</view>
|
||||
<view class="info-panel__row">
|
||||
<text class="info-panel__label">Config</text>
|
||||
<text class="info-panel__value">{{configSourceText}}</text>
|
||||
</view>
|
||||
<view class="info-panel__row">
|
||||
<text class="info-panel__label">Game</text>
|
||||
<text class="info-panel__value">{{gameSessionStatus}}</text>
|
||||
@@ -267,8 +308,8 @@
|
||||
<text class="info-panel__value">{{punchHintText}}</text>
|
||||
</view>
|
||||
<view class="control-row">
|
||||
<view class="control-chip {{gameModeText === '顺序赛' ? 'control-chip--active' : 'control-chip--secondary'}}" bindtap="handleSetClassicMode">顺序赛</view>
|
||||
<view class="control-chip {{gameModeText === '积分赛' ? 'control-chip--active' : 'control-chip--secondary'}}" bindtap="handleSetScoreOMode">积分赛</view>
|
||||
<view class="control-chip {{configSourceText === '顺序赛配置' ? 'control-chip--active' : 'control-chip--secondary'}}" bindtap="handleLoadClassicConfig">顺序赛配置</view>
|
||||
<view class="control-chip {{configSourceText === '积分赛配置' ? 'control-chip--active' : 'control-chip--secondary'}}" bindtap="handleLoadScoreOConfig">积分赛配置</view>
|
||||
</view>
|
||||
<view class="control-row">
|
||||
<view class="control-chip control-chip--primary" bindtap="handleRecenter">回到首屏</view>
|
||||
|
||||
@@ -299,6 +299,10 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.map-side-button--default {
|
||||
background: rgba(248, 251, 244, 0.96);
|
||||
}
|
||||
|
||||
.map-side-button--icon {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
@@ -327,6 +331,16 @@
|
||||
background: rgba(229, 233, 230, 0.92);
|
||||
}
|
||||
|
||||
.map-side-button--muted .map-side-button__action-image {
|
||||
opacity: 0.46;
|
||||
filter: grayscale(1);
|
||||
}
|
||||
|
||||
.map-side-button--active {
|
||||
background: rgba(255, 226, 88, 0.98);
|
||||
box-shadow: 0 0 0 4rpx rgba(255, 241, 158, 0.18), 0 12rpx 28rpx rgba(120, 89, 0, 0.2);
|
||||
}
|
||||
|
||||
.map-side-button__text {
|
||||
font-size: 18rpx;
|
||||
line-height: 1.1;
|
||||
@@ -336,6 +350,16 @@
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
.map-side-button__action-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 22rpx;
|
||||
}
|
||||
|
||||
.map-side-button--active .map-side-button__action-image {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.compass-widget {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -1019,6 +1043,92 @@
|
||||
.race-panel__chevron--offset {
|
||||
right: 0;
|
||||
}
|
||||
.game-info-modal {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
padding: 0 20rpx 28rpx;
|
||||
box-sizing: border-box;
|
||||
background: rgba(7, 18, 12, 0.34);
|
||||
z-index: 31;
|
||||
}
|
||||
|
||||
.game-info-modal__dialog {
|
||||
width: 100%;
|
||||
max-height: 72vh;
|
||||
border-radius: 36rpx;
|
||||
background: rgba(248, 251, 244, 0.98);
|
||||
box-shadow: 0 20rpx 60rpx rgba(7, 18, 12, 0.24);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.game-info-modal__header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 24rpx;
|
||||
padding: 22rpx 28rpx 18rpx;
|
||||
border-bottom: 1rpx solid rgba(22, 48, 32, 0.08);
|
||||
}
|
||||
|
||||
.game-info-modal__header-main {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.game-info-modal__header-actions {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.game-info-modal__eyebrow {
|
||||
font-size: 22rpx;
|
||||
font-weight: 800;
|
||||
letter-spacing: 4rpx;
|
||||
color: #5f7a65;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.game-info-modal__title {
|
||||
margin-top: 12rpx;
|
||||
font-size: 42rpx;
|
||||
line-height: 1.08;
|
||||
font-weight: 700;
|
||||
color: #163020;
|
||||
}
|
||||
|
||||
.game-info-modal__subtitle {
|
||||
margin-top: 10rpx;
|
||||
font-size: 22rpx;
|
||||
line-height: 1.3;
|
||||
color: #5f7a65;
|
||||
}
|
||||
|
||||
.game-info-modal__close {
|
||||
flex-shrink: 0;
|
||||
min-width: 108rpx;
|
||||
padding: 14rpx 22rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #163020;
|
||||
color: #f7fbf2;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.game-info-modal__content {
|
||||
max-height: calc(72vh - 132rpx);
|
||||
padding: 12rpx 24rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.debug-section--info {
|
||||
margin-top: 14rpx;
|
||||
}
|
||||
|
||||
.debug-modal {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
|
||||
Reference in New Issue
Block a user