Compare commits

..

2 Commits

Author SHA1 Message Date
7651db49b2
让他好看一点 2024-04-21 18:21:34 +08:00
08c6bd7d63
似乎要成 2024-04-21 18:01:58 +08:00

View File

@ -15,13 +15,14 @@ let run_env = {
console.log("run_env", run_env); console.log("run_env", run_env);
// let is_debug = true;
let is_debug = false;
let logger = { let logger = {
// debug: 只在 from_code 时输出 // debug: 只在 from_code 时输出
debug: function (...msg) { debug: function (...msg) {
if (run_env.from_code) { if (run_env.from_code && is_debug) {
// 上个色 // 上个色
// let last_stack = new Error().stack;
// console.log("\x1b[32mlogger<", last_stack, ">:", ...msg, "\x1b[0m")
console.log("\x1b[32mlogger:", ...msg, "\x1b[0m") console.log("\x1b[32mlogger:", ...msg, "\x1b[0m")
} }
}, },
@ -30,6 +31,30 @@ let logger = {
} }
} }
function fmt_RunUpdate(update) {
let message = update.d;
let source_plr = update.e.a;
let target_plr = update.f;
if (target_plr !== null && target_plr.a !== null) {
target_plr = target_plr.a
} else {
target_plr = "none"
}
let affect = update.x;
if (affect !== null && affect.a !== null) {
affect = affect.a
} else {
affect = "none"
}
return {
message: message,
source_plr: source_plr,
target_plr: target_plr,
affect: affect,
// raw: update,
}
}
if (run_env.from_code) { if (run_env.from_code) {
console.log("Running from code"); console.log("Running from code");
@ -13241,6 +13266,7 @@ HtmlRenderer.inner_render.prototype = {
} }
}, },
b4() { b4() {
// MARK: 渲染器主"循环"
var async_goto = 0, var async_goto = 0,
async_complete = P._makeAsyncAwaitCompleter(t.z), async_complete = P._makeAsyncAwaitCompleter(t.z),
q, this_ = this, q, this_ = this,
@ -13278,7 +13304,6 @@ HtmlRenderer.inner_render.prototype = {
return P._asyncReturn(q, async_complete) return P._asyncReturn(q, async_complete)
} }
}) })
// console.log("输出 实力评分.ing")
return P._asyncStartSync($async$b4, async_complete) return P._asyncStartSync($async$b4, async_complete)
}, },
ft(a) { ft(a) {
@ -13319,6 +13344,9 @@ HtmlRenderer.inner_render.prototype = {
} }
if (this_.cx instanceof T.RunUpdateWin) { if (this_.cx instanceof T.RunUpdateWin) {
this_.fQ() this_.fQ()
} else if (run_env.from_code) {
logger.debug(fmt_RunUpdate(this_.cx))
this_.b4()
} else { } else {
s = this_.db s = this_.db
if (s == null) { if (s == null) {
@ -13334,7 +13362,7 @@ HtmlRenderer.inner_render.prototype = {
this_.db.appendChild(HtmlRenderer._updateToHtml(this_.cx)) this_.db.appendChild(HtmlRenderer._updateToHtml(this_.cx))
this_.b4() this_.b4()
} }
if (a) { if (a && !run_env.from_code) {
s = this_.b s = this_.b
s.scrollTop = C.JsInt.aI(C.d.aI(s.scrollHeight) - s.clientHeight) s.scrollTop = C.JsInt.aI(C.d.aI(s.scrollHeight) - s.clientHeight)
} }
@ -13348,6 +13376,12 @@ HtmlRenderer.inner_render.prototype = {
// e = "click", // e = "click",
let d = this_.b, let d = this_.b,
document_ = document document_ = document
if (run_env.from_code) {
logger.debug("到达代码最高层! fQ!")
logger.info(fmt_RunUpdate(this_.cx))
return
}
d.appendChild(document_.createElement("br")) d.appendChild(document_.createElement("br"))
s = this_.cx.e.gb2() s = this_.cx.e.gb2()
r = $.ay.h(0, s).a r = $.ay.h(0, s).a
@ -13413,21 +13447,16 @@ HtmlRenderer.inner_render.prototype = {
g = document_.createElement("button") g = document_.createElement("button")
g.textContent = LangData.get_lang("xPRN") // 返回 g.textContent = LangData.get_lang("xPRN") // 返回
h.appendChild(g) h.appendChild(g)
if (!run_env.from_code) { W.es(g, "click", new HtmlRenderer.jB(), false)
W.es(g, "click", new HtmlRenderer.jB(), false)
}
g = document_.createElement("button") g = document_.createElement("button")
g.textContent = LangData.get_lang("KXmn") // 分享 g.textContent = LangData.get_lang("KXmn") // 分享
h.appendChild(g) h.appendChild(g)
if (!run_env.from_code) { W.es(g, "click", new HtmlRenderer.jC(), false)
W.es(g, "click", new HtmlRenderer.jC(), false)
}
g = document_.createElement("button") g = document_.createElement("button")
g.textContent = LangData.get_lang("Zvon") // 帮助 g.textContent = LangData.get_lang("Zvon") // 帮助
h.appendChild(g) h.appendChild(g)
if (!run_env.from_code) { W.es(g, "click", new HtmlRenderer.jD($.qq()), false)
W.es(g, "click", new HtmlRenderer.jD($.qq()), false)
}
d = h.style d = h.style
document_ = "" + (C.d.aI(m.offsetWidth) - C.d.aI(h.offsetWidth) - 8) + "px" document_ = "" + (C.d.aI(m.offsetWidth) - C.d.aI(h.offsetWidth) - 8) + "px"
d.marginLeft = document_ d.marginLeft = document_
@ -21433,7 +21462,7 @@ function main() {
if (run_env.from_code) { if (run_env.from_code) {
raw_names = name_input raw_names = name_input
console.log("node input:|\n", raw_names, "\n|") console.log("node input\n----------\n" + raw_names, "\n----------")
} else { } else {
m = window.sessionStorage.getItem(LangData.eQ("k")) m = window.sessionStorage.getItem(LangData.eQ("k"))