Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 11 additions & 0 deletions common/RepConvTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -867,4 +867,15 @@ function _RepConvTool() {
$('<script/>',{'type':"text/template", 'id':"tpl_grcrt_button"})
.text('<div class="left"></div><div class="right"></div><div class="caption js-caption"><% if (icon && icon_position === \'left\') { %><div class="icon"></div><% } %><img src="https://cdn.grcrt.net/img/octopus.png" style="width: 20px;float:left;margin: 0px 5px 0px -6px"><%= caption %><% if (icon && icon_position === \'right\') { %><div class="icon"></div><% } %><div class="effect js-effect"></div></div>')
);
this.getPlayerId4Name = function(pName){
var _ret = undefined;
try{
$.each(RepConv.cachePlayers, function(pId,pData){
if (pData.name == pName)
_ret = pData.id;
})
return _ret;
} catch(e){}
return null;
}
}
1 change: 1 addition & 0 deletions langs/RepConvV2EN.full.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ RepConvLangArray.en = {
HASRESEARCH:'DO',
NORESEARCH:'DO NOT',
SETTINGSAVED:'Settings for [city] have been saved',
BTNRESET:'reset',
},
RESWND:{
RESLEFT:'resources left to send',
Expand Down
1 change: 1 addition & 0 deletions langs/RepConvV2PL.full.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ RepConvLangArray.pl = {
HASRESEARCH:'MASZ',
NORESEARCH:'NIE MASZ',
SETTINGSAVED:'Ustawienia dla miasta [city] zostały zapisane',
BTNRESET:'usuń ustawienia',
},
RESWND:{
RESLEFT:'pozostało do wysłania',
Expand Down
45 changes: 42 additions & 3 deletions modules/GRCRTConverterCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,44 @@ function _GRCRTConverterCtrl(wnd) {
})
genImage(report.resources, 30, GRCRTtpl.rct.genImgM+5, 7.5)
}
function __getReportResourcesSpy(){
RepConv.Debug && console.log("__getReportResources2");
var _UA = {};
report.resources = __initResources(),
report.resources.title = _content.find($('#right_side>h4')).eq(1).html()||' ',
$.each(_content.find($('#right_side>div.spy_success_left_align')).eq(1).find($('li>div.res_background32')), function(indR, elemR){
switch($(elemR).children()[0].className){
case "resources_small wood":
_UA = {
i : 'S1',
b : $(elemR).nextAll().text()
},
report.resources.ua.push(_UA),
report.resources.wood = $(elemR).nextAll().text();
//report.resources.count += RepConvTool.Unit(report.resources.wood, "000") + GRCRTtpl.rct.separator;
break;
case "resources_small stone":
_UA = {
i : 'S2',
b : $(elemR).nextAll().text()
},
report.resources.ua.push(_UA),
report.resources.stone = $(elemR).nextAll().text();
//report.resources.count += RepConvTool.Unit(report.resources.stone, "000") + GRCRTtpl.rct.separator;
break;
case "resources_small iron":
_UA = {
i : 'S3',
b : $(elemR).nextAll().text()
},
report.resources.ua.push(_UA),
report.resources.iron = $(elemR).nextAll().text();
//report.resources.count += RepConvTool.Unit(report.resources.iron, "000") + GRCRTtpl.rct.separator;
break;
}
})
genImage(report.resources, 30, GRCRTtpl.rct.genImgM+5, 7.5)
}
function __getReportBunt(){
RepConv.Debug && console.log("__getReportBunt");
report.bunt = '';
Expand Down Expand Up @@ -663,6 +701,7 @@ function _GRCRTConverterCtrl(wnd) {
}
report[site].full.ua.push(_UA),
report[site].splits[rowNumber].ua.push(_UA)
// console.log(report);
colCount++;
}),
genImage(report[site].full),
Expand Down Expand Up @@ -1964,14 +2003,14 @@ function _GRCRTConverterCtrl(wnd) {
|| (_content.find($('div#right_side>.spy_success_left_align')) && _content.find($('div#right_side>.spy_success_left_align')).eq(0).text().trim())
|| _content.find($('div#right_side>p'))[0].innerHTML.replace(/.*:([0-9]*)/, '$1').trim()
: '',
(newForm ? __getReportResources2() : (__getReportResources(), report.resources.title = _content.find($('#right_side>#resources')).prev().html()))
(newForm ? __getReportResourcesSpy() : (__getReportResources(), report.resources.title = _content.find($('#right_side>#resources')).prev().html()))
if (report.iron.count != '') {
report.iron.count = RepConvTool.AddSize(report.iron.count,8);
}
try {
report.god = {
title : (newForm ? _content.find($('#right_side>h4')).eq(2).html() : ""),
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") : "")
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')+")" : ""),
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") : "")
}
} catch (__err){
report.god = {
Expand Down
22 changes: 20 additions & 2 deletions modules/RepConvABH.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ function _RepConvABH(){
.append(
'.grcrt_abh_unit_wrapper {'+
'position: absolute;'+
'top: 135px;'+
'left: 120px;'+
'top: 190px;'+
'left: 35px;'+
'cursor:pointer;'+
'}'
)
Expand Down Expand Up @@ -330,6 +330,24 @@ function _RepConvABH(){
)
.appendTo("#GRCRT_abh_settings .GRCRT_abh_buttons")
.css("margin", "auto"),
$(RepConvForm.button(RepConvTool.GetLabel('ABH.WND.BTNRESET')))
.click(
function(){
var storeArr = RepConvABH.savedArr || {},
thisTown = Game.townId;
delete storeArr[thisTown]
RepConvABH.savedArr = storeArr,
RepConvTool.setItem(RepConv.CookieUnitsABH,JSON.stringify(RepConvABH.savedArr));
if (RepConv.Debug) console.log(JSON.stringify(storeArr));
//GRCRTabhWnd.close();
(GRCRTabhWnd.getJQElement()).find($('.tech_tree_box span.research_icon')).addClass('inactive is_researched grcrt_set')
setTimeout(function(){
HumanMessage.success(RepConvTool.GetLabel('ABH.WND.SETTINGSAVED').replace('[city]',Game.townName))
},0)
}
)
.appendTo("#GRCRT_abh_settings .GRCRT_abh_buttons")
.css("margin", "auto"),
fillForm(abhUnit);
}
function onClick(that){
Expand Down
Loading