Skip to content

Commit

Permalink
Bugfixes #90 #92 #95
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Siekiera committed Sep 17, 2019
1 parent 8172b7e commit 65bf14b
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 22 deletions.
12 changes: 12 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
##Changelog - Chrome Extension

#####v2.3.7.1

- Produkt Übersicht:
- Kopf-Filter angepasst [#92](https://github.com/dsiekiera/foe-helfer-extension/issues/92)
- aktive Münzbonus hinzugefügt => korrekte Berechnung [#90](https://github.com/dsiekiera/foe-helfer-extension/issues/90)

- Eigenanteilsrechner:
- Kopierbutton war außer Funktion [#95](https://github.com/dsiekiera/foe-helfer-extension/issues/95)


---

#####v2.3.7

**BugFix**
Expand Down
17 changes: 16 additions & 1 deletion css/web/boxes.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Projekt: foe
*
* erstellt von: Daniel Siekiera <[email protected]>
* zu letzt bearbeitet: 09.09.19, 18:31 Uhr
* zu letzt bearbeitet: 17.09.19, 19:31 Uhr
*
* Copyright © 2019
*
Expand Down Expand Up @@ -169,6 +169,16 @@
color: #FFB539;
}

#costCalculator #costCalculatorBody p.header {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

#costCalculator #costCalculatorBody p.header span {
color: #F3D6A0;
}

#costCalculator #costCalculatorBody strong.error {
color: #ef1616;
}
Expand Down Expand Up @@ -541,6 +551,11 @@
padding-top: 15px;
}

#Productions #ProductionsBody table tr.highlight-row {
background-color: rgba(40, 18, 7, 0.8);
color: #ffb539;
}

#Productions #ProductionsBody table #all-search {
background-color: #F9EBC6;
color: #93795D;
Expand Down
55 changes: 54 additions & 1 deletion js/web/ant.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Projekt: foe
*
* erstellt von: Daniel Siekiera <[email protected]>
* zu letzt bearbeitet: 16.09.19, 21:14 Uhr
* zu letzt bearbeitet: 17.09.19, 18:06 Uhr
*
* Copyright © 2019
*
Expand Down Expand Up @@ -113,6 +113,16 @@ document.addEventListener("DOMContentLoaded", function(){
Menu.BuildOverlayMenu();
}

// --------------------------------------------------------------------------------------------------
// Boosts zusammen tragen
let BoostService = d.find(obj => {
return obj['requestClass'] === 'BoostService' && obj['requestMethod'] === 'getAllBoosts';
});

if(BoostService !== undefined){
MainParser.CollectBoosts(BoostService['responseData']);
}

// --------------------------------------------------------------------------------------------------
// Karte wird gewechselt zum Außenposten
let GridService = d.find(obj => {
Expand Down Expand Up @@ -437,6 +447,24 @@ document.addEventListener("DOMContentLoaded", function(){
*/
MainParser = {

BoostMapper: {
'supplies_boost': 'supply_production',
'happiness' : 'happiness_amount',
'military_boost' : 'att_boost_attacker',
'money_boost' : 'coin_production'
},

/**
* Speichert alle aktiven Boosts
*/
AllBoosts: {
'def_boost_defender': 0,
'happiness_amount': 0,
'att_boost_attacker': 0,
'coin_production': 0,
'supply_production': 0
},

/**
*
*/
Expand Down Expand Up @@ -1059,6 +1087,11 @@ MainParser = {
};

lgs.push(b);

if(d[i]['bonus'] !== undefined && MainParser.BoostMapper[d[i]['bonus']['type']] !== undefined)
{
MainParser.AllBoosts[ MainParser.BoostMapper[ d[i]['bonus']['type'] ] ] += d[i]['bonus']['value']
}
}
}
}
Expand All @@ -1070,6 +1103,26 @@ MainParser = {
},


/**
* Sammelt aktive Boosts der Stadt
*
* @param d
* @constructor
*/
CollectBoosts: (d)=>{
for(let i in d)
{
if(d.hasOwnProperty(i))
{
if(MainParser.AllBoosts[d[i]['type']] !== undefined)
{
MainParser.AllBoosts[d[i]['type']] += d[i]['value']
}
}
}
},


SaveLGInventory: (d)=>{
MainParser.apiCall(d, 'LGInventory');
},
Expand Down
4 changes: 2 additions & 2 deletions js/web/calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Projekt: foe
*
* erstellt von: Daniel Siekiera <[email protected]>
* zu letzt bearbeitet: 07.09.19, 16:45 Uhr
* zu letzt bearbeitet: 17.09.19, 19:26 Uhr
*
* Copyright © 2019
*
Expand Down Expand Up @@ -63,7 +63,7 @@ Calculator = {
h.push('<div class="text-center dark-bg" style="padding:5px 0 3px;">');

// LG - Daten + Spielername
h.push('<p><strong>' + BuildingInfo['name'] + ' - ' + BuildingInfo['player']['name'] + ' </strong><br>' + i18n['Boxes']['Calculator']['Step'] + '' + e['level'] + ' &rarr; ' + (parseInt(e['level']) +1) +'</p>');
h.push('<p class="header"><strong><span>' + BuildingInfo['name'] + '</span> - ' + BuildingInfo['player']['name'] + ' </strong><br>' + i18n['Boxes']['Calculator']['Step'] + '' + e['level'] + ' &rarr; ' + (parseInt(e['level']) +1) +'</p>');


// FP im Lager
Expand Down
9 changes: 4 additions & 5 deletions js/web/part-calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Projekt: foe
*
* erstellt von: Daniel Siekiera <[email protected]>
* zu letzt bearbeitet: 16.09.19, 13:17 Uhr
* zu letzt bearbeitet: 17.09.19, 19:42 Uhr
*
* Copyright © 2019
*
Expand Down Expand Up @@ -651,7 +651,7 @@ Parts = {
'<option value="2"' + (s === '2' ? ' selected' : '') + '>Name LG P1 P2 P3 P4 P5</option>' +
'<option value="3"' + (s === '3' ? ' selected' : '') + '>Name LG P5/4/3/2/1</option>' +
'<option value="4"' + (s === '4' ? ' selected' : '') + '>Name LG P1/2/3/4/5</option>' +
'<option value="5"' + (s === '5' ? ' selected' : '') + '>Name LG P5(FP) P4(FP) P3(FP) P2(FP) P1(FP)</option>' +
'<option value="5"' + (s === '5' ? ' selected' : (s === null ? ' selected' : '') ) + '>Name LG P5(FP) P4(FP) P3(FP) P2(FP) P1(FP)</option>' +
'<option value="6"' + (s === '6' ? ' selected' : '') + '>Name LG P1(FP) P2(FP) P3(FP) P4(FP) P5(FP)</option>' +
'</select></div>';

Expand Down Expand Up @@ -685,7 +685,7 @@ Parts = {

let pn = $('#player-name').val(),
bn = $('#build-name').val(),
sn = $('#chain-scheme option:selected').val();
sn = $('#chain-scheme').val();

if(pn.length !=''){
localStorage.setItem('PlayerCopyName', pn);
Expand All @@ -706,8 +706,7 @@ Parts = {

// wieder zuklappen
Parts.BackGroundBoxAnimation(false);

}, 3000);
}, 1750);


let sol = {
Expand Down
29 changes: 17 additions & 12 deletions js/web/productions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Projekt: foe
*
* erstellt von: Daniel Siekiera <[email protected]>
* zu letzt bearbeitet: 16.09.19, 15:06 Uhr
* zu letzt bearbeitet: 17.09.19, 19:08 Uhr
*
* Copyright © 2019
*
Expand Down Expand Up @@ -39,6 +39,8 @@ Productions = {
'packaging', // Güter Gruppe (5 verschieden z.B.)
],

Boosts: [],

Buildings: [
'greatbuilding',
'residential',
Expand All @@ -58,6 +60,9 @@ Productions = {

Productions.entities = Productions.GetSavedData();

// Münzboost ausrechnen und bereitstellen
Productions.Boosts['money'] = ((MainParser.AllBoosts['coin_production'] + 100) / 100 );

// leere Arrays erzeugen
for(let i in Productions.Types)
{
Expand Down Expand Up @@ -106,14 +111,6 @@ Productions = {
// das Gebäude produziert etwas?
if(building !== false){

/*
// "Alle" - prüfen ob es noch nicht im Array ist
let check = Productions.BuildingsAll.map((el) => el.eid).indexOf(building['eid']);
if(check === -1)
{
Productions.BuildingsAll.push(building);
}
*/
Productions.BuildingsAll.push(building);

// Nach Produkt
Expand Down Expand Up @@ -207,7 +204,15 @@ Productions = {

for(let k in a) {
if(a.hasOwnProperty(k)) {
products[k] = a[k];

// Wenn Münzen, dann Bonus drauf
if(k === 'money')
{
products[k] = (parseInt(a[k]) * Productions.Boosts['money']);;
}
else {
products[k] = a[k]
}
}
}

Expand Down Expand Up @@ -274,7 +279,7 @@ Productions = {

let tds = '<tr>' +
'<td>' + buildings[i]['name'] + '</td>' +
'<td class="text-right is-number">' + Number(buildings[i]['products'][type]).toLocaleString('de-DE') + '</td>' +
'<td class="text-right is-number" data-number="' + buildings[i]['products'][type] + '">' + Number(buildings[i]['products'][type]).toLocaleString('de-DE') + '</td>' +
'<td class="wsnw is-date" data-date="' + moment.unix(buildings[i]['at']).format('YYYY-MM-DD HH:mm') + '">' + moment.unix(buildings[i]['at']).format('DD.MM.YYYY HH:mm') + ' Uhr</td>' +
'<td>' + moment.unix(buildings[i]['at']).fromNow() + '</td>' +
'</tr>';
Expand Down Expand Up @@ -326,7 +331,7 @@ Productions = {
let tds = '<tr>' +
'<td colspan="1" class="text-right">' + groups[i]['count'] + 'x </td>' +
'<td colspan="2">' + groups[i]['name'] + '</td>' +
'<td colspan="1" class="is-number">' + Number(groups[i]['products']).toLocaleString('de-DE') + '</td>' +
'<td colspan="1" class="is-number" data-number="' + groups[i]['products'] + '">' + Number(groups[i]['products']).toLocaleString('de-DE') + '</td>' +
'</tr>';

rowB.push(tds);
Expand Down
5 changes: 4 additions & 1 deletion vendor/tableSorter/table-sorter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Projekt: foe
*
* erstellt von: Daniel Siekiera <[email protected]>
* zu letzt bearbeitet: 16.09.19, 15:08 Uhr
* zu letzt bearbeitet: 17.09.19, 17:05 Uhr
*
* Copyright © 2019
*
Expand Down Expand Up @@ -180,9 +180,12 @@

} else if (type === 'numeric') {
let i = 0;
rtn = $(elm).children('td').eq(column).data('number');
/*
rtn = parseFloat(val.replace(/[\.\D\%]/g, function (match) {
return match === "." ? (i++ === 0 ? '.' : '') : '';
}));
*/

} else if ('caseSensitive' === type) {
rtn = assignNumberToString(val);
Expand Down

0 comments on commit 65bf14b

Please sign in to comment.