Files
2026-11-22 07:21:29 -03:00

39 lines
1.1 KiB
TypeScript

// SPDX-FileCopyrightText: 2026 Paula Wisnievski
// SPDX-License-Identifier: AGPL-3.0-or-later
import type { KeyCode } from "./input_manager.ts";
import type { Volumes } from "./sounds.ts";
// the player's settings, like minecraft's Options and its key mappings
export class Options {
render_distance = 16;
// 0 to 1, each sound category's under master's, see client/sounds.ts
volume: Volumes = { master: 1, music: 1, ambient: 1, blocks: 1, entities: 1, players: 1, ui: 1 };
key_forward: KeyCode = "KeyW";
key_back: KeyCode = "KeyS";
key_left: KeyCode = "KeyA";
key_right: KeyCode = "KeyD";
key_jump: KeyCode = "Space";
// like minecraft. ctrl+w would close the tab, see confirm_leaving in main.ts
key_sprint: KeyCode = "ControlLeft";
key_sneak: KeyCode = "ShiftLeft";
key_inventory: KeyCode = "KeyE";
// with ctrl it drops the whole stack
key_drop: KeyCode = "KeyQ";
key_chat: KeyCode = "KeyT";
key_debug: KeyCode = "F3";
key_fullscreen: KeyCode = "F11";
key_hotbar: KeyCode[] = [
"Digit1",
"Digit2",
"Digit3",
"Digit4",
"Digit5",
"Digit6",
"Digit7",
"Digit8",
"Digit9",
];
}