feat: add game graphic
This commit is contained in:
@@ -211,6 +211,22 @@ class TableHud extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
/// گرادیانِ قابِ آواتار بر اساسِ نشانِ رتبه (برنز→پادشاه). پیشفرض: طلایی.
|
||||
List<Color> _rankFrame(String tier) {
|
||||
switch (tier) {
|
||||
case 'bronze':
|
||||
return const [Color(0xFFCD9B6A), Color(0xFF7A4A22)];
|
||||
case 'silver':
|
||||
return const [Color(0xFFEDF1F4), Color(0xFF98A2AD)];
|
||||
case 'diamond':
|
||||
return const [Color(0xFF9BE7F0), Color(0xFF2E8BA0)];
|
||||
case 'king':
|
||||
return const [Color(0xFFCE9BEA), Color(0xFF6A2FA0)];
|
||||
default: // gold و ناشناخته/بات
|
||||
return const [Color(0xFFF3D27A), AppColors.goldDark];
|
||||
}
|
||||
}
|
||||
|
||||
class _PlayerSeat extends StatelessWidget {
|
||||
final GamePlayer player;
|
||||
final double diameter;
|
||||
@@ -271,19 +287,24 @@ class _PlayerSeat extends StatelessWidget {
|
||||
clipBehavior: Clip.none,
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// قابِ طلایی + آواتار.
|
||||
// قابِ رتبهای + آواتار (رنگِ قاب بر اساسِ نشانِ رتبهی بازیکن).
|
||||
Container(
|
||||
width: diameter,
|
||||
height: diameter,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
gradient: const LinearGradient(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [Color(0xFFF3D27A), AppColors.goldDark],
|
||||
colors: _rankFrame(player.bot ? '' : player.rankTier),
|
||||
),
|
||||
boxShadow: const [
|
||||
BoxShadow(color: Colors.black54, blurRadius: 6),
|
||||
boxShadow: [
|
||||
const BoxShadow(color: Colors.black54, blurRadius: 6),
|
||||
if (isTurn)
|
||||
BoxShadow(
|
||||
color: _rankFrame(player.rankTier)[0]
|
||||
.withValues(alpha: 0.6),
|
||||
blurRadius: 12),
|
||||
],
|
||||
),
|
||||
padding: EdgeInsets.all(ringW),
|
||||
|
||||
Reference in New Issue
Block a user