From 3040b17e53bd1f72039dfb819167da4c4b09c09b Mon Sep 17 00:00:00 2001 From: Areso Date: Tue, 2 Jul 2019 01:21:32 +0500 Subject: [PATCH] fix stat screen bugs --- index.html | 55 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/index.html b/index.html index 626fce03..d24650f7 100644 --- a/index.html +++ b/index.html @@ -1140,12 +1140,13 @@

How to play

year.innerHTML = ""; pop.innerHTML = ""; popPage = Math.round(game.years.length)/10; + //console.log('checkPop '+popPage); if (game.years.length > 10) { //select the latest 10 for (i=0;i<10;i++) { year.innerHTML = year.innerHTML +''+ game.years[game.years.length-10+i] +''; pop.innerHTML = pop.innerHTML +''+ game.pops[game.years.length-10+i] +''; - console.log('period is '+game.years[game.years.length-10+i]+' and pop is '+game.pops[game.years.length-10+i]); + //console.log('period is '+game.years[game.years.length-10+i]+' and pop is '+game.pops[game.years.length-10+i]); } openTab(null, 'tabPopulation'); } else { @@ -1154,7 +1155,7 @@

How to play

for (i=0;i'+ game.years[game.years.length-game.years.length+i] +''; pop.innerHTML = pop.innerHTML +''+ game.pops[game.years.length-game.years.length+i] +''; - console.log('period is '+game.years[game.years.length-game.years.length+i]+' and pop is '+game.pops[game.years.length-game.years.length+i]); + //console.log('period is '+game.years[game.years.length-game.years.length+i]+' and pop is '+game.pops[game.years.length-game.years.length+i]); } openTab(null, 'tabPopulation'); } else { @@ -1168,12 +1169,13 @@

How to play

year.innerHTML = ""; pop.innerHTML = ""; popPage = 0; + //console.log('popStart '+popPage); if (game.years.length > 10) { //select the latest 10 for (i=0;i<10;i++) { year.innerHTML = year.innerHTML +''+ game.years[i] +''; pop.innerHTML = pop.innerHTML +''+ game.pops[i] +''; - console.log('period is '+game.years[i]+' and pop is '+game.pops[i]); + //console.log('period is '+game.years[i]+' and pop is '+game.pops[i]); } openTab(null, 'tabPopulation'); } else { @@ -1182,7 +1184,7 @@

How to play

for (i=0;i'+ game.years[i] +''; pop.innerHTML = pop.innerHTML +''+ game.pops[i] +''; - console.log('period is '+game.years[i]+' and pop is '+game.pops[i]); + //console.log('period is '+game.years[i]+' and pop is '+game.pops[i]); } openTab(null, 'tabPopulation'); } else { @@ -1197,15 +1199,17 @@

How to play

pop.innerHTML = ""; if (popPage - 1 > 0) { popPage = popPage-1; + } else { + popPage = 0; } popPage = Math.round(popPage*10)/10; - console.log(popPage); + //console.log('popPrev is '+popPage); if (game.years.length > 10) { //select the latest 10 for (i=0;i<10;i++) { year.innerHTML = year.innerHTML +''+ game.years[popPage*10+i] +''; pop.innerHTML = pop.innerHTML +''+ game.pops[popPage*10+i] +''; - console.log('period is '+game.years[popPage*10+i]+' and pop is '+game.pops[popPage*10+i]); + //console.log('period is '+game.years[popPage*10+i]+' and pop is '+game.pops[popPage*10+i]); } openTab(null, 'tabPopulation'); } else { @@ -1214,7 +1218,7 @@

How to play

for (i=0;i'+ game.years[game.years.length-game.years.length+i] +''; pop.innerHTML = pop.innerHTML +''+ game.pops[game.years.length-game.years.length+i] +''; - console.log('period is '+game.years[game.years.length-game.years.length+i]+' and pop is '+game.pops[game.years.length-game.years.length+i]); + //console.log('period is '+game.years[game.years.length-game.years.length+i]+' and pop is '+game.pops[game.years.length-game.years.length+i]); } openTab(null, 'tabPopulation'); } else { @@ -1229,15 +1233,17 @@

How to play

pop.innerHTML = ""; if (popPage + 1 < Math.round(game.years.length)/10-1 ) { popPage = popPage+1; + } else { + popPage = Math.round(game.years.length)/10-1; } popPage = Math.round(popPage*10)/10; - console.log(popPage); + //console.log('popNext is '+popPage); if (game.years.length > 10) { //select the latest 10 for (i=0;i<10;i++) { year.innerHTML = year.innerHTML +''+ game.years[popPage*10+i] +''; pop.innerHTML = pop.innerHTML +''+ game.pops[popPage*10+i] +''; - console.log('period is '+game.years[popPage*10+i]+' and pop is '+game.pops[popPage*10+i]); + //console.log('period is '+game.years[popPage*10+i]+' and pop is '+game.pops[popPage*10+i]); } openTab(null, 'tabPopulation'); } else { @@ -1246,7 +1252,7 @@

How to play

for (i=0;i'+ game.years[game.years.length-game.years.length+i] +''; pop.innerHTML = pop.innerHTML +''+ game.pops[game.years.length-game.years.length+i] +''; - console.log('period is '+game.years[game.years.length-game.years.length+i]+' and pop is '+game.pops[game.years.length-game.years.length+i]); + //console.log('period is '+game.years[game.years.length-game.years.length+i]+' and pop is '+game.pops[game.years.length-game.years.length+i]); } openTab(null, 'tabPopulation'); } else { @@ -1270,7 +1276,7 @@

How to play

for (i=0;i<10;i++) { year.innerHTML = year.innerHTML +''+ game.years[game.years.length-10+i] +''; gold.innerHTML = gold.innerHTML +''+ game.budgets[game.years.length-10+i] +''; - console.log('period is '+game.years[game.years.length-10+i]+' and gold is '+game.budgets[game.years.length-10+i]); + //console.log('period is '+game.years[game.years.length-10+i]+' and gold is '+game.budgets[game.years.length-10+i]); } openTab(null, 'tabGold'); } else { @@ -1279,7 +1285,7 @@

How to play

for (i=0;i'+ game.years[game.years.length-game.years.length+i] +''; gold.innerHTML = gold.innerHTML +''+ game.budgets[game.years.length-game.years.length+i] +''; - console.log('period is '+game.years[game.years.length-game.years.length+i]+' and gold is '+game.budgets[game.years.length-game.years.length+i]); + //console.log('period is '+game.years[game.years.length-game.years.length+i]+' and gold is '+game.budgets[game.years.length-game.years.length+i]); } openTab(null, 'tabGold'); } else { @@ -1298,7 +1304,7 @@

How to play

for (i=0;i<10;i++) { year.innerHTML = year.innerHTML +''+ game.years[i] +''; gold.innerHTML = gold.innerHTML +''+ game.budgets[i] +''; - console.log('period is '+game.years[i]+' and gold is '+game.budgets[i]); + //console.log('period is '+game.years[i]+' and gold is '+game.budgets[i]); } openTab(null, 'tabGold'); } else { @@ -1307,7 +1313,7 @@

How to play

for (i=0;i'+ game.years[i] +''; gold.innerHTML = gold.innerHTML +''+ game.budgets[i] +''; - console.log('period is '+game.years[i]+' and gold is '+game.budgets[i]); + //console.log('period is '+game.years[i]+' and gold is '+game.budgets[i]); } openTab(null, 'tabGold'); } else { @@ -1322,15 +1328,17 @@

How to play

gold.innerHTML = ""; if (goldPage - 1 > 0) { goldPage = goldPage-1; + } else { + goldPage = 0; } goldPage = Math.round(goldPage*10)/10; - console.log(goldPage); + //console.log(goldPage); if (game.years.length > 10) { //select the latest 10 for (i=0;i<10;i++) { year.innerHTML = year.innerHTML +''+ game.years[goldPage*10+i] +''; gold.innerHTML = gold.innerHTML +''+ game.budgets[goldPage*10+i] +''; - console.log('period is '+game.years[goldPage*10+i]+' and gold is '+game.budgets[goldPage*10+i]); + //console.log('period is '+game.years[goldPage*10+i]+' and gold is '+game.budgets[goldPage*10+i]); } openTab(null, 'tabGold'); } else { @@ -1339,7 +1347,7 @@

How to play

for (i=0;i'+ game.years[game.years.length-game.years.length+i] +''; gold.innerHTML = gold.innerHTML +''+ game.budgets[game.years.length-game.years.length+i] +''; - console.log('period is '+game.years[game.years.length-game.years.length+i]+' and gold is '+game.budgets[game.years.length-game.years.length+i]); + //console.log('period is '+game.years[game.years.length-game.years.length+i]+' and gold is '+game.budgets[game.years.length-game.years.length+i]); } openTab(null, 'tabGold'); } else { @@ -1354,15 +1362,17 @@

How to play

gold.innerHTML = ""; if (goldPage + 1 < Math.round(game.years.length)/10-1 ) { goldPage = goldPage+1; + } else { + goldPage = Math.round(game.years.length)/10-1; } goldPage = Math.round(goldPage*10)/10; - console.log(goldPage); + //console.log(goldPage); if (game.years.length > 10) { //select the latest 10 for (i=0;i<10;i++) { year.innerHTML = year.innerHTML +''+ game.years[goldPage*10+i] +''; gold.innerHTML = gold.innerHTML +''+ game.budgets[goldPage*10+i] +''; - console.log('period is '+game.years[popPage*10+i]+' and pop is '+game.budgets[goldPage*10+i]); + //console.log('period is '+game.years[popPage*10+i]+' and pop is '+game.budgets[goldPage*10+i]); } openTab(null, 'tabGold'); } else { @@ -1371,7 +1381,7 @@

How to play

for (i=0;i'+ game.years[game.years.length-game.years.length+i] +''; gold.innerHTML = gold.innerHTML +''+ game.budgets[game.years.length-game.years.length+i] +''; - console.log('period is '+game.years[game.years.length-game.years.length+i]+' and pop is '+game.budgets[game.years.length-game.years.length+i]); + //console.log('period is '+game.years[game.years.length-game.years.length+i]+' and pop is '+game.budgets[game.years.length-game.years.length+i]); } openTab(null, 'tabGold'); } else { @@ -1577,6 +1587,11 @@

How to play

composite_gm(); } function populatePatchnotes() { + msg = "version 1.0.222"; + writeToTextArea(msg); + msg = "fixed bugs on stats screens"; + writeToTextArea(msg); + msg = "version 1.0.219"; writeToTextArea(msg); msg = "fixed imbalance of execution citizens";