Skip to content

Commit

Permalink
fix: ram as vis flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jvenin committed Apr 14, 2024
1 parent 62d96ef commit 99a5f86
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 28 deletions.
12 changes: 8 additions & 4 deletions lib/classes/gsf/header2/chunks/chunk_attributes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -575,13 +575,14 @@ class VehiAttributes extends ChunkAttributes {
bool get unknown => bits[unknownIndice];

@override
List<int> get visibilityFlags => [];
List<int> get visibilityFlags => [
ramHighIndice,
ramLowIndice,
];

@override
List<int> get usedIndices => super.usedIndices
..addAll([
ramHighIndice,
ramLowIndice,
unknownIndice,
]);
}
Expand Down Expand Up @@ -810,7 +811,10 @@ class ShipAttributes extends ChunkAttributes {
bool get unknown => bits[unknownIndice];

@override
List<int> get visibilityFlags => [];
List<int> get visibilityFlags => [
ramHighIndice,
ramLowIndice,
];

@override
bool isCompatible(ChunkAttributes filter) {
Expand Down
24 changes: 0 additions & 24 deletions lib/widgets/header2/widgets/chunks/attributes/misc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,6 @@ class MiscFlagsDisplay extends StatelessWidget {
];
case ModelType.vehi:
return [
FlagBox(
label: "ram_high",
attributes: chunkAttributes,
indice: VehiAttributes.ramHighIndice,
onPress: onPress,
),
FlagBox(
label: "ram_low",
attributes: chunkAttributes,
indice: VehiAttributes.ramLowIndice,
onPress: onPress,
),
FlagBox(
label: "Unknown (light collision?)",
attributes: chunkAttributes,
Expand All @@ -112,18 +100,6 @@ class MiscFlagsDisplay extends StatelessWidget {
];
case ModelType.ship:
return [
FlagBox(
label: "ram_high",
attributes: chunkAttributes,
indice: ShipAttributes.ramHighIndice,
onPress: onPress,
),
FlagBox(
label: "ram_low",
attributes: chunkAttributes,
indice: ShipAttributes.ramLowIndice,
onPress: onPress,
),
FlagBox(
label: "Use construction flags",
attributes: chunkAttributes,
Expand Down
30 changes: 30 additions & 0 deletions lib/widgets/header2/widgets/chunks/attributes/visibility.dart
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,36 @@ class VisibilityFlagsDisplay extends StatelessWidget {
onPress: onPress,
),
];
case ModelType.vehi:
return [
FlagBox(
label: "ram_high",
attributes: chunkAttributes,
indice: VehiAttributes.ramHighIndice,
onPress: onPress,
),
FlagBox(
label: "ram_low",
attributes: chunkAttributes,
indice: VehiAttributes.ramLowIndice,
onPress: onPress,
),
];
case ModelType.ship:
return [
FlagBox(
label: "ram_high",
attributes: chunkAttributes,
indice: ShipAttributes.ramHighIndice,
onPress: onPress,
),
FlagBox(
label: "ram_low",
attributes: chunkAttributes,
indice: ShipAttributes.ramLowIndice,
onPress: onPress,
),
];
case ModelType.misc:
return [
FlagBox(
Expand Down

0 comments on commit 99a5f86

Please sign in to comment.