API ReferenceGE Extensionscareermodules
Logbook
M.dependencies = {'career_career'}
Dependencies
M.dependencies = {'career_career'}Player-facing event journal tracking mission unlocks, facility discoveries, spawn point unlocks, and tutorial info entries. Supports popups, read/unread state, and sound effects.
Public API
| Function | Signature | Description |
|---|---|---|
M.getLogbook | () → table | All entries sorted newest-first (includes hook-injected entries) |
M.getPopups | () → table | Unread entries marked as popups |
M.getLogbookMostRecentUnread | (limit) → table | Up to limit (default 3) recent entries, unread first |
M.setLogbookEntryRead | (entryId, read) | Mark entry as read/unread |
M.addNewLogbookEntry | (entry, skipSave) → entry | Create a new logbook entry with auto-ID and timestamp |
M.missionUnlocked | (id) | Add "mission unlocked" entry |
M.deliveryFacilityUnlocked | (id) | Add "delivery facility unlocked" entry |
M.spawnPointUnlocked | (spawnPoint) | Add "spawn point unlocked" entry |
M.genericInfoUnlocked | (title, text, cover, ratio, flavour, type) → entry | General info entry with sound |
M.genericLogbookEntry | (title, text, cover, coverText) → entry | Generic entry without special type |
M.logbookEntry | (id) | Create entry from HTML template at /ui/modules/careerLogbook/pages/ID/ |
Hook Handlers
| Hook | Purpose |
|---|---|
M.onCareerActive | Load logbook from save, populate default entries if empty |
M.onSaveCurrentSaveSlot | Save logbook data |
M.onUpdate | Reset sound guard each frame |
Entry Structure
{
type = "progress", -- "progress", "info"
cardTypeLabel = "ui.career.poiCard.missionUnlocked",
title = "Race: Highway Sprint",
text = "New mission unlocked!",
cover = "/gameplay/missions/preview.jpg",
time = 1700000000,
entryId = 5,
isNew = true, -- unread state
showMessage = true, -- triggers toast notification
hideInRecent = false, -- exclude from recent list
}Default Entries
On first load, these entries are created (in reverse order):
welcome, logbook, walkingMode, cameras, driving, crashRecover, bigmap, refueling, missions, dealership, testdrive, computer, partShopping, tuning, milestones, delivery
See Also
- linearTutorial - Tutorial progression triggers logbook entries
- milestones - Milestones can trigger entries