Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Commit

Permalink
feat: FIFA 21
Browse files Browse the repository at this point in the history
Update for FIFA 21 with all functionality from last year.

Co-authored-by: Eimar Fandino <eimar.fandino.hurtado@nl.abnamro.com>
Co-authored-by: Tim Klingeleers <Mardaneus86@users.noreply.github.com>

BREAKING CHANGE: no longer works for FIFA 20
  • Loading branch information
eimarfandino committed Oct 5, 2020
1 parent 2232d6d commit ce30a9c
Show file tree
Hide file tree
Showing 14 changed files with 3,173 additions and 1,718 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
@@ -0,0 +1,4 @@
dist/
tampermonkey-headers.js
webpack.config.js
webpack.config.prd.js
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
dist/
node_modules/
.vscode/
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -2,9 +2,9 @@

[![Join the chat at https://gitter.im/futwebapp-tampermonkey/Lobby](https://badges.gitter.im/futwebapp-tampermonkey/Lobby.svg)](https://gitter.im/futwebapp-tampermonkey/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

FIFA 20's companion app for FIFA Ultimate Team, the FUT 20 Web App, is a website that let's you trade and manage your team on the go.
FIFA 21's companion app for FIFA Ultimate Team, the FUT 21 Web App, is a website that let's you trade and manage your team on the go.

This TamperMonkey script is meant to enhance the FUT 20 Web App experience. You can install the script following the instructions below. Afterwards you will get a settings button on the bottom right of the web app, where you can enable every feature by itself. The script provides a certain degree of customization possibilities.
This TamperMonkey script is meant to enhance the FUT 21 Web App experience. You can install the script following the instructions below. Afterwards you will get a settings button on the bottom right of the web app, where you can enable every feature by itself. The script provides a certain degree of customization possibilities.

:warning: Using this script is at your own risk. EA might (temp-)ban you for altering parts of their Web App.

Expand Down
8 changes: 4 additions & 4 deletions app/futbin/futbin-player-links.js
Expand Up @@ -85,11 +85,11 @@ export class FutbinPlayerLinks extends BaseScript {
let futbinPlayerIds = Database.getJson('futbin-player-ids', []);
const futbinPlayer = futbinPlayerIds.find(i => i.id === item.resourceId);
if (futbinPlayer != null) {
return resolve(`https://www.futbin.com/20/player/${futbinPlayer.futbinId}`);
return resolve(`https://www.futbin.com/21/player/${futbinPlayer.futbinId}`);
}

const name = `${item._staticData.firstName} ${item._staticData.lastName}`.replace(' ', '+');
const url = `https://www.futbin.com/search?year=20&term=${name}`;
const url = `https://www.futbin.com/search?year=21&term=${name}`;
return GM_xmlhttpRequest({
method: 'GET',
url,
Expand All @@ -114,10 +114,10 @@ export class FutbinPlayerLinks extends BaseScript {
});
}
Database.setJson('futbin-player-ids', futbinPlayerIds);
return resolve(`https://www.futbin.com/20/player/${exactPlayers[0].id}`);
return resolve(`https://www.futbin.com/21/player/${exactPlayers[0].id}`);
} else if (exactPlayers.length > 1) {
// Take first one, several players are returned more than once
return resolve(`https://www.futbin.com/20/player/${exactPlayers[0].id}`);
return resolve(`https://www.futbin.com/21/player/${exactPlayers[0].id}`);
}

return resolve(null); // TODO: what should we do if we find more than one?
Expand Down
2 changes: 1 addition & 1 deletion app/futbin/futbin-prices.js
Expand Up @@ -227,7 +227,7 @@ export class FutbinPrices extends BaseScript {
const fetchAtOnce = 30;
const futbinlist = [];
while (resourceIdMapping.length > 0 && fetchedPlayers < resourceIdMapping.length && Database.get('lastFutbinFetchFail', 0) + (5 * 60000) < Date.now()) {
const futbinUrl = `https://www.futbin.com/20/playerPrices?player=&rids=${
const futbinUrl = `https://www.futbin.com/21/playerPrices?player=&rids=${
resourceIdMapping.slice(fetchedPlayers, fetchedPlayers + fetchAtOnce)
.map(i => i.playerId)
.filter((current, next) => current !== next && current !== 0)
Expand Down
5 changes: 5 additions & 0 deletions app/futbin/style/futbin-prices.scss
Expand Up @@ -29,6 +29,11 @@
width: 25%;
float: right;
}

.listFUTItem .auction {
display: block;
}

.listFUTItem .auction .auctionValue {
width: 24%;
float: left;
Expand Down
13 changes: 4 additions & 9 deletions app/index.js
@@ -1,5 +1,5 @@
/* globals onVisibilityChanged services UTNavigationController
UTViewController UTObservable window document $ */
/* globals onVisibilityChanged services UTGameFlowNavigationController
UTViewController EAObservable window document $ */
import 'babel-polyfill';
import './index.scss';
import initSettingsScreen from './settings';
Expand Down Expand Up @@ -32,16 +32,11 @@ import {
} from './club';
*/

window.onPageNavigation = new UTObservable();
window.onPageNavigation = new EAObservable();

window.currentPage = '';

// prevent debugger trap
setInterval(() => {
_0x1a026c = function () {}; // eslint-disable-line no-global-assign, no-undef
}, 500);

UTNavigationController.prototype.didPush = (t) => {
UTGameFlowNavigationController.prototype.didPush = (t) => {
if (t) {
analytics.trackPage(t.className);
window.onPageNavigation.notify(t.className);
Expand Down
2 changes: 1 addition & 1 deletion app/index.scss
Expand Up @@ -3,7 +3,7 @@

.ut-content {
border: 0;

&.ut-content--split-view-extend {
max-height: 100%;
}
Expand Down
17 changes: 12 additions & 5 deletions app/instant-bin-confirm/instant-bin-confirm.js
@@ -1,7 +1,8 @@
/* global
gPopupClickShield
enums
controllers
EADialogViewController
services
utils
*/

Expand Down Expand Up @@ -34,10 +35,14 @@ export class InstantBinConfirm extends BaseScript {
proceed();
return;
}
const n = new controllers.views.popups.Dialog(
dialog.message, dialog.title,
enums.UIDialogTypes.MESSAGE, amount, dialog.buttonLabels,
);

const n = new EADialogViewController({
dialogOptions: [dialog.buttonLabels[0],
dialog.buttonLabels[1]],
message: services.Localization.localize(dialog.message, amount),
title: services.Localization.localize(dialog.title),
});

n.init();
gPopupClickShield.setActivePopup(n);
n.onExit.observe(this, (e, t) => {
Expand All @@ -47,6 +52,8 @@ export class InstantBinConfirm extends BaseScript {
} else if (cancel) {
cancel();
}
} else {
cancel();
}
});
};
Expand Down
7 changes: 6 additions & 1 deletion app/settings/index.scss
Expand Up @@ -8,7 +8,7 @@
font-family: UltimateTeam-Icons,sans-serif;
content: "\E056";
font-size: 2rem;
color: black;
color: gray;
}
}

Expand All @@ -24,13 +24,18 @@
z-index: 998;
padding: 15px;

label {
color: black;
}

&, *, *:before, *:after {
box-sizing: border-box;
}

footer {
text-align: center;
padding: 15px;
color: black;

hr {
border: none;
Expand Down
2 changes: 1 addition & 1 deletion app/transferlist/min-bin.js
Expand Up @@ -100,7 +100,7 @@ class MinBin extends BaseScript {

GM_notification({
text: notificationText,
title: 'FUT 20 Web App',
title: 'FUT 21 Web App',
timeout: 5000,
onclick: () => window.focus(),
});
Expand Down

0 comments on commit ce30a9c

Please sign in to comment.