Skip to content

Commit a039a50

Browse files
committed
fix(spy report): minor fixes to spy report conversion
1 parent eef0865 commit a039a50

File tree

1 file changed

+42
-3
lines changed

1 file changed

+42
-3
lines changed

modules/GRCRTConverterCtrl.js

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,44 @@ function _GRCRTConverterCtrl(wnd) {
489489
})
490490
genImage(report.resources, 30, GRCRTtpl.rct.genImgM+5, 7.5)
491491
}
492+
function __getReportResourcesSpy(){
493+
RepConv.Debug && console.log("__getReportResources2");
494+
var _UA = {};
495+
report.resources = __initResources(),
496+
report.resources.title = _content.find($('#right_side>h4')).eq(1).html()||' ',
497+
$.each(_content.find($('#right_side>div.spy_success_left_align')).eq(1).find($('li>div.res_background32')), function(indR, elemR){
498+
switch($(elemR).children()[0].className){
499+
case "resources_small wood":
500+
_UA = {
501+
i : 'S1',
502+
b : $(elemR).nextAll().text()
503+
},
504+
report.resources.ua.push(_UA),
505+
report.resources.wood = $(elemR).nextAll().text();
506+
//report.resources.count += RepConvTool.Unit(report.resources.wood, "000") + GRCRTtpl.rct.separator;
507+
break;
508+
case "resources_small stone":
509+
_UA = {
510+
i : 'S2',
511+
b : $(elemR).nextAll().text()
512+
},
513+
report.resources.ua.push(_UA),
514+
report.resources.stone = $(elemR).nextAll().text();
515+
//report.resources.count += RepConvTool.Unit(report.resources.stone, "000") + GRCRTtpl.rct.separator;
516+
break;
517+
case "resources_small iron":
518+
_UA = {
519+
i : 'S3',
520+
b : $(elemR).nextAll().text()
521+
},
522+
report.resources.ua.push(_UA),
523+
report.resources.iron = $(elemR).nextAll().text();
524+
//report.resources.count += RepConvTool.Unit(report.resources.iron, "000") + GRCRTtpl.rct.separator;
525+
break;
526+
}
527+
})
528+
genImage(report.resources, 30, GRCRTtpl.rct.genImgM+5, 7.5)
529+
}
492530
function __getReportBunt(){
493531
RepConv.Debug && console.log("__getReportBunt");
494532
report.bunt = '';
@@ -663,6 +701,7 @@ function _GRCRTConverterCtrl(wnd) {
663701
}
664702
report[site].full.ua.push(_UA),
665703
report[site].splits[rowNumber].ua.push(_UA)
704+
// console.log(report);
666705
colCount++;
667706
}),
668707
genImage(report[site].full),
@@ -1964,14 +2003,14 @@ function _GRCRTConverterCtrl(wnd) {
19642003
|| (_content.find($('div#right_side>.spy_success_left_align')) && _content.find($('div#right_side>.spy_success_left_align')).eq(0).text().trim())
19652004
|| _content.find($('div#right_side>p'))[0].innerHTML.replace(/.*:([0-9]*)/, '$1').trim()
19662005
: '',
1967-
(newForm ? __getReportResources2() : (__getReportResources(), report.resources.title = _content.find($('#right_side>#resources')).prev().html()))
2006+
(newForm ? __getReportResourcesSpy() : (__getReportResources(), report.resources.title = _content.find($('#right_side>#resources')).prev().html()))
19682007
if (report.iron.count != '') {
19692008
report.iron.count = RepConvTool.AddSize(report.iron.count,8);
19702009
}
19712010
try {
19722011
report.god = {
1973-
title : (newForm ? _content.find($('#right_side>h4')).eq(2).html() : ""),
1974-
img_url : (newForm ? RepConvTool.Adds((RepConv.grcrt_cdn+"ui/3/{0}.png").RCFormat((_content.find($('div#right_side>.spy_success_left_align')).eq(2).find($('.god_display .god_mini')).attr('class').split(/\s+/)[1] || 'nogod')), "img") : "")
2012+
title : (newForm ? _content.find($('#right_side>h4')).eq(2).html() + "("+_content.find($('div#right_side>.spy_success_left_align')).eq(2).find($('.god_display .god_micro')).attr('title')+")" : ""),
2013+
img_url : (newForm ? RepConvTool.Adds((RepConv.grcrt_cdn+"ui/3/{0}.png").RCFormat((_content.find($('div#right_side>.spy_success_left_align')).eq(2).find($('.god_display .god_micro')).attr('class').split(/\s+/)[1] || 'nogod')), "img") : "")
19752014
}
19762015
} catch (__err){
19772016
report.god = {

0 commit comments

Comments
 (0)