a
This commit is contained in:
parent
0e432c62ae
commit
348f355eb2
4 changed files with 12 additions and 34 deletions
|
|
@ -2,8 +2,10 @@
|
|||
.tool-tip-popover {
|
||||
position: fixed;
|
||||
z-index: 2147483000;
|
||||
width: 220px;
|
||||
max-width: min(220px, calc(100vw - 16px));
|
||||
width: max-content;
|
||||
min-width: 160px;
|
||||
max-width: min(320px, calc(100vw - 18px));
|
||||
box-sizing: border-box;
|
||||
padding: 7px 9px;
|
||||
border-radius: 10px;
|
||||
background: rgba(46, 38, 30, 0.78);
|
||||
|
|
@ -15,6 +17,9 @@
|
|||
backdrop-filter: blur(1px);
|
||||
text-shadow: 0 1px 3px rgba(25, 18, 12, 0.55);
|
||||
pointer-events: none;
|
||||
white-space: normal;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
}
|
||||
.tool-tip-popover.hidden { display: none; }
|
||||
.selected-actions {
|
||||
|
|
@ -733,16 +738,6 @@
|
|||
.tool-category[data-tool-category="operate"]:not(.collapsed) { top: 58px; }
|
||||
}
|
||||
|
||||
/* v39.15.38: prevent long tooltips from spilling outside the viewport. */
|
||||
.tool-tip-popover {
|
||||
width: max-content;
|
||||
min-width: 160px;
|
||||
max-width: min(320px, calc(100vw - 18px));
|
||||
box-sizing: border-box;
|
||||
white-space: normal;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
}
|
||||
@media (max-width: 980px) {
|
||||
body.touch-mobile-ui .tool-tip-popover {
|
||||
max-width: min(280px, calc(100vw - 24px));
|
||||
|
|
|
|||
|
|
@ -5,9 +5,8 @@ function bindUI() {
|
|||
loadLogPushSettings();
|
||||
syncLogPushControls();
|
||||
syncAudioControls();
|
||||
applyToolTips();
|
||||
window.TarinaiTooltips?.applyToolPalette?.();
|
||||
window.bindGroundUI?.(world);
|
||||
renderEcologyCards();
|
||||
window.TarinaiSaveSystem?.bindSaveSystem?.();
|
||||
uiCache.toolButtons = Array.from(ui.toolPalette?.querySelectorAll(".tool") || []);
|
||||
function isActiveToolMode() {
|
||||
|
|
@ -453,10 +452,10 @@ function bindUI() {
|
|||
if (clickedInsideGameOrToolUi(e.target)) return;
|
||||
selectTool("observe"); // \u9053\u5177\u8a2d\u7f6e\u30e2\u30fc\u30c9\u3092\u89e3\u9664
|
||||
});
|
||||
ui.creditsBtn?.addEventListener("click", () => { audio.uiClick?.(); openCreditsDialog(); });
|
||||
ui.creditsCloseBtn?.addEventListener("click", closeCreditsDialog);
|
||||
ui.creditsBtn?.addEventListener("click", () => { audio.uiClick?.(); ui.creditsDialog?.classList.remove("hidden"); });
|
||||
ui.creditsCloseBtn?.addEventListener("click", () => ui.creditsDialog?.classList.add("hidden"));
|
||||
ui.creditsDialog?.addEventListener("click", (e) => {
|
||||
if (e.target === ui.creditsDialog) closeCreditsDialog();
|
||||
if (e.target === ui.creditsDialog) ui.creditsDialog.classList.add("hidden");
|
||||
});
|
||||
ui.resetBtn?.addEventListener("click", () => {
|
||||
audio.uiClick?.();
|
||||
|
|
@ -587,7 +586,7 @@ function bindUI() {
|
|||
closeFieldDialog();
|
||||
closeEcologyDialog();
|
||||
closeArchiveResetDialog();
|
||||
closeCreditsDialog();
|
||||
ui.creditsDialog?.classList.add("hidden");
|
||||
});
|
||||
|
||||
window.addEventListener("resize", resizeCanvas);
|
||||
|
|
|
|||
|
|
@ -46,10 +46,6 @@ function hydrateLazyImages(root) {
|
|||
}
|
||||
}
|
||||
|
||||
function applyToolTips() {
|
||||
window.TarinaiTooltips?.applyToolPalette?.();
|
||||
}
|
||||
|
||||
function renderEcologyCards() {
|
||||
if (!ui.ecologyGrid || ui.ecologyGrid.dataset.ready === "1") return;
|
||||
const cards = window.TEXT_CATALOG?.ecologyCards || [];
|
||||
|
|
@ -148,14 +144,6 @@ function showToast(text) {
|
|||
showToast._timer = setTimeout(() => ui.toast.classList.add("hidden"), 1400);
|
||||
}
|
||||
|
||||
function openCreditsDialog() {
|
||||
ui.creditsDialog?.classList.remove("hidden");
|
||||
}
|
||||
|
||||
function closeCreditsDialog() {
|
||||
ui.creditsDialog?.classList.add("hidden");
|
||||
}
|
||||
|
||||
function syncTopButtons() {
|
||||
ui.pauseBtn.textContent = world.paused ? "\u518d\u958b" : "\u4e00\u6642\u505c\u6b62";
|
||||
ui.speedBtn.textContent = `\u901f\u5ea6 x${world.speed}`;
|
||||
|
|
|
|||
|
|
@ -122,13 +122,9 @@
|
|||
}
|
||||
|
||||
global.TarinaiTooltips = Object.freeze({
|
||||
ensure: ensureTooltipPopover,
|
||||
bind: bindTooltip,
|
||||
show: showTooltip,
|
||||
hide: hideTooltip,
|
||||
refresh: refreshTooltip,
|
||||
active: () => activeTooltipElement,
|
||||
applyToolPalette: applyToolPaletteTooltips,
|
||||
});
|
||||
global.bindTooltip = bindTooltip;
|
||||
})(window);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue