Skip to content

Commit

Permalink
feat: Add helldivers assets
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisL61 committed Nov 16, 2024
1 parent 752e5b2 commit 41a6051
Show file tree
Hide file tree
Showing 55 changed files with 346 additions and 70 deletions.
61 changes: 1 addition & 60 deletions api/v1/helldivers/activities.json
Original file line number Diff line number Diff line change
@@ -1,60 +1 @@
[
{
"id":"ranked",
"name": "_ranked",
"image": "https://alexisl61.github.io/Games_RichPresence/assets/the_finals/gamemodes/the_finals_ranked.jpg",
"description": "_ranked_description",
"gamemodes": [
{
"id": "world_tour",
"name": "_world_tour",
"image": "https://alexisl61.github.io/Games_RichPresence/assets/the_finals/gamemodes/the_finals_ranked_world_tour.jpg",
"description": "_world_tour_description",
"rpc": "_world_tour_rpc"
},
{
"id": "ranked_cashout",
"name": "_ranked_cashout",
"image": "https://alexisl61.github.io/Games_RichPresence/assets/the_finals/gamemodes/the_finals_ranked_cashout.jpg",
"description": "_ranked_cashout_description",
"rpc": "_ranked_cashout_rpc"
}
]
},
{
"id":"casual",
"name": "_casual",
"image": "https://alexisl61.github.io/Games_RichPresence/assets/the_finals/gamemodes/the_finals_casual.jpg",
"description": "_casual_description",
"gamemodes": [
{
"id": "casual_quick_cash",
"name": "_casual_quick_cash",
"image": "https://alexisl61.github.io/Games_RichPresence/assets/the_finals/gamemodes/the_finals_casual_quick_cash.png",
"description": "_casual_quick_cash_description",
"rpc": "_casual_quick_cash_rpc"
},
{
"id": "casual_bank_it",
"name": "_casual_bank_it",
"image": "https://alexisl61.github.io/Games_RichPresence/assets/the_finals/gamemodes/the_finals_casual_bank_it.png",
"description": "_casual_bank_it_description",
"rpc": "_casual_bank_it_rpc"
},
{
"id": "casual_power_shift",
"name": "_casual_power_shift",
"image": "https://alexisl61.github.io/Games_RichPresence/assets/the_finals/gamemodes/the_finals_casual_power_shift.png",
"description": "_casual_power_shift_description",
"rpc": "_casual_power_shift_rpc"
},
{
"id": "casual_terminal_attack",
"name": "_casual_terminal_attack",
"image": "https://alexisl61.github.io/Games_RichPresence/assets/the_finals/gamemodes/the_finals_casual_terminal_attack.png",
"description": "_casual_terminal_attack_description",
"rpc": "_casual_terminal_attack_rpc"
}
]
}
]
[]
Binary file added assets/helldivers/biomes/Canyon.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Crimsonmoor.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Desert.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Desolate.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Ethereal.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Foggy Swamp.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Highlands.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Icemoss Special.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Icemoss.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Jungle.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Mesa.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Moon.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Rainforest.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Swamp.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Toxic.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Tundra.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Wasteland.webp
Binary file not shown.
Binary file added assets/helldivers/biomes/Winter.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Canyon.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Crimsonmoor.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Desert.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Desolate.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Ethereal.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Foggy Swamp.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Highlands.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Icemoss Special.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Icemoss.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Jungle.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Mesa.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Moon.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Rainforest.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Swamp.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Toxic.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Tundra.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Wasteland.webp
Binary file not shown.
Binary file added assets/helldivers/planets/Winter.webp
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions games_richpresence/assets/helldivers/svg/eagle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class _HelldiversBackgroundState extends State<HelldiversBackground> {
return Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(image: DecorationImage(image: Assets.helldivers.images.background.provider())),
decoration: BoxDecoration(color: Colors.black, image: DecorationImage(image: Assets.helldivers.images.background.provider(), opacity: 0.5, fit: BoxFit.cover)),
child: widget.child,
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import 'package:flutter/widgets.dart';

class HelldiversLargePanel extends StatelessWidget {
final Color? borderColor;
final String title;
final String subtitle;
final Widget? icon;
final Widget? child;
final String description;

const HelldiversLargePanel(
{super.key,
this.borderColor,
required this.title,
required this.subtitle,
this.icon,
this.child,
required this.description});

@override
Widget build(BuildContext context) {
return Container(
width: 400,
decoration: BoxDecoration(
color: Color.fromRGBO(0, 0, 0, 0.8),
border: Border.all(
color: borderColor ?? Color(0xFF30302f),
width: 2,
),
),
child: Padding(
padding: const EdgeInsets.all(18),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
if (icon != null) icon!,
if (icon != null) SizedBox(width: 20),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
subtitle,
style: TextStyle(
color: Color.fromRGBO(120, 120, 116, 1),
fontSize: 14,
),
),
Text(
title,
style: TextStyle(
color: Color.fromRGBO(255, 255, 255, 1),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
))
],
),
SizedBox(height: 10),
Text(description,
style: TextStyle(
color: Color.fromRGBO(255, 255, 255, 1),
fontSize: 16,
)),
if (child != null) SizedBox(height: 20),
if (child != null) child!,
],
),
),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import 'package:flutter/widgets.dart';
import 'package:games_richpresence/model/class/game_activities/helldivers/faction.dart';
import 'package:games_richpresence/model/class/game_activities/helldivers/planets.dart';

class HelldiversPlanetPanel extends StatelessWidget {
final HelldiversPlanet planet;

const HelldiversPlanetPanel({super.key, required this.planet});

@override
Widget build(BuildContext context) {
return Container(
width: 400,
decoration: BoxDecoration(
color: Color.fromRGBO(0, 0, 0, 0.8),
border: Border.all(
color: Color(0xFFc9c9cb),
width: 2,
),
),
child: Column(
children: [
Row(
children: [
Image(image: AssetImage(planet.owner.icon), width: 70, height: 70),
SizedBox(width: 20),
Expanded(
child: Column(
children: [
Text(
planet.name,
style: TextStyle(
color: planet.owner.color,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
SizedBox(width: 10),
Text(
planet.sector,
style: TextStyle(
color: planet.owner.color,
fontSize: 14,
),
),
],
)),
Image.network(
planet.biomeImage,
width: 400,
height: 200,
fit: BoxFit.cover,
errorBuilder: (context, error, stackTrace) => Container(
width: 400,
height: 200,
color: Color(0xFF3F3F3F),
),
),
],
)
],
));
}
}
52 changes: 51 additions & 1 deletion games_richpresence/lib/gen/assets.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import 'package:flutter/material.dart';
import 'package:games_richpresence/gen/assets.gen.dart';

enum HelldiversFactions {
humans,
terminids,
automatons;

static HelldiversFactions fromString(String faction) {
switch (faction) {
case 'Humans':
return HelldiversFactions.humans;
case 'Terminids':
return HelldiversFactions.terminids;
case 'Automatons':
return HelldiversFactions.automatons;
}
throw Exception('Unknown faction: $faction');
}
}

extension HelldiversFactionsExtension on HelldiversFactions {
String get icon {
switch (this) {
case HelldiversFactions.humans:
return Assets.helldivers.images.superhearthIcon.path;
case HelldiversFactions.terminids:
return Assets.helldivers.images.terminidIcon.path;
case HelldiversFactions.automatons:
return Assets.helldivers.images.automatonIcon.path;
}
}

Color get color {
switch (this) {
case HelldiversFactions.humans:
return const Color(0xFFa7daeb);
case HelldiversFactions.terminids:
return const Color(0xFFfe6d72);
case HelldiversFactions.automatons:
return const Color(0xFFffc100);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import 'package:games_richpresence/model/class/game_activities/helldivers/faction.dart';

class HelldiversPlanet {
final int id;
final String name;
final String sector;
final String biomeImage;
final Position position;
final HelldiversFactions owner;

HelldiversPlanet(
{required this.id,
required this.name,
required this.sector,
required this.biomeImage,
required this.position,
required this.owner});
}

class Position {
final double x;
final double y;

Position({required this.x, required this.y});
}
Loading

0 comments on commit 41a6051

Please sign in to comment.