fix(buff): UI 남은 시간 표시가 elapsedMs 기반이던 누락 수정
Some checks failed
CI / analyze-and-test (push) Has been cancelled
Some checks failed
CI / analyze-and-test (push) Has been cancelled
- enhanced_animation_panel: 버프 남은 시간 계산을 DateTime.now() 기준으로 변경 - game_session_controller: autoRevive 만료 체크도 실제 시간 기준으로 변경 - 좌상단/우상단에 타임스탬프 원시값이 표시되던 문제 해결
This commit is contained in:
@@ -247,9 +247,10 @@ class GameSessionController extends ChangeNotifier {
|
||||
_monetization = _monetization.copyWith(speedBoostEndMs: null);
|
||||
}
|
||||
|
||||
// 자동부활 버프 만료 체크
|
||||
// 자동부활 버프 만료 체크 (실제 시간 기준)
|
||||
final endMs = _monetization.autoReviveEndMs;
|
||||
if (endMs != null && elapsedMs >= endMs) {
|
||||
final now = DateTime.now().millisecondsSinceEpoch;
|
||||
if (endMs != null && now >= endMs) {
|
||||
_monetization = _monetization.copyWith(autoReviveEndMs: null);
|
||||
debugPrint('[GameSession] Auto-revive buff expired');
|
||||
notifyListeners();
|
||||
|
||||
@@ -214,19 +214,19 @@ class _EnhancedAnimationPanelState extends State<EnhancedAnimationPanel>
|
||||
int? get _currentMonsterHpMax =>
|
||||
widget.progress.currentCombat?.monsterStats.hpMax;
|
||||
|
||||
/// 자동부활 버프 남은 시간 (ms)
|
||||
/// 자동부활 버프 남은 시간 (ms) — 실제 시간(wall clock) 기준
|
||||
int get _autoReviveRemainingMs {
|
||||
final endMs = widget.autoReviveEndMs;
|
||||
if (endMs == null) return 0;
|
||||
final remaining = endMs - widget.skillSystem.elapsedMs;
|
||||
final remaining = endMs - DateTime.now().millisecondsSinceEpoch;
|
||||
return remaining > 0 ? remaining : 0;
|
||||
}
|
||||
|
||||
/// 5배속 버프 남은 시간 (ms)
|
||||
/// 5배속 버프 남은 시간 (ms) — 실제 시간(wall clock) 기준
|
||||
int get _speedBoostRemainingMs {
|
||||
final endMs = widget.speedBoostEndMs;
|
||||
if (endMs == null) return 0;
|
||||
final remaining = endMs - widget.skillSystem.elapsedMs;
|
||||
final remaining = endMs - DateTime.now().millisecondsSinceEpoch;
|
||||
return remaining > 0 ? remaining : 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user