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/combat_stats.dart';
|
||||||
import 'package:asciineverdie/src/core/model/game_state.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/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/model/skill.dart';
|
||||||
import 'package:asciineverdie/src/core/util/deterministic_random.dart';
|
import 'package:asciineverdie/src/core/util/deterministic_random.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -935,8 +935,6 @@ class _GamePlayScreenState extends State<GamePlayScreen>
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: PotionInventoryPanel(
|
child: PotionInventoryPanel(
|
||||||
inventory: state.potionInventory,
|
inventory: state.potionInventory,
|
||||||
usedInBattle:
|
|
||||||
state.progress.currentCombat?.usedPotionTypes ?? const {},
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
@@ -754,9 +754,6 @@ class _MobileCarouselLayoutState extends State<MobileCarouselLayout> {
|
|||||||
inventory: state.inventory,
|
inventory: state.inventory,
|
||||||
potionInventory: state.potionInventory,
|
potionInventory: state.potionInventory,
|
||||||
encumbrance: state.progress.encumbrance,
|
encumbrance: state.progress.encumbrance,
|
||||||
usedPotionTypes:
|
|
||||||
state.progress.currentCombat?.usedPotionTypes ??
|
|
||||||
const {},
|
|
||||||
),
|
),
|
||||||
|
|
||||||
// 2: 장비
|
// 2: 장비
|
||||||
|
|||||||
@@ -16,13 +16,11 @@ class InventoryPage extends StatelessWidget {
|
|||||||
required this.inventory,
|
required this.inventory,
|
||||||
required this.potionInventory,
|
required this.potionInventory,
|
||||||
required this.encumbrance,
|
required this.encumbrance,
|
||||||
this.usedPotionTypes = const {},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
final Inventory inventory;
|
final Inventory inventory;
|
||||||
final PotionInventory potionInventory;
|
final PotionInventory potionInventory;
|
||||||
final ProgressBarState encumbrance;
|
final ProgressBarState encumbrance;
|
||||||
final Set<PotionType> usedPotionTypes;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -41,7 +39,6 @@ class InventoryPage extends StatelessWidget {
|
|||||||
flex: 2,
|
flex: 2,
|
||||||
child: PotionInventoryPanel(
|
child: PotionInventoryPanel(
|
||||||
inventory: potionInventory,
|
inventory: potionInventory,
|
||||||
usedInBattle: usedPotionTypes,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
@@ -12,11 +12,9 @@ class PotionInventoryPanel extends StatelessWidget {
|
|||||||
const PotionInventoryPanel({
|
const PotionInventoryPanel({
|
||||||
super.key,
|
super.key,
|
||||||
required this.inventory,
|
required this.inventory,
|
||||||
this.usedInBattle = const {},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
final PotionInventory inventory;
|
final PotionInventory inventory;
|
||||||
final Set<PotionType> usedInBattle;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -43,7 +41,6 @@ class PotionInventoryPanel extends StatelessWidget {
|
|||||||
return _PotionRow(
|
return _PotionRow(
|
||||||
potion: entry.potion,
|
potion: entry.potion,
|
||||||
quantity: entry.quantity,
|
quantity: entry.quantity,
|
||||||
isUsedThisBattle: usedInBattle.contains(entry.potion.type),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -88,22 +85,17 @@ class _PotionRow extends StatelessWidget {
|
|||||||
const _PotionRow({
|
const _PotionRow({
|
||||||
required this.potion,
|
required this.potion,
|
||||||
required this.quantity,
|
required this.quantity,
|
||||||
this.isUsedThisBattle = false,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
final Potion potion;
|
final Potion potion;
|
||||||
final int quantity;
|
final int quantity;
|
||||||
final bool isUsedThisBattle;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final color = _getPotionColor();
|
final color = _getPotionColor();
|
||||||
final opacity = isUsedThisBattle ? 0.5 : 1.0;
|
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 2),
|
padding: const EdgeInsets.symmetric(vertical: 2),
|
||||||
child: Opacity(
|
|
||||||
opacity: opacity,
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
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