Skip to content

Commit 2f3033f

Browse files
authored
Merge pull request #8 from grcrt/revert-7-development
Revert "Development"
2 parents 843aa5f + a6f3440 commit 2f3033f

File tree

4 files changed

+114
-14
lines changed

4 files changed

+114
-14
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Below you will find a set of guidelines for contributing to the GRCRT project. T
2929

3030
## Code of Conduct
3131

32-
This project and everyone participating in it is governed by the GRCRT [Code of Conduct](https://github.com/grcrt/grcrt-script/blob/master/.github/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [developer@grcrt.net](mailto:developer@grcrt.net).
32+
This project and everyone participating in it is governed by the GRCRT [Code of Conduct](https://github.com/grcrt/grcrt-script/blob/docs/.github/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [developer@grcrt.net](mailto:developer@grcrt.net).
3333

3434

3535
## What should I know before I get started?

GRCRT.f.errReporter.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ function grcrtErrReporter(err){
3636
sendErr()
3737
} else {
3838
console.log(_json);
39-
if(typeof Layout == "object" && typeof Layout.showConfirmDialog == "function"){
4039
Layout.showConfirmDialog(
4140
"GRCRTools oops!",
4241
'<div><img src="'+RepConv.grcrt_cdn+'img/octopus.png" style="float:left;padding-right: 10px"/><p style="padding:5px"><b>Found error</b><br/><pre>'+err+'</pre><br/>You want send?</p></div>',
@@ -45,10 +44,5 @@ function grcrtErrReporter(err){
4544
sendErr()
4645
}
4746
)
48-
} else {
49-
setTimeout(function(){
50-
grcrtErrReporter(err);
51-
},500);
52-
}
5347
}
5448
}

modules/GRCRT_AO.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function _GRCRT_AO() {
2525
,
2626
_scrollWidth = Object.size(GameData.researches)*(40+_aoMargin*2),
2727
_scrollLock = false,
28-
_towns = null,//MM.getCollections().Town[0],
28+
_towns = MM.getCollections().Town[0],
2929
_researchMode = true,
3030
_researchQueue = {};
3131

modules/RepConvGRC.js

Lines changed: 112 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ function _RepConvGRC() {
470470
.mousePopup(new MousePopup(RepConvTool.GetLabel('STATS.PLAYER')));
471471
if ("https:" == window.location.protocol && (RepConv.active.statsGRCL != 'potusek')) {
472472
$(_link).attr({
473+
//'href' : getStatsLink('player', $(this).attr('player_id'), $(this).attr('player_name')),
473474
'href' : getStatsLink('player', _player, _player_name),
474475
'target' : '_blank'
475476
})
@@ -1696,18 +1697,41 @@ function _RepConvGRC() {
16961697
function showStats(what, who_id, who_name){
16971698
var
16981699
RepConvNode = $('<div/>', {'id': 'RepConvNode'});
1699-
if (RepConv.active.statsGRCL == 'potusek') {
1700+
// if (RepConv.active.statsGRCL == 'grepostats') {
1701+
// var website = getStatsLink(what, who_id, who_name);
1702+
// RepConvNode.append($('<iframe/>', {'src': website, 'style': 'width: 975px; height: 480px;'}));
1703+
// Layout.dialogWindow.open(RepConvNode.html().toString(), RepConvTool.GetLabel('STATS.'+what.toUpperCase()), 975, 480, null, false).setPosition("center", "center");
1704+
// } else
1705+
if (RepConv.active.statsGRCL == 'grepointel') {
1706+
if (what == 'player') {
1707+
what = 'pn';
1708+
} else if (what == 'alliance') {
1709+
what = 'an'
1710+
}
1711+
var website = getStatsLink(what, who_id, who_name);
1712+
RepConvNode.append($('<iframe/>', {'src': website, 'style': 'width: 1020px; height: 580px;'}));
1713+
Layout.dialogWindow.open(RepConvNode.html().toString(), RepConvTool.GetLabel('STATS.'+what.toUpperCase()), 1020, 580, null, false).setPosition("center", "center");
1714+
} else {
1715+
//try {
1716+
// (WM.getWindowByType("grcrt_stats")[0]).close()
1717+
//} catch (e){}
17001718
WF.open("grcrt_stats",{
17011719
args: {
17021720
'what': what,
17031721
'id': who_id,
17041722
'name': who_name
17051723
}
17061724
})
1725+
//var website = RepConv.grcrt_domain+'light/'+what+'/' + Game.world_id + '/' + who_id + '/' + Game.locale_lang;
1726+
//RepConvNode.append($('<iframe/>', {'src': website, 'style': 'width: 825px; height: 625px; border: 0px'}));
1727+
//Layout.dialogWindow.open(RepConvNode.html().toString(), RepConvTool.GetLabel('STATS.'+what.toUpperCase()), 825, 690, function(){},false).setPosition("center", "center");
17071728
}
17081729
}
17091730
function getStatsLink(what, who_id, who_name){
17101731
var website;
1732+
// if (RepConv.active.statsGRCL == 'grepostats') {
1733+
// website = 'http://' + Game.market_id + '.grepostats.com/world/' + Game.world_id + '/'+what+'/' + who_id;
1734+
// } else
17111735
if (RepConv.active.statsGRCL == 'grepointel') {
17121736
if (what == 'player') {
17131737
what = 'pn';
@@ -1768,6 +1792,72 @@ function _RepConvGRC() {
17681792
} catch (e){}
17691793
}
17701794

1795+
//function wonderLinks(RCGP) {
1796+
// if (RCGP.getJQElement().find($('.grcrt_linkbox')).length == 0) {
1797+
// RCGP.setHeight(540)
1798+
// var _div = $('<div/>',{'class':'grcrt_linkbox'})
1799+
// .css({'margin': '0px 5px 10px 0px','padding': '0 30px'});
1800+
// _div
1801+
// .append(
1802+
// $('<a/>',{
1803+
// 'href':'http://devpotusek.potusek.eu/'+Game.locale_lang+'/wonder/'+Game.world_id+'/'+Game.alliance_id+'/'+RepConv.hash+'#'+WorldWonders.all_wonders[WorldWonders.wonder_nr].wonder_type,'target':'_blank'})
1804+
// .css({'float': 'left'})
1805+
// .html('Pokaż mój udział w budowie')
1806+
// )
1807+
// if (MM.checkAndPublishRawModel('Player', {id : Game.player_id}).getAllianceRights().founder || MM.checkAndPublishRawModel('Player', {id : Game.player_id}).getAllianceRights().leader) {
1808+
// _div
1809+
// .append(
1810+
// $('<a/>',{
1811+
// 'href':'http://devpotusek.potusek.eu/'+Game.locale_lang+'/wonder/'+Game.world_id+'/'+Game.alliance_id+'/'+($.md5(Game.alliance_id + "_" + Game.world_id))+'#'+WorldWonders.all_wonders[WorldWonders.wonder_nr].wonder_type,'target':'_blank'})
1812+
// .css({'float': 'right'})
1813+
// .html('Pokaż udział członków sojuszu w budowie')
1814+
// )
1815+
// }
1816+
// _div
1817+
// .append(
1818+
// $('<br/>').css('clear','both')
1819+
// )
1820+
// _div
1821+
// .insertAfter(RCGP.getJQElement().find($('.gpwindow_content>.wonder_state>.game_border')).eq(0))
1822+
// }
1823+
//}
1824+
1825+
function logWonderSend(data){
1826+
// var
1827+
// _wonder = wonders[data.island_x+'_'+data.island_y],
1828+
// _json = {
1829+
// lang:Game.world_id.substr(0,2),
1830+
// world:Game.world_id,
1831+
// wonder_id:WorldWonders.all_wonders[_wonder].id,
1832+
// wonder_lvl:WorldWonders.all_wonders[_wonder].expansion_stage,
1833+
// alliance_id:MM.checkAndPublishRawModel("Player", {
1834+
// id: Game.player_id
1835+
// }).getAllianceId(),
1836+
// player_id:Game.player_id,
1837+
// wood:data.wood,
1838+
// stone:data.stone,
1839+
// iron:data.iron,
1840+
// power:data.power,
1841+
// wonder_type: WorldWonders.all_wonders[_wonder].wonder_type,
1842+
// wonder_name: JSON.parse(
1843+
// RepConvTool.Atob(
1844+
// $('a.gp_goto_wonder_link').attr('href')
1845+
// )
1846+
// ).name,
1847+
// player_hash : RepConv.hash,
1848+
// alliance_hash : $.md5(MM.checkAndPublishRawModel("Player", {
1849+
// id: Game.player_id
1850+
// }).getAllianceId() + "_" + Game.world_id)
1851+
// },
1852+
// _send = $.ajax({
1853+
// 'url' : RepConv.grcrt_domain+'wonder.php',
1854+
// 'method' : 'post',
1855+
// 'data' : {json:(JSON.stringify(_json))},
1856+
// 'cache':false,
1857+
// 'async':true
1858+
// });
1859+
}
1860+
17711861
function posibleSpell(RCGP){
17721862
if (RepConv.active.power) {
17731863
switch (RCGP.getContext().sub) {
@@ -1778,6 +1868,9 @@ function _RepConvGRC() {
17781868
.css('opacity','0.4')
17791869
.attr('href',null)
17801870
.attr('onclick',null);
1871+
//$.each(RCGP.getJQElement().find($('.js-power-icon').filter(function(){return !$(this).hasClass('disabled')})), function(ind, elem){
1872+
// $(elem).find($('div[name=counter]')).remove()
1873+
//})
17811874

17821875
RepConv.Debug && console.log('loadPower');
17831876
$.each(RCGP.getJQElement().find($('.js-power-icon div[name=counter]')), function(ind, elem) {
@@ -1893,10 +1986,10 @@ function _RepConvGRC() {
18931986
),
18941987
resEmo = $('<fieldset/>', {'style': 'float:right; width:370px; min-height: 250px;'})
18951988

1896-
var chbx = {}
1897-
$.each(RepConv.sChbxs, function(opt, optData){
1898-
chbx[opt] = genCheckBox(opt, RepConv.settings[opt], optData.label)
1899-
})
1989+
var chbx = {}
1990+
$.each(RepConv.sChbxs, function(opt, optData){
1991+
chbx[opt] = genCheckBox(opt, RepConv.settings[opt], optData.label)
1992+
})
19001993

19011994
// cPower = genCheckBox(RepConv.CookiePower, RepConv.active.power, 'CHKPOWERNAME'),
19021995
// cFTabs = genCheckBox(RepConv.CookieForumTabs, RepConv.active.ftabs, 'CHKFORUMTABS'),
@@ -1911,15 +2004,16 @@ function _RepConvGRC() {
19112004

19122005
// cbBuPo = genCheckBox(RepConv.Cookie+'_bupo', RepConv.settings[RepConv.Cookie+'_bupo'], 'CHKBUPO'),
19132006

1914-
var
19152007
cSLoop = genCheckBox('GRCRTsoundLoop',RepConv.active.sounds.loop, 'CHKSOUNDLOOP'),
19162008
cSMute = genCheckBox('GRCRTsoundMute',RepConv.active.sounds.mute, 'POPSOUNDMUTE'),
19172009
sStats = $('<div/>',{'id':'statsGRC2Sel','class':'dropdown default','style':'margin-left:5px;width: 150px;'})
19182010
.dropdown({
19192011
list_pos : 'left',
19202012
value : RepConv.active.statsGRCL,
19212013
options : [
2014+
//{value: 'potusek', name: 'grepolis.potusek.eu'},
19222015
{value: 'potusek', name: 'www.grcrt.net'},
2016+
//{value: 'grepostats', name: "grepostats.com"},
19232017
{value: 'grepointel', name: "grepointel.com"}
19242018
]
19252019
})
@@ -2185,6 +2279,17 @@ function _RepConvGRC() {
21852279
}
21862280
}
21872281

2282+
var acc = {}, alliance_name = MM.checkAndPublishRawModel('Player',{id:Game.player_id}).getAllianceName()
2283+
$.each(ITowns.towns, function(ind,town){
2284+
var cc = town;
2285+
cc.points = cc.getPoints();
2286+
cc.player_name = Game.player_name
2287+
cc.alliance_name = alliance_name
2288+
acc[ind]=cc
2289+
})
2290+
2291+
2292+
21882293
function emotsTabs(wndType, action){//insertArea){
21892294
var content = $('<div/>', {'class': 'gpwindow_content', 'style': 'overflow-y:auto !important; max-height: 185px; min-height: 120px;'}),
21902295
contentLinks = $('<ul/>', {'class':'menu_inner grcrt_menu_inner', 'style':'padding: 0px;left:0px;'}),
@@ -3290,6 +3395,7 @@ function _RepConvGRC() {
32903395
json.iron = (settings.url.indexOf('decrease_build_time_with_favor')>-1) ? 0 : json.iron,
32913396
json.power = (settings.url.indexOf('decrease_build_time_with_favor')>-1) ? 400 : 0,
32923397
RepConv.Debug && console.log(json);
3398+
// logWonderSend(json);
32933399
}
32943400
//} catch (e){}
32953401
$.each(Layout.wnd.getAllOpen(), function(ind, elem) {

0 commit comments

Comments
 (0)