weixin_39852953
weixin_39852953
2021-01-07 11:57

extend the gym display with openable member details

Description

When a gym member (pokémon) is clicked, it's information is shown. This helps mobile users as the trainer name tooltips were nearly impossible to see on touch.

The issue required some reorganization of the gym details layout, nothing ground-breaking. The pokemon icons now include a fixed size border which is transparent by default but modifies the spacing of icons.

Information includes CP, IVs, HP and moves, so it lets you prepare for a gym battle. This required new fields in the raw_data response.

Move names were not available so I made a json from all the moves listed on bulbapedia. The fields are self explanatory I hope.

The team logo is supposed to be the same size as the details texts. This is true in chrome, but not perfect in firefox or edge. Might need some tuning, a fixed height container or the whole idea should just be scrapped as the team icon holds no valuable information whatsoever.

Stuff is in english, translations are completely neglected, sorry.

Motivation and Context

The two selling points are: 1. Trainer name is visible on mobile. Previously it was not as you cannot properly hover the pokémon's icon to see the tooltip. 2. Gym battles can be prepared for by seeing the exact power of a pokemon.

1290

How Has This Been Tested?

Nothing too difficult, so I was satisfied with seeing it work on my machine.

Screenshots (if appropriate):

Closed: gympokemon_closed

Open: gympokemon_real

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [x] My code follows the code style of this project.
  • [x] My change requires a change to the documentation.
  • [x] I have updated the documentation accordingly.

该提问来源于开源项目:RocketMap/RocketMap

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

35条回答

  • weixin_39852953 weixin_39852953 4月前

    The problem with the one in 1272 is that it only includes the move names and not the types/damage/etc which might be useful.

    点赞 评论 复制链接分享
  • weixin_39927144 weixin_39927144 4月前

    i agree with u but IV notifications of found pokemon on the map are more important imo. Move damage is fixed and already sort of known by most players, could we make a gymmoves.json for gym details? the 2 should not conflict that way.

    点赞 评论 复制链接分享
  • weixin_39852953 weixin_39852953 4月前

    I posted there to ask the author to move to an other json format. Would be great, but if not, ill rename my json.

    点赞 评论 复制链接分享
  • weixin_39985286 weixin_39985286 4月前

    Can't you modify your code like theirs? Just use that format.

    点赞 评论 复制链接分享
  • weixin_39927144 weixin_39927144 4月前

    The problem is all 3 pulls in question are using different formats..

    点赞 评论 复制链接分享
  • weixin_39852953 weixin_39852953 4月前

    IV is shown now as: 100% (15/15/15) . Everybody knows what ATK/DEF/STA is apparently.

    moves.json format is now the same as #1316 , there are guides at #1272 on how to use this moves.json format.

    also free slots are now clearly indicated, although it's a little ugly.

    点赞 评论 复制链接分享
  • weixin_39927144 weixin_39927144 4月前

    Thanks, ill report back with some results shortly.

    点赞 评论 复制链接分享
  • weixin_39927144 weixin_39927144 4月前

    can confirm the moves.json change is working good here and for use with #1272 just follow the changes in this comment below! Thanks again! would be even slicker if we could get a merge with #1316 and incorporate that also, i still really like that pull and how it looks on the PC. would be the best of all worlds combined into one!

    https://github.com/PokemonGoMap/PokemonGo-Map/pull/1272#issuecomment-248092565

    actually i found 2 issues, HP is reported as double the actual value for all gym defenders. and should freshly taken lvl 3 gyms report 2 open spots, even tho the 2nd spot is pending the first spot to be filled? imo it should, i pre lvl gyms personally, so rather than only seeing 1 open spot, it would be nice to see ALL open spots, even hypothetical ones.

    点赞 评论 复制链接分享
  • weixin_39852953 weixin_39852953 4月前

    HP is double? Strange. I'll investigate.

    点赞 评论 复制链接分享
  • weixin_39683863 weixin_39683863 4月前

    I guess this could be, because Pokemon get double HP while defending gyms? So not a bug imo

    点赞 评论 复制链接分享
  • weixin_39927144 weixin_39927144 4月前

    Did you confirm the issue? seems i recall in the DB they arent recorded with double HP..

    点赞 评论 复制链接分享
  • weixin_39781550 weixin_39781550 4月前

    just to be clear so i'm not pulling my hair out for no reason. Your saying if I have #1272 installed on my server and I make the following changes

    
    Change line 329 of map.js from
    Moves: ${moves[move1]} / ${moves[move2]}
    to
    Moves: ${moves[move1]['name']} / ${moves[move2]['name']}
    
    and as it has been already said, remove moves.json from this PR and use the #1316 moves.json.
    That's it, you can have both PRs working together :)
    

    Then I can get IVs for all pokemon and gym details and IVs for gym pokemon? TIA for any help you can provide.

    点赞 评论 复制链接分享
  • weixin_39927144 weixin_39927144 4月前

    thats all i did was make that change in map.js, then rebuild and your good.

    点赞 评论 复制链接分享
  • weixin_39781550 weixin_39781550 4月前

    and you had #1272 installed? Cause thats what I tried and it wasn't working for me but then I started looking at the files changed in this PR and I realized that there does seem to be some code that is different in other files. I wish I knew what I was missing :/

    点赞 评论 复制链接分享
  • weixin_39551103 weixin_39551103 4月前

    Closing, moving forward with PR1316

    点赞 评论 复制链接分享
  • weixin_39852953 weixin_39852953 4月前

    Have you tried using 1316 on a small screen? Have you seen how much space a sidebar consumes? Have you seen it's speed? Please compare it to this PR.

    I'm not saying 1316 does not have a lot of quality work in it, but it does require a 24" wide screen and relatively good processing power to be convenient, this PR on the other hand works on a small handheld device. The data fits on your screen, opening member details is instantaneous.

    点赞 评论 复制链接分享
  • weixin_39927144 weixin_39927144 4月前

    , thats disappointing, 1316 conflicts with 1272, both are looking to be merged correct?

    • can you rework this slightly to make your work compatible with 1316 so both options are available on the map? theres def. room for both imo
    点赞 评论 复制链接分享
  • weixin_39547298 weixin_39547298 4月前

    Doesnt work on me, may be I am doing something wrong? I git clone branch https://github.com/SoonDead/PokemonGo-Map/tree/gym-member-details from you and try to run, but no info pop-up when i tap on pokemon with inside gym info.

    点赞 评论 复制链接分享
  • weixin_39852953 weixin_39852953 4月前

    I don't think you are doing something wrong. You might try to run npm run build to rebuild all javascript and sass but otherwise it should work.

    What browser/os did you try it in? Try it in a desktop browser and see if there is a javascript error in the developer console.

    点赞 评论 复制链接分享
  • weixin_39547298 weixin_39547298 4月前

    ok, I'll try, before running I did npm install. I tried on desktop chrome, windows7

    点赞 评论 复制链接分享
  • weixin_39852953 weixin_39852953 4月前

    The exact same version works fine form me in chrome. You could try a Ctrl+F5 on the page to ignore the cache and redownload the javascript in the browser.

    点赞 评论 复制链接分享
  • weixin_39985286 weixin_39985286 4月前

    I want this one to be merged tho!

    点赞 评论 复制链接分享
  • weixin_39927144 weixin_39927144 4月前

    same, #1316 looks great but is cumbersome on mobile devices, i still think both 1316 and this PR would work better together

    点赞 评论 复制链接分享
  • weixin_39869693 weixin_39869693 4月前

    Now, I'm running only this PR, but grunt build task doesn't generate the moves.json file. screen shot 2016-09-20 at 8 04 02 am

    点赞 评论 复制链接分享
  • weixin_39852953 weixin_39852953 4月前

    sorry did not commit moves.json as gitignore hid it and I did not notice

    I'll steal the IV% calculations from #1316 .

    now it will conflict on the moves.json. I should either use the format in #1316 or #1272 . I'll try to figure out something. I especially like the coloring in #1316, I'll probably use the design of that.

    点赞 评论 复制链接分享
  • weixin_39927144 weixin_39927144 4月前

    hmm thats a tough call, i vote #1272, as i've been using that IV pull for a while now and its a really nice update!.

    点赞 评论 复制链接分享
  • weixin_39869693 weixin_39869693 4月前

    -XP I ran npm install and grunt build tasks, but it doesn't work. screen shot 2016-09-19 at 8 40 20 pm

    点赞 评论 复制链接分享
  • weixin_39852953 weixin_39852953 4月前

    Are you maybe pulling in an other PR that involves moves (for example #1271 )? Since I specifically check the move existing in the available moves and display it's number if it does not, it is possible that you have a moves.json but in a different format, where the "name" field is not present.

    An other possibility is that the raw_data response does not include the member's move_1 and move_2 field because the values are missing from the database but I highly doubt it.

    True, if you have any suggestion on the layout do not hesitate to explain. A mockup in paint would be the best.

    点赞 评论 复制链接分享
  • weixin_39938746 weixin_39938746 4月前

    Maybe remove CP altogether and condense hp and moves into 1 line:

    HP 100 | Water Gun, Ice Beam

    I think it should be obvious what water gun and ice beam are without needing to specify those are "Moves"

    点赞 评论 复制链接分享
  • weixin_39985286 weixin_39985286 4月前

    I too, have this problem with undefined moves...

    点赞 评论 复制链接分享
  • weixin_39869693 weixin_39869693 4月前

    I merged this PR with #1272, I'll try running your PR to see if appear undefined moves. Also I'll check my moves.json file. Thanks.

    点赞 评论 复制链接分享
  • weixin_39927144 weixin_39927144 4月前

    i've also merged with #1272 and i get the undefined moves also, ill wait to see a confirmed fix until i mess with it.

    Is it possible to modify the data and include IV on the same line as ATK/DEF/STA so its

    Attack: 15 | Defense: 12 | Stamina: 15 | IV: 91%

    or possibly remove the CP duplicate and replace that with IV %. either way, this is exactly like i had envisioned it should have been from the start, the gym sidebar is really nice on a PC but not as functional on mobile as this PR. Good Job and thanks a bunch!

    点赞 评论 复制链接分享
  • weixin_39869693 weixin_39869693 4月前

    I found a problem, every move appears as undefined on the gym. screen shot 2016-09-19 at 7 20 38 pm

    点赞 评论 复制链接分享
  • weixin_39636707 weixin_39636707 4月前

    did you perform a grunt build or npm install? It almost looks like the moves.min.json file wasn't compiled, thus the undefined moves

    点赞 评论 复制链接分享
  • weixin_39938746 weixin_39938746 4月前

    Probably don't need to display CP twice

    点赞 评论 复制链接分享

相关推荐