update : icon image

This commit is contained in:
2025-12-07 16:48:03 +09:00
parent 8771f2c1af
commit d5609aff0f
21 changed files with 684 additions and 394 deletions
+32 -10
View File
@@ -13,7 +13,8 @@ import '../utils/item_utils.dart';
import '../widgets/battle/character_status_card.dart';
import '../widgets/battle/battle_log_overlay.dart';
import '../widgets/battle/floating_battle_texts.dart';
import '../widgets/battle/stage_ui.dart';
import '../widgets/stage/shop_ui.dart';
import '../widgets/stage/rest_ui.dart';
import '../widgets/battle/shake_widget.dart';
import '../widgets/battle/battle_animation_widget.dart';
import '../widgets/battle/explosion_widget.dart';
@@ -489,7 +490,6 @@ class _BattleScreenState extends State<BattleScreen> {
_buildFloatingActionButton(
context,
"ATK",
Icons.whatshot,
ThemeConfig.btnActionActive,
ActionType.attack,
battleProvider.isPlayerTurn &&
@@ -501,7 +501,6 @@ class _BattleScreenState extends State<BattleScreen> {
_buildFloatingActionButton(
context,
"DEF",
Icons.shield,
ThemeConfig.btnDefendActive,
ActionType.defend,
battleProvider.isPlayerTurn &&
@@ -564,7 +563,17 @@ class _BattleScreenState extends State<BattleScreen> {
bool isSkip = item.id == "reward_skip";
return SimpleDialogOption(
onPressed: () {
battleProvider.selectReward(item);
bool success = battleProvider.selectReward(item);
if (!success) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text(
"Inventory is full! Cannot take item.",
),
backgroundColor: Colors.red,
),
);
}
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -587,10 +596,11 @@ class _BattleScreenState extends State<BattleScreen> {
: ThemeConfig.rarityCommon,
),
),
child: Icon(
ItemUtils.getIcon(item.slot),
color: ItemUtils.getColor(item.slot),
size: 24,
child: Image.asset(
ItemUtils.getIconPath(item.slot),
width: 24,
height: 24,
fit: BoxFit.contain,
),
),
if (!isSkip) const SizedBox(width: 12),
@@ -722,18 +732,30 @@ class _BattleScreenState extends State<BattleScreen> {
Widget _buildFloatingActionButton(
BuildContext context,
String label,
IconData icon,
Color color,
ActionType actionType,
bool isEnabled,
) {
String iconPath;
if (actionType == ActionType.attack) {
iconPath = 'assets/data/icon/icon_weapon.png';
} else {
iconPath = 'assets/data/icon/icon_shield.png';
}
return FloatingActionButton(
heroTag: label,
onPressed: isEnabled
? () => _showRiskLevelSelection(context, actionType)
: null,
backgroundColor: isEnabled ? color : ThemeConfig.btnDisabled,
child: Icon(icon),
child: Image.asset(
iconPath,
width: 32,
height: 32,
color: ThemeConfig.textColorWhite, // Tint icon white
fit: BoxFit.contain,
),
);
}
}
+12 -12
View File
@@ -125,13 +125,12 @@ class InventoryScreen extends StatelessWidget {
left: 4,
top: 4,
child: Opacity(
opacity: item != null ? 0.2 : 0.1,
child: Icon(
ItemUtils.getIcon(slot),
size: 40,
color: item != null
? ItemUtils.getColor(slot)
: ThemeConfig.textColorGrey,
opacity: item != null ? 0.5 : 0.2, // Increase opacity slightly for images
child: Image.asset(
ItemUtils.getIconPath(slot),
width: 40,
height: 40,
fit: BoxFit.contain,
),
),
),
@@ -238,11 +237,12 @@ class InventoryScreen extends StatelessWidget {
left: 4,
top: 4,
child: Opacity(
opacity: 0.2,
child: Icon(
ItemUtils.getIcon(item.slot),
size: 40,
color: ItemUtils.getColor(item.slot),
opacity: 0.5, // Adjusted opacity for image visibility
child: Image.asset(
ItemUtils.getIconPath(item.slot),
width: 40,
height: 40,
fit: BoxFit.contain,
),
),
),
+1
View File
@@ -37,6 +37,7 @@ class _MainMenuScreenState extends State<MainMenuScreen> {
Future<void> _continueGame() async {
final data = await SaveManager.loadGame();
if (data != null && mounted) {
// BattleProvider is already provided with ShopProvider via ProxyProvider in main.dart
context.read<BattleProvider>().loadFromSave(data);
Navigator.pushReplacement(
context,