# Notice (notice.dc)

This section explains notice fields, purposes, allowed values, and rendering behavior, with a complete example.

For `dc` format and conventions, please read:
- [Getting Started](../Getting_Started)

## Location
- Directory: `DLC/info/`
- File: `notice.dc`

## Complete Example
```dc
isNoticeEnabled = true
neverShow = false
ShowFrequency = "perlaunchmanager"

[Title]
zh_cn = "公告"
en_us = "Notice"

[Subhead]
enabled = true
zh_cn = "请仔细阅读"
en_us = "Please read carefully"

[ContentUrl]
en_us = "https://example.com/notice-en.md"
zh_cn = "https://example.com/notice-zh.md"

[Contents]
en_us = """# Update Notes

This is fallback content when ContentUrl is unavailable."""
zh_cn = """# 更新说明

这是 ContentUrl 不可用时显示的回退内容。"""
```

---

## Field Reference

#### `isNoticeEnabled`
- **Purpose**: Enable/disable notice.
- **Allowed**: Boolean.

#### `neverShow`
- **Purpose**: If `true`, never show again.
- **Allowed**: Boolean.

#### `ShowFrequency`
- **Purpose**: Display frequency (e.g. `perlaunchmanager`).
- **Allowed**: String.
  - `perlaunchgame`: show on every game launch in the main menu (outside DLC Manager).
  - `pergamesession`: show once when opening DLC Manager during a game session.
  - `perlaunchmanager`: show every time DLC Manager opens.
  - `once`: show only once.
- **Default**: `perlaunchmanager`.

#### `[Title]`
- **Purpose**: Notice title (localized).
- **Allowed**: Object `{ zh_cn: "...", en_us: "..." }`.

#### `[Subhead]`
- **Purpose**: Subtitle.
- **Allowed**: Object containing:
  - `enabled` (boolean)
  - localized text

#### `[Contents]`
- **Purpose**: Body content.
- **Allowed**: Localized strings.
- **Rendering**: Markdown + MC formatting codes (colors, etc.) supported.

#### `[ContentUrl]`
- **Purpose**: Online content URL (higher priority than `Contents`).
- **Allowed**:
  - Single string URL
  - Localized object (same shape as `Contents`)
- **Behavior**:
  - If `ContentUrl` is configured and fetch succeeds, remote text is rendered.
  - If fetch fails, fallback to `Contents`.
  - Fetch timeout: connect `3s`, read `5s`.

---

## Markdown Support
Supported:
- **Bold**, *Italic*, ~~Strikethrough~~, ++Underline++
- Lists (`-` / `*`)
- Links `[text](https://example.com)`
- Horizontal rule `---` (renders as a gray line)

Minecraft formatting codes are also supported:
```
§a green text §r reset
```

## Multi-line Text
Use triple-quoted strings:
```dc
[Contents]
zh_cn = """Line 1
Line 2

- Item 1
- Item 2"""
```

---

## FAQ
- **Why does parsing fail?**
  - The content string contains unescaped line breaks or quotes.
- **Why are links not clickable?**
  - Only standard Markdown links are clickable in the notice screen.
