Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding highway shields in Peru #1178

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc-img/shield_map_world.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions icons/shield_pe_2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions icons/shield_pe_3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions src/js/shield_defs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3164,6 +3164,53 @@ export function loadShields() {
textColor: Color.shields.white,
};

// Peru
shields["PE:national"] = {
spriteBlank: ["shield_pe_2", "shield_pe_3"],
textColor: Color.shields.black,
padding: {
left: 3,
right: 3,
top: 7,
bottom: 4,
},
};
[
"AM",
"AN",
"AP",
"AR",
"AY",
"CA",
"CU",
"HU",
"HV",
"IC",
"JU",
"LA",
"LI",
"LM",
"LO",
"MD",
"MO",
"PA",
"PI",
"PU",
"SM",
"TA",
"TU",
"UC",
].forEach(
(department) =>
([
shields[`PE:departmental:${department}`],
shields[`PE:rural:${department}`],
] = [
escutcheonDownShield(12, Color.shields.white, Color.shields.black),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These shields are visually closer to the state highway shields of Mexico (see line 584). Let's factor that out into a reusable shield definition and use it here.

Side note: this is making it really clear how much we need a draw function for badge shields, and maybe support for crossbars and accent colors in some of the functions...

pillShield(Color.shields.white, Color.shields.black),
])
);

// Uruguay
shields["UY"] = homePlateDownShield(
5,
Expand Down
Loading