Compare commits
	
		
			No commits in common. "8279e6260a4d4752b6d07f55ea3e78455ba89770" and "ed94c651729b3b525a3390bfcfa4e1bf63c230a0" have entirely different histories. 
		
	
	
		
			8279e6260a
			...
			ed94c65172
		
	
		
	| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
import ModUtils from '../modUtils.js';
 | 
					import ModUtils from '../modUtils.js';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Custom lobby patches
 | 
					// Custom lobby patches
 | 
				
			||||||
export default (/** @type {ModUtils} */ { insertCode, replaceCode, replaceRawCode, dictionary: dict, waitForMinification }) => {
 | 
					export default (/** @type {ModUtils} */ { insertCode, replaceRawCode, dictionary: dict, waitForMinification }) => {
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    // set player id correctly
 | 
					    // set player id correctly
 | 
				
			||||||
    insertCode(`function aBG(aBE) {
 | 
					    insertCode(`function aBG(aBE) {
 | 
				
			||||||
| 
						 | 
					@ -13,20 +13,13 @@ export default (/** @type {ModUtils} */ { insertCode, replaceCode, replaceRawCod
 | 
				
			||||||
		return -1;
 | 
							return -1;
 | 
				
			||||||
	}`, `if (__fx.customLobby.isActive()) return __fx.customLobby.getPlayerId();`);
 | 
						}`, `if (__fx.customLobby.isActive()) return __fx.customLobby.getPlayerId();`);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    insertCode(`this.y___ = function() { s___.t(5, 5); };
 | 
					 | 
				
			||||||
	    this.a3a = function() { s___.w___(); aY.init(); }; /* here */`,
 | 
					 | 
				
			||||||
        `__fx.customLobby.setJoinFunction(() => { s___.w___(); aY.init(); });`)
 | 
					 | 
				
			||||||
    replaceCode(`var url = aQt[0] + Sockets.a.b[socketId] + aQt[1 + dg]; socket = new WebSocket(url);`,
 | 
					 | 
				
			||||||
        `var url = aQt[0] + Sockets.a.b[socketId] + aQt[1 + dg];
 | 
					 | 
				
			||||||
        socket = new WebSocket(__fx.customLobby.isActive() && socketId === 1 ? __fx.customLobby.getSocketURL() : url);`)
 | 
					 | 
				
			||||||
    // if the server is unreachable
 | 
					 | 
				
			||||||
    insertCode(`if (socketId === 0) { q.a08(3249); return; } /* here */`,
 | 
					 | 
				
			||||||
        `if (socketId === 1 && __fx.customLobby.isActive()) {
 | 
					 | 
				
			||||||
            q.a08(3249);
 | 
					 | 
				
			||||||
            return __fx.customLobby.setActive(false);
 | 
					 | 
				
			||||||
        }`)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    waitForMinification(() => {
 | 
					    waitForMinification(() => {
 | 
				
			||||||
 | 
					        replaceRawCode("this.aHm=function(){i___.rX(),aM.a7U(0),aM.init()}",
 | 
				
			||||||
 | 
					            `this.aHm=function(){i___.rX(),aM.a7U(0),aM.init()},
 | 
				
			||||||
 | 
					            __fx.customLobby.setJoinFunction(() => { i___.rX(); aM.a7U(0); aM.init(); })`
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					        replaceRawCode(`(socketId-aq.kt.a82)+"/",(socket=new WebSocket(url)`,
 | 
				
			||||||
 | 
					            `(socketId-aq.kt.a82)+"/",(socket=new WebSocket(__fx.customLobby.isActive() && socketId === 1 ? __fx.customLobby.getSocketURL() : url)`)
 | 
				
			||||||
        replaceRawCode("this.send=function(socketId,data){aJE(socketId),aJ4[socketId].send(data)}",
 | 
					        replaceRawCode("this.send=function(socketId,data){aJE(socketId),aJ4[socketId].send(data)}",
 | 
				
			||||||
            "this.send=function(socketId,data){aJE(socketId),aJ4[socketId].send(data)},__fx.customLobby.setSendFunction(this.send)")
 | 
					            "this.send=function(socketId,data){aJE(socketId),aJ4[socketId].send(data)},__fx.customLobby.setSendFunction(this.send)")
 | 
				
			||||||
        replaceRawCode("b7.dH(a0),0===b7.size?aq.kt.aJJ(wR,3205):",
 | 
					        replaceRawCode("b7.dH(a0),0===b7.size?aq.kt.aJJ(wR,3205):",
 | 
				
			||||||
| 
						 | 
					@ -54,6 +47,8 @@ export default (/** @type {ModUtils} */ { insertCode, replaceCode, replaceRawCod
 | 
				
			||||||
            __fx.customLobby.isActive() && (sV.style.display = "none"),`);
 | 
					            __fx.customLobby.isActive() && (sV.style.display = "none"),`);
 | 
				
			||||||
        // allow games with one player
 | 
					        // allow games with one player
 | 
				
			||||||
        replaceRawCode("if((t3=bk.t1.t3[e0])<2)return!1;", "if((t3=bk.t1.t3[e0])<2 && !__fx.customLobby.isActive())return!1;")
 | 
					        replaceRawCode("if((t3=bk.t1.t3[e0])<2)return!1;", "if((t3=bk.t1.t3[e0])<2 && !__fx.customLobby.isActive())return!1;")
 | 
				
			||||||
 | 
					        // if the server is unreachable
 | 
				
			||||||
 | 
					        replaceRawCode("{g.wc(3249)}", "{__fx.customLobby.isActive()?(g.wc(3249),__fx.customLobby.setActive(false)):g.wc(3249)}")
 | 
				
			||||||
        // error descriptions
 | 
					        // error descriptions
 | 
				
			||||||
        const errors = { 3249: "No servers found", 4705: "Lobby not found", 4730: "Kicked from lobby" };
 | 
					        const errors = { 3249: "No servers found", 4705: "Lobby not found", 4730: "Kicked from lobby" };
 | 
				
			||||||
        replaceRawCode(`m.n___(4,5,new o(__L(),xT(e),!0))`,
 | 
					        replaceRawCode(`m.n___(4,5,new o(__L(),xT(e),!0))`,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,26 +0,0 @@
 | 
				
			||||||
import ModUtils from "../modUtils.js";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Highlight clan spawnpoints
 | 
					 | 
				
			||||||
export default (/** @type {ModUtils} */ { replaceCode, waitForMinification, replaceRawCode }) => {
 | 
					 | 
				
			||||||
    // when rendered on game start
 | 
					 | 
				
			||||||
    replaceCode(
 | 
					 | 
				
			||||||
        `var x = (d.minX[i] + d.maxX[i] + 1 - hQ - 2) >> 1;
 | 
					 | 
				
			||||||
        var y = (d.minY[i] + d.maxY[i] + 1 - hQ - 2) >> 1;
 | 
					 | 
				
			||||||
        ctx.drawImage(a1e[game.gIsTeamGame ? ((game.gGameType === 9 && aD.a[i] === 5) ? 3 : t.ids[i]) : (i < game.gHumans ? 1 : 0)], x, y);`,
 | 
					 | 
				
			||||||
        `var highlight = __fx.settings.highlightClanSpawns && __fx.clanFilter.inOwnClan[i];
 | 
					 | 
				
			||||||
        if (highlight) hQ *= 2;
 | 
					 | 
				
			||||||
        var x = (d.minX[i] + d.maxX[i] + 1 - hQ - 2) >> 1;
 | 
					 | 
				
			||||||
        var y = (d.minY[i] + d.maxY[i] + 1 - hQ - 2) >> 1;
 | 
					 | 
				
			||||||
        if (highlight) ctx.drawImage(a1e[game.gIsTeamGame ? ((game.gGameType === 9 && aD.a[i] === 5) ? 3 : t.ids[i]) : (i < game.gHumans ? 1 : 0)], x, y, hQ, hQ);
 | 
					 | 
				
			||||||
        else ctx.drawImage(a1e[game.gIsTeamGame ? ((game.gGameType === 9 && aD.a[i] === 5) ? 3 : t.ids[i]) : (i < game.gHumans ? 1 : 0)], x, y);`,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
    waitForMinification(() => {
 | 
					 | 
				
			||||||
        // when rendered during spawn selection
 | 
					 | 
				
			||||||
        replaceRawCode("function(a6,es,bK,hP,hQ,hR,ov){0===dV.eg[a6]||0===dV.ev[a6]||(hQ=ay.ak*((dV.nu[a6]+dV.nw[a6]+1)/2-bK)/(hQ-bK)-.5*es,bK=ay.al*((dV.nv[a6]+dV.nx[a6]+1)/2-hP)/(hR-hP)-.5*es,hQ>ay.ak)||bK>ay.al||hQ<-es||bK<-es||(bI.setTransform(cz,0,0,cz,hQ,bK),",
 | 
					 | 
				
			||||||
            `function(a6,es,bK,hP,hQ,hR,ov){
 | 
					 | 
				
			||||||
            var highlight = __fx.settings.highlightClanSpawns && __fx.clanFilter.inOwnClan[a6];
 | 
					 | 
				
			||||||
            if (highlight) es *= 2;
 | 
					 | 
				
			||||||
            0===dV.eg[a6]||0===dV.ev[a6]||(hQ=ay.ak*((dV.nu[a6]+dV.nw[a6]+1)/2-bK)/(hQ-bK)-.5*es,bK=ay.al*((dV.nv[a6]+dV.nx[a6]+1)/2-hP)/(hR-hP)-.5*es,hQ>ay.ak)||bK>ay.al||hQ<-es||bK<-es||(bI.setTransform(highlight?cz*2:cz,0,0,highlight?cz*2:cz,hQ,bK),`
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
    })
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -292,6 +292,23 @@ canvas.font=aY.g0.g1(1,fontSize),canvas.fillStyle="rgba("+gR+","+tD+","+hj+",0.6
 | 
				
			||||||
            `aK.nH = (window.devicePixelRatio || 1) * aEr, __fx.hoveringTooltip.canvasPixelScale = aK.nH,`)
 | 
					            `aK.nH = (window.devicePixelRatio || 1) * aEr, __fx.hoveringTooltip.canvasPixelScale = aK.nH,`)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    { // Highlight clan spawnpoints
 | 
				
			||||||
 | 
					        // when rendered on game start
 | 
				
			||||||
 | 
					        replaceRawCode("var x;0!==playerData.eg[i]&&0!==playerData.playerTerritories[i]&&(x=playerData.nu[i]+playerData.nw[i]+1-gv-2>>1,gv=playerData.nv[i]+playerData.nx[i]+1-gv-2>>1,ctx.drawImage(km[game.gIsTeamGame?lV.i6[i]:i<game.gHumans?1:0],x,gv))",
 | 
				
			||||||
 | 
					            `var x, y, highlight = __fx.settings.highlightClanSpawns && __fx.clanFilter.inOwnClan[i];
 | 
				
			||||||
 | 
					            if (highlight) gv *= 2;
 | 
				
			||||||
 | 
					            0!==playerData.eg[i]&&0!==playerData.playerTerritories[i]&&(x=playerData.nu[i]+playerData.nw[i]+1-gv-2>>1,y=playerData.nv[i]+playerData.nx[i]+1-gv-2>>1,
 | 
				
			||||||
 | 
					            highlight ? ctx.drawImage(km[game.gIsTeamGame?lV.i6[i]:i<game.gHumans?1:0],x,y, gv, gv)
 | 
				
			||||||
 | 
					            : ctx.drawImage(km[game.gIsTeamGame?lV.i6[i]:i<game.gHumans?1:0],x,y))`)
 | 
				
			||||||
 | 
					        // when rendered during spawn selection
 | 
				
			||||||
 | 
					        replaceRawCode("function(a6,es,bK,hP,hQ,hR,ov){0===dV.eg[a6]||0===dV.ev[a6]||(hQ=ay.ak*((dV.nu[a6]+dV.nw[a6]+1)/2-bK)/(hQ-bK)-.5*es,bK=ay.al*((dV.nv[a6]+dV.nx[a6]+1)/2-hP)/(hR-hP)-.5*es,hQ>ay.ak)||bK>ay.al||hQ<-es||bK<-es||(bI.setTransform(cz,0,0,cz,hQ,bK),",
 | 
				
			||||||
 | 
					            `function(a6,es,bK,hP,hQ,hR,ov){
 | 
				
			||||||
 | 
					            var highlight = __fx.settings.highlightClanSpawns && __fx.clanFilter.inOwnClan[a6];
 | 
				
			||||||
 | 
					            if (highlight) es *= 2;
 | 
				
			||||||
 | 
					            0===dV.eg[a6]||0===dV.ev[a6]||(hQ=ay.ak*((dV.nu[a6]+dV.nw[a6]+1)/2-bK)/(hQ-bK)-.5*es,bK=ay.al*((dV.nv[a6]+dV.nx[a6]+1)/2-hP)/(hR-hP)-.5*es,hQ>ay.ak)||bK>ay.al||hQ<-es||bK<-es||(bI.setTransform(highlight?cz*2:cz,0,0,highlight?cz*2:cz,hQ,bK),`
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Detailed team pie chart percentage
 | 
					    // Detailed team pie chart percentage
 | 
				
			||||||
    replaceRawCode(`qr=Math.floor(100*f0+.5)+"%"`,
 | 
					    replaceRawCode(`qr=Math.floor(100*f0+.5)+"%"`,
 | 
				
			||||||
        `qr = (__fx.settings.detailedTeamPercentage ? (100*f0).toFixed(2) : Math.floor(100*f0+.5)) + "%"`)
 | 
					        `qr = (__fx.settings.detailedTeamPercentage ? (100*f0).toFixed(2) : Math.floor(100*f0+.5)) + "%"`)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
import { getUIGap, getVar } from "./gameInterface.js";
 | 
					import { getUIGap } from "./gameInterface.js";
 | 
				
			||||||
import { getSettings } from "./settings.js";
 | 
					import { getSettings } from "./settings.js";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const keybindFunctions = {
 | 
					export const keybindFunctions = {
 | 
				
			||||||
| 
						 | 
					@ -9,7 +9,7 @@ export const keybindFunctions = {
 | 
				
			||||||
export const keybindHandler = key => {
 | 
					export const keybindHandler = key => {
 | 
				
			||||||
    const keybindData = getSettings().attackPercentageKeybinds.find(keybind => keybind.key === key);
 | 
					    const keybindData = getSettings().attackPercentageKeybinds.find(keybind => keybind.key === key);
 | 
				
			||||||
    if (keybindData === undefined) return false;
 | 
					    if (keybindData === undefined) return false;
 | 
				
			||||||
    if (getVar("gameState") !== 0) executeKeybind(keybindData);
 | 
					    executeKeybind(keybindData);
 | 
				
			||||||
    return true;
 | 
					    return true;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
function executeKeybind(keybind) {
 | 
					function executeKeybind(keybind) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
const fx_version = '0.6.7.3'; // FX Client Version
 | 
					const fx_version = '0.6.7.2'; // FX Client Version
 | 
				
			||||||
const fx_update = 'Mar 8'; // FX Client Last Updated
 | 
					const fx_update = 'Mar 2'; // FX Client Last Updated
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if ("serviceWorker" in navigator) {
 | 
					if ("serviceWorker" in navigator) {
 | 
				
			||||||
  navigator.serviceWorker.addEventListener("message", (e) => {
 | 
					  navigator.serviceWorker.addEventListener("message", (e) => {
 | 
				
			||||||
| 
						 | 
					@ -23,9 +23,6 @@ import hoveringTooltip from "./hoveringTooltip.js";
 | 
				
			||||||
import { keybindFunctions, keybindHandler, mobileKeybinds } from "./keybinds.js";
 | 
					import { keybindFunctions, keybindHandler, mobileKeybinds } from "./keybinds.js";
 | 
				
			||||||
import customLobby from './customLobby.js';
 | 
					import customLobby from './customLobby.js';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const savedVersion = localStorage.getItem("fx_version");
 | 
					 | 
				
			||||||
if (savedVersion !== fx_version) localStorage.setItem("fx_version", fx_version);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
window.__fx = window.__fx || {};
 | 
					window.__fx = window.__fx || {};
 | 
				
			||||||
const __fx = window.__fx;
 | 
					const __fx = window.__fx;
 | 
				
			||||||
__fx.version = fx_version + " " + fx_update;
 | 
					__fx.version = fx_version + " " + fx_update;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue