import { Vector2 } from '../types/Vector2'; import { Vector3 } from '../types/Vector3'; import { Vector4 } from '../types/Vector4'; import { Color } from '../types/Color'; import { createFromHandle } from '../types/HandleRegistry'; import { inv, rai, raf, ras, rav, pvi, pvf, pvv, pvii, pvfi, _h, f, int, uint, float, Hash, u8, u16, u32, u64, i8, i16, i32, i64 } from '../types/NativeAliases'; export class Clock { /** * @param ms */ static setMillisecondsPerGameMinute(ms: int): void { inv('0x04EEDB3848DACF68', ms); } /** * Gets the current ingame clock second. Note that ingame clock seconds change really fast since a day in RDR is only 48 minutes in real life. * * @returns */ static getClockSeconds(): int { return inv('0xB6101ABE62B5F080', rai()); } /** * @param hour * @param minute * @param second */ static advanceClockTimeTo(hour: int, minute: int, second: int): void { inv('0x0184750AE88D0B1D', hour, minute, second); } /** * @returns inDateTime; timeToAdd; outDateTime */ static addTimeToDateTime(): [number, number, number] { const result = inv<[number, number, number]>('0x28EEACE9B43D9597', pvi(), pvi(), pvi()); return [result[0], result[1], result[2]]; } /** * SET_CLOCK_TIME(12, 34, 56); * * @param hour * @param minute * @param second */ static setClockTime(hour: int, minute: int, second: int): void { inv('0x3A52C59FFB2DEED8', hour, minute, second); } /** * Gets the current ingame hour, expressed without zeros. (09:34 will be represented as 9) * * @returns */ static getClockHours(): int { return inv('0xC82CF208C2B19199', rai()); } /** * @returns */ static getMillisecondsPerGameMinute(): int { return inv('0xE4CB8D126501EC52', rai()); } /** * Gets the current day of the week. 0: Sunday * 1: Monday * 2: Tuesday * 3: Wednesday * 4: Thursday * 5: Friday * 6: Saturday * * @returns */ static getClockDayOfWeek(): int { return inv('0x4DD02D4C7FB30076', rai()); } /** * @param toggle */ static pauseClockThisFrame(toggle: boolean): void { inv('0x568D998A9FF96774', toggle); } /** * @returns */ static getClockYear(): int { return inv('0xE136DCA28C4A48BA', rai()); } /** * @returns */ static getClockMonth(): int { return inv('0x2D44E8FC79EAB1AC', rai()); } /** * @returns year; month; day; hour; minute; second */ static getPosixTime(): [number, number, number, number, number, number] { const result = inv<[number, number, number, number, number, number]>('0x90338AD4A784E455', pvi(), pvi(), pvi(), pvi(), pvi(), pvi()); return [result[0], result[1], result[2], result[3], result[4], result[5]]; } /** * Same as GET_POSIX_TIME except that it takes a single pointer to a struct. * * @returns outTime */ static getPosixTimeStruct(): number { const result = inv('0x86A68E84E5884951', pvi()); return result; } /** * @returns */ static getClockDayOfMonth(): int { return inv('0xDF2FD796C54480A5', rai()); } /** * @param hours * @param minutes * @param seconds */ static addToClockTime(hours: int, minutes: int, seconds: int): void { inv('0xAB7C251C7701D336', hours, minutes, seconds); } /** * @param day * @param month * @param year */ static setClockDate(day: int, month: int, year: int): void { inv('0x02AD3092562941E2', day, month, year); } /** * @param toggle * @param unused */ static pauseClock(toggle: boolean, unused: any): void { inv('0x4D1A590C92BF377E', toggle, unused); } /** * Base year is 1898. * * @returns */ static getSecondsSinceBaseYear(): int { return inv('0x78FD8BE812E436B2', rai()); } /** * Gets the current ingame clock minute. * * @returns */ static getClockMinutes(): int { return inv('0x4E162231B823DBBF', rai()); } }