Add more entries

+ Add a texture variation system.
This commit is contained in:
zontreck 2025-03-25 19:52:42 -07:00
parent 16f40d3a88
commit 4a2699615d
12 changed files with 79 additions and 11 deletions

BIN
assets/sprites/castform.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
assets/sprites/feebas.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
assets/sprites/kecleon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
assets/sprites/milotic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -1,7 +1,7 @@
import 'dart:io'; import 'dart:io';
class Constants { class Constants {
static const VERSION = "1.0.032525+1924"; static const VERSION = "1.0.032525+1952";
static bool get isMobile => Platform.isAndroid || Platform.isIOS; static bool get isMobile => Platform.isAndroid || Platform.isIOS;
} }

View file

@ -177,9 +177,7 @@ class _DexEntryState extends State<DexEntry> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (_pkmn.id != Pokemon.Unown.id) Center(child: Image.asset(_pkmn.toDexPath())),
Center(child: Image.asset(_pkmn.toDexPath())),
if (_pkmn.id == Pokemon.Unown.id) SessionData.PrintUnown(),
Center( Center(
child: Text( child: Text(
"ID: ${_pkmn.pokeDexID}", "ID: ${_pkmn.pokeDexID}",
@ -202,6 +200,10 @@ class _DexEntryState extends State<DexEntry> {
), ),
], ],
), ),
if (_pkmn.extraVariants.isNotEmpty)
Text("Extra Variations: ", style: TextStyle(fontSize: 24)),
if (_pkmn.extraVariants.isNotEmpty) _pkmn.getVariations(),
SizedBox(height: 32), SizedBox(height: 32),
if (Constants.isMobile) if (Constants.isMobile)
SingleChildScrollView( SingleChildScrollView(

View file

@ -54,6 +54,13 @@ class SessionData {
} }
static Widget PrintUnown() { static Widget PrintUnown() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: getUnownList(),
);
}
static List<Widget> getUnownList() {
List<Widget> widgets = []; List<Widget> widgets = [];
List<Widget> tmpWidgets = []; List<Widget> tmpWidgets = [];
@ -80,10 +87,7 @@ class SessionData {
Row(crossAxisAlignment: CrossAxisAlignment.start, children: tmpWidgets), Row(crossAxisAlignment: CrossAxisAlignment.start, children: tmpWidgets),
); );
return Column( return widgets;
crossAxisAlignment: CrossAxisAlignment.start,
children: widgets,
);
} }
static int highestGenID() { static int highestGenID() {

View file

@ -98,6 +98,9 @@ enum EvolutionCondition {
EmptySlot, EmptySlot,
PokeballInBag, PokeballInBag,
ShinyStone, ShinyStone,
PrismScale,
Or,
MaxBeauty,
} }
abstract class Evolution { abstract class Evolution {
@ -1114,7 +1117,7 @@ enum Pokemon {
previousPokemon: 79, previousPokemon: 79,
), ),
Misdreavus(200, Generation.Two, [Type.Ghost], null), Misdreavus(200, Generation.Two, [Type.Ghost], null),
Unown(201, Generation.Two, [Type.Psychic], null), Unown(201, Generation.Two, [Type.Psychic], null, extraVariants: ["abc"]),
Wobbuffet(202, Generation.Two, [Type.Psychic], null), Wobbuffet(202, Generation.Two, [Type.Psychic], null),
Girafarig(203, Generation.Two, [Type.Normal, Type.Psychic], null), Girafarig(203, Generation.Two, [Type.Normal, Type.Psychic], null),
Pineco(204, Generation.Two, [Type.Bug], SingleEvolution(205, 31)), Pineco(204, Generation.Two, [Type.Bug], SingleEvolution(205, 31)),
@ -1638,7 +1641,32 @@ enum Pokemon {
[Type.Rock, Type.Bug], [Type.Rock, Type.Bug],
null, null,
previousPokemon: 347, previousPokemon: 347,
); ),
Feebas(
349,
Generation.Three,
[Type.Water],
SingleEvolution(
350,
-1,
condition: [
EvolutionCondition.Trading,
EvolutionCondition.Holding,
EvolutionCondition.PrismScale,
EvolutionCondition.Or,
EvolutionCondition.MaxBeauty,
],
),
),
Milotic(350, Generation.Three, [Type.Water], null, previousPokemon: 349),
Castform(
351,
Generation.Three,
[Type.Normal],
null,
extraVariants: ["castform_rainy", "castform_snowy", "castform_sunny"],
),
Kecleon(352, Generation.Three, [Type.Normal], null);
final int id; final int id;
final String properName; final String properName;
@ -1647,6 +1675,7 @@ enum Pokemon {
final Evolution? evolution; final Evolution? evolution;
final int dexID; final int dexID;
final int previousPokemon; final int previousPokemon;
final List<String> extraVariants;
bool get hasEvolutions => evolution != null; bool get hasEvolutions => evolution != null;
const Pokemon( const Pokemon(
this.id, this.id,
@ -1656,6 +1685,7 @@ enum Pokemon {
this.dexID = -1, this.dexID = -1,
this.properName = "", this.properName = "",
this.previousPokemon = -1, this.previousPokemon = -1,
this.extraVariants = const [],
}); });
String get pokemonName => properName == "" ? name : properName; String get pokemonName => properName == "" ? name : properName;
@ -1702,6 +1732,31 @@ enum Pokemon {
return sRet; return sRet;
} }
Widget getVariations() {
List<Widget> variants = [];
if (id == Pokemon.Unown.id)
variants = SessionData.getUnownList();
else {
List<Widget> tmpRow = [];
int i = 0;
int row = Constants.isMobile ? 3 : 4;
for (var variant in extraVariants) {
tmpRow.add(Image.asset("assets/sprites/${variant}.png"));
i++;
if (i >= row) {
variants.add(Row(children: tmpRow));
tmpRow = [];
i = 0;
}
}
if (tmpRow.isNotEmpty) variants.add(Row(children: tmpRow));
}
return Column(children: variants);
}
List<Widget> getEvolutions(int subID) { List<Widget> getEvolutions(int subID) {
//print("SUBID ${subID}"); //print("SUBID ${subID}");

View file

@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.0.032525+1924 version: 1.0.032525+1952
environment: environment:
sdk: ^3.7.0 sdk: ^3.7.0
@ -447,6 +447,13 @@ flutter:
- assets/sprites/cradily.png - assets/sprites/cradily.png
- assets/sprites/anorith.png - assets/sprites/anorith.png
- assets/sprites/armaldo.png - assets/sprites/armaldo.png
- assets/sprites/feebas.png
- assets/sprites/milotic.png
- assets/sprites/castform.png
- assets/sprites/castform_rainy.png
- assets/sprites/castform_snowy.png
- assets/sprites/castform_sunny.png
- assets/sprites/kecleon.png
# An image asset can refer to one or more resolution-specific "variants", see # An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images # https://flutter.dev/to/resolution-aware-images