fix getCorrective

This commit is contained in:
ZXMushroom63 2024-10-18 19:42:24 +08:00
parent b7fad68438
commit 9730e87c46
4 changed files with 4 additions and 121 deletions

View File

@ -115,6 +115,9 @@ globalThis.modapi_postinit = "(" + (() => {
return name;
}
ModAPI.util.wrap = function (outputValue, target, corrective, disableFunctions) {
target ||= {};
corrective ||= false;
disableFunctions ||= false;
const CorrectiveArray = patchProxyConfToCorrective(ModAPI.util.TeaVMArray_To_Recursive_BaseData_ProxyConf);
const CorrectiveRecursive = patchProxyConfToCorrective(ModAPI.util.TeaVM_to_Recursive_BaseData_ProxyConf);
if (outputValue && typeof outputValue === "object" && Array.isArray(outputValue.data) && typeof outputValue.type === "function") {
@ -125,7 +128,7 @@ globalThis.modapi_postinit = "(" + (() => {
}
if (outputValue && typeof outputValue === "object" && !Array.isArray(outputValue)) {
if (corrective) {
return new Proxy(outputValue.data, CorrectiveRecursive);
return new Proxy(outputValue, CorrectiveRecursive);
}
return new Proxy(outputValue, ModAPI.util.TeaVM_to_Recursive_BaseData_ProxyConf);
}

View File

@ -1,23 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>EF Injector Roadmap</title>
<link rel="stylesheet" href="roadmap.css" />
</head>
<body>
<h1>EaglerForgeInjector Roadmap</h1>
<div id="todolist">
Add custom itemstack meta to LCI [done]
Fix blocklook.js [todo]
Fix setblocktest.js [done]
Async toolkit library [done]
Object.keys() and `in` operator on proxy objects [todo]
Add textures to LCI. [todo]
</div>
<script src="roadmap.js"></script>
</body>
</html>

View File

@ -1,66 +0,0 @@
html,
body {
background-color: black;
color: white;
font-family: sans-serif;
overflow-x: hidden;
}
html {
padding: 0;
margin: 0;
width: 100vw;
height: 100vh;
}
body {
padding: 0.2rem;
}
* {
margin: 0;
padding: 0;
}
span {
text-align: left;
padding: 6px;
border-radius: 1rem;
background-color: rgba(125, 125, 125, 0.2);
margin-top: 1rem;
display: block;
}
summary {
background-color: rgba(255, 255, 255, 0.1);
padding: 4px;
border-radius: 0.6rem;
cursor: pointer;
padding-left: 8px;
}
span summary span {
width: 13.5px;
height: 13.5px;
display: inline-block;
float: right;
position: relative;
top: -19.5px;
right: -4px;
background-color: red;
border-radius: 9px;
opacity: 0.6;
transition: opacity 0.2s;
}
span summary span:hover {
opacity: 1;
}
span.working summary span {
background-color: rgb(255, 102, 0);
}
span.done summary span {
background-color: lime;
}
#todolist {
width: calc(50vw - 0.6rem);
margin-right: 0.2rem;
}
@media only screen and (max-width: 600px) {
#todolist {
width: calc(100vw - 0.6rem);
}
}

View File

@ -1,31 +0,0 @@
var todolist = document.querySelector("#todolist");
function getValue(a) {
if (a.includes("wip")) {
return 1;
}
if (a.includes("done")) {
return 2;
}
return 0;
}
var map = {
wip: "working",
done: "done"
}
var list = todolist.innerText.split("]").filter(x => x.length !== 0);
list.sort((a, b) => {
return getValue(a) - getValue(b);
});
todolist.innerHTML = "";
list.forEach(a => {
var x = a.split("[");
var d = document.createElement("span");
var s = document.createElement("summary");
d.appendChild(s);
s.innerHTML = x[0].trim().replaceAll("`", "<code>").replaceAll('#', "</code>");
var z = document.createElement("span");
d.classList.add(map[x[1].toLowerCase().trim()] || "todo");
s.appendChild(z);
todolist.appendChild(d);
});