add toggle proxy button
This commit is contained in:
parent
67eb726630
commit
ff32a46310
javascript
src/main/java/net
57684
javascript/classes.js
57684
javascript/classes.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -15,7 +15,7 @@
|
|||
|
||||
<script type="text/javascript" src="music.js"></script>
|
||||
|
||||
<script type="text/javascript" src="classes.js?t=updateme9"></script>
|
||||
<script type="text/javascript" src="classes.js?t=updateme10"></script>
|
||||
<script type="text/javascript">
|
||||
//window.eag_self_proxy=true;//set to true to set the default proxy to the current url
|
||||
//window.eag_proxy_list="";//set to a string of comma-separated proxy ip:port combinations for a custom proxy list
|
||||
|
@ -66,4 +66,4 @@ if(window.navigator.clipboard&&window.isSecureContext&&navigator.userAgent.toLow
|
|||
</head>
|
||||
<body style="margin:0px;width:100vw;height:100vh;" id="game_frame">
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -86,7 +86,7 @@ public class GuiScreenEditProfile extends GuiScreen {
|
|||
this.dropDownOptions = EaglerProfile.concatArrays(n, defaultOptions);
|
||||
}
|
||||
|
||||
private GuiButton button0, button1, button2, button3;
|
||||
private GuiButton button0, button1, button2, button3, button4;
|
||||
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
@ -105,6 +105,7 @@ public class GuiScreenEditProfile extends GuiScreen {
|
|||
this.buttonList.add(button2 = new GuiButton(3, this.width / 2 - 21 + 71, this.height / 6 + 110, 72, 20, var1.translateKey("profile.clearSkin")));
|
||||
|
||||
this.buttonList.add(button3 = new GuiButton(4, this.width / 2 - 21 + 71, this.height / 6 + 134, 72, 20, this.mc.gameSettings.useDefaultProtocol?"Switch to Eaglercraft":"Switch to Vanilla"));
|
||||
this.buttonList.add(button4 = new GuiButton(5, this.width / 2 - 21, this.height / 6 + 134, 72, 20, (this.mc.gameSettings.useProxy?"Dis":"En")+"able Proxy Mode"));
|
||||
//this.buttonList.add(new GuiButton(200, this.width / 2, this.height / 6 + 72, 150, 20, var1.translateKey("gui.done")));
|
||||
}
|
||||
|
||||
|
@ -351,6 +352,10 @@ public class GuiScreenEditProfile extends GuiScreen {
|
|||
//toggle version mode
|
||||
this.mc.gameSettings.useDefaultProtocol=!this.mc.gameSettings.useDefaultProtocol;
|
||||
button3.displayString=this.mc.gameSettings.useDefaultProtocol?"Switch to Eaglercraft":"Switch to Vanilla";
|
||||
}else if (par1GuiButton.id == 5) {
|
||||
//toggle using proxy
|
||||
this.mc.gameSettings.useProxy=!this.mc.gameSettings.useProxy;
|
||||
button4.displayString=(this.mc.gameSettings.useProxy?"Dis":"En")+"able Proxy Mode";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import java.util.Arrays;
|
|||
|
||||
public class GameSettings {
|
||||
public static boolean useDefaultProtocol = true;
|
||||
public static boolean useProxy = true;
|
||||
public static String proxy = "";
|
||||
public static String getNewProxy(){
|
||||
if(ConfigConstants.proxies.length==1)return ConfigConstants.proxies[0];
|
||||
|
|
|
@ -74,7 +74,7 @@ public class GuiConnecting extends GuiScreen {
|
|||
}
|
||||
}
|
||||
|
||||
this.clientHandler = new NetClientHandler(this.mc, this.mc.gameSettings.proxy.equals("")?uri:uria, 0);
|
||||
this.clientHandler = new NetClientHandler(this.mc, (this.mc.gameSettings.proxy.equals("")||!this.mc.gameSettings.useProxy)?uri:uria, 0);
|
||||
if(this.mc.gameSettings.useDefaultProtocol) {
|
||||
this.clientHandler.addToSendQueue(new Packet2ClientProtocol(61, EaglerProfile.username, uria, port));
|
||||
}else{
|
||||
|
|
Loading…
Reference in New Issue
Block a user