@@ -2193,13 +2193,27 @@ function _RepConvGRC() {
2193
2193
function townPopup ( ) {
2194
2194
if ( RepConv . settings [ RepConv . Cookie + '_town_popup' ] ) {
2195
2195
var acc = { } ,
2196
- alliance_name = MM . checkAndPublishRawModel ( 'Player' , { id :Game . player_id } ) . getAllianceName ( )
2196
+ alliance_name = MM . checkAndPublishRawModel ( 'Player' , { id :Game . player_id } ) . getAllianceName ( ) ,
2197
+ heroes = MM . getCollections ( ) [ 'PlayerHero' ] [ 0 ] , heroArray = { } ,
2198
+ i = DM . getl10n ( "heroes" , "common" )
2199
+ $ . each ( heroes . getHeroes ( ) , function ( idh , hhero ) {
2200
+ var o = GameData . heroes [ hhero . getId ( ) ] ;
2201
+ heroArray [ hhero . getOriginTownId ( ) ] = {
2202
+ id : hhero . getId ( ) ,
2203
+ level : hhero . getLevel ( ) ,
2204
+ name : hhero . getName ( ) ,
2205
+ category : i . hero_of [ o . category ] ,
2206
+ txt_lvl : i . level ( hhero . getLevel ( ) )
2207
+ }
2208
+
2209
+ } )
2197
2210
$ . each ( ITowns . towns , function ( ind , town ) {
2198
2211
var cc = town ;
2199
2212
cc . points = cc . getPoints ( ) ,
2200
2213
cc . player_name = Game . player_name ,
2201
2214
cc . alliance_name = alliance_name ,
2202
2215
cc . tooltip = new MousePopup ( WMap . createTownTooltip ( 'town' , cc ) ) ,
2216
+ cc . grcrt_hero = heroArray [ cc . getId ( ) ] ,
2203
2217
acc [ ind ] = cc
2204
2218
2205
2219
} )
@@ -2208,6 +2222,10 @@ function _RepConvGRC() {
2208
2222
// $(et).find($('.town_name')).mousePopup(new MousePopup(WMap.createTownTooltip('town',cc)))
2209
2223
$ ( et ) . find ( $ ( '.town_name' ) ) . mousePopup ( cc . tooltip )
2210
2224
$ ( et ) . addClass ( 'grcrtPopup' )
2225
+ if ( cc . grcrt_hero ) {
2226
+ $ ( et ) . prepend ( '<div class="grcrt_hero hero_icon hero25x25 ' + cc . grcrt_hero . id + '"><div class="value">' + cc . grcrt_hero . level + '</div></div>' )
2227
+ $ ( et ) . find ( $ ( '.grcrt_hero.hero_icon' ) ) . tooltip ( '<div class="ui_hero_tooltip_small"><div class="icon_border"><div class="icon hero50x50 ' + cc . grcrt_hero . id + '"></div></div><b>' + cc . grcrt_hero . name + '</b><br />' + cc . grcrt_hero . category + '<br /><br /><b>' + cc . grcrt_hero . txt_lvl + '</b><br /></div>' )
2228
+ }
2211
2229
} )
2212
2230
2213
2231
}
@@ -3498,6 +3516,10 @@ function _RepConvGRC() {
3498
3516
'.grcrt_brackets:before { content: "("}\n' +
3499
3517
'.grcrt_brackets:after { content: ")"}'
3500
3518
)
3519
+ . append (
3520
+ '.grcrt_hero { float: left; margin: 0 2px;}\n' +
3521
+ '.grcrt_hero.hero_icon .value { color: white; float: right; text-shadow: 1px 1px 0 #000; padding-top: 5px;}'
3522
+ )
3501
3523
)
3502
3524
. append (
3503
3525
$ ( '<style/>' , { 'id' :'grcrt_ft' } )
0 commit comments