summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Desktop/HudLayout.fs
diff options
context:
space:
mode:
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 =