Skip to content

Commit

Permalink
更新20220406幼年池
Browse files Browse the repository at this point in the history
尝试修复第三方图片缓存组件失效的问题
添加英雄获取方式
  • Loading branch information
jay committed Apr 6, 2022
1 parent bd98bdc commit 0f5988a
Show file tree
Hide file tree
Showing 29 changed files with 465 additions and 73 deletions.
Binary file added assets/faces/ch06_02_Rackesis_F_NormalEX01.webp
Binary file not shown.
Binary file added assets/faces/ch07_03_Nanna_F_Legend01.webp
Binary file not shown.
Binary file added assets/faces/ch09_00_Ike_MF_Pair.webp
Binary file not shown.
Binary file added assets/faces/ch09_02_Senerio_M_Before01.webp
Binary file not shown.
Binary file added assets/faces/ch09_09_Wayu_F_Before01.webp
Binary file not shown.
Binary file added assets/faces/ch09_14_Erase_F_Before01.webp
Binary file not shown.
Binary file added assets/faces/ch09_27_Bole_M_Before01.webp
Binary file not shown.
Binary file added assets/icons/1580.webp
Binary file not shown.
Binary file added assets/icons/1581.webp
Binary file not shown.
Binary file added assets/icons/1582.webp
Binary file not shown.
Binary file added assets/icons/1583.webp
Binary file not shown.
Binary file added assets/icons/1584.webp
Binary file not shown.
Binary file added assets/icons/1585.webp
Binary file not shown.
Binary file added assets/icons/1586.webp
Binary file not shown.
Binary file added assets/icons/1587.webp
Binary file not shown.
Binary file added assets/icons/1588.webp
Binary file not shown.
Binary file added assets/icons/1589.webp
Binary file not shown.
8 changes: 4 additions & 4 deletions lib/core/enum/person_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ enum PersonType {
}

extension PersonTypeExtension on PersonType {
String get value {
String get name {
switch (this) {
case PersonType.Normal:
return "普通召唤";
case PersonType.Grand_Hero_Battle:
return "大英雄战";
case PersonType.Special:
return "超英雄";
return "超英雄召唤";
case PersonType.Story:
return "剧情";
case PersonType.Legendary:
return "传承英雄";
return "传承英雄召唤";
case PersonType.Mythic:
return "神阶英雄";
return "神阶英雄召唤";
case PersonType.Tempest_Trials:
return "战涡连战";
}
Expand Down
1 change: 1 addition & 0 deletions lib/core/filters/skill.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class SkillFilter implements Filter<Skill, SkillFilterType> {
}

bool _filterMove(Skill skill, Set<MoveTypeEnum> valid) {
// 应该也可以使用位操作过滤,目前的方式比较好理解,暂时没发现性能问题,先不修改了
// e.g skill.movEquip=8(b1000) validator=[0,0,0,1]
List<String> validator = skill.movEquip!
.toRadixString(2)
Expand Down
4 changes: 2 additions & 2 deletions lib/env_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class EnvProvider {
static late final String tempDir;

/// 程序版本
static const String appVersion = "1.2.0Beta2";
static const String appVersion = "1.2.1";

/// 内建数据版本,必须与data.bin保持一致
static const int builtinDbVersion = 1647051532413;
static const int builtinDbVersion = 1649208732256;

/// app版本
static const int appVersionCode = 15;
Expand Down
1 change: 1 addition & 0 deletions lib/home_screens/others/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ class _DataVersionTileState extends State<_DataVersionTile> {
await context.read<Repository>().gameDb.updateDb(json);
await for (var file
in Directory(cachePath).list(recursive: true)) {
// todo 去掉和update的比较
if (file is File &&
p.basename(file.path) != "data.bin") {
String relative = p.relative(file.path,
Expand Down
5 changes: 5 additions & 0 deletions lib/home_screens/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ class Screens extends StatelessWidget {
);
},
),
// floatingActionButton: FloatingActionButton(
// onPressed: () => Navigator.of(context).push(MaterialPageRoute<void>(
// builder: (BuildContext context) => const SkyCastlePage(),
// )),
// ),
),
);
}
Expand Down
41 changes: 41 additions & 0 deletions lib/models/sky_castle/field.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
class Field {
final String id;
final int width;
final int height;
final int baseTerrain;
final List<List<int>> terrain;
Field({
required this.id,
required this.width,
required this.height,
required this.baseTerrain,
required this.terrain,
});

Map<String, dynamic> toJson() {
return {
'id': id,
'width': width,
'height': height,
'base_terrain': baseTerrain,
'terrain': terrain,
};
}

factory Field.fromJson(Map<String, dynamic> map) {
return Field(
id: map['id'] ?? '',
width: map['width']?.toInt() ?? 0,
height: map['height']?.toInt() ?? 0,
baseTerrain: map['base_terrain']?.toInt() ?? 0,
terrain: (map["terrain"] as List<dynamic>)
.map((e) => (e as List<dynamic>).cast<int>())
.toList(),
);
}

@override
String toString() {
return 'Field(id: $id, width: $width, height: $height, base_terrain: $baseTerrain, terrain: $terrain)';
}
}
60 changes: 40 additions & 20 deletions lib/pages/hero_detail/page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:cloud_db/cloud_db.dart';
import 'package:feh_rebuilder/core/enum/move_type.dart';
import 'package:feh_rebuilder/core/enum/page_state.dart';
import 'package:feh_rebuilder/core/enum/person_type.dart';
import 'package:feh_rebuilder/core/enum/stats.dart';
import 'package:feh_rebuilder/core/enum/weapon_type.dart';
import 'package:feh_rebuilder/core/filters/skill.dart';
Expand Down Expand Up @@ -381,6 +382,9 @@ class _AttrTile extends StatelessWidget {
heroTag: hero.idTag!,
resplendent: true,
version: hero.versionNum!,
type: (hero.minRarity == 0 && hero.maxRarity == 0)
? null
: PersonType.values[hero.type],
child: ClipOval(
child: UniImage(
path: p
Expand All @@ -394,6 +398,9 @@ class _AttrTile extends StatelessWidget {
heroTag: hero.idTag!,
resplendent: false,
version: hero.versionNum!,
type: (hero.minRarity == 0 && hero.maxRarity == 0)
? null
: PersonType.values[hero.type],
child: ClipOval(
child: UniImage(
path: p
Expand All @@ -409,6 +416,9 @@ class _AttrTile extends StatelessWidget {
heroTag: hero.idTag!,
resplendent: false,
version: hero.versionNum!,
type: (hero.minRarity == 0 && hero.maxRarity == 0)
? null
: PersonType.values[hero.type],
child: ClipOval(
child: UniImage(
path: p
Expand Down Expand Up @@ -639,27 +649,33 @@ class _RarityTile extends StatelessWidget {
hero.minRarity == 0
? hero.maxRarity == 0
? const Text("暂未添加")
: Row(
children: [
UniImage(
path: p.join("assets", "static",
"Rarity${hero.maxRarity}.png"),
height: 20),
],
: Tooltip(
message: PersonType.values[hero.type].name,
child: Row(
children: [
UniImage(
path: p.join("assets", "static",
"Rarity${hero.maxRarity}.png"),
height: 20),
],
),
)
: Row(
children: [
UniImage(
path: p.join(
"assets", "static", "Rarity${hero.minRarity}.png"),
height: 20),
const Text("--"),
UniImage(
path: p.join(
"assets", "static", "Rarity${hero.maxRarity}.png"),
height: 20),
],
)
: Tooltip(
message: PersonType.values[hero.type].name,
child: Row(
children: [
UniImage(
path: p.join("assets", "static",
"Rarity${hero.minRarity}.png"),
height: 20),
const Text("--"),
UniImage(
path: p.join("assets", "static",
"Rarity${hero.maxRarity}.png"),
height: 20),
],
),
),
],
),
);
Expand Down Expand Up @@ -1076,11 +1092,13 @@ class _DescWidget extends StatefulWidget implements PreferredSizeWidget {
required this.heroTag,
required this.resplendent,
required this.version,
this.type,
}) : super(key: key);
final Widget child;
final String heroTag;
final bool resplendent;
final int version;
final PersonType? type;
@override
State<_DescWidget> createState() => _DescWidgetState();

Expand Down Expand Up @@ -1166,6 +1184,8 @@ class _DescWidgetState extends State<_DescWidget>
Text(
"登场版本:${(widget.version / 100).floor()}.${widget.version % 100}",
),
if (widget.type != null)
Text("获取方式:${widget.type!.name}"),
],
),
),
Expand Down
Loading

0 comments on commit 0f5988a

Please sign in to comment.