mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-06-27 18:38:14 -05:00
Update #48 - Added some features from OptiFine
This commit is contained in:
@ -16,6 +16,11 @@
|
||||
|
||||
const clientPlatfSPName = "clientPlatformSingleplayer";
|
||||
|
||||
/** @type {HTMLElement} */
|
||||
var integratedServerCrashPanel = null;
|
||||
|
||||
var integratedServerCrashPanelShowing = false;
|
||||
|
||||
function initializeClientPlatfSP(spImports) {
|
||||
|
||||
/** @type {Worker|null} */
|
||||
@ -163,9 +168,6 @@ function initializeClientPlatfSP(spImports) {
|
||||
}
|
||||
};
|
||||
|
||||
/** @type {HTMLElement} */
|
||||
var integratedServerCrashPanel = null;
|
||||
|
||||
/**
|
||||
* @param {string} report
|
||||
* @param {number} x
|
||||
@ -188,12 +190,14 @@ function initializeClientPlatfSP(spImports) {
|
||||
integratedServerCrashPanel.style.width = "" + ((w / s) - 20) + "px";
|
||||
integratedServerCrashPanel.style.height = "" + ((h / s) - 20) + "px";
|
||||
integratedServerCrashPanel.style.display = "block";
|
||||
integratedServerCrashPanelShowing = true;
|
||||
};
|
||||
|
||||
spImports["hideCrashReportOverlay"] = function() {
|
||||
if(integratedServerCrashPanel) {
|
||||
integratedServerCrashPanel.style.display = "none";
|
||||
}
|
||||
integratedServerCrashPanelShowing = false;
|
||||
};
|
||||
|
||||
window.__curEaglerX188UnloadListenerCB = function() {
|
||||
|
@ -222,6 +222,7 @@ async function initPlatformInput(inputImports) {
|
||||
reportWindowSize();
|
||||
|
||||
parentElement.addEventListener("contextmenu", currentEventListeners.contextmenu = function(/** Event */ evt) {
|
||||
if(evt.target === integratedServerCrashPanel) return;
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
});
|
||||
@ -369,8 +370,10 @@ async function initPlatformInput(inputImports) {
|
||||
}
|
||||
|
||||
window.addEventListener("keydown", /** @type {function(Event)} */ (currentEventListeners.keydown = function(/** KeyboardEvent */ evt) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
if(integratedServerCrashPanelShowing) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
}
|
||||
if(evt.key === "F11" && !evt.repeat) {
|
||||
toggleFullscreenImpl();
|
||||
return;
|
||||
@ -380,8 +383,10 @@ async function initPlatformInput(inputImports) {
|
||||
}));
|
||||
|
||||
window.addEventListener("keyup", /** @type {function(Event)} */ (currentEventListeners.keyup = function(/** KeyboardEvent */ evt) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
if(integratedServerCrashPanelShowing) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
}
|
||||
pushEvent(EVENT_TYPE_INPUT, EVENT_INPUT_KEYBOARD, createKeyEvent(EVENT_KEY_UP, evt));
|
||||
}));
|
||||
|
||||
|
Reference in New Issue
Block a user