// ==UserScript== // @name 【FSU】FIFA FUT WEB 增强器 // @namespace https://futcd.com/ // @version 2.2 // @description FIFAFUT模式SBC任务便捷操作增强器👍👍👍,额外信息展示、近期低价自动查询、一键挂出球员、跳转FUTBIN、快捷搜索、拍卖行优化等等...👍👍👍 // @author Futcd_kcka // @match https://www.ea.com/fifa/ultimate-team/web-app/* // @match https://www.easports.com/*/fifa/ultimate-team/web-app/* // @match https://www.ea.com/*/fifa/ultimate-team/web-app/* // @icon data:image/png;base64,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 // @require https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/2.2.1/jquery.min.js // @grant GM_addStyle // @grant GM_openInTab // @grant GM_xmlhttpRequest // @connect ea.com // @connect futbin.com // @connect futbin.org // @connect futcd.com // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; window.requirementTarget = ""; var futsbcup = {},events = {},info = {},cntlr = {},html = {},className = {}; info = { "unassigned":{"state":false,"run":0,"playerId":[]}, "task":{"obj":{"parent":".ut-tile-hub-objective","stat":{},"html":{}},"sbc":{"parent":".ut-tile-hub-sbc","stat":{},"html":{}}}, "base":{"state":false,"platform":"pc","price":{},"sId":"","localization":"",autoLoad:true,"ratings":{}}, "criteria":{"state":false,"data":{},"repeat":0}, "roster":{"state":false,"data":{},"page":-1,"element":{},"thousand":{"lowest":99}}, "language":"en", "localization":{}, "quick":{}, "squad":{"load":true}, "league":{2012:'中超',61:'英乙',60:'英甲',14:'英冠',13:'英超',2208:'英丙',2149:'印超',32:'意乙',31:'意甲',54:'西乙',53:'西甲',68:'土超',50:'苏超',308:'葡超',39:'美职联',17:'法乙',16:'法甲',20:'德乙',19:'德甲',2076:'德丙',2118:'传奇',353:'阿甲'} }; cntlr = { "current":function(){return getAppMain().getRootViewController().getPresentedViewController().getCurrentViewController().getCurrentController();}, "right":function(){return getAppMain().getRootViewController().getPresentedViewController().getCurrentViewController().getCurrentController()._rightController._currentController}, "left":function(){return getAppMain().getRootViewController().getPresentedViewController().getCurrentViewController().getCurrentController()._leftController}, }; events.notice = function(text,type){ services.Notification.queue([events.L10n(text),type]) }; events.init = async function(){ info.base.sId = services.Authentication.sessionUtas.id; console.log(info.base.sId) let locale = services.Messages.messagesDAO.authDelegate.sessionUtas.locale; info.language = "en"; info.base.year = APP_YEAR_SHORT; if(locale.language == "zh"){ info.language = locale.variant == "Hans" ? "chs" : "cht"; } console.log(info.language) events.notice("notice.succeeded",0); GM_xmlhttpRequest({ method:"GET", url:"https://futcd.com/data/fsuupdata.json", timeout:8000, headers: { "Content-type": "application/json" }, onload:function(res){ let urlText = events.L10n("top.readme"); let urlLink = "https://mfrasi851i.feishu.cn/docx/JJsjdos9go7pWxxaiaBcWNVinOf"; if(res.status == 404){ events.notice("notice.upgradefailed",2); }else{ let data = JSON.parse(res.response); let myVersion = Number(GM_info.script.version) || 0; if(data["version"] > myVersion){ urlText = events.L10n("top.upgrade"); urlLink = data["updateURL"]; events.notice("notice.upgradeconfirm",1); } } getAppMain()._FIFAHeader._view.__fifaLink.insertAdjacentHTML('afterend', `${urlText}`); }, onerror:function(){ events.notice("notice.upgrade.failed",2); } }) let user = services.User.getUser().getSelectedPersona(); if(user.isXbox || user.isPlaystation || user.isStadia){ info.base.platform = "ps"; info.base.platform = "ps"; } services.User.maxAllowedAuctions = 100; GM_xmlhttpRequest({ method:"GET", url:"https://futcd.com/data/futpricenew.json", headers: { "Content-type": "application/json" }, onload:function(res){ let data = JSON.parse(res.response); if(info.base.platform == "pc"){ info.base.price = data["pc"]; }else{ info.base.price = data["tv"]; } }, }) info.base.localization = services.Localization.repository._collection; GM_xmlhttpRequest({ method:"GET", url:`https://utas.mob.v1.fut.ea.com/ut/game/fifa${info.base.year}/scmp/campaign/categories`, headers: { "Content-type": "application/json", "X-UT-SID": info.base.sId }, onload:function(response){ let data = JSON.parse(response.response); let nowDate = Math.round(new Date().getTime()/1000); let objJson = {reward:"",new:{"-1":0}}; let rewardJson = {"player":0,"pack":0}; for (let i = 0; i < data.length; i++) { data[i].groupsList.forEach( (item,key) => { let tempJson = {"f":"0","e":"0"} if(item.groupType !== 2){ if(item.startTime >= nowDate - 86400){ tempJson.f = "1"; objJson.new["-1"]++; if(objJson.new.hasOwnProperty(String(i+1))){ objJson.new[String(i+1)]++; }else{ objJson.new[String(i+1)] = 1; } for (let z = 0; z < item.awardsList.length; z++) { if(item.awardsList[z].awardType == "pack"){ rewardJson["pack"]++; } if(item.awardsList[z].awardType == "item"){ if(item.awardsList[z].itemDataReduced.itemType == "player"){ rewardJson["player"]++; } } } } if(item.endTime <= nowDate + 86400 && item.endTime !== 0){ tempJson.e = "1"; } } objJson[`${item.groupType.toString()}-${item.groupId.toString()}`] = tempJson; }) } let reward = []; if(rewardJson["player"] > 0){ reward.push(events.L10n("task.player")) } if(rewardJson["pack"] > 0){ reward.push(events.L10n("task.pack")) } objJson.reward = reward.join("、"); info.task.obj.stat = objJson; info.task.obj.html = events.taskHtml(objJson.new["-1"],objJson.reward); }, }) GM_xmlhttpRequest({ method:"GET", url:"https://futcd.com/data/futsbc.json", headers: { "Content-type": "application/json", "Cache-Control": "600" }, onload:function(res){ let sbcJson = JSON.parse(res.response); info.task.sbc.stat = sbcJson; info.task.sbc.html = events.taskHtml(sbcJson.new["0"],sbcJson.reward); }, }) const staticData = services.Item.itemDao.itemRepo.getStaticData(); for (let item of staticData) { if(!info.base.ratings.hasOwnProperty(item.rating)){ info.base.ratings[item.rating] = []; } info.base.ratings[item.rating].push(item.id) } //console.log(info.base.ratings) var dataNumber = [0,250,500,750]; const itemFactory = new UTItemEntityFactory(); for (const key in dataNumber) { console.log("读取第几页",key) let tempData = await getThousand(dataNumber[key]); for (let item of tempData.itemData) { info.roster.thousand[item.resourceId] = {"untradeable":item.untradeable,"rating":item.rating,"id":item.id}; services.Item.itemDao.itemRepo.club.addClubItem(itemFactory.createItem(item)) if(item.rating < info.roster.thousand.lowest){ info.roster.thousand.lowest = item.rating; } } } $(".ut-click-shield").append(`
${events.L10n("loadingclose.text")}
`); $(".fsu-loading-close").click(function () { $(".fsu-loading").removeClass("showing fsu-loading"); $(".fsu-loading .loaderIcon").css("display", "none"); }); }; function getThousand(dataNumber){ return new Promise(res => { let postData = {"count": 250,"sort": "desc","sortBy": "ovr","start": dataNumber,"type": "player"}; GM_xmlhttpRequest({ method:"POST", url:`https://utas.mob.v1.fut.ea.com/ut/game/fifa${info.base.year}/club`, headers: { "Content-type": "application/json", "X-UT-SID": info.base.sId }, data:JSON.stringify(postData), onload:function(response){ res(JSON.parse(response.response)) }, }) }) }; events.taskHtml = function(number,text){ let html = "
{Number}
{reward}
"; if(number > 0){ html = html.replace("{Number}",events.L10n("task.added") + number); }else{ html = html.replace("fsu-task","fsu-task no"); html = html.replace("{Number}",events.L10n("task.noadded")); } if(text == "、"){ text = ""; } let reward = text; reward = reward.replace("组合包",events.L10n("task.pack")); reward = reward.replace("球员",events.L10n("task.player")); html = html.replace("{reward}",reward); return html; }; events.priceFormat = function(value){ var text = ""; var number = parseInt(value.replace(/,/g,'')); if(info.language == "en"){ switch (true) { case number == 0: text = `${events.L10n("price.formatno")}`; break; case number > 999999: text = `${parseFloat(parseFloat(number / 1000000).toFixed(2)).toLocaleString()}M`; break; case number > 999: text = `${parseFloat(parseFloat(number / 1000).toFixed(2)).toLocaleString()}K`; break; default: text = number.toLocaleString(); break; } }else{ switch (true) { case number == 0: text = `${events.L10n("price.formatno")}`; break; case number > 9999: text = `${parseFloat(parseFloat(number / 10000).toFixed(2)).toLocaleString()}${events.L10n("price.formatcompany")}`; break; default: text = number.toLocaleString(); break; } } return text; }; events.positionsToHtml = (posArr,type) => { let posCalss = type == 1 ? "big" : ""; let posHtml = ``; let posSubArr = []; for (let posId of posArr) { posSubArr.push(`
  • ${info.base.localization[`extendedPlayerInfo.positions.position${posId}`]}
  • `); } return posHtml.replace("{item}",posSubArr.join("")); }; events.attributeToHtml = (data,type,mode) => { let attrHtml = ""; let subCalss = type == 1 ? "big" : ""; if(mode == 0 || mode == 1){ let posHtml = ``; let posSubArr = []; for (let posId of data.pos) { posSubArr.push(`
  • ${info.base.localization[`extendedPlayerInfo.positions.position${posId}`]}
  • `); } attrHtml += posHtml.replace("{item}",posSubArr.join("")); } if(mode == 0 || mode == 2){ attrHtml += `
    ${data.work}
    ${data.sw}
    `; } if(mode == 0){ attrHtml += `
    ${info.base.localization[`global.leagueFull.2023.league${data.league}`]}
    `; } if(mode == 3){ let leagueText = info.base.localization[`global.leagueabbr5.2023.league${data.league}`]; if(info.language == "chs" && info.league.hasOwnProperty(data.league)){ leagueText = info.league[data.league]; } attrHtml += leagueText; } return attrHtml; }; events.uasReset = function(){ if($("#uasreset").length == 0){ $(".ut-section-header-view").eq(0).append(events.L10n(html.uasBtn)); $("#uasreset").click(function () { services.Item.itemDao.itemRepo.unassigned.reset(); getAppMain().getRootViewController().getPresentedViewController().getCurrentViewController()._backButton._tapDetected(this); events.notice("notice.uasreset",0); }) } }; events.quickList = function(){ if($(".DetailView").length == 0) return; let detailObject = new Object(); if(cntlr.right().hasOwnProperty("_quickListPanel")){ detailObject = cntlr.right()._quickListPanel.item; }else{ detailObject = cntlr.right()._panel._quickListPanel.item; } if(detailObject == null) return; info.quick = events.playerAttext(detailObject); if($(".tns-slide-active .fsu-card-pos").length == 0){ $(".tns-slide-active .ut-item-view--main.ut-item-view").after(events.attributeToHtml(info.quick,1,0)); } if(info.roster.data.hasOwnProperty(info.quick.id) && $(".accordian").length !== 0){ let price = info.roster.data[info.quick.id].prices[info.base.platform].LCPrice; if($(".fsu-quickauction").length == 0){ $(".accordian").after(``); $(".fsu-quickauction").click(async function (){ console.log("卖球员一次") let price = Number((info.roster.data[info.quick.id].prices[info.base.platform].LCPrice).replace(/,/g, "")); await cntlr.right()._quickListPanel._view._bidNumericStepper.setValue(price); await cntlr.right()._quickListPanel._view._buyNowNumericStepper.setValue(price); await cntlr.right()._quickListPanel._view._listButton._tapDetected(this); events.notice("notiec.quickauction",1); }) }else if($(".fsu-quickauction-price").text() !== price){ $(".fsu-quickauction-price").text(price); } }else{ if($(".fsu-quickauction").length == 0){ $(".fsu-quickauction").remove(); } } if($(".fsu-gotofutbin").length == 0 && $(".more").length !== 0 && $(".more").is(":visible")){ $(".more").after(``); $(".fsu-gotofutbin").click(async function () { events.showLoader(); let name = info.quick.name.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); console.log(name) let url = `https://www.futbin.org/futbin/api/searchPlayersByName?playername=${name}&year=${info.base.year}`; let tempData = await getFutbin(url); let futbinId = ""; for (let item of tempData.data) { if(item.resource_id == info.quick.id){ futbinId = item.ID; break; } } events.hideLoader(); GM_openInTab(`https://www.futbin.com/${info.base.year}/player/${futbinId}/`, { active: true, insert: true, setParent :true }); }) } }; events.squad = async function(pageClass){ let type = pageClass == className.sbcItem ? 1 : 2; if($(".ut-squad-slot-view").length == 0) return; info.squad.league = []; let playerList = cntlr.left()._squad.getPlayers(); let playerArray = []; for (let item of playerList) { if(item._item.definitionId !== 0){ let playerBox = `.ut-squad-slot-view[index=${item.index}]`; if(!info.roster.data.hasOwnProperty(item._item.definitionId)){ playerArray.push(item._item.definitionId); } let playerData = events.playerAttext(item._item); let posHtml = events.attributeToHtml(playerData,2,1); if($(playerBox).find(".fsu-card-pos").length == 0){ $(playerBox).append(posHtml); }else if($(playerBox).find(".fsu-card-pos").prop('outerHTML') !== posHtml){ $(posHtml).replaceAll(`${playerBox} .fsu-card-pos`); } if(type == 1){ let leagueHtml = events.attributeToHtml(playerData,2,3); if($(playerBox).find(".fsu-card-lea").length == 0){ $(playerBox).find(".playStyle").addClass("fsu-card-lea"); $(playerBox).find(".playStyle").append(leagueHtml); } }else{ let otherHtml = events.attributeToHtml(playerData,2,2); if($(playerBox).find(".fsu-card-attr").length == 0){ $(playerBox).append(otherHtml); }else if($(playerBox).find(".fsu-card-attr").prop('outerHTML') !== otherHtml){ $(otherHtml).replaceAll(`${playerBox} .fsu-card-attr`); } } playerData.index = item.index; info.squad[item.index] = playerData; } } if(playerArray.length !== 0){ let tempData = await getFutbin(`https://www.futbin.com/${info.base.year}/playerPrices?player=&rids=${playerArray.join()}`); info.roster.data = Object.assign(info.roster.data,tempData); console.log(tempData) } for (let item of playerList) { let playerId = item._item.definitionId; if(playerId !== 0){ let playerBox = `.ut-squad-slot-view[index=${item.index}]`; let playerPrice = "0"; if(info.roster.data.hasOwnProperty(playerId)){ playerPrice = info.roster.data[playerId].prices[info.base.platform].LCPrice; } let priceHtml = `
    ${events.priceFormat(playerPrice)}
    `; if($(playerBox).find(".fsu-squad-price").length == 0){ $(playerBox).append(priceHtml); }else if($(playerBox).find(".fsu-squad-price").prop('outerHTML') !== priceHtml){ $(priceHtml).replaceAll(`${playerBox} .fsu-squad-price`); } } } }; events.playerAttext = (element) =>{ let playerAttribute = {}; playerAttribute.id = element.definitionId; playerAttribute.type = element.type; playerAttribute.rating = element.rating; playerAttribute.duplicate = element.duplicateId; playerAttribute.name = `${element._staticData.firstName} ${element._staticData.lastName}`; playerAttribute.pos = JSON.parse(JSON.stringify(element.possiblePositions)); playerAttribute.pos.splice(playerAttribute.pos.indexOf(element.preferredPosition),1); playerAttribute.league = element.leagueId; playerAttribute.untradeable = element.untradeable; let work = ["M","L","H"]; playerAttribute.work = `${work[element._offensiveWorkRate]}/${work[element._defensiveWorkRate]}`; playerAttribute.sw = `${element._skillMoves + 1}/${element._weakFoot}`; return playerAttribute; }; events.showLoader = () => { $(".ut-click-shield").addClass("showing fsu-loading"); $(".loaderIcon").css("display", "block"); }; events.hideLoader = () => { $(".ut-click-shield").removeClass("showing fsu-loading"); $(".loaderIcon").css("display", "none"); }; events.rosterInfo = function(type){ let playerElement = ".listFUTItem"; if(type == 5){ playerElement = ".player-pick-option"; } if(type == 1){ playerElement = ".ut-pinned-list .listFUTItem"; } if($(playerElement).length == 0){ console.log("未加载完成球员直接返回") return; } //"roster":{"state":false,"price":{},"repeat":{}}, //1搜索球员列表 2俱乐部 3拍卖名单 4预览包 5挑选包 6未分配重复球员 7拍卖搜索列表 info.roster.element.box = ".rowContent.has-tap-callback .entityContainer"; let playerSource = []; let btnBox = ".pagingContainer"; let btnHtml = events.L10n(html.priceBtn2); let dataPrefix = true; let page = -1; // console.log("添加读取按钮",type) switch (type) { case 1: btnHtml = events.L10n(html.priceBtn); playerSource = cntlr.right().getView()._list.listRows; page = cntlr.right().clubViewModel.getCurrentPage(); break; case 2: btnHtml = events.L10n(html.priceBtn); playerSource = cntlr.current()._leftController._view._list.listRows; page = cntlr.left().clubViewModel.getCurrentPage(); break; case 3: btnBox = ".ut-section-header-view:eq(2)"; playerSource = cntlr.current()._leftController._viewmodel._collection; dataPrefix = false; break; case 4: btnBox = ".view-modal-container.form-modal header"; info.roster.element.box = ".rowContent .entityContainer"; let AppResume4 = getAppMain()._defaultDispatcher._observers._collection["notification.AppResume"]._observers; playerSource = AppResume4[AppResume4.length - 1].scope._view.listRows break; case 5: btnBox = ".view-modal-container.form-modal header"; info.roster.element.box = ".player-pick-option"; let AppResume5 = getAppMain()._defaultDispatcher._observers._collection["notification.AppResume"]._observers; playerSource = AppResume5[AppResume5.length - 1].scope.picks dataPrefix = false; break; case 6: btnBox = ".ut-section-header-view:eq(0)"; playerSource = cntlr.current()._leftController._viewmodel._collection; dataPrefix = false; break; case 7: btnHtml = events.L10n(html.priceBtn); playerSource = cntlr.current()._leftController._view._list.listRows; page = cntlr.left()._paginationViewModel.pageIndex; break; default: break; } info.roster.element.type = type; var playerNoRepIdList = []; var playerArray = []; for (let i = 0; i < playerSource.length; i++) { let tempId = 0; playerArray[i] = dataPrefix ? events.playerAttext(playerSource[i].data) : events.playerAttext(playerSource[i]); if(playerArray[i].type == "player"){ tempId = playerArray[i].id; } if(tempId !== 0){ if(playerNoRepIdList.indexOf(tempId) == -1 && !info.roster.data.hasOwnProperty(tempId)){ playerNoRepIdList.push(tempId) } } } info.roster.element.player = playerArray; var priceUrl = []; if(playerNoRepIdList.length > 0){ let getRepeat = Math.ceil(playerNoRepIdList.length / 20); for (let i = 0; i < getRepeat; i++) { let listToText = playerNoRepIdList.splice(-20).join(); priceUrl.push(`https://www.futbin.com/${info.base.year}/playerPrices?player=&rids=${listToText}`) } } info.roster.element.url = priceUrl; if($(".fsu-price").length == 0){ events.rosterFill(info.roster.element.player,info.roster.element.box,type); if(info.roster.element.url.length !== 0){ rosterLoad(type); } } if($("#getprice").length == 0 || info.roster.page !== page){ info.roster.page = page; if($("#getprice").length == 0){ $(btnBox).append(btnHtml); } if([1,2,7].indexOf(type) !== -1 && $(btnBox).is(":hidden")){ $(btnBox).prev().addClass("paginated"); $(btnBox).css('display','flex'); $("#getprice").css('margin','auto'); } $("#getprice").click(async function () { events.showLoader(); events.notice("notice.priceloading", 1); for (const key in info.roster.element.url) { let tempData = await getFutbin(info.roster.element.url[key]); info.roster.data = Object.assign(info.roster.data,tempData); } events.rosterFill(info.roster.element.player,info.roster.element.box,type); events.hideLoader(); }) } if(priceUrl.length == 0){ console.log("没有可查询的球员") $("#getprice").addClass("disabled"); }else{ $("#getprice").removeClass("disabled"); } }; async function rosterLoad(type){ for (const key in info.roster.element.url) { let tempData = await getFutbin(info.roster.element.url[key]); info.roster.data = Object.assign(info.roster.data,tempData); } events.rosterFill(info.roster.element.player,info.roster.element.box,type); } events.rosterFill = (playerArray,playerBox,listType) => { for (let i = 0; i < playerArray.length; i++) { if(playerArray[i].type == "player"){ let dPrice = "0"; if(info.base.price.hasOwnProperty(playerArray[i].rating) == true){ dPrice = info.base.price[playerArray[i].rating]["p"]; } if(listType > 2){ $(playerBox).eq(i).find(".fsu-duplicates").remove(); $(playerBox).eq(i).append("
    ") let stateHtml = ""; if(playerArray[i].duplicate == 0){ if($(playerBox).eq(i).parents(".listFUTItem").hasClass('won')) continue; stateHtml = `
    ${events.L10n("duplicate.swap")}
    `; }else{ let playerExistence = false; let playerUntradeable = false; if(services.Item.itemDao.itemRepo.club.items._collection.hasOwnProperty(playerArray[i].duplicate) && !playerExistence){ playerExistence = true; playerUntradeable = services.Item.itemDao.itemRepo.club.items._collection[playerArray[i].duplicate].untradeable; } if(info.roster.thousand.hasOwnProperty(playerArray[i].id) && !playerExistence){ playerExistence = true; playerUntradeable = info.roster.thousand[playerArray[i].id].untradeable; } if(playerExistence){ if(playerUntradeable){ stateHtml = `
    ${events.L10n("duplicate.not")}
    `; }else{ stateHtml = `
    ${events.L10n("duplicate.yes")}
    `; } }else{ if(playerArray[i].rating <= info.roster.thousand.lowest){ stateHtml = `
    ${events.L10n("duplicate.nodata")}
    `; }else{ stateHtml = `
    ${events.L10n("duplicate.swap")}
    `; } } } $(playerBox).eq(i).find(".fsu-duplicates").append(stateHtml); if([6,4,3].indexOf(listType) !== -1){ $(playerBox).eq(i).find(".fsu-duplicates").append(`
    ${events.L10n("duplicate.lowprice")}${events.priceFormat(dPrice)}
    `); } } let attrType = listType == 5 ? 1 : 2; if($(playerBox).eq(i).find(".fsu-card-pos").length == 0){ $(playerBox).eq(i).find(".player .ut-item-view--main.ut-item-view").after(events.attributeToHtml(playerArray[i],attrType,1)); } if($(playerBox).eq(i).find(".fsu-card-attr").length == 0){ if([7,1].indexOf(listType) !== -1){ $(playerBox).eq(i).append(events.attributeToHtml(playerArray[i],attrType,2)); }else{ $(playerBox).eq(i).find(".player .ut-item-view--main.ut-item-view").after(events.attributeToHtml(playerArray[i],attrType,2)); } } if($(playerBox).eq(i).find(".fsu-card-lea").length == 0){ $(playerBox).eq(i).find(".playStyle").addClass("fsu-card-lea"); if(listType == 5) $(playerBox).eq(i).find(".playStyle").addClass("big"); $(playerBox).eq(i).find(".playStyle").append(events.attributeToHtml(playerArray[i],attrType,3)); } let priceHtml = "
    {pSub1}{pSub2}
    "; let priceSubHtml1 = ""; let priceSubHtml2 = ""; let priceClass = ""; if(info.roster.data.hasOwnProperty(playerArray[i].id)){ let price = info.roster.data[playerArray[i].id].prices[info.base.platform].LCPrice; priceSubHtml1 = `
    ${events.L10n("price.now")}
    {pValue}
    `; priceSubHtml1 = priceSubHtml1.replace("{pValue}",events.priceFormat(price)); if([2,3,4,6].indexOf(listType) !== -1){ priceClass = "block"; }; } if(listType == 1){ priceSubHtml2 = `
    ${events.L10n("price.low")}
    ${events.priceFormat(dPrice)}
    `; } priceHtml = priceHtml.replace("{pClass}",priceClass); priceHtml = priceHtml.replace("{pSub1}",priceSubHtml1); priceHtml = priceHtml.replace("{pSub2}",priceSubHtml2); $(playerBox).eq(i).find(".fsu-price").remove(); $(playerBox).eq(i).append(priceHtml); } } }; events.sbcButton = function(pageClass){ let consultHtml = "",element = ".ut-squad-summary-info--right",countState = false; let requirements = cntlr.current()._requirementsNotification._challenge.eligibilityRequirements; for (let item of requirements) { if(item.kvPairs._collection.hasOwnProperty(19)){ console.log("有评分选项") countState = true; window.requirementTarget = item.kvPairs._collection[19][0]; } if(item.kvPairs._collection.hasOwnProperty(35)){ consultHtml = events.L10n(html.consultBtn).replace("{sbcId}",cntlr.current()._challengeId + "/" + cntlr.current()._set.name); console.log("有默契选项") } } $(element).after(consultHtml); if(countState){ $(element).after(events.L10n(html.countBtn)); $("#goToCount").click(function () { let playerArray = getAppMain().getRootViewController().getPresentedViewController().getCurrentViewController().getCurrentController()._squad.getFieldPlayers(),playerNumber = [],playerRatingText = ""; for (let item of playerArray) { if(item.isBrick()){ playerNumber.push(0); }else{ if(item.item.rating !== 0){ playerNumber.push(item.item.rating) } } } if(playerNumber.length > 0){ playerRatingText = "&ratings=" + playerNumber.join(","); } GM_openInTab("https://futcd.com/sbc.html?target=" + window.requirementTarget.toString() + playerRatingText, { active: true, insert: true, setParent :true }); }); } } events.sbcInput = function(controller){ for (let item of ["club","nation","league"]) { let searchSeat = controller.searchFilters._collection[item].__label; let searchLabelText = $(searchSeat).text(); $(searchSeat).html(html.searchInput.replace("{text}",searchLabelText)) } $(".fsu-input").bind('input propertychange', function() { let targetObject = $(this).parents(".ut-search-filter-control--row").siblings("ul.inline-list"); let targetPanel = targetObject.parent(".inline-container"); let targetPanelTop = targetPanel.position().top; targetObject.css("height","14rem").css("background-color","#171826") targetObject.children("li").show(); if($(this).val().length > 0){ let targetLength = targetObject.children("li:contains('" + $(this).val() + "')").length; if(targetLength > 0){ targetObject.children("li:not(:contains('" + $(this).val() + "'))").hide(); if(targetLength < 4 && targetPanelTop !== 0){ let targetHeight = (4 - targetLength) * 49; targetObject.css("height",`calc(14rem - ${targetHeight}px)`); targetPanel.css("top",`calc(-224px + ${targetHeight}px)`); }else{ targetObject.css("height","14rem"); if(targetPanelTop !== 0){ targetPanel.css("top","-224px"); } } } }else{ targetObject.css("height","14rem"); if(targetPanelTop !== 0){ targetPanel.css("top","-224px"); } } }); } events.L10n = function(param) { let text = ""; if(param.indexOf("{") !== -1){ text = param; let paramArr = param.match(/{(.*?)}/g); for (let item of paramArr) { let paramFormat = item.match(/{(.*?)}/)[1]; if(info.localization[info.language].hasOwnProperty(paramFormat)){ text = text.replace(item,info.localization[info.language][paramFormat]); } } }else{ text = info.localization[info.language].hasOwnProperty(param) ? info.localization[info.language][param] : param; } return text; } info.localization = { "chs":{ "price.btntext":"查询价格", "price.formatno":"无数据", "price.formatcompany":"万", "price.now":"球员低价", "price.low":"评分低价", "duplicate.swap":"可发送俱乐部", "duplicate.not":"队内不可交易", "duplicate.yes":"队内可交易", "duplicate.nodata":"无队内数据", "duplicate.lowprice":"评分低价:", "top.readme":"【FSU】插件使用说明", "top.upgrade":"有新版FSU插件可升级", "notice.upgradefailed":"查询新版本失败", "notice.upgradeconfirm":"有新版本点击顶部链接查看", "notice.uasreset":"已重新载入列表 请重新进入查看", "notice.priceloading":"开始读取价格数据 请稍等", "notice.loaderror":"读取数据失败 请检查网络", "notice.succeeded":"FSU插件加载成功", "notice.duplicateloading":"开始读取重复球员数据 请稍等", "notice.quicksearch":"使用快捷添加 直接沿用上次配置搜索球员", "notice.noduplicate":"已无重复球员", "notiec.quickauction":"球员将按照最低售价作为即买价挂出", "task.player":"球员", "task.pack":"组合包", "task.added":"今日新增:", "task.noadded":"今日无新增", "task.new":"新", "task.expire":"即将到期", "task.nodata":"无数据请过段时间重新进入WEBAPP再查看", "sbc.price":"造价预估:", "sbc.like":"值得做:", "sbc.dislike":"不值得:", "sbc.consult":"抄作业", "sbc.count":"算评分", "sbc.duplicates":"重复球员名单", "sbc.addduplicate":"添加重复球员", "sbc.swapduplicate":"替换为重复球员", "sbc.notduplicate":"无重复球员", "sbc.addquick":"快捷添加球员", "sbc.swapquick":"快捷替换球员", "uasreset.btntext":"卡球员重载", "loadingclose.text":"数据载入 如卡顿点此关闭", "quicklist.gotofutbin":"前往FUTBIN查看", "quicklist.auction":"按低价快速拍卖", }, "cht":{ "price.btntext":"查詢價格", "price.formatno":"沒有數據", "price.formatcompany":"萬", "price.now":"最低價格", "price.low":"評分最低價格", "duplicate.swap":"可以送到球會", "duplicate.not":"球會球員無法交易", "duplicate.yes":"球會球員可交易", "duplicate.nodata":"沒有球員數據", "duplicate.lowprice":"評分最低價格:", "top.readme":"【FSU】插件使用說明", "top.upgrade":"有新版本的FSU插件可更新", "notice.upgradefailed":"查詢新版本失敗", "notice.upgradeconfirm":"有新版本點擊頂部鏈接查看", "notice.uasreset":"已重新載入列表 請重新進入查看", "notice.priceloading":"開始讀取價格數據 請稍等", "notice.loaderror":"讀取數據失敗 請檢查網絡", "notice.succeeded":"FSU插件載入成功", "notice.duplicateloading":"開始讀取重複球員數據 請稍等", "notice.quicksearch":"使用快捷增加球員 直接沿用上次配置搜索球員", "notice.noduplicate":"已經沒有重複球員", "notiec.quickauction":"球員將按最低價格列在轉會市場上", "task.player":"球員", "task.pack":"組合包", "task.added":"今日新增:", "task.noadded":"今日沒有新增", "task.new":"新", "task.expire":"即將過期", "task.nodata":"沒有數據請過段時間重新進入WEBAPP再查看", "sbc.price":"製作價格:", "sbc.like":"贊成:", "sbc.dislike":"反對:", "sbc.consult":"參考方案", "sbc.count":"計算評分", "sbc.duplicates":"重複球員名單", "sbc.addduplicate":"新增重複球員", "sbc.swapduplicate":"交換為重複球員", "sbc.notduplicate":"沒有重複球員", "sbc.addquick":"快速新增球員", "sbc.swapquick":"快速交換球員", "uasreset.btntext":"重新載入名單", "loadingclose.text":"數據載入中 如長時間未響應 請點擊此處關閉", "quicklist.gotofutbin":"前往FUTBIN查看", "quicklist.auction":"使用最低價格列入轉會", }, "en":{ "price.btntext":"Check Price", "price.formatno":"No Data", "price.formatcompany":"ten thousand", "price.now":"Low Price", "price.low":"Rating Price", "duplicate.swap":"Can be Sent to Club", "duplicate.not":"Club Players are Untradeable", "duplicate.yes":"Club Players are Tradable", "duplicate.nodata":"No Club Players Data", "duplicate.lowprice":"Rating Price ", "top.readme":"【FSU】Plugin Instructions", "top.upgrade":"There is a new version of the FSU plugin that can be upgraded", "notice.upgradefailed":"Query new version failed", "notice.upgradeconfirm":"There is a new version, click the top link to view", "notice.uasreset":"The list has been reloaded, please re-enter to view", "notice.priceloading":"Start reading price data, please wait", "notice.loaderror":"Failed to read data, please check the network", "notice.succeeded":"FSU plugin loaded successfully", "notice.duplicateloading":"Start reading duplicate player data, please wait", "notice.quicksearch":"Use the shortcut to add, directly follow the last configuration to search for players", "notice.noduplicate":"no duplicate player", "notiec.quickauction":"Players will be listed at the lowest selling price as an immediate purchase price", "task.player":"Player", "task.pack":"Pack", "task.added":"Added today ", "task.noadded":"No new additions today", "task.new":"New", "task.expire":"Expiring", "task.nodata":"No data, please re-enter WEBAPP after a while to check", "sbc.price":"Cost estimate:", "sbc.like":"Thumbs Up:", "sbc.dislike":"Thumbs Down:", "sbc.consult":"See Plan", "sbc.count":"Calculate Score", "sbc.duplicates":"Duplicate Players List", "sbc.addduplicate":"Add Duplicate Players", "sbc.swapduplicate":"Swap Duplicate Players", "sbc.notduplicate":"No Duplicate Players", "sbc.addquick":"Quick Add Player", "sbc.swapquick":"Quick Swap Player", "uasreset.btntext":"Reload List", "loadingclose.text":"If you encounter stuck, click here to close", "quicklist.gotofutbin":"Go to FUTBIN", "quicklist.auction":"Quick Auction at Low Price", }, } html = { "priceBtn":"", "priceBtn2":"", "taskBar":"
    {Number}
    ", "sbcInfo":"
    {sbc.price}{price}
    {sbc.like}{up}{sbc.dislike}{down}
    ", "consultBtn":"{sbc.consult}", "countBtn":"{sbc.count}", "searchInput":"", "uasBtn":"", }; className = { "home":"UTHomeHubViewController", "object":"UTObjectivesHubViewController", "sbc":"UTSBCHubViewController", "sbcList":"UTSBCChallengesViewController", "sbcItem":"UTSBCSquadSplitViewController", "squadItem":"UTSquadSplitViewController", }; futsbcup.keys = { sytle:".fsu-consult,.fsu-count{margin: auto;background-color: #7e42f5;border-color: transparent;color: #29ffc9;padding-left: 1rem;padding-right: 1rem;line-height: 2rem; height: 2rem;font-size: 1rem; display: block; text-align: center; text-decoration: none;}.fsu-consult:hover{background-color: #a991f2;}.fsu-input{border: 0 !important;background-color: rgba(0,0,0,0) !important;padding-left: 0 !important;}.fsu-count{background-color: #1a96f6;color: #f2f2f2;}.fsu-count:hover{background-color: #45a9f7;}html[dir=ltr] button.flat.pagination.next{order: 2;}button.flat.pagination.fsu-getprice::before{content: '\\\E04D';font-size: 1rem;margin-right: 0.2rem;font-family: UltimateTeam-Icons,sans-serif;}.tns-horizontal.tns-subpixel>.tns-item{position: relative;}button.notevents{pointer-events: none;color: #a4a9b4;}.btn-standard.section-header-btn.mini.call-to-action.fsu-getprice{margin-left: 1rem;}.btn-standard.section-header-btn.mini.call-to-action.fsu-getprice:hover{background-color:#e9dfcd}.view-modal-container.form-modal header .fsu-getprice{position: absolute;top: .5rem;left: 0;height: 2rem;line-height: 2rem;}.fsu-task-bar{position: absolute;right: .2rem;top: 0;}.ut-objective-entry-view--title span.task-new{padding-left: 0.5rem;padding-right: 0.8rem;background-color: #d31332;margin-right: 0.2rem;}.ut-sbc-set-tile-view .tileHeader span.task-new{padding-left: 0.3rem;padding-right: 0.8rem;background-color: #d31332;margin-right: 0.2rem;}.ut-sbc-set-tile-view.production-tagged .tileHeader::before{display:none;}.sbcInfo{padding: 0.5rem;background-color: #d313325c;display: flex;font-family: UltimateTeamCondensed,sans-serif;justify-content: space-between;font-size: 1.1rem;}.sbcInfo div{width: 50%;}.sbcInfo div{width: 50%;}.sbcInfo div:last-child{display: flex;justify-content: space-around;}.fsu-task{display: flex;justify-content: space-between;padding: 0.5rem;background-color: #d31332;}.fsu-task.no{background-color: #d313325c;}.task-expire{background-color: #d313325c;height: 2rem;line-height: 2rem;text-align: center;}a.header_explain{color: #a2a2a2;text-decoration: none;line-height: 3rem;}a.header_explain:hover{color: #ffffff;}.ut-fifa-header-view{display: flex;justify-content: space-between;}.fsu-duplicates{display: flex;color: #201e20;margin-top: .2rem;}.fsu-duplicates > div{font-family: UltimateTeamCondensed,sans-serif;background-color: #3B4754;padding: 0 0.5rem;text-align: center;border-radius: 20px;font-size: 0.9rem;margin-right: 0.5rem;}.fsu-duplicates > div.swap{background-color: #36b84b;}.fsu-duplicates > div.not{background-color: #8A6E2C;}.fsu-duplicates > div.yes{background-color: #264A35;}.fsu-price{padding-left: 6.3rem;font-family: UltimateTeamCondensed,sans-serif;}.fsu-price-item{display: flex;margin-top: 0.4rem;align-items: center;}.fsu-price-title{font-size:.875rem;color: #a4a9b4;line-height: 1rem;padding-right: 0.3rem;}.fsu-price-value{font-size: 1rem;line-height: 1rem;display: flex;align-items: center;justify-content: center;}.fsu-price.block{padding-left: 0;position: absolute;right: 0;top: 0;height: 100%;display: flex;align-items: center;}.fsu-price.block .fsu-price-item{background-color: #264A35;padding: 0.5rem;text-align: center;border-radius: 4px;margin-top: 0;display: block;}.fsu-price.block .fsu-price-title{padding: 0;font-size: 1rem;line-height: 1rem;}.fsu-price.block .fsu-price-value{font-size: 1.2rem;margin-top: .5rem;line-height: 1.2rem;}.ut-transfer-list-view .listFUTItem .auction{max-width: 18rem;right: 8rem !important;top: 20%;}.player-pick-option .fsu-price{padding-left:0;display:flex;justify-content:center;}.player-pick-option .fsu-duplicates{justify-content:center;}.player-pick-option .fsu-duplicates > div.swap{margin:0;}.large-picks-container .player-pick-option.selected{background-size: 100% auto !important;}.SearchResults.ui-layout-left ul:not(.fsu-card-pos){display: grid;grid-template-columns: repeat(2, minmax(0, 1fr));}.SearchResults.ui-layout-left .listFUTItem.has-auction-data.selected .rowContent.has-tap-callback{background-color: #2c319b8f;}.SearchResults .listFUTItem.has-auction-data .entityContainer{width: 100%;}.SearchResults .listFUTItem.has-auction-data .player-stats-data-component{width: 44%;}.SearchResults .listFUTItem.has-auction-data .player-stats-data-component ul{display: grid;grid-template-columns: repeat(3, minmax(0, 1fr));}.SearchResults .listFUTItem.has-auction-data .player-stats-data-component ul li{padding:0;margin-top: 0.2rem;}.SearchResults .listFUTItem.has-auction-data .auction{display: flex;width: 46%;right: 0;top: 2.7rem;}.SearchResults.ui-layout-left .listFUTItem .rowContent.has-tap-callback::before{display:none;}.SearchResults .fsu-duplicates {position: absolute;bottom: 4px;z-index: 100;width: 93px;margin: 0;left: 10px;}.SearchResults .fsu-duplicates > div {margin: 0;padding: 0;width: 100%;font-size: 0.8rem;text-align: center;}.SearchResults .fsu-price {position: absolute;right: 4px;background-color: #264A35;border-radius: 4px;top: 8px;padding-left:0;}.SearchResults .fsu-price-item {margin: 0.3rem;}.fsu-getprice.disabled{pointer-events: none;color: #787d85 !important;}.btn-standard.fsu-getprice.disabled{background-color: #11151a;}@media (max-width:1130px){.ut-transfer-list-view .listFUTItem .auction{top:24%}ul.itemList .listFUTItem.has-auction-data .fsu-duplicates{margin-top: 5rem;margin-left: 6.2rem;}}.fsu-loading-close{display: none;position: absolute;bottom: 40%;z-index: 999;}.fsu-loading .fsu-loading-close{display: block;}.fsu-card-pos{position: absolute;right: 0px;top: 1.6rem;width:22px;z-index: 2;font-weight: 300;}.fsu-card-pos li{font-size: 80%;background: #0040A6;border-radius: 4px;color: #ffffff;margin-bottom: 2px;text-align: center;}.fsu-card-pos.big{z-index: 3;top: 2.6rem;width: 30px;font-weight:600;}.fsu-card-pos.big li{font-size: 100%;font-weight: 300;}.fsu-squad-price {font-size: 0.7rem;text-align: center;position: absolute;top: -.4rem;z-index:1;-webkit-transform: translateX(-50%);transform: translateX(-50%);left: 50%;background-color: #0f1417;padding: 0 .4rem;border-radius: 4px;color: #a4a9b4;display: flex;align-items: center;}.fsu-squad-price span,.fsu-price-value span{font-size:90%;white-space: nowrap;}.fsu-card-attr{position: absolute;bottom: 3%;display: flex;justify-content: space-between;width: 82%;margin: 0 9%;font-size: 0.8rem;height: 1rem;align-items: flex-start;border-radius: 4px;background-color: #0040A6;}.fsu-card-attr div{padding: 0 3px;font-family: UltimateTeamCondensed,sans-serif;font-weight:300;background-color: #0040A6;}.fsu-card-attr div:nth-child(2){font-size: 104%;}.fsu-card-attr.big{bottom: 7%;font-size: 1rem;height: 1.2rem;font-weight:600;}.fsu-card-attr.big div{padding: 0px 4px;}.entityContainer > .fsu-card-attr{z-index: 3;width: 3.2rem;left: 2rem;margin: 0;bottom: 7%;}.SearchResults .entityContainer > .fsu-card-attr{top: 5%;z-index: 1;}.tns-inner .large>.ut-squad-slot-chemistry-points-view.item{left: 3%;bottom: 20%;}.fsu-card-lea.playStyle:before{display:none}.fsu-card-lea.playStyle{bottom:11% !important;font-size:70% !important; font-family: UltimateTeam,sans-serif;line-height: 1;}.fsu-card-lea.playStyle.big{bottom: 10% !important;}.ut-squad-slot-view .fsu-card-attr{bottom: 0%;}.ut-squad-pitch-view .ut-squad-slot-view .fsu-card-attr{-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;-webkit-flex-direction: column;flex-direction: column;background: none;width: 1rem;height: 2.1rem;left: -1.4rem;z-index: 2;top:1.6rem;align-items: center;}.ut-squad-slot-view .fsu-card-pos{font-size: 1rem;font-family: UltimateTeamCondensed,sans-serif;font-weight: 300;}.ut-squad-pitch-view .ut-squad-slot-view .fsu-card-pos{right: -0.9rem;}.fsu-card-lea-big{position: absolute;z-index: 3;background-color: #0040A6;border-radius: 4px;padding: 2px 4px;left: 50%;-webkit-transform: translateX(-50%) !important;transform: translateX(-50%) !important;white-space: nowrap;font-size: 86.75%;line-height: 1;}.fsu-task-bar-favorite{background-color: rgb(255,86,48);right: 0.2rem;top: 2px;color: #ffffff;padding: 0 6px;border-radius: 4px;line-height: 1.2rem;position: absolute;}", sytle:".fsu-consult,.fsu-count{margin: auto;background-color: #7e42f5;border-color: transparent;color: #29ffc9;padding-left: 1rem;padding-right: 1rem;line-height: 2rem; height: 2rem;font-size: 1rem; display: block; text-align: center; text-decoration: none;}.fsu-consult:hover{background-color: #a991f2;}.fsu-input{border: 0 !important;background-color: rgba(0,0,0,0) !important;padding-left: 0 !important;}.fsu-count{background-color: #1a96f6;color: #f2f2f2;}.fsu-count:hover{background-color: #45a9f7;}html[dir=ltr] button.flat.pagination.next{order: 2;}button.flat.pagination.fsu-getprice::before{content: '\\\E04D';font-size: 1rem;margin-right: 0.2rem;font-family: UltimateTeam-Icons,sans-serif;}.tns-horizontal.tns-subpixel>.tns-item{position: relative;}button.notevents{pointer-events: none;color: #a4a9b4;}.btn-standard.section-header-btn.mini.call-to-action.fsu-getprice{margin-left: 1rem;}.btn-standard.section-header-btn.mini.call-to-action.fsu-getprice:hover{background-color:#e9dfcd}.view-modal-container.form-modal header .fsu-getprice{position: absolute;top: .5rem;left: 0;height: 2rem;line-height: 2rem;}.fsu-task-bar{position: absolute;right: .2rem;top: 0;}.ut-objective-entry-view--title span.task-new{padding-left: 0.5rem;padding-right: 0.8rem;background-color: #d31332;margin-right: 0.2rem;}.ut-sbc-set-tile-view .tileHeader span.task-new{padding-left: 0.3rem;padding-right: 0.8rem;background-color: #d31332;margin-right: 0.2rem;}.ut-sbc-set-tile-view.production-tagged .tileHeader::before{display:none;}.sbcInfo{padding: 0.5rem;background-color: #d313325c;display: flex;font-family: UltimateTeamCondensed,sans-serif;justify-content: space-between;font-size: 1.1rem;}.sbcInfo div{width: 50%;}.sbcInfo div{width: 50%;}.sbcInfo div:last-child{display: flex;justify-content: space-around;}.fsu-task{display: flex;justify-content: space-between;padding: 0.5rem;background-color: #d31332;}.fsu-task.no{background-color: #d313325c;}.task-expire{background-color: #d313325c;height: 2rem;line-height: 2rem;text-align: center;}a.header_explain{color: #a2a2a2;text-decoration: none;line-height: 3rem;}a.header_explain:hover{color: #ffffff;}.ut-fifa-header-view{display: flex;justify-content: space-between;}.fsu-duplicates{display: flex;color: #201e20;margin-top: .2rem;}.fsu-duplicates > div{font-family: UltimateTeamCondensed,sans-serif;background-color: #3B4754;padding: 0 0.5rem;text-align: center;border-radius: 20px;font-size: 0.9rem;margin-right: 0.5rem;}.fsu-duplicates > div.swap{background-color: #36b84b;}.fsu-duplicates > div.not{background-color: #8A6E2C;}.fsu-duplicates > div.yes{background-color: #264A35;}.fsu-price{padding-left: 6.3rem;font-family: UltimateTeamCondensed,sans-serif;}.fsu-price-item{display: flex;margin-top: 0.4rem;align-items: center;}.fsu-price-title{font-size:.875rem;color: #a4a9b4;line-height: 1rem;padding-right: 0.3rem;}.fsu-price-value{font-size: 1rem;line-height: 1rem;display: flex;align-items: center;justify-content: center;}.fsu-price.block{padding-left: 0;position: absolute;right: 0;top: 0;height: 100%;display: flex;align-items: center;}.fsu-price.block .fsu-price-item{background-color: #264A35;padding: 0.5rem;text-align: center;border-radius: 4px;margin-top: 0;display: block;}.fsu-price.block .fsu-price-title{padding: 0;font-size: 1rem;line-height: 1rem;}.fsu-price.block .fsu-price-value{font-size: 1.2rem;margin-top: .5rem;line-height: 1.2rem;}.ut-transfer-list-view .listFUTItem .auction{max-width: 18rem;right: 8rem !important;top: 20%;}.player-pick-option .fsu-price{padding-left:0;display:flex;justify-content:center;}.player-pick-option .fsu-duplicates{justify-content:center;}.player-pick-option .fsu-duplicates > div.swap{margin:0;}.large-picks-container .player-pick-option.selected{background-size: 100% auto !important;}.SearchResults.ui-layout-left ul:not(.fsu-card-pos){display: grid;grid-template-columns: repeat(2, minmax(0, 1fr));}.SearchResults.ui-layout-left .listFUTItem.has-auction-data.selected .rowContent.has-tap-callback{background-color: #2c319b8f;}.SearchResults .listFUTItem.has-auction-data .entityContainer{width: 100%;}.SearchResults .listFUTItem.has-auction-data .player-stats-data-component{width: 44%;}.SearchResults .listFUTItem.has-auction-data .player-stats-data-component ul{display: grid;grid-template-columns: repeat(3, minmax(0, 1fr));}.SearchResults .listFUTItem.has-auction-data .player-stats-data-component ul li{padding:0;margin-top: 0.2rem;}.SearchResults .listFUTItem.has-auction-data .auction{display: flex;width: 46%;right: 0;top: 2.7rem;}.SearchResults.ui-layout-left .listFUTItem .rowContent.has-tap-callback::before{display:none;}.SearchResults .fsu-duplicates {position: absolute;bottom: 4px;z-index: 100;width: 93px;margin: 0;left: 10px;}.SearchResults .fsu-duplicates > div {margin: 0;padding: 0;width: 100%;font-size: 0.8rem;text-align: center;}.SearchResults .fsu-price {position: absolute;right: 4px;background-color: #264A35;border-radius: 4px;top: 8px;padding-left:0;}.SearchResults .fsu-price-item {margin: 0.3rem;}.fsu-getprice.disabled{pointer-events: none;color: #787d85 !important;}.btn-standard.fsu-getprice.disabled{background-color: #11151a;}@media (max-width:1130px){.ut-transfer-list-view .listFUTItem .auction{top:24%}ul.itemList .listFUTItem.has-auction-data .fsu-duplicates{margin-top: 5rem;margin-left: 6.2rem;}}.fsu-loading-close{display: none;position: absolute;bottom: 40%;z-index: 999;}.fsu-loading .fsu-loading-close{display: block;}.fsu-card-pos{position: absolute;right: 0px;top: 1.6rem;width:22px;z-index: 3;font-weight: 300;}.fsu-card-pos li{font-size: 80%;background: #0040A6;border-radius: 4px;color: #ffffff;margin-bottom: 2px;text-align: center;}.fsu-card-pos.big{z-index: 3;top: 2.6rem;width: 30px;font-weight:600;}.fsu-card-pos.big li{font-size: 100%;font-weight: 300;}.fsu-squad-price {font-size: 0.7rem;text-align: center;position: absolute;top: -.4rem;z-index:1;-webkit-transform: translateX(-50%);transform: translateX(-50%);left: 50%;background-color: #0f1417;padding: 0 .4rem;border-radius: 4px;color: #a4a9b4;display: flex;align-items: center;}.fsu-squad-price span,.fsu-price-value span{font-size:90%;white-space: nowrap;}.fsu-card-attr{position: absolute;bottom: 3%;display: flex;justify-content: space-between;width: 82%;margin: 0 9%;font-size: 0.8rem;height: 1rem;align-items: flex-start;border-radius: 4px;background-color: #0040A6;}.fsu-card-attr div{padding: 0 3px;font-family: UltimateTeamCondensed,sans-serif;font-weight:300;background-color: #0040A6;}.fsu-card-attr div:nth-child(2){font-size: 104%;}.fsu-card-attr.big{bottom: 7%;font-size: 1rem;height: 1.2rem;font-weight:600;}.fsu-card-attr.big div{padding: 0px 4px;}.entityContainer > .fsu-card-attr{z-index: 3;width: 3.2rem;left: 2rem;margin: 0;bottom: 7%;}.SearchResults .entityContainer > .fsu-card-attr{top: 5%;z-index: 1;}.tns-inner .large>.ut-squad-slot-chemistry-points-view.item{left: 3%;bottom: 20%;}.fsu-card-lea.playStyle:before{display:none}.fsu-card-lea.playStyle{bottom:11% !important;font-size:70% !important; font-family: UltimateTeam,sans-serif;line-height: 1;}.fsu-card-lea.playStyle.big{bottom: 10% !important;}.ut-squad-slot-view .fsu-card-attr{bottom: 0%;}.ut-squad-pitch-view .ut-squad-slot-view .fsu-card-attr{-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;-webkit-flex-direction: column;flex-direction: column;background: none;width: 1rem;height: 2.1rem;left: -1.4rem;z-index: 2;top:1.6rem;align-items: center;}.ut-squad-slot-view .fsu-card-pos{font-size: 1rem;font-family: UltimateTeamCondensed,sans-serif;font-weight: 300;}.ut-squad-pitch-view .ut-squad-slot-view .fsu-card-pos{right: -0.9rem;}.fsu-card-lea-big{position: absolute;z-index: 3;background-color: #0040A6;border-radius: 4px;padding: 2px 4px;left: 50%;-webkit-transform: translateX(-50%) !important;transform: translateX(-50%) !important;white-space: nowrap;font-size: 86.75%;line-height: 1;}.fsu-task-bar-favorite{background-color: rgb(255,86,48);right: 0.2rem;top: 2px;color: #ffffff;padding: 0 6px;border-radius: 4px;line-height: 1.2rem;position: absolute;}", }; function getFutbin(url){ return new Promise(res => { GM_xmlhttpRequest({ method:"GET", url:url, headers: { "Content-type": "application/json" }, onload:function(response){ if(response.status == 404){ events.notice("notice.loaderror",2); if($(".ut-click-shield").is(':visible')){ $(".fsu-loading").removeClass("showing fsu-loading"); $(".fsu-loading .loaderIcon").css("display", "none"); } return; } res(JSON.parse(response.response)) }, onerror:function(){ events.notice("notice.loaderror",2); if($(".ut-click-shield").is(':visible')){ $(".fsu-loading").removeClass("showing fsu-loading"); $(".fsu-loading .loaderIcon").css("display", "none"); } } }) }) }; futsbcup.callBack = function(mutationsList){ let fsuAdd = mutationsList.some((item) => { if (item.target.className.indexOf("fsu-") !== -1) { return true; } }); //console.log(mutationsList) //console.log("fsuadd",fsuAdd) if(fsuAdd) return; if($(".ut-tab-bar-view.game-navigation").length === 0) return; if(!cntlr.current() || !cntlr.current().className) return; let currentName = cntlr.current().className; if(currentName == className.home){ if($(".view-navbar-clubinfo-name") !== null && info.base.state == false){ events.init(); info.base.state = true; } if(info.task["obj"].html !== "" && $(info.task["obj"].parent).find(".fsu-task").length == 0){ $(info.task["obj"].parent).find("header").after(info.task["obj"].html); } if(info.task["sbc"].html !== "" && $(info.task["sbc"].parent).find(".fsu-task").length == 0){ $(info.task["sbc"].parent).find("header").after(info.task["sbc"].html); } } if(currentName == className.object){ if(info.task["obj"].stat.new[-1] > 0 && $(".fsu-task-bar").length == 0){ let objBar = cntlr.current()._view._objectivesTM.items; let newJson = info.task["obj"].stat.new; for (let name in newJson) { if(name !== "-1"){ objBar[name].__root.insertAdjacentHTML('beforeend', events.L10n(html.taskBar).replace("{Number}",`+${newJson[name]}`)); } } } let objectiveSubview = cntlr.current().getView().objectiveSubview; if(typeof objectiveSubview == "object"){ if(objectiveSubview.hasOwnProperty("groups") && $(".ut-objective-entry-view--title span").length == 0){ let objList = objectiveSubview.groups; for (let i = 0; i < objList.length; i++) { let objId = objList[i].id; let objAttr = info.task["obj"].stat[objId]; if(objAttr !== undefined){ let titleHtml = ""; let expireHtml = "" if(objAttr.f == "1"){ titleHtml = `${events.L10n("task.new")}`; } if(objAttr.e == "1"){ expireHtml = `
    ${events.L10n("task.expire")}
    `; } objList[i].__title.insertAdjacentHTML('afterBegin', titleHtml); objList[i].__title.parentElement.insertAdjacentHTML('afterend', expireHtml); } } } } } if(currentName == className.sbc){ if(info.task["sbc"].stat.new[0] > 0 && $(".fsu-task-bar").length == 0){ let sbcBar = cntlr.current()._view._SBCCategoriesTM.items; let newJson = info.task["sbc"].stat.new; for (let name in newJson) { if(sbcBar[name] !== undefined){ sbcBar[name].__root.insertAdjacentHTML('beforeend', events.L10n(html.taskBar).replace("{Number}",`+${newJson[name]}`)); } } } if(services.SBC.repository.categories._collection.hasOwnProperty("Favourite")){ let sbcFavorite = services.SBC.repository.categories._collection.Favourite.setIds; let sbcFavoriteExpire = 0; for (let sbcId of sbcFavorite) { if(info.task["sbc"].stat[sbcId].e == "1") sbcFavoriteExpire++; } if(sbcFavoriteExpire > 0){ let sbcFavoriteHmtl = `
    ${sbcFavoriteExpire}
    `; let sbcFavoriteBox = ".ea-filter-bar-item-view:eq(1)"; if($(sbcFavoriteBox).find(".fsu-task-bar-favorite").length == 0){ $(sbcFavoriteBox).append(sbcFavoriteHmtl) }else if($(sbcFavoriteBox).find(".fsu-task-bar-favorite").prop('outerHTML') !== sbcFavoriteHmtl){ $(sbcFavoriteHmtl).replaceAll(`${sbcFavoriteBox} .fsu-task-bar-favorite`) } } } let sbcList = cntlr.current()._view.sbcSetTiles; if(sbcList.length > 0 && $(".tileHeader span").length == 0){ for (let i = 0; i < sbcList.length; i++) { let sbcId = sbcList[i].data.id; let sbcAttr = info.task["sbc"].stat[sbcId]; if(sbcAttr !== undefined){ let titleHtml = ""; let expireHtml = ""; if(sbcAttr.f == "1"){ titleHtml = `${events.L10n("task.new")}`; } if(sbcAttr.e == "1"){ expireHtml = `
    ${events.L10n("task.expire")}
    `; } sbcList[i].__tileTitle.insertAdjacentHTML('afterBegin', titleHtml); sbcList[i].__root.insertAdjacentHTML('afterBegin', expireHtml); if(sbcList[i]._interactionState == true){ let infoHtml = events.L10n(html.sbcInfo); let priceText = "0"; if(sbcAttr.type !== "7"){ if(info.base.platform == "pc"){ priceText = sbcAttr.pc; }else{ priceText = sbcAttr.tv; } } infoHtml = infoHtml.replace("{price}",events.priceFormat(priceText)); infoHtml = infoHtml.replace("{up}",sbcAttr.u); infoHtml = infoHtml.replace("{down}",sbcAttr.d); sbcList[i].__root.lastChild.insertAdjacentHTML('beforebegin', infoHtml) } }else{ sbcList[i].__tileTitle.insertAdjacentHTML('afterBegin', ""); sbcList[i].__root.lastChild.insertAdjacentHTML('beforebegin', `
    ${events.L10n("task.nodata")}
    `) } } } } if(currentName == className.sbcItem){ if($(".fsu-sbcButton").length == 0){ events.sbcButton(currentName); } } if($(".view-modal-container.form-modal").length == 1){ let notification = getAppMain()._defaultDispatcher._observers._collection["notification.AppResume"]._observers.slice(-1); if(notification[0].scope.className == 'UTStorePackRevealModalListViewController'){ events.rosterInfo(4); } if(notification[0].scope.className == 'UTPlayerPicksViewController'){ events.rosterInfo(5); } } if(currentName == "ClubSearchResultsSplitViewController"){ events.quickList(); events.rosterInfo(2); }; if(currentName == "UTMarketSearchResultsSplitViewController"){ events.quickList(); events.rosterInfo(7); }; if(currentName == "UTTransferListSplitViewController"){ events.rosterInfo(3); events.quickList(); }; if(currentName == "UTUnassignedItemsSplitViewController"){ events.rosterInfo(6); events.uasReset(); events.quickList(); }; if([className.sbcItem,className.squadItem].indexOf(currentName) != -1){ if(cntlr.current()._rightController.className == "UTSquadComparePlayersViewController"){ return; } if(cntlr.right().className == "UTClubSearchFiltersViewController"){ if($(".fsu-input").length == 0){ events.sbcInput(cntlr.right().getView()._filterContainer); } if(info.criteria.state){ let currentCriteria = cntlr.right().viewmodel.searchCriteria; if(info.unassigned.run == 1){ let searchCriteria = new UTSearchCriteriaDTO(); searchCriteria._type = "player"; searchCriteria.count = 21; searchCriteria.sortBy = Object.keys(info.criteria.data).length ? info.criteria.data.sortBy : "ovr"; searchCriteria._sort = Object.keys(info.criteria.data).length ? info.criteria.data._sort : "desc"; searchCriteria.defId = info.unassigned.playerId; console.log(searchCriteria.sortBy,searchCriteria._sort) cntlr.right().viewmodel.searchCriteria = searchCriteria; cntlr.right().getView().getSearchButton()._tapDetected(this); events.notice("notice.duplicateloading",1); return; } if(info.unassigned.run !== 0 && currentCriteria.defId.length == 0){ console.log("状态不是0","但是判断符合条件给变成0") info.unassigned.run = 0; } if(info.unassigned.run == 2){ console.log("状态2","修改input") cntlr.right().getView().getPlayerNameSearch()._playerNameInput.setValue(events.L10n("sbc.duplicates")); cntlr.right().getView().getSortDropDown().setIndexById(2); let posId = -1; if(cntlr.current()._squad._players[cntlr.left().getView().getSelectedSlot()._slotIndex].position !== null){ posId = cntlr.current()._squad._players[cntlr.left().getView().getSelectedSlot()._slotIndex].position.typeId; } return; } console.log("开始判断进行填充选项","此时的saveCriteria为:",info.criteria.data) if(Object.keys(info.criteria.data).length == 0){ cntlr.right().getView().getSortDropDown().setIndexById(2); info.criteria.state = false; }else{ info.criteria.state = false; //交易选项匹配判断 currentCriteria._untradeables = info.criteria.data._untradeables; if(info.criteria.data._untradeables == "true"){ cntlr.right().getView().getSortOptions().toggles._collection["sort-untradeable"].toggle(true); }else{ cntlr.right().getView().getSortOptions().toggles._collection["sort-untradeable"].toggle(false); } //排除队伍选项匹配判断 if(cntlr.current().className == className.squadItem){ currentCriteria.excludeDefIds = []; }else{ currentCriteria.excludeDefIds = info.criteria.data.excludeDefIds; if(info.criteria.data.excludeDefIds.length > 0){ cntlr.right().getView().getSortOptions().toggles._collection["sort-exclude-squad"].toggle(true); }else{ cntlr.right().getView().getSortOptions().toggles._collection["sort-exclude-squad"].toggle(false); } } //排序条件选项匹配判断 if(info.criteria.data.sortBy !== currentCriteria.sortBy || info.criteria.data._sort !== currentCriteria._sort){ let sort = ["valuedesc","valueasc","ovrdesc","ovrasc","recentdesc"] for (let i = 0; i < sort.length; i++) { if(info.criteria.data.sortBy + info.criteria.data._sort == sort[i]){ cntlr.right().getView().getSortDropDown().setIndexById(i); break; } } } //品质条件选项匹配判断 if(info.criteria.data.level !== currentCriteria.level){ for (const v of cntlr.right().getView()._filterContainer.filters[0].options) { if(v.value == info.criteria.data.level){ cntlr.right().getView()._filterContainer.filters[0].setIndexById(v.id); break; } } } //稀有条件选项匹配判断 if(info.criteria.data.rarities !== currentCriteria.rarities){ if(info.criteria.data.rarities.length == 1){ cntlr.right().getView()._filterContainer.filters[1].setIndexById(info.criteria.data.rarities[0]) } } //位置条件选项匹配判断 if(info.criteria.data._position == "any"){ cntlr.right().getView()._filterContainer.filters[2].setIndexById(-1) }else{ let posId = -1; if(cntlr.current()._squad._players[cntlr.left().getView().getSelectedSlot()._slotIndex].position !== null){ posId = cntlr.current()._squad._players[cntlr.left().getView().getSelectedSlot()._slotIndex].position.typeId; } cntlr.right().getView()._filterContainer.filters[2].setIndexById(posId) } //地区条件选项匹配判断 if(info.criteria.data.nation !== currentCriteria.nation){ cntlr.right().getView()._filterContainer.filters[4].setIndexById(info.criteria.data.nation) } //联赛条件选项匹配判断 if(info.criteria.data.league !== currentCriteria.league){ cntlr.right().getView()._filterContainer.filters[5].setIndexById(info.criteria.data.league) } //俱乐部条件选项匹配判断 if(info.criteria.data.club !== currentCriteria.club){ cntlr.right().getView()._filterContainer.filters[6].setIndexById(info.criteria.data.club) } if(info.criteria.repeat == 1){ cntlr.right().getView().getSearchButton()._tapDetected(this); info.criteria.repeat = 0; events.notice("notice.quicksearch",1); console.log("快捷添加状态变为",0) return; } } } } if(cntlr.right().className == "UTSelectItemFromClubViewController"){ if($(".paginated-item-list .listFUTItem").length == 0 && $(".paginated-item-list .ut-no-results-view").length == 0){ console.log("没有结果输出") return; } if(info.unassigned.run == 1){ info.unassigned.run = 2; console.log("状态1","判断是否没有球员") if($(".paginated-item-list .listFUTItem").length == 0){ events.notice("notice.noduplicate",2); services.Item.itemDao.itemRepo.unassigned.reset(); return; } } events.rosterInfo(1); if(cntlr.right().searchCriteria.defId.length == 0 && cntlr.current().className !== className.squadItem){ info.criteria.data = JSON.parse(JSON.stringify(cntlr.right().searchCriteria)); } } if(cntlr.right().className == "UTSlotDetailsViewController"){ info.criteria.state = true; events.quickList(); if(currentName == className.sbcItem){ if($(".position-container").length !== 0){ let btnPrev = ""; let btnPattern = 0; if(cntlr.current()._squad._players[cntlr.left().getView().getSelectedSlot()._slotIndex].getItem().definitionId == 0){ btnPrev = info.base.localization["infopanel.label.addplayer"]; btnPattern = 1; }else{ btnPrev = info.base.localization["infopanel.label.swapplayer"]; btnPattern = 2; } if(btnPattern == 0) return; if($("#weifenpei").length == 0){ let btnText = btnPattern == 1 ? events.L10n("sbc.addduplicate") : events.L10n("sbc.swapduplicate"); let btnDisabled = ""; let unassignedJson = services.Item.itemDao.itemRepo.unassigned._collection; info.unassigned = {"state":false,"run":0,"playerId":[]}; console.log("点选位置重置为状态",0) if(Object.keys(unassignedJson).length > 0){ let players = []; for (let i = 0; i < cntlr.current()._squad._players.length; i++) { if(cntlr.current()._squad._players[i].item.definitionId !== 0){ players.push(cntlr.current()._squad._players[i].item.definitionId) } } for (const key in unassignedJson) { if(unassignedJson[key].isDuplicate() && unassignedJson[key].loans == -1 && unassignedJson[key].type == "player" && players.indexOf(unassignedJson[key].definitionId) == -1){ info.unassigned.playerId.push(unassignedJson[key].definitionId); } } } if(info.unassigned.playerId.length > 0){ info.unassigned.state = true; }else{ btnDisabled = "disabled"; btnText = events.L10n("sbc.notduplicate"); } $(`.btn-text:contains(${btnPrev})`).parent().after(``); if(info.unassigned.state){ $("#weifenpei").click(function () { cntlr.right()._panelView.eButtonSelected(cntlr.right()._panelView._btnAddSwap) info.unassigned.run = 1; console.log("点击按钮变为状态",1) }) } } if($("#repeat").length == 0){ info.criteria.repeat = 0; let btnText = btnPattern == 1 ? events.L10n("sbc.addquick") : events.L10n("sbc.swapquick"); let btnDisabled = Object.keys(info.criteria.data).length ? "" : "disabled"; $(`.btn-text:contains(${btnPrev})`).parent().after(``); if(Object.keys(info.criteria.data).length){ $("#repeat").click(function () { cntlr.right()._panelView.eButtonSelected(cntlr.right()._panelView._btnAddSwap) info.criteria.repeat = 1; console.log("快捷添加状态变为",1) }) } } } } } events.squad(currentName); }; if(currentName == "UTMarketSearchFiltersViewController"){ if(cntlr.current().getView()._tabMenu.selectedItemId === 0){ if($(".fsu-input").length == 0){ events.sbcInput(cntlr.current().getView()._searchFilters); } } }; }; futsbcup.start = function(){ GM_addStyle(this.keys.sytle); //选择一个需要观察的节点 var targetNode = document.getElementsByTagName("body")[0], // 设置observer的配置选项 config = {childList: true,characterData: true,attributes: false,subtree: true}, observer = new MutationObserver(this.callBack); //使用配置文件对目标节点进行观测 observer.observe(targetNode, config); }; futsbcup.start() })();