-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Daniel Siekiera
committed
Sep 17, 2019
1 parent
8172b7e
commit 65bf14b
Showing
7 changed files
with
109 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
* | ||
|
@@ -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; | ||
} | ||
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
* | ||
|
@@ -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 => { | ||
|
@@ -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 | ||
}, | ||
|
||
/** | ||
* | ||
*/ | ||
|
@@ -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'] | ||
} | ||
} | ||
} | ||
} | ||
|
@@ -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'); | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
* | ||
|
@@ -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'] + ' → ' + (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'] + ' → ' + (parseInt(e['level']) +1) +'</p>'); | ||
|
||
|
||
// FP im Lager | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
* | ||
|
@@ -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>'; | ||
|
||
|
@@ -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); | ||
|
@@ -706,8 +706,7 @@ Parts = { | |
|
||
// wieder zuklappen | ||
Parts.BackGroundBoxAnimation(false); | ||
|
||
}, 3000); | ||
}, 1750); | ||
|
||
|
||
let sol = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
* | ||
|
@@ -39,6 +39,8 @@ Productions = { | |
'packaging', // Güter Gruppe (5 verschieden z.B.) | ||
], | ||
|
||
Boosts: [], | ||
|
||
Buildings: [ | ||
'greatbuilding', | ||
'residential', | ||
|
@@ -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) | ||
{ | ||
|
@@ -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 | ||
|
@@ -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] | ||
} | ||
} | ||
} | ||
|
||
|
@@ -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>'; | ||
|
@@ -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); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
* | ||
|
@@ -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); | ||
|