refactor(ui): 물약 글로벌 쿨타임 적용 UI 정리

- usedPotionTypes/usedInBattle 파라미터 제거
- 전투당 타입별 제한 → 시간 기반 쿨타임 전환
- PotionInventoryPanel 불투명도 로직 제거
This commit is contained in:
JiWoong Sul
2026-01-16 00:12:43 +09:00
parent b8a4d73461
commit a2b5bb7dc0
5 changed files with 38 additions and 60 deletions

View File

@@ -935,8 +935,6 @@ class _GamePlayScreenState extends State<GamePlayScreen>
Expanded(
child: PotionInventoryPanel(
inventory: state.potionInventory,
usedInBattle:
state.progress.currentCombat?.usedPotionTypes ?? const {},
),
),

View File

@@ -754,9 +754,6 @@ class _MobileCarouselLayoutState extends State<MobileCarouselLayout> {
inventory: state.inventory,
potionInventory: state.potionInventory,
encumbrance: state.progress.encumbrance,
usedPotionTypes:
state.progress.currentCombat?.usedPotionTypes ??
const {},
),
// 2: 장비

View File

@@ -16,13 +16,11 @@ class InventoryPage extends StatelessWidget {
required this.inventory,
required this.potionInventory,
required this.encumbrance,
this.usedPotionTypes = const {},
});
final Inventory inventory;
final PotionInventory potionInventory;
final ProgressBarState encumbrance;
final Set<PotionType> usedPotionTypes;
@override
Widget build(BuildContext context) {
@@ -41,7 +39,6 @@ class InventoryPage extends StatelessWidget {
flex: 2,
child: PotionInventoryPanel(
inventory: potionInventory,
usedInBattle: usedPotionTypes,
),
),

View File

@@ -12,11 +12,9 @@ class PotionInventoryPanel extends StatelessWidget {
const PotionInventoryPanel({
super.key,
required this.inventory,
this.usedInBattle = const {},
});
final PotionInventory inventory;
final Set<PotionType> usedInBattle;
@override
Widget build(BuildContext context) {
@@ -43,7 +41,6 @@ class PotionInventoryPanel extends StatelessWidget {
return _PotionRow(
potion: entry.potion,
quantity: entry.quantity,
isUsedThisBattle: usedInBattle.contains(entry.potion.type),
);
},
);
@@ -88,69 +85,57 @@ class _PotionRow extends StatelessWidget {
const _PotionRow({
required this.potion,
required this.quantity,
this.isUsedThisBattle = false,
});
final Potion potion;
final int quantity;
final bool isUsedThisBattle;
@override
Widget build(BuildContext context) {
final color = _getPotionColor();
final opacity = isUsedThisBattle ? 0.5 : 1.0;
return Padding(
padding: const EdgeInsets.symmetric(vertical: 2),
child: Opacity(
opacity: opacity,
child: Row(
children: [
// 물약 아이콘
_PotionIcon(type: potion.type, tier: potion.tier),
const SizedBox(width: 4),
child: Row(
children: [
// 물약 아이콘
_PotionIcon(type: potion.type, tier: potion.tier),
const SizedBox(width: 4),
// 물약 이름 (번역 적용)
Expanded(
child: Text(
l10n.translateSpell(potion.name),
style: TextStyle(
fontSize: 16,
color: color,
fontWeight: FontWeight.w500,
),
overflow: TextOverflow.ellipsis,
// 물약 이름 (번역 적용)
Expanded(
child: Text(
l10n.translateSpell(potion.name),
style: TextStyle(
fontSize: 16,
color: color,
fontWeight: FontWeight.w500,
),
overflow: TextOverflow.ellipsis,
),
),
// 회복량 표시
_HealBadge(potion: potion),
const SizedBox(width: 4),
// 수량
Container(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
decoration: BoxDecoration(
color: color.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(8),
),
child: Text(
'x$quantity',
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
color: color,
),
),
// 회복량 표시
_HealBadge(potion: potion),
const SizedBox(width: 4),
// 수량
Container(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
decoration: BoxDecoration(
color: color.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(8),
),
child: Text(
'x$quantity',
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
color: color,
),
),
),
// 전투 중 사용 불가 표시
if (isUsedThisBattle) ...[
const SizedBox(width: 4),
const Icon(Icons.block, size: 12, color: Colors.grey),
],
],
),
),
],
),
);
}