mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-06-28 02:48:14 -05:00
Update #48 - Added some features from OptiFine
This commit is contained in:
@ -77,6 +77,8 @@ class OpenGLObjects {
|
||||
private static int hashGen = 0;
|
||||
final WebGLTexture ptr;
|
||||
final int hash;
|
||||
int width;
|
||||
int height;
|
||||
|
||||
TextureGL(WebGLTexture ptr) {
|
||||
this.ptr = ptr;
|
||||
@ -92,6 +94,22 @@ class OpenGLObjects {
|
||||
PlatformOpenGL._wglDeleteTextures(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCacheSize(int w, int h) {
|
||||
width = w;
|
||||
height = h;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class ProgramGL implements IProgramGL {
|
||||
|
@ -318,6 +318,7 @@ public class PlatformInput {
|
||||
parent.addEventListener("contextmenu", contextmenu = new EventListener<MouseEvent>() {
|
||||
@Override
|
||||
public void handleEvent(MouseEvent evt) {
|
||||
if(evt.getTarget() == ClientMain.integratedServerCrashPanel) return;
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
}
|
||||
@ -471,8 +472,10 @@ public class PlatformInput {
|
||||
win.addEventListener("keydown", keydown = new EventListener<KeyboardEvent>() {
|
||||
@Override
|
||||
public void handleEvent(KeyboardEvent evt) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
if(!ClientMain.integratedServerCrashPanelShowing) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
}
|
||||
if(!enableRepeatEvents && evt.isRepeat()) return;
|
||||
LegacyKeycodeTranslator.LegacyKeycode keyCode = null;
|
||||
if(keyCodeTranslatorMap != null && hasCodeVar(evt)) {
|
||||
@ -528,8 +531,10 @@ public class PlatformInput {
|
||||
win.addEventListener("keyup", keyup = new EventListener<KeyboardEvent>() {
|
||||
@Override
|
||||
public void handleEvent(KeyboardEvent evt) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
if(!ClientMain.integratedServerCrashPanelShowing) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
}
|
||||
LegacyKeycodeTranslator.LegacyKeycode keyCode = null;
|
||||
if(keyCodeTranslatorMap != null && hasCodeVar(evt)) {
|
||||
keyCode = keyCodeTranslatorMap.get(evt.getCode());
|
||||
|
@ -618,7 +618,8 @@ public class ClientMain {
|
||||
}
|
||||
}
|
||||
|
||||
private static HTMLElement integratedServerCrashPanel = null;
|
||||
public static HTMLElement integratedServerCrashPanel = null;
|
||||
public static boolean integratedServerCrashPanelShowing = false;
|
||||
|
||||
public static void showIntegratedServerCrashReportOverlay(String report, int x, int y, int w, int h) {
|
||||
if(integratedServerCrashPanel == null) {
|
||||
@ -655,12 +656,14 @@ public class ClientMain {
|
||||
style.setProperty("width", "" + ((w / s) - 20) + "px");
|
||||
style.setProperty("height", "" + ((h / s) - 20) + "px");
|
||||
style.setProperty("display", "block");
|
||||
integratedServerCrashPanelShowing = true;
|
||||
}
|
||||
|
||||
public static void hideIntegratedServerCrashReportOverlay() {
|
||||
if(integratedServerCrashPanel != null) {
|
||||
integratedServerCrashPanel.getStyle().setProperty("display", "none");
|
||||
}
|
||||
integratedServerCrashPanelShowing = false;
|
||||
}
|
||||
|
||||
@JSBody(params = { "el", "str" }, script = "el.innerText = str;")
|
||||
|
Reference in New Issue
Block a user