rock-mod
Version:
Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.
34 lines (33 loc) • 2.27 kB
TypeScript
import { type IControlsManager } from "../../common/controls/IControlsManager";
/**
* Реализация `IControlsManager` поверх натива-обёртки CCMP `ccmp.natives.pad.*`.
*
* Все четыре метода — прямой passthrough к соответствующим GTA V-нативам
* (`DISABLE_CONTROL_ACTION`, `IS_CONTROL_PRESSED`, `IS_DISABLED_CONTROL_PRESSED`,
* `GET_DISABLED_CONTROL_NORMAL`) с сохранением порядка аргументов:
*
* IControlsManager.disableControlAction(padIndex, control, disable)
* → ccmp.natives.pad.disableControlAction(padIndex, control, disable)
*
* Семантика и значения индексов идентичны RageMP — гейм-mod консьюмеры
* (`ControlsService` / `WeaponService.disableControlActions`) используют те
* же константы `Control.*` (см. `@shared/common/enums/Control`).
*
* **Hot path:** `disableControlAction` вызывается на каждый render-tick из
* `WeaponController.onRender`. CCMP-native — это синхронный вызов V8 op'а,
* стоимость порядка единиц микросекунд; никакой буферизации не нужно.
*
* Имена параметров `CcmpNativesPad.disableControlAction(control, action, ...)`
* **обманчивы** — это generic-renames из натив-генератора. Фактически первый
* аргумент — `padIndex` (0..2), второй — `control` (Control.*), третий —
* `disable: boolean`. См. https://docs.fivem.net/natives/?_0xFE99B66D43DA8E7B.
*/
export declare class CCMPControlsManager implements IControlsManager {
disableControlAction(padIndex: number, control: number, disable: boolean): void;
isDisabledControlPressed(padIndex: number, control: number): boolean;
isDisabledControlJustPressed(padIndex: number, control: number): boolean;
isControlPressed(padIndex: number, control: number): boolean;
isControlJustPressed(padIndex: number, control: number): boolean;
isControlJustReleased(padIndex: number, control: number): boolean;
getDisabledControlNormal(padIndex: number, control: number): number;
}