summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Desktop/HudLayout.fs
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-29 15:44:35 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-29 15:44:35 +0800
commitdce50b835235a103af1d8e6ec836fe12d841f135 (patch)
tree820d2a5f8a092e66e31b5ca06527302dd81735ed /src/LivingVillage.Desktop/HudLayout.fs
parent21b03c043466c3cbce1d71ff055c9d71631b6073 (diff)
downloadliving-village-dce50b835235a103af1d8e6ec836fe12d841f135.tar.gz
p77: 日历卡/浮动提示药丸化并修复面板遮挡快捷栏
- DrawCalendarCard 改半透明底+1px 描边+accent 发丝线,日历卡微缩(52→48) - FloatingPrompt 新增 layoutWrapped/wrapText,锚定长文本逐字折行(不丢字、居中锚点、避让 HUD 带) - 新增 HudLayout.panelRect,DrawPanel 用其几何;DialogOverlay.bottomMargin 24→72 1280x720 下对话 rect 底 648、任务面板底 652,均 < hotbar 顶 660,不再压 3-8 号槽 - 新增 P77LayoutTests(4 尺寸不破版/不遮挡 + 真实长提示折行) - 证据 LV_P43/P44/P67_SHOT + scripts/analyze-p77.py(verdict PASS) 落 docs/evidence/p77-* - Desktop 361/361, Kernel 120/120, digest 953775FA...F7F6C 不变
Diffstat (limited to 'src/LivingVillage.Desktop/HudLayout.fs')
-rw-r--r--src/LivingVillage.Desktop/HudLayout.fs19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/LivingVillage.Desktop/HudLayout.fs b/src/LivingVillage.Desktop/HudLayout.fs
index 4310586..63d4ed5 100644
--- a/src/LivingVillage.Desktop/HudLayout.fs
+++ b/src/LivingVillage.Desktop/HudLayout.fs
@@ -197,7 +197,7 @@ module HudLayout =
let calendarMarginRight = 12
let calendarMarginTop = 8
let calendarPadX = 10
- let calendarPadY = 8
+ let calendarPadY = 6
let calendarLineGap = 4
let calendarTextHeight = 8 * textScale
let calendarCardHeight = 2 * calendarTextHeight + calendarLineGap + 2 * calendarPadY
@@ -324,6 +324,23 @@ module HudLayout =
let hotbarInputAllowed (menuPlaying: bool) (worldInputAllowed: bool) : bool =
menuPlaying && worldInputAllowed
+ // ---- P77:底部左侧互动/任务面板几何(与 hotbar 错开,不遮挡)----
+
+ let panelLineHeight = 18
+ let panelMaxWidth = 380
+ let panelPadX = 12
+ let panelTopExtra = 26
+
+ /// 面板几何:左下角、宽度自适应视口,且底边始终抬到 hotbar 顶上方 8px(不遮挡快捷栏)。
+ let panelRect (viewportWidth: int) (viewportHeight: int) (lineCount: int) : Rectangle =
+ let width = min panelMaxWidth (max 1 (viewportWidth - 32))
+ let height = max 1 lineCount * panelLineHeight + panelTopExtra
+ let bar = hotbarBarRect viewportWidth viewportHeight
+ let maxBottom = bar.Y - 8
+ let y =
+ max (barHeight + 12) (min (viewportHeight - height - 16) (max 0 (maxBottom - height)))
+ Rectangle(16, y, width, height)
+
// ---- P76:面板文本按实测像素宽度折行(换行而非整行截断,中文逐字、拉丁逐字)----
let wrapText (maxWidth: int) (scale: int) (text: string) : string list =