rage-framework-example/apps/client/src/index.ts

15 lines
406 B
TypeScript
Raw Normal View History

2024-06-13 20:12:40 +00:00
import { fw } from 'rage-fw-client'
2024-09-30 18:40:58 +00:00
fw.player.registerBrowser(mp.browsers.new('package://cef/index.html'))
2024-06-15 14:41:45 +00:00
2024-09-30 18:40:58 +00:00
fw.event.register('cefReady', async () => {
fw.system.log.info('cefReady')
2024-06-13 20:12:40 +00:00
2024-09-30 18:40:58 +00:00
const responseCef = await fw.player.triggerBrowser('customCefEvent', [
'from client',
])
fw.system.log.info(responseCef)
2024-06-13 20:12:40 +00:00
2024-09-30 18:40:58 +00:00
await fw.player.triggerServer('customServerEvent', ['from client'])
2024-06-13 20:12:40 +00:00
})