Skip to content

Commit

Permalink
Merge pull request #96 from mainIine/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
Th3OnlyC0D3R authored Apr 30, 2021
2 parents cd93fdb + 6a38a8e commit 1c29a96
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 19 deletions.
13 changes: 8 additions & 5 deletions js/web/_i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
"Boxes.FPCollector.battlegrounds_conquest": "Gefechts-Belohnung",
"Boxes.FPCollector.chest": "Begegnungsbelohnung",
"Boxes.FPCollector.chestEvent": "Event Belohnung",
"Boxes.FPCollector.chestEventGrandPrize": "Event Liga-Ergebniss",
"Boxes.FPCollector.collectReward": "Belohnung",
"Boxes.FPCollector.dailyChallenges": "Tägliche Herausforderung",
"Boxes.FPCollector.diplomaticGifts": "diplomatisches Geschenk",
Expand Down Expand Up @@ -310,22 +311,25 @@
"Boxes.Investment.DateParseErrorDesc": "Das Datum \"__InvalidDate__\" konnte nicht geparsed werden",
"Boxes.Investment.HiddenGB": "versteckte LG",
"Boxes.Investment.InvestBar": "Investierte FP: ",
"Boxes.Investment.Overview.AdditionalColumns": "zusätzliche Spalten",
"Boxes.Investment.Overview.Blueprints": "Blaupausen",
"Boxes.Investment.Overview.Building": "Gebäude",
"Boxes.Investment.Overview.EntryTime": "Eintragszeit",
"Boxes.Investment.Overview.EntryTimeDesc": "Wann wurde die erste Einzahlung erfasst?",
"Boxes.Investment.Overview.HideGB": "LG aus Berechnung und Liste ausblenden.",
"Boxes.Investment.Overview.Invested": "Investiert",
"Boxes.Investment.Overview.InvestedDesc": "Wieviele FP wurden investiert?",
"Boxes.Investment.Overview.Medals": "Medaillen",
"Boxes.Investment.Overview.Player": "Spieler",
"Boxes.Investment.Overview.Profit": "Gewinn",
"Boxes.Investment.Overview.ProfitDesc": "erzielter Gewinn, gelb -> Platz ist noch nicht sicher, rot/grün -> Verlust/Gewinn sicher",
"Boxes.Investment.Overview.Progress": "Fortschritt",
"Boxes.Investment.Overview.RemainingFP": "verbleibende FP",
"Boxes.Investment.Overview.RestFP": "Rest FP",
"Boxes.Investment.Overview.RestFPDesc": "Wieviele FP noch bis zum leveln?",
"Boxes.Investment.Overview.SettingsEntryTime": "zeige Eintragsdatum",
"Boxes.Investment.Overview.SettingsEntryTime": "Eintragsdatum",
"Boxes.Investment.Overview.SettingsHiddenGB": "zeige ausgeblendete LG",
"Boxes.Investment.Overview.SettingsRestFP": "zeige restliche FP",
"Boxes.Investment.Overview.SettingsRestFP": "restliche FP",
"Boxes.Investment.Overview.SettingsSave": "Speichern",
"Boxes.Investment.Overview.SettingsUnsafeCalc": "berechne nur sicheren Gewinn/Verlust",
"Boxes.Investment.PlayerFound": "Spieler gefunden",
Expand Down Expand Up @@ -789,6 +793,7 @@
"Menu.greatbuildings.Title": "LG Investitionen",
"Menu.unitsGex.Desc": "???",
"Menu.unitsGex.Title": "???",
"quests.CounterTooltip.Content": "Es gibt ein Limit von 2000 übersprungenen Quests pro Tag",
"Settings.About.Desc": "Der FoE Helper ist eine kostenlose Browser-Erweiterung für Forge of Empires, die von Spielern für Spieler entwickelt wurde. Das Tool ist nicht mit InnoGames verbunden.",
"Settings.About.RatingDesc": "Gefällt dir, was du siehst? Dann würden wir uns über eine Rezension im Store freuen!",
"Settings.About.RatingTitle": "Bewerte die Extension",
Expand Down Expand Up @@ -915,7 +920,5 @@
"WsChat.UserLeave": " ist gegangen.",
"WsChat.UserReEnter": " hat den Chat erneut betreten.",
"WsChat.World": "Welt - ",
"_Language": "Deutsch",
"quests.CounterTooltip.Content": "Es gibt ein Limit von 2000 übersprungenen Quests pro Tag",
"Boxes.FPCollector.chestEventGrandPrize": "Event Liga-Ergebniss"
"_Language": "Deutsch"
}
11 changes: 7 additions & 4 deletions js/web/_i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,22 +304,25 @@
"Boxes.Investment.DateParseErrorDesc": "The Date value \"__InvalidDate__\" could not be parsed",
"Boxes.Investment.HiddenGB": "Hidden GB",
"Boxes.Investment.InvestBar": "Invested FPs: ",
"Boxes.Investment.Overview.AdditionalColumns": "Additional columns",
"Boxes.Investment.Overview.Blueprints": "Blueprints",
"Boxes.Investment.Overview.Building": "Building",
"Boxes.Investment.Overview.EntryTime": "Entry Time",
"Boxes.Investment.Overview.EntryTimeDesc": "When was the first deposit recorded?",
"Boxes.Investment.Overview.HideGB": "Hide GB from calculation and list.",
"Boxes.Investment.Overview.Invested": "Invested",
"Boxes.Investment.Overview.InvestedDesc": "How many FP were invested",
"Boxes.Investment.Overview.Medals": "Medals",
"Boxes.Investment.Overview.Player": "Player",
"Boxes.Investment.Overview.Profit": "Profit",
"Boxes.Investment.Overview.ProfitDesc": "profit achieved, yellow -> Rank is not safe, red/green -> Loss/Profit safe",
"Boxes.Investment.Overview.Progress": "Progress",
"Boxes.Investment.Overview.RemainingFP": "remaining FP",
"Boxes.Investment.Overview.RestFP": "Rest FP",
"Boxes.Investment.Overview.RestFPDesc": "How many FPs still to level up",
"Boxes.Investment.Overview.SettingsEntryTime": "show entry time",
"Boxes.Investment.Overview.SettingsEntryTime": "entry time",
"Boxes.Investment.Overview.SettingsHiddenGB": "show hidden GB",
"Boxes.Investment.Overview.SettingsRestFP": "show rest FP",
"Boxes.Investment.Overview.SettingsRestFP": "rest FP",
"Boxes.Investment.Overview.SettingsSave": "Save",
"Boxes.Investment.Overview.SettingsUnsafeCalc": "calculate only safe profit/loss",
"Boxes.Investment.PlayerFound": "New Events found!",
Expand Down Expand Up @@ -783,6 +786,7 @@
"Menu.greatbuildings.Title": "GB Investment",
"Menu.unitsGex.Desc": "???",
"Menu.unitsGex.Title": "???",
"quests.CounterTooltip.Content": "There is a limit of 2000 rejected quests per day",
"Settings.About.Desc": "The FoE Helper is a free browser extension for Forge of Empires developed for players by players. The tool is not affiliated with InnoGames.",
"Settings.About.RatingDesc": "If you like what you see and what we do, please leave a good review in the Store!",
"Settings.About.RatingTitle": "Rate the Extension",
Expand Down Expand Up @@ -909,6 +913,5 @@
"WsChat.UserLeave": " has gone.",
"WsChat.UserReEnter": " has entered the room again.",
"WsChat.World": "World - ",
"_Language": "English",
"quests.CounterTooltip.Content": "There is a limit of 2000 rejected quests per day"
"_Language": "English"
}
1 change: 1 addition & 0 deletions js/web/_i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
"Boxes.GreatBuildings.Title": "Aperçu investissement GM",
"Boxes.GuildMemberStat.AutoStartOnUpdate": "ouvrir l'aperçu après la mise à jour",
"Boxes.GuildMemberStat.Battles": "Batailles",
"Boxes.GuildMemberStat.ChangeView": "Changer la vue",
"Boxes.GuildMemberStat.ConfirmNo": "Non",
"Boxes.GuildMemberStat.ConfirmYes": "Oui",
"Boxes.GuildMemberStat.Date": "Date",
Expand Down
17 changes: 17 additions & 0 deletions js/web/investment/css/investment.css
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,21 @@
#InvestmentBody .last-update-message .icon.updaterequired {
background: url(../images/update_required.svg);
background-size: 18px 18px;
}

#InvestmentBody tr th span {
display: inline-block;
width: 25px;
height: 25px;
vertical-align: bottom;
}

#InvestmentBody tr th span.blueprints {
background: url(../../x_img/blueprint.png) center no-repeat;
background-size: contain;
}

#InvestmentBody tr th span.medal {
background: url(../../x_img/medal.png) center no-repeat;
background-size: contain;
}
75 changes: 65 additions & 10 deletions js/web/investment/js/investment.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ let Investment = {
let InvestmentSettings = JSON.parse(localStorage.getItem('InvestmentSettings'));
let showEntryDate = (InvestmentSettings && InvestmentSettings.showEntryDate !== undefined) ? InvestmentSettings.showEntryDate : 0;
let showRestFp = (InvestmentSettings && InvestmentSettings.showRestFp !== undefined) ? InvestmentSettings.showRestFp : 0;
let showMedals = (InvestmentSettings && InvestmentSettings.showMedals !== undefined) ? InvestmentSettings.showMedals : 0;
let showBlueprints = (InvestmentSettings && InvestmentSettings.showBlueprints !== undefined) ? InvestmentSettings.showBlueprints : 0;
let showHiddenGb = (InvestmentSettings && InvestmentSettings.showHiddenGb !== undefined) ? InvestmentSettings.showHiddenGb : 0;
let lastupdate = (InvestmentSettings && InvestmentSettings.lastupdate !== undefined) ? InvestmentSettings.lastupdate : 0;
let removeUnsafeCalc = (InvestmentSettings && InvestmentSettings.removeUnsafeCalc !== undefined) ? InvestmentSettings.removeUnsafeCalc : 0;
Expand Down Expand Up @@ -170,9 +172,19 @@ let Investment = {

h.push('<th class="is-number text-center" data-type="invest-group">&nbsp;</th>' +
'<th class="is-number text-center invest-tooltip" data-type="invest-group" title="' + HTML.i18nTooltip(i18n('Boxes.Investment.Overview.InvestedDesc')) + '">' + i18n('Boxes.Investment.Overview.Invested') + '</th>' +
'<th class="is-number text-center invest-tooltip" data-type="invest-group" title="' + HTML.i18nTooltip(i18n('Boxes.Investment.Overview.ProfitDesc')) + '" >' + i18n('Boxes.Investment.Overview.Profit') + '</th>' +
'</tr>' +
'</thead><tbody class="invest-group">');
'<th class="is-number text-center invest-tooltip" data-type="invest-group" title="' + HTML.i18nTooltip(i18n('Boxes.Investment.Overview.ProfitDesc')) + '" >' + i18n('Boxes.Investment.Overview.Profit') + '</th>');

if(showMedals)
{
h.push('<th class="is-number text-center" data-type="invest-group"><span class="medal" title="' + HTML.i18nTooltip(i18n('Boxes.Investment.Overview.Medals')) + '"></span></th>');
}

if(showBlueprints)
{
h.push('<th class="is-number text-center" data-type="invest-group"><span class="blueprints" title="' + HTML.i18nTooltip(i18n('Boxes.Investment.Overview.Blueprints')) + '"></span></th><th></th>');
}

h.push('<th></th></tr></thead><tbody class="invest-group">');

let CurrentGB = await IndexDB.db.investhistory.reverse().toArray();

Expand Down Expand Up @@ -205,6 +217,8 @@ let Investment = {
let restFp = contribution['max_progress'] - contribution['current_progress'];
let rankImageValue = contribution['rank'] <= 6 ? contribution['rank'] : 6;
let isHidden = typeof contribution['ishidden'] !== 'undefined' ? contribution['ishidden'] : 0;
let Blueprints = typeof contribution['blueprints'] !== 'undefined' ? contribution['blueprints'] : 0;
let Medals = typeof contribution['medals'] !== 'undefined' ? contribution['medals'] : 0;
let hiddenClass = '';
let history = {};

Expand Down Expand Up @@ -252,7 +266,19 @@ let Investment = {

h.push(`<td class="is-number text-center" data-number="${contribution['rank']}"><img class="rank invest-tooltip" src="${extUrl}js/web/x_img/gb_p${rankImageValue}.png" title="Rang ${contribution['rank']}" /></td>`);
h.push(`<td class="is-number text-center gbinvestment" data-number="${contribution['currentFp']}">${contribution['currentFp']}</td>`);
h.push(`<td class="is-number text-center gbprofit" data-number="${RealProfit}"><b class="${RealProfitClass}">${RealProfit}</b></td></tr>`);
h.push(`<td class="is-number text-center gbprofit" data-number="${RealProfit}"><b class="${RealProfitClass}">${RealProfit}</b></td>`);

if(showMedals)
{
h.push(`<td class="is-number text-center gbmedals" data-number="${Medals}"><b class="${RealProfitClass === 'error' ? 'success' : RealProfitClass}">${HTML.Format(Medals)}</b></td>`);
}

if(showBlueprints)
{
h.push(`<td class="is-number text-center gbblueprints" data-number="${Blueprints}"><b class="${RealProfitClass === 'error' ? 'success' : RealProfitClass}">${HTML.Format(Blueprints)}</b></td>`);
}

h.push('<td></td></tr>');
}

h.push('</tbody></table>');
Expand Down Expand Up @@ -346,13 +372,17 @@ let Investment = {
InvestmentSettings = JSON.parse(localStorage.getItem('InvestmentSettings')),
showEntryDate = (InvestmentSettings && InvestmentSettings.showEntryDate !== undefined) ? InvestmentSettings.showEntryDate : 0,
showRestFp = (InvestmentSettings && InvestmentSettings.showRestFp !== undefined) ? InvestmentSettings.showRestFp : 0,
showBlueprints = (InvestmentSettings && InvestmentSettings.showBlueprints !== undefined) ? InvestmentSettings.showBlueprints : 0,
showMedals = (InvestmentSettings && InvestmentSettings.showMedals !== undefined) ? InvestmentSettings.showMedals : 0,
showHiddenGb = (InvestmentSettings && InvestmentSettings.showHiddenGb !== undefined) ? InvestmentSettings.showHiddenGb : 0,
removeUnsafeCalc = (InvestmentSettings && InvestmentSettings.removeUnsafeCalc !== undefined) ? InvestmentSettings.removeUnsafeCalc : 0;

c.push(`<p class="text-center"><input id="showentrydate" name="showentrydate" value="1" type="checkbox" ${(showEntryDate === 1) ? ' checked="checked"':''} /> <label for="showentrydate">${i18n('Boxes.Investment.Overview.SettingsEntryTime')}</label></p>`);
c.push(`<p class="text-center"><input id="showrestfp" name="showrestfp" value="1" type="checkbox" ${(showRestFp === 1) ? ' checked="checked"':''} /> <label for="showrestfp">${i18n('Boxes.Investment.Overview.SettingsRestFP')}</label></p>`);
c.push(`<p class="text-center"><input id="showhiddengb" name="showhiddengb" value="1" type="checkbox" ${(showHiddenGb === 1) ? ' checked="checked"':''} /> <label for="showhiddengb">${i18n('Boxes.Investment.Overview.SettingsHiddenGB')}</label></p>`);
c.push(`<p class="text-center"><input id="removeunsafecalc" name="removeunsafecalc" value="1" type="checkbox" ${(removeUnsafeCalc === 1) ? ' checked="checked"':''} /> <label for="removeunsafecalc">${i18n('Boxes.Investment.Overview.SettingsUnsafeCalc')}</label></p>`);
c.push(`<p>${i18n('Boxes.Investment.Overview.AdditionalColumns')}:</p><p><input id="showentrydate" name="showentrydate" value="1" type="checkbox" ${(showEntryDate === 1) ? ' checked="checked"':''} /> <label for="showentrydate">${i18n('Boxes.Investment.Overview.SettingsEntryTime')}</label></p>`);
c.push(`<p><input id="showrestfp" name="showrestfp" value="1" type="checkbox" ${(showRestFp === 1) ? ' checked="checked"':''} /> <label for="showrestfp">${i18n('Boxes.Investment.Overview.SettingsRestFP')}</label></p>`);
c.push(`<p><input id="showmedals" name="showmedals" value="1" type="checkbox" ${(showMedals === 1) ? ' checked="checked"':''} /> <label for="showmedals">${i18n('Boxes.Investment.Overview.Medals')}</label></p>`);
c.push(`<p><input id="showblueprints" name="showblueprints" value="1" type="checkbox" ${(showBlueprints === 1) ? ' checked="checked"':''} /> <label for="showblueprints">${i18n('Boxes.Investment.Overview.Blueprints')}</label></p>`);
c.push(`<p><hr /><input id="showhiddengb" name="showhiddengb" value="1" type="checkbox" ${(showHiddenGb === 1) ? ' checked="checked"':''} /> <label for="showhiddengb">${i18n('Boxes.Investment.Overview.SettingsHiddenGB')}</label></p>`);
c.push(`<p><input id="removeunsafecalc" name="removeunsafecalc" value="1" type="checkbox" ${(removeUnsafeCalc === 1) ? ' checked="checked"':''} /> <label for="removeunsafecalc">${i18n('Boxes.Investment.Overview.SettingsUnsafeCalc')}</label></p>`);
c.push(`<hr><p><button id="save-Investment-settings" class="btn btn-default" style="width:100%" onclick="Investment.SettingsSaveValues()">${i18n('Boxes.Investment.Overview.SettingsSave')}</button></p>`);

$('#InvestmentSettingsBox').html(c.join(''));
Expand Down Expand Up @@ -384,6 +414,8 @@ let Investment = {
current_progress: Investment['current_progress'],
max_progress: Investment['max_progress'],
profit: Investment['profit'],
medals: Investment['medals'],
blueprints: Investment['blueprints'],
increase: Investment['increase'],
ishidden: Investment['ishidden'],
date: MainParser.getCurrentDate()
Expand All @@ -395,6 +427,8 @@ let Investment = {
gbname: Investment['gbname'],
current_progress: Investment['current_progress'],
profit: Investment['profit'],
medals: Investment['medals'],
blueprints: Investment['blueprints'],
rank: Investment['rank'],
fphistory: Investment['fphistory'],
increase: Investment['increase'],
Expand Down Expand Up @@ -446,12 +480,16 @@ let Investment = {
Rank = LGData[i]['rank'],
increase = 0;
let CurrentErtrag = 0.0;
let Medals = 0;
let Blueprints = 0;
let Profit = 0;
let GbhasUpdate = false;
let arrfphistory = [];
let isHidden = 0;

if (undefined !== LGData[i]['reward']) {
Medals = MainParser.round(LGData[i]['reward']['resources'] !== undefined && LGData[i]['reward']['resources']['medals'] !== undefined ? LGData[i]['reward']['resources']['medals'] * arc : 0);
Blueprints = MainParser.round(LGData[i]['reward']['blueprints'] !== undefined ? LGData[i]['reward']['blueprints'] * arc : 0);
CurrentErtrag = MainParser.round(LGData[i]['reward']['strategy_point_amount'] !== undefined ? LGData[i]['reward']['strategy_point_amount'] * arc : 0);
Profit = CurrentErtrag;
}
Expand Down Expand Up @@ -501,12 +539,15 @@ let Investment = {
allGB = Investment.remove_key_from_array(allGB, CurrentGB.id);
}

if (CurrentGB !== undefined && !FullSync) {
if (CurrentGB !== undefined && !FullSync)
{
playerSyncGbKeys = Investment.remove_key_from_array(playerSyncGbKeys, CurrentGB.id);
}

if(CurrentGB !== undefined && CurrentGB['ishidden'] === undefined){
if(CurrentGB !== undefined && (CurrentGB['ishidden'] === undefined || CurrentGB['medals'] === undefined))
{
GbhasUpdate=true;
arrfphistory = JSON.parse(CurrentGB['fphistory']);
}

if (CurrentGB === undefined || GbhasUpdate)
Expand All @@ -525,6 +566,8 @@ let Investment = {
current_progress: CurrentProgress,
max_progress: MaxProgress,
profit: Profit,
medals: Medals,
blueprints: Blueprints,
ishidden: isHidden,
increase: increase
});
Expand Down Expand Up @@ -574,6 +617,8 @@ let Investment = {

value['showEntryDate'] = 0;
value['showRestFp'] = 0;
value['showBlueprints'] = 0;
value['showMedals'] = 0;
value['showHiddenGb'] = 0;
value['removeUnsafeCalc'] = 0;

Expand All @@ -587,6 +632,16 @@ let Investment = {
value['showRestFp'] = 1;
}

if ($("#showmedals").is(':checked'))
{
value['showMedals'] = 1;
}

if ($("#showblueprints").is(':checked'))
{
value['showBlueprints'] = 1;
}

if ($("#showhiddengb").is(':checked'))
{
value['showHiddenGb'] = 1;
Expand Down

0 comments on commit 1c29a96

Please sign in to comment.