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

Spritesheet rework #2348

Open
wants to merge 92 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
4bd0f7d
Added a grunt task to generate the spritesheet.
Oct 17, 2017
fd8318d
Replaced the old sprite files/css parts.
Oct 17, 2017
7e91536
Updated the map to use the new spritesheet.
Oct 17, 2017
45cded2
Removed the auto-generated files.
Oct 17, 2017
1d0a306
Removed the 'sprites' task.
Oct 17, 2017
ab01b30
Added sprites.sass to the gitignore.
Oct 17, 2017
95b56e4
Removed another generated file.
Oct 17, 2017
3b48790
One last generated file.
Oct 17, 2017
d7dba18
Fixed some entries in the .gitignore.
Oct 18, 2017
5ff0762
CSS sprites are now dynamically resizable.
Oct 18, 2017
6f96175
Pokemon forms now display correctly.
Oct 18, 2017
d4d2812
Refactored some sprite/icon functions.
Oct 18, 2017
92fb445
Tidied up pokemon sprite css.
Oct 19, 2017
71a31ac
Modified the check in runserer.py for the spritesheets.
Oct 22, 2017
dd95199
Added a directory for icon parts.
Oct 22, 2017
5fc8866
Added pokemon icons for testing purposes.
Oct 22, 2017
e7f9654
Renamed sprite css classes.
Oct 22, 2017
3a05416
Added some dependencies.
Oct 22, 2017
db6a4a7
Gym icons are now generated using a grunt task.
Oct 22, 2017
6286f76
Added cairo to the testing setup.
Oct 22, 2017
2ac517f
Moved icon generation code into a separate js script.
Oct 23, 2017
8e079d2
Moved HSL files into a separate folder.
Oct 28, 2017
70f0a8e
Added other icons temporarily (for testing).
Nov 3, 2017
81c2af7
Created a custom task for spritesheet generation.
Nov 3, 2017
08bd024
Excluded spritesheet build tasks from static file check.
Nov 3, 2017
66aa6a6
Made raid pokemon icons larger.
Nov 3, 2017
2ce519f
Linting.
Nov 3, 2017
ae99bf1
Switched old raid bosses for new ones.
Nov 5, 2017
1653f82
Removed an unused package.
Nov 5, 2017
f0a6483
Added new raid pokemon, and split resource loading.
Nov 5, 2017
b791e17
Fixed pokemon icons on the stats page.
Nov 5, 2017
aaa0306
Tidied up some css.
Nov 5, 2017
f90734f
Refactored marker fetching and added position markers to the spritesh…
Nov 5, 2017
9dd061a
Linting.
Nov 5, 2017
b15bbb2
Re-added sprite tasks to the gruntfile.
Nov 5, 2017
168f1ad
Removed auto-built gym icons.
Nov 6, 2017
abdfd9e
Added the heart icon.
Nov 6, 2017
686d310
Removed pokemon icons.
Nov 6, 2017
7ca6884
Removed an unnecessary file.
Nov 6, 2017
b36661f
Added the ID? part.
Nov 6, 2017
d0b66ef
Added the _unknown icon, and support for ignoring existing icons.
Nov 6, 2017
1f9ced5
Linting.
Nov 6, 2017
f7202cd
Removed outdated images.
Nov 6, 2017
3a647ac
Updated .gitignore.
Nov 6, 2017
30eb325
Added the pokemon icons directory back in.
Nov 6, 2017
c082c6a
Removed local version of mylocation-sprite.
Nov 6, 2017
ab73ee9
Moved cluster icons to the icons folder.
Nov 6, 2017
5147b8a
Position markers should now load correctly.
Nov 6, 2017
c7b710d
Replaced heart images with sprites.
Nov 7, 2017
6909e92
Fixed pokemon sprites in labels.
Nov 7, 2017
28d28cc
Moved number loading to gym resources.
Nov 7, 2017
dbddf01
Switched to using stars for raid levels.
Nov 7, 2017
6fb3d21
Linting.
Nov 7, 2017
6d07a00
Changed the positioning of raid stars.
Nov 7, 2017
6f3f276
Moved gym strength indicator back over.
Nov 7, 2017
ea46621
Removed an unused image.
Nov 7, 2017
735d872
Extracted pokemon form data to a json file.
Nov 9, 2017
c9aebab
Removed space around the circle icon.
Nov 9, 2017
f8cf97c
Added some bitmap fonts.
Nov 9, 2017
f2f5a8f
Fixed promise handling in spritesheet generation.
Nov 9, 2017
199f40b
Added default pokemon icon generation.
Nov 9, 2017
eda19e7
Rocket.png is now a sprite.
Nov 9, 2017
5720d47
Close.png is now a sprite.
Nov 9, 2017
f52ab77
Linting.
Nov 9, 2017
5499e2f
Tidied up some css.
Nov 9, 2017
cb30725
Removed a copy of RocketMap.png.
Nov 9, 2017
05fc8fa
Moved move-bar sprites onto the main spritesheet.
Nov 9, 2017
2f7cabe
Added a grunt task to compress the sritesheet.
Nov 10, 2017
2078fb9
Made canvassmith optional.
Nov 10, 2017
093ff4d
Converted line endings to unix-style.
Nov 10, 2017
cbc76b1
Removed unnecessary dependency.
Nov 11, 2017
1876dc2
Pokemon forms now use standard names.
Nov 11, 2017
16d55a3
Replaced 'ID?' text with a generated '?'.
Nov 11, 2017
ece0e58
Refactored pokemon form handling.
Nov 11, 2017
359f435
Added shadows to gym icons.
Nov 11, 2017
cf2d3e9
Removed grunt-promise as it fails on windows.
Nov 12, 2017
1250a3f
Removed unnecessary return.
Nov 12, 2017
321d6af
Removed last instance of grunt-promise.
Nov 13, 2017
49c338a
Removed an old icon part.
Nov 13, 2017
160450f
Icons are now re-generated intelligently.
Nov 14, 2017
b41301c
Updated gym icons.
Nov 14, 2017
7ba18d2
Some graphics updates (courtesy of sirlindquvist).
Nov 14, 2017
2f2c617
Icons are now created in batches.
Nov 16, 2017
0a71805
Linting.
Nov 16, 2017
bdce14a
Fixed an issue with icon promises.
Nov 16, 2017
f91d4f0
Build spritesheet in batches.
Nov 22, 2017
297e337
Removed static01.zip.
Nov 22, 2017
089d7a2
Added some debug lines.
Nov 26, 2017
1a87fb7
More debug lines.
Nov 26, 2017
1d401b0
Minor graphical fixes courtesy of sirlindqvist.
Jan 11, 2018
073c629
Minor graphical fixes courtesy of sirlindqvist (2).
Jan 11, 2018
e8f700f
Re-added Magikarp as a raid boss.
Jan 11, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 23 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
"google": true,
"moment": false,
"MarkerClusterer": true,
"isNotifyPoke": true,
"isTouchDevice": true,
"isMobileDevice": true,

"noLabelsStyle": true,
"darkStyle": true,
Expand All @@ -48,17 +45,35 @@

"Store": true,
"mapData": true,
"pokemonFormMap": true,
"formMap": true,
"spriteMap": true,
"spriteClass": true,
"getSprite": true,
"getSpriteMarker": true,
"pokemonIcon": true,
"pokemonSprite": true,
"pokestopSprite": true,
"pokestopMarker": true,
"gymSprite": true,
"gymMarker": true,
"spawnpointMarker": true,
"getPositionMarkers": true,
"positionMarker": true,
"setupPokemonMarker": true,
"updatePokemonMarker": true,
"isNotifyPoke": true,
"isTouchDevice": true,
"isMobileDevice": true,
"toTitleCase": true,

"pokemonSprites": true,
"centerLat": true,
"centerLng": true,
"clusterImagePath": true,
"showConfig": true,

"pageLoaded": true,
"countMarkers": true,
"skel": true,
"setupPokemonMarker": true,
"updatePokemonMarker": true

"pageLoaded": true
}
}
15 changes: 8 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ src/
_build
_build_html
beehive.*
static/images/raid/*.png
!static/images/raid/*_unknown.png
static/icons-sprite.png
static/icons-large-sprite.png
static/icons/*.png
static/icons/.tracking
static/icons/pokemon/*.png
static/icons/gyms/*.png
!static/icons/gyms/heart.png
static/spritesheet.png
static/sass/sprites.scss
static/css/custom.css
static/js/custom.js
*.csv
Expand All @@ -34,5 +35,5 @@ static/js/custom.js
!contrib/supervisord/gen-workers.sh
!contrib/supervisord/install-reinstall.sh
!static/data/*
!static/icons/hsl*.png
!static/app/settings.json
!static/app/settings.json
static/data/sprite_map.json
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ python:
- 2.7

# Install steps MUST succeed or will immediately halt the build.
before_install:
- sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++

install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install --lts=boron
- pip install flake8
Expand Down
29 changes: 24 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ module.exports = function (grunt) {

// load plugins as needed instead of up front
require('jit-grunt')(grunt, {
unzip: 'grunt-zip'
unzip: 'grunt-zip',
pngmin: 'grunt-pngmin'
})

var path = require('path')
var fs = require('fs')
var buildIcons = require('./static/js/build_icons.js')
var buildSpritesheet = require('./static/js/build_spritesheet.js')

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
Expand Down Expand Up @@ -77,9 +80,10 @@ module.exports = function (grunt) {
build: {
files: {
'static/dist/data/pokemon.min.json': 'static/data/pokemon.json',
'static/dist/data/pokemon_forms.min.json': 'static/data/pokemon_forms.json',
'static/dist/data/moves.min.json': 'static/data/moves.json',
'static/dist/data/mapstyle.min.json': 'static/data/mapstyle.json',
'static/dist/data/searchmarkerstyle.min.json': 'static/data/searchmarkerstyle.json',
'static/dist/data/sprite_map.min.json': 'static/data/sprite_map.json',
'static/dist/locales/de.min.json': 'static/locales/de.json',
'static/dist/locales/fr.min.json': 'static/locales/fr.json',
'static/dist/locales/ja.min.json': 'static/locales/ja.json',
Expand Down Expand Up @@ -144,16 +148,31 @@ module.exports = function (grunt) {
src: 'static01.zip',
dest: 'static/'
}
},
pngmin: {
compile: {
files: [
{
src: 'static/spritesheet.png',
dest: 'static/'
}
],
options: {
ext: '.png',
force: true
}
}
}

})

grunt.registerTask('icons-build', 'Builds the icons for gyms and raids.', buildIcons)
grunt.registerTask('sp-build', 'Builds the spritesheet.', buildSpritesheet)
grunt.registerTask('js-build', ['newer:babel', 'newer:uglify'])
grunt.registerTask('css-build', ['newer:sass', 'newer:cssmin'])
grunt.registerTask('js-lint', ['newer:eslint'])
grunt.registerTask('json', ['newer:minjson'])

grunt.registerTask('build', ['clean', 'js-build', 'css-build', 'json', 'unzip'])
grunt.registerTask('build', ['clean', 'icons-build', 'sp-build', 'pngmin',
'js-build', 'css-build', 'json'])
grunt.registerTask('lint', ['js-lint'])
grunt.registerTask('default', ['build', 'watch'])
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Live visualization of all the Pokémon (with option to show gyms, raids and PokéStops) in your area. This is a proof of concept that we can load all the Pokémon visible nearby given a location. Currently runs on a Flask server displaying Google Maps with markers on it.

![Map](https://github.com/RocketMap/RocketMap/blob/develop/static/RocketMap.png)
![Map](https://github.com/RocketMap/RocketMap/blob/develop/docs/_static/img/RocketMap.png)

## Features:

Expand Down
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
"main": "Gruntfile.js",
"dependencies": {
"babel-preset-env": "^1.6.0",
"bluebird": "^3.5.1",
"eslint": "^3.1.1",
"eslint-config-standard": "^5.3.5",
"eslint-plugin-promise": "^2.0.0",
"eslint-plugin-standard": "^2.0.0",
"file-changed": "^1.2.1",
"grunt": "^0.4.5",
"grunt-babel": "^6.0.0",
"grunt-cli": "^1.2.0",
Expand All @@ -25,11 +27,18 @@
"grunt-legacssy": "latest",
"grunt-minjson": "latest",
"grunt-newer": "^1.2.0",
"grunt-pngmin": "^1.3.0",
"grunt-sass": "latest",
"grunt-unused": "latest",
"grunt-usemin": "latest",
"grunt-zip": "^0.17.1",
"jit-grunt": "^0.10.0"
"handlebars": "^4.0.11",
"jimp": "^0.2.28",
"jit-grunt": "^0.10.0",
"spritesmith": "^3.1.1"
},
"optionalDependencies": {
"canvassmith": "^1.2.0"
},
"scripts": {
"build": "grunt build",
Expand Down
6 changes: 4 additions & 2 deletions runserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ def validate_assets(args):

static_path = os.path.join(root_path, 'static/js')
for file in os.listdir(static_path):
if file.endswith(".js"):
if (file.endswith(".js")
and file != 'build_icons.js'
and file != 'build_spritesheet.js'):
generated_path = os.path.join(static_path, '../dist/js/',
file.replace(".js", ".min.js"))
source_path = os.path.join(static_path, file)
Expand All @@ -138,7 +140,7 @@ def validate_assets(args):

# You need custom image files now.
if not os.path.isfile(
os.path.join(root_path, 'static/icons-sprite.png')):
os.path.join(root_path, 'static/spritesheet.png')):
log.critical(assets_error_log)
return False

Expand Down
Binary file removed static/RocketMap.png
Binary file not shown.
5 changes: 5 additions & 0 deletions static/data/pokemon_forms.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"201": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", ["exclamation", "!"], ["question", "?"]],
"351": [["normal", "NML"], ["sunny", "SUN"], ["rainy", "RN"], ["snowy", "SNW"]],
"386": [["normal", "NML"], ["attack", "ATK"], ["defense", "DEF"], ["speed", "SPE"]]
}
90 changes: 0 additions & 90 deletions static/data/searchmarkerstyle.json

This file was deleted.