fix: format hour display on Loop End screen to avoid floating-point precision errors
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m22s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m22s
- Use formatHour() instead of raw {hour} to display time in HH:MM format
(e.g. '15:00' instead of '14.999999999999998')
- Export formatHour from stores barrel index
- Fixes #336
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Circular Dependencies
|
||||
Generated: 2026-06-10T07:56:31.400Z
|
||||
Generated: 2026-06-10T08:00:19.784Z
|
||||
Found: 2 circular chain(s) — these MUST be fixed before modifying involved files.
|
||||
|
||||
1. 1) stores/golem-combat-actions.ts > stores/golem-combat-helpers.ts
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"_meta": {
|
||||
"generated": "2026-06-10T07:56:29.402Z",
|
||||
"generated": "2026-06-10T08:00:17.492Z",
|
||||
"description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.",
|
||||
"usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry."
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { fmt } from '@/lib/game/stores';
|
||||
import { fmt, formatHour } from '@/lib/game/stores';
|
||||
import { useGameStore } from '@/lib/game/stores';
|
||||
|
||||
interface GameOverScreenProps {
|
||||
@@ -40,7 +40,7 @@ export function GameOverScreen({ day, hour, insightGained, totalInsight }: GameO
|
||||
<div className="text-xs text-gray-400">Day Reached</div>
|
||||
</div>
|
||||
<div className="p-3 bg-gray-800 rounded">
|
||||
<div className="text-xl font-bold text-purple-400 game-mono">{hour}</div>
|
||||
<div className="text-xl font-bold text-purple-400 game-mono">{formatHour(hour)}</div>
|
||||
<div className="text-xs text-gray-400">Hour</div>
|
||||
</div>
|
||||
<div className="p-3 bg-gray-800 rounded">
|
||||
|
||||
@@ -32,6 +32,7 @@ export type { GameCoordinatorStore } from './gameStore';
|
||||
export {
|
||||
fmt,
|
||||
fmtDec,
|
||||
formatHour,
|
||||
getFloorMaxHP,
|
||||
getFloorElement,
|
||||
getFloorElements,
|
||||
|
||||
Reference in New Issue
Block a user