refactor(ui): 물약 글로벌 쿨타임 적용 UI 정리
- usedPotionTypes/usedInBattle 파라미터 제거 - 전투당 타입별 제한 → 시간 기반 쿨타임 전환 - PotionInventoryPanel 불투명도 로직 제거
This commit is contained in:
@@ -7,6 +7,7 @@ import 'package:asciineverdie/src/core/model/combat_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/monster_combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/potion.dart';
|
||||
import 'package:asciineverdie/src/core/model/skill.dart';
|
||||
import 'package:asciineverdie/src/core/util/deterministic_random.dart';
|
||||
|
||||
|
||||
@@ -935,8 +935,6 @@ class _GamePlayScreenState extends State<GamePlayScreen>
|
||||
Expanded(
|
||||
child: PotionInventoryPanel(
|
||||
inventory: state.potionInventory,
|
||||
usedInBattle:
|
||||
state.progress.currentCombat?.usedPotionTypes ?? const {},
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
@@ -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: 장비
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
@@ -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,22 +85,17 @@ 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: [
|
||||
// 물약 아이콘
|
||||
@@ -143,14 +135,7 @@ class _PotionRow extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// 전투 중 사용 불가 표시
|
||||
if (isUsedThisBattle) ...[
|
||||
const SizedBox(width: 4),
|
||||
const Icon(Icons.block, size: 12, color: Colors.grey),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user