Compare commits
	
		
			4 Commits 
		
	
	
		
			ed94c65172
			...
			da3c5b0e15
		
	
	| Author | SHA1 | Date | 
|---|---|---|
| 
							
							
								 | 
						da3c5b0e15 | |
| 
							
							
								 | 
						8279e6260a | |
| 
							
							
								 | 
						77839a0e03 | |
| 
							
							
								 | 
						98116c8633 | 
								
									
									
										
											2
										
									
									build.js
									
									
									
									
								
								
							
							
										
											2
										
									
									build.js
									
									
									
									
								| 
						 | 
					@ -87,7 +87,7 @@ const dictionary = modUtils.dictionary;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const rawCodeSegments = [
 | 
					const rawCodeSegments = [
 | 
				
			||||||
	`aQ.eI(e0)?aQ.eE(e0)?a38=__L([a38]):(player=aQ.eF(e0),oq=__L([b0.uS.zG(@playerData.@rawPlayerNames[player],b0.p9.qQ(0,10),150)])+"   ",oq=(oq+=__L([b0.wx.a07(playerData.@playerBalances[player])])+"   ")+__L([b0.wx.a07(playerData.@playerTerritories[player])])+"   ",`,
 | 
						`aQ.eI(e0)?aQ.eE(e0)?a38=__L([a38]):(player=aQ.eF(e0),oq=__L([b0.uS.zG(@playerData.@rawPlayerNames[player],b0.p9.qQ(0,10),150)])+"   ",oq=(oq+=__L([b0.wx.a07(playerData.@playerBalances[player])])+"   ")+__L([b0.wx.a07(playerData.@playerTerritories[player])])+"   ",`,
 | 
				
			||||||
	"this.@gLobbyMaxJoin=1===dg?this.@gHumans:this.@data.@playerCount,this.tZ=this.gLobbyMaxJoin,this.@gBots=this.gLobbyMaxJoin-this.gHumans,this.sg=0,",
 | 
						"1===a.b?this.@gLobbyMaxJoin=this.@gHumans:this.gLobbyMaxJoin=this.@data.@playerCount,this.tZ=this.gLobbyMaxJoin,this.@gBots=this.gLobbyMaxJoin-this.gHumans,this.sg=0,",
 | 
				
			||||||
	"[0]=__L(),@strs[1]=@game.@gIsSingleplayer?__L():__L(),",
 | 
						"[0]=__L(),@strs[1]=@game.@gIsSingleplayer?__L():__L(),",
 | 
				
			||||||
	"?(this.gB=Math.floor(.066*aK.fw),g5=aK.g5-4*@uiSizes.@gap-this.gB):",
 | 
						"?(this.gB=Math.floor(.066*aK.fw),g5=aK.g5-4*@uiSizes.@gap-this.gB):",
 | 
				
			||||||
	`for(a0L=new Array(@game.@gMaxPlayers),a0A.font=a07,@i=game.gMaxPlayers-1;0<=i;i--)a0L[i]=i+1+".",@playerData.@playerNames[i]=aY.qW.tm(playerData.@rawPlayerNames[i],a07,a0W),a0K[i]=Math.floor(a0A.measureText(playerData.playerNames[i]).width);`,
 | 
						`for(a0L=new Array(@game.@gMaxPlayers),a0A.font=a07,@i=game.gMaxPlayers-1;0<=i;i--)a0L[i]=i+1+".",@playerData.@playerNames[i]=aY.qW.tm(playerData.@rawPlayerNames[i],a07,a0W),a0K[i]=Math.floor(a0A.measureText(playerData.playerNames[i]).width);`,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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, replaceRawCode, dictionary: dict, waitForMinification }) => {
 | 
					export default (/** @type {ModUtils} */ { insertCode, replaceCode, replaceRawCode, dictionary: dict, waitForMinification }) => {
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    // set player id correctly
 | 
					    // set player id correctly
 | 
				
			||||||
    insertCode(`function aBG(aBE) {
 | 
					    insertCode(`function aBG(aBE) {
 | 
				
			||||||
| 
						 | 
					@ -13,13 +13,20 @@ export default (/** @type {ModUtils} */ { insertCode, replaceRawCode, dictionary
 | 
				
			||||||
		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 + l.dg]; socket = new WebSocket(url);`,
 | 
				
			||||||
 | 
					        `var url = aQt[0] + Sockets.a.b[socketId] + aQt[1 + l.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):",
 | 
				
			||||||
| 
						 | 
					@ -47,8 +54,6 @@ export default (/** @type {ModUtils} */ { insertCode, replaceRawCode, dictionary
 | 
				
			||||||
            __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))`,
 | 
				
			||||||
| 
						 | 
					@ -68,8 +73,8 @@ export default (/** @type {ModUtils} */ { insertCode, replaceRawCode, dictionary
 | 
				
			||||||
        replaceRawCode(":50,this.a=this.b=this.data.c,this.d=this.b?new e:null,",
 | 
					        replaceRawCode(":50,this.a=this.b=this.data.c,this.d=this.b?new e:null,",
 | 
				
			||||||
            ":50,this.a=this.b=__fx.customLobby.isActive() ? __fx.customLobby.gameInfo.spawnSelection : this.data.c,this.d=this.b?new e:null,")
 | 
					            ":50,this.a=this.b=__fx.customLobby.isActive() ? __fx.customLobby.gameInfo.spawnSelection : this.data.c,this.d=this.b?new e:null,")
 | 
				
			||||||
        // bot count
 | 
					        // bot count
 | 
				
			||||||
        replaceRawCode(",this.gLobbyMaxJoin=1===dg?this.gHumans:this.data.playerCount,this.maxPlayers=this.gLobbyMaxJoin,this.gBots=this.gLobbyMaxJoin-this.gHumans,this.sg=0,",
 | 
					        replaceRawCode("1===a.b?this.gLobbyMaxJoin=this.gHumans:this.gLobbyMaxJoin=this.data.playerCount,this.maxPlayers=this.gLobbyMaxJoin,this.gBots=this.gLobbyMaxJoin-this.gHumans,this.sg=0,",
 | 
				
			||||||
            `,this.gLobbyMaxJoin = __fx.customLobby.isActive() ? Math.max(Math.min(__fx.customLobby.gameInfo.botCount, this.data.playerCount), this.gHumans) : 1===dg?this.gHumans:this.data.playerCount,
 | 
					            `this.gLobbyMaxJoin = __fx.customLobby.isActive() ? Math.max(Math.min(__fx.customLobby.gameInfo.botCount, this.data.playerCount), this.gHumans) : 1===a.b?this.gLobbyMaxJoin=this.gHumans:this.gLobbyMaxJoin=this.data.playerCount,
 | 
				
			||||||
            this.maxPlayers=this.gLobbyMaxJoin,this.gBots=this.gLobbyMaxJoin-this.gHumans,this.sg=0,`)
 | 
					            this.maxPlayers=this.gLobbyMaxJoin,this.gBots=this.gLobbyMaxJoin-this.gHumans,this.sg=0,`)
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,26 @@
 | 
				
			||||||
 | 
					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),`
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -20,8 +20,8 @@ function applyPatches(/** @type {ModUtils} */ { replace, replaceOne, replaceRawC
 | 
				
			||||||
    replaceOne(/(\(22,"logo",8,")[^"]+"\)/g, "$1" + assets.smallLogo + "\")");
 | 
					    replaceOne(/(\(22,"logo",8,")[^"]+"\)/g, "$1" + assets.smallLogo + "\")");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Add FX Client version info to the game version window
 | 
					    // Add FX Client version info to the game version window
 | 
				
			||||||
    replaceRawCode(`ar.oa(4,1,new s8(__L(),gameVersion+"<br><a href='"+ah.aC5+"' target='_blank'>"+ah.aC5+"</a>",`,
 | 
					    replaceRawCode(`ar.oa(4,1,new s8(__L(),c.gameVersion+"<br><a href='"+ah.aC5+"' target='_blank'>"+ah.aC5+"</a>",`,
 | 
				
			||||||
        `ar.oa(4,1,new s8(__L(),gameVersion+"<br><a href='"+ah.aC5+"' target='_blank'>"+ah.aC5+"</a>"
 | 
					        `ar.oa(4,1,new s8(__L(),c.gameVersion+"<br><a href='"+ah.aC5+"' target='_blank'>"+ah.aC5+"</a>"
 | 
				
			||||||
+ "<br><br><b>" + "FX Client v" + __fx.version + "<br><a href='https://discord.gg/dyxcwdNKwK' target='_blank'>FX Client Discord server</a>"
 | 
					+ "<br><br><b>" + "FX Client v" + __fx.version + "<br><a href='https://discord.gg/dyxcwdNKwK' target='_blank'>FX Client Discord server</a>"
 | 
				
			||||||
+ "<br><a href='https://github.com/fxclient/FXclient' target='_blank'>Github repository</a></b>",`);
 | 
					+ "<br><a href='https://github.com/fxclient/FXclient' target='_blank'>Github repository</a></b>",`);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -292,31 +292,14 @@ 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)) + "%"`)
 | 
				
			||||||
    replaceRawCode(",fontSize=+dz*Math.min(f0,.37);", ",fontSize=(__fx.settings.detailedTeamPercentage ? 0.75 : 1)*dz*Math.min(f0,.37);")
 | 
					    replaceRawCode(",fontSize=+dz*Math.min(f0,.37);", ",fontSize=(__fx.settings.detailedTeamPercentage ? 0.75 : 1)*dz*Math.min(f0,.37);")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Invalid hostname detection avoidance
 | 
					    // Invalid hostname detection avoidance
 | 
				
			||||||
    replaceRawCode(`,hostnameIsValid=0<=window.location.hostname.toLowerCase().indexOf("territorial.io"),`,
 | 
					    replaceRawCode(`,this.hostnameIsValid=0<=window.location.hostname.toLowerCase().indexOf("territorial.io"),`,
 | 
				
			||||||
        `,hostnameIsValid=true,`)
 | 
					        `,this.hostnameIsValid=true,`)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Disable built-in Territorial.io error reporting
 | 
					    // Disable built-in Territorial.io error reporting
 | 
				
			||||||
    replaceOne(/window\.addEventListener\("error",function (\w+)\((\w+)\){/g,
 | 
					    replaceOne(/window\.addEventListener\("error",function (\w+)\((\w+)\){/g,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
import { getUIGap } from "./gameInterface.js";
 | 
					import { getUIGap, getVar } 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;
 | 
				
			||||||
    executeKeybind(keybindData);
 | 
					    if (getVar("gameState") !== 0) executeKeybind(keybindData);
 | 
				
			||||||
    return true;
 | 
					    return true;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
function executeKeybind(keybind) {
 | 
					function executeKeybind(keybind) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
const fx_version = '0.6.7.2'; // FX Client Version
 | 
					const fx_version = '0.6.7.4'; // FX Client Version
 | 
				
			||||||
const fx_update = 'Mar 2'; // FX Client Last Updated
 | 
					const fx_update = 'Mar 8'; // FX Client Last Updated
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if ("serviceWorker" in navigator) {
 | 
					if ("serviceWorker" in navigator) {
 | 
				
			||||||
  navigator.serviceWorker.addEventListener("message", (e) => {
 | 
					  navigator.serviceWorker.addEventListener("message", (e) => {
 | 
				
			||||||
| 
						 | 
					@ -23,6 +23,9 @@ 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