update
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../common/custom_icon_button.dart';
|
||||
import '../common/custom_button_widget.dart';
|
||||
|
||||
class BattleControls extends StatelessWidget {
|
||||
final bool isAttackEnabled;
|
||||
@@ -23,25 +23,52 @@ class BattleControls extends StatelessWidget {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
CustomIconButton(
|
||||
iconPath: 'assets/images/icons/weapons/sword_02.png',
|
||||
isEnabled: isAttackEnabled,
|
||||
onTap: onAttackPressed,
|
||||
iconColor: Colors.white,
|
||||
CustomButtonWidget(
|
||||
width: 64,
|
||||
height: 64,
|
||||
padding: const EdgeInsets.all(12),
|
||||
onTap: isAttackEnabled ? onAttackPressed : null,
|
||||
child: Opacity(
|
||||
opacity: isAttackEnabled ? 1.0 : 0.5,
|
||||
child: Image.asset(
|
||||
'assets/images/icons/weapons/sword_02.png',
|
||||
color: Colors.white,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
CustomIconButton(
|
||||
iconPath: 'assets/images/icons/subweapons/shield_01.png',
|
||||
isEnabled: isDefendEnabled,
|
||||
onTap: onDefendPressed,
|
||||
iconColor: Colors.white,
|
||||
CustomButtonWidget(
|
||||
width: 64,
|
||||
height: 64,
|
||||
padding: const EdgeInsets.all(12),
|
||||
onTap: isDefendEnabled ? onDefendPressed : null,
|
||||
child: Opacity(
|
||||
opacity: isDefendEnabled ? 1.0 : 0.5,
|
||||
child: Image.asset(
|
||||
'assets/images/icons/subweapons/shield_02.png',
|
||||
color: Colors.white,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
CustomIconButton(
|
||||
iconPath: 'assets/images/icons/potions/potion_blue.png',
|
||||
isEnabled: isAttackEnabled, // Enabled when it's player turn
|
||||
onTap: onItemPressed,
|
||||
iconColor: Colors.white,
|
||||
CustomButtonWidget(
|
||||
width: 64,
|
||||
height: 64,
|
||||
padding: const EdgeInsets.all(12),
|
||||
onTap:
|
||||
onItemPressed, // Item usually always enabled or managed by parent? Sticking to logic
|
||||
child: Opacity(
|
||||
opacity: isAttackEnabled
|
||||
? 1.0
|
||||
: 0.5, // Using AttackEnabled as proxy for "Player Turn"? Text implies "Enabled when it's player turn"
|
||||
child: Image.asset(
|
||||
'assets/images/icons/potions/potion_blue.png',
|
||||
color: Colors.white,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user