feat(game): 添加游戏桌面组件的警告提示和动画效果
- 在动物游戏中添加余额不足和选择限制的警告提示 - 为警告状态添加震动动画和视觉反馈效果 - 实现倒计时警告状态的动画和样式变化 - 添加胜利和失败状态的历史记录显示 - 为筹码和操作按钮添加禁用状态的视觉效果 - 实现用户信息和流程按钮的交互功能 - 添加自动设置弹窗的打开功能 - 优化游戏阶段切换时的选择清空逻辑 - 添加剩余时间变化的回调函数支持 - 为历史记录添加中奖状态的颜色标识
This commit is contained in:
@@ -203,20 +203,38 @@ export const useGameRoundStore = create<GameRoundStoreState>()((set) => ({
|
||||
})
|
||||
},
|
||||
setPhase: (phase) => {
|
||||
set((state) => ({
|
||||
round: {
|
||||
...state.round,
|
||||
phase,
|
||||
},
|
||||
}))
|
||||
set((state) => {
|
||||
const nextState: Partial<GameRoundStoreState> = {
|
||||
round: {
|
||||
...state.round,
|
||||
phase,
|
||||
},
|
||||
}
|
||||
|
||||
if (phase === 'settled') {
|
||||
nextState.selections = []
|
||||
}
|
||||
|
||||
return nextState
|
||||
})
|
||||
},
|
||||
syncRound: (round) => {
|
||||
set((state) => ({
|
||||
round: {
|
||||
set((state) => {
|
||||
const nextRound = {
|
||||
...state.round,
|
||||
...round,
|
||||
},
|
||||
}))
|
||||
}
|
||||
|
||||
const nextState: Partial<GameRoundStoreState> = {
|
||||
round: nextRound,
|
||||
}
|
||||
|
||||
if (nextRound.phase === 'settled') {
|
||||
nextState.selections = []
|
||||
}
|
||||
|
||||
return nextState
|
||||
})
|
||||
},
|
||||
upsertSelections: (selections) => {
|
||||
set({ selections })
|
||||
|
||||
Reference in New Issue
Block a user