Skip to content

🎛️ 침대 화면 UI 및 레이아웃

매개변수기술 사양
Target Screen Classnet.minecraft.client.gui.screens.InBedChatScreen
Superclassnet.minecraft.client.gui.screens.ChatScreen
Mixin HandlerInBedChatScreenMixin.java
주입 지점@Inject(method = "init", at = @At("TAIL"))
버튼 너비$98\text{ px}$ (왼쪽: 침대에서 일어나기, 오른쪽: 채팅 토글)
Button Height$20\text{ px}$
Button Gap$4\text{ px}$
Vertical Anchor$Y = H - 40\text{ px}$
Translation Keysvanilla-outsider-bed-chat-hider.hideChat, ...showChat

🎮 플레이어 상호작용 흐름

플레이어가 침대에 누우면:

  1. Minecraft가 InBedChatScreen 화면을 엽니다.
  2. 바닐라 기본 상태에서는 화면 하단에 하나의 넓은 침대에서 일어나기 버튼(너비 $200\text{px}$)이 위치합니다.
  3. Bed Chat Hider는 침대에서 일어나기 버튼 크기를 $98\text{px}$로 동적 조정하고 그 옆에 나란히 $98\text{px}$ 크기의 채팅 숨기기 / 채팅 표시 버튼을 추가합니다.
  4. 토글 버튼을 클릭하면 메모리 상태가 반전되어 화면을 닫거나 플레이어를 깨우지 않고도 모든 위젯이 즉시 새로고침됩니다.

📐 좌표 기하학 및 분할 수학 공식

바닐라 Minecraft의 단일 버튼 위치 계산 공식은 다음과 같습니다: $$X_{\text{vanilla}} = \frac{W}{2} - 100, \quad \text{Width} = 200, \quad Y = H - 40$$

Bed Chat Hider는 이 $200\text{px}$ 영역을 중앙의 $4\text{px}$ 간격이 있는 대칭 듀얼 버튼 클러스터로 분할합니다:

$$\text{Leave Bed Button: } X_1 = \frac{W}{2} - 100, \quad \text{Width}_1 = 98, \quad Y_1 = H - 40$$ $$\text{Center Gap: } \Delta X = 4\text{ px}$$ $$\text{Toggle Chat Button: } X_2 = \frac{W}{2} + 2, \quad \text{Width}_2 = 98, \quad Y_2 = H - 40$$

$$\text{Total Span: } W_1 + \Delta X + W_2 = 98 + 4 + 98 = 200\text{ px}$$


🖼️ 화면 레이아웃 ASCII 다이어그램

바닐라 수면 화면:

+-------------------------------------------------------------+
| [Chat Log Overlay Area]                                     |
| <Player1> Good night everyone!                              |
|                                                             |
| [Chat Input EditBox] ______________________________________ |
|                                                             |
|                 [      Leave Bed (200px)      ]             |
+-------------------------------------------------------------+

Bed Chat Hider 수면 화면 (채팅 표시):

+-------------------------------------------------------------+
| [Chat Log Overlay Area]                                     |
| <Player1> Good night everyone!                              |
|                                                             |
| [Chat Input EditBox] ______________________________________ |
|                                                             |
|           [ Leave Bed (98px) ]  [ Hide Chat (98px) ]         |
+-------------------------------------------------------------+

Bed Chat Hider 수면 화면 (채팅 숨김):

+-------------------------------------------------------------+
|                                                             |
|              (Clean, Unobstructed Sleep View)               |
|                                                             |
|                                                             |
|           [ Leave Bed (98px) ]  [ Show Chat (98px) ]         |
+-------------------------------------------------------------+

💻 기술 코드 구현

java
// Sourced from InBedChatScreenMixin.java
@Inject(method = "init", at = @At("TAIL"))
private void onInit(CallbackInfo ci) {
    if (this.leaveBedButton != null) {
        this.leaveBedButton.setX(this.width / 2 - 100);
        this.leaveBedButton.setWidth(98);
    }

    Button toggleButton = Button.builder(
        bedchathider$getButtonMessage(),
        button -> {
            BedChatHiderClient.hideChat = !BedChatHiderClient.hideChat;
            this.rebuildWidgets();
        }
    ).bounds(this.width / 2 + 2, this.height - 40, 98, 20).build();

    this.addRenderableWidget(toggleButton);
    bedchathider$updateChatState();
}

관련 페이지: | 채팅 가시성 및 입력 차단 | 아키텍처 및 Mixin 분석

Official documentation & web portal for Dasik Igaijinn mods.