From 939ab88d90c9ad86bfdc9e4482047e3852fd536c Mon Sep 17 00:00:00 2001 From: Seemann Date: Mon, 26 Dec 2022 13:03:16 -0500 Subject: [PATCH] update to 1.0.6-dev --- CHANGELOG.md | 17 +++ SDK/cleo_redux.lib | Bin 7742 -> 7936 bytes SDK/cleo_redux64.lib | Bin 7764 -> 7954 bytes SDK/cleo_redux_sdk.h | 3 + SDK/cleo_redux_sdk.rs | 12 +++ docs/en/SUMMARY.md | 1 + docs/en/api.md | 124 +++++++++++++-------- docs/en/definitions.md | 10 +- docs/en/events.md | 186 ++++++++++++++++++++++++++++++++ docs/en/installation-plugins.md | 17 +-- installer/cleo_redux.iss | 14 ++- 11 files changed, 323 insertions(+), 61 deletions(-) create mode 100644 docs/en/events.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 75cdcc7..0e117b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +### 1.0.6 + +- new built-in function `addEventListener` to react on [game events](https://re.cleo.li/docs/en/events.html) +- fix a rare deadlock causing scripts to stop on timeout + +**SDK AND PLUGINS** + +- new SDK method `TriggerEvent` to trigger custom events with some payload. SDK version is now 7. +- new Events plugin that brings in a few events to react on in JS/TS code: `OnVehicleCreate`, `OnPedCreate`, `OnObjectCreate`, `OnVehicleDelete`, `OnPedDelete`, `OnObjectDelete` +- IdeLoader 1.3: generate `ide_loader.d.ts` for better intellisense in TS scripts +- TxtLoader 1.1: generate `txt_loader.d.ts` for better intellisense in TS scripts + +**BREAKING CHANGES** + +- bumped minimum required versions of [command definitions](https://re.cleo.li/docs/en/definitions.html) + ### 1.0.5 - December 15, 2022 - add [TypeScript support](https://re.cleo.li/docs/en/typescript.html) @@ -8,6 +24,7 @@ - `is_variadic` attribute is no longer used in JIT compilation of commands with the `arguments` type **SDK AND PLUGINS** + - IdeLoader 1.2: fixed a parser bug that prevented `.ide` files with a `2dfx` section to be loaded - Frontend 1.1: reduced a timeout during a check for updates to 10 seconds - ImGuiRedux: [more commands](https://library.sannybuilder.com/#/unknown_x86/classes/ImGui) diff --git a/SDK/cleo_redux.lib b/SDK/cleo_redux.lib index d51580913cf6840e9728e039fce61803363f8305..2b5d6baea4f88b0b347ce35171f756de3ebf385f 100644 GIT binary patch delta 722 zcmY+?ziSg=7zgn0X=0O_+~rq)@AsGI*NfpDFGo+D58slNQO|U-}mm2_Tck;;eGGn?w)%;-+GyCEjJdg zFPZjL8V8UE0%bsL1KJ@FUT|$QDZ*Q9HKsIhL{|Y@mr1c%SBoi~I3_j#+cA?SOAT45 z=a|X@whoh~)2=P1G<3wvfbD=uiJWVfNlEtEnoMcrNL2w_pGmsD!Xoiul3}{oWHiOR ze@R?ZQ`QINw#R%>udJ`H)$eVt)t;ePtUP&IES_Bx-@Jv!;*J0F%y3%e0MJ%}Lk(C6 z1KT7=Sfc^0Mu9HP#()-`(8dICOr=SnN7*T$L+NQ?i-uH=0|%5#0K1e<0!`9KEY%dy zrxl%zWE$M0yx6~VSILO*Sl*MtMTm|Pv#MjCl)%}~u;TtN7tXDSU*3cmUViAWyomme zD1cAASCe8hAe22Z9xSl#gp$^)phxli_&C=SZ`C*U&YZZT`J7$xSSxtLECu{hm8GCswg#O_J(i{lQk$je73rR(8AGbD zmi|bn2-x^fh{7r9fu%@Lx?nAV0S867psmHW#DP00Dtg4MDH{&qau&*oDueRajRer>;9a&PS&9UL$3m+Ioqb25H@{nL3DT|F*RUcoQg-UZHv7B+QXRuj#b Q-`)SZ`LvE76Q8lgKO)a}M*si- diff --git a/SDK/cleo_redux64.lib b/SDK/cleo_redux64.lib index ac5029f5574449205f0a94d5e2594eca76eb49ea..f44a7711c943a8f764eb542a4ea8092b75f5c675 100644 GIT binary patch delta 709 zcmY+?y-OQm90&04h0_MT+?iMNdI_euG=(e;p#%#}1P6x_I%KH{#Sk27i-bb61SGgw z#3yrR6*?UTN3E0!l}r%_U0Uo^a7h1v^m{Kzdhod~_dL(tJC~oY0ZWhBGghUF zoP52t(P-4SmOs`vo2XVd-hHS}Hi2U*nX#K!@&W%?Au9 z=LZfb9AF=fs1^insS*M%C_fJzQJnSMrV*`2fFYH*H+@=+0bO$GTuPJfsGI;!DXRlL z;=YQT=@(L3Tu&FJv=Mo9C@GVRFwWdxT>rI*#_Tt_`}5^kWR+v-T-4?siD<_z>v*1I?NgUZ sndfdi=DKz+-(3FST%kk8I9o(RLqmAf z&`?7JQ9=#jR3H%{)F`d>^L*&w^L#n(xrck6JD7Tz+|L%rGyUeZ(hXn+aDD^YFyP4n z`a_2|4VWq{`827(wtaT^7XZ^eO98%TI%cUym$q37swlPx1lOb{OTCLyjipdZ;vyjm z2c#0)*6N7xqfK>|qH|J}rC3rbvlO>*p}2+eQiE*>uOn;hDhaEo*_Mi_{}USE5q&#> zVeUWY0Uo%Yv=^w5<^u}!Neh19p3+?XnDicCo75n%Mon7m1!|NEaSjE-K#5wEivV?+ zivraMhhz*WlO+!1sX_c#!eO5lUG`aH-hQeWzv`JqeAs;A*?DFiYmPjLE!Tx|CC>Gv z$a}0}*`49trYCAt-Kt`JJnXs?*V@ki443(I-L|@?{=ADDtxp`eqGCedFlUS^SH_!O Va*L;g-*IyJdOOI&NQke*&>z;Tb^ibW diff --git a/SDK/cleo_redux_sdk.h b/SDK/cleo_redux_sdk.h index 4ef0f7b..847b83c 100644 --- a/SDK/cleo_redux_sdk.h +++ b/SDK/cleo_redux_sdk.h @@ -151,5 +151,8 @@ extern "C" { /// since v6 /// Is end of arguments reached bool IsEndOfArguments(Context ctx); + /// since v7 + /// Triggers an event with the given name and data + void TriggerEvent(const char* name, const char* data); } diff --git a/SDK/cleo_redux_sdk.rs b/SDK/cleo_redux_sdk.rs index a55d356..bfb588e 100644 --- a/SDK/cleo_redux_sdk.rs +++ b/SDK/cleo_redux_sdk.rs @@ -195,6 +195,10 @@ extern "C" { /// /// since v6 fn IsEndOfArguments(ctx: Context) -> bool; + /// Trigger an event with the given name and data + /// + /// since v7 + fn TriggerEvent(event: *const c_char, data: *const c_char); } macro_rules! sz { @@ -478,3 +482,11 @@ pub fn get_number_of_active_js_scripts() -> usize { pub fn is_end_of_arguments(ctx: Context) -> bool { unsafe { IsEndOfArguments(ctx) } } + +/// Triggers an event with the given name and data +/// +/// since v7 +#[allow(dead_code)] +pub fn trigger_event(name: &str, data: &str) { + unsafe { TriggerEvent(sz!(name), sz!(data)) } +} diff --git a/docs/en/SUMMARY.md b/docs/en/SUMMARY.md index 3e1a32d..2313e46 100644 --- a/docs/en/SUMMARY.md +++ b/docs/en/SUMMARY.md @@ -24,6 +24,7 @@ - [Script Lifecycle](./script-lifecycle.md) - [Imports](./imports.md) - [Asynchronous Programming](./async.md) + - [Events](./events.md) - [API](./api.md) - [Fluent Interface](./fluent-interface.md) - [Enums](./enums.md) diff --git a/docs/en/api.md b/docs/en/api.md index 113c8ca..a203ca2 100644 --- a/docs/en/api.md +++ b/docs/en/api.md @@ -1,5 +1,30 @@ # JavaScript API +- [Native functions](#native-functions) +- [CLEO Redux Bindings](#cleo-redux-bindings) + - [Variables](#variables) + - [HOST](#host) + - [ONMISSION](#onmission) + - [TIMERA, TIMERB](#timera-timerb) + - [\_\_dirname](#__dirname) + - [\_\_filename](#__filename) + - [Functions](#functions) + - [log](#log) + - [wait](#wait) + - [showTextBox](#showtextbox) + - [exit](#exit) + - [native](#native) + - [Static Objects](#static-objects) + - [Memory](#memory) + - [Math](#math) + - [FxtStore](#fxtstore) + - [CLEO](#cleo) + - [CLEO.debug](#cleodebug) + - [CLEO.version](#cleoversion) + - [CLEO.apiVersion](#cleoapiversion) + - [CLEO.runScript](#cleorunscript) + - [CLEO.getLastEvent](#cleogetlastevent) + ## Native functions CLEO Redux supports all commands native to the current game. In the classic GTA 3D series they are also known as _opcodes_. In GTA IV they are known as _native functions_. You can find them in [Sanny Builder Library](https://library.sannybuilder.com/). @@ -194,71 +219,82 @@ if (native("HAS_MODEL_LOADED", 101)) { log(CLEO.apiVersion.build); // undefined ``` -##### CLEO.runScript + ##### CLEO.runScript -- `CLEO.runScript(fileName, args?)` - method that spawns a new instance of the script. `fileName` is the path to the script to launch. `args` is an optional parameter to pass arguments to the script. + - `CLEO.runScript(fileName, args?)` - method that spawns a new instance of the script. `fileName` is the path to the script to launch. `args` is an optional parameter to pass arguments to the script. - > Don't overuse this feature as spawning a new script is a costly operation. Avoid spawning too many scripts in a loop. + > Don't overuse this feature as spawning a new script is a costly operation. Avoid spawning too many scripts in a loop. - `runScript` has the following limitations: + `runScript` has the following limitations: - - JS scripts must have an extension `.mjs`, CS scripts must have an extension `.s`. This is necessary to avoid automatic script loading. - - spawning CS scripts is not supported in the [delegate mode](./relation-to-cleo-library.md#running-cleo-redux-as-an-addon-to-cleo-library) (i.e. won't work in GTA San Andreas with CLEO 4 installed.) + - JS scripts must have an extension `.mjs`, CS scripts must have an extension `.s`. This is necessary to avoid automatic script loading. + - spawning CS scripts is not supported in the [delegate mode](./relation-to-cleo-library.md#running-cleo-redux-as-an-addon-to-cleo-library) (i.e. won't work in GTA San Andreas with CLEO 4 installed.) - When running a new script you can also provide arguments to it. `args` is a JavaScript object which keys correspond to variable names in the script. Key names for a CS script are numeric and correspond to local variables (0@, 1@, 2@, etc). JS scripts can receive both numbers and strings as arguments, whereas CS scripts can only receive numbers. + When running a new script you can also provide arguments to it. `args` is a JavaScript object which keys correspond to variable names in the script. Key names for a CS script are numeric and correspond to local variables (0@, 1@, 2@, etc). JS scripts can receive both numbers and strings as arguments, whereas CS scripts can only receive numbers. - You can spawn multiple instances of the same script with different arguments. + You can spawn multiple instances of the same script with different arguments. - ###### Launching a new JS script + ###### Launching a new JS script - Imagine that you have two files `main.js` and `child.mjs` in the CLEO directory: + Imagine that you have two files `main.js` and `child.mjs` in the CLEO directory: - main.js: + main.js: - ```js - CLEO.runScript("./child.mjs", { a: 1, b: "str", c: 10.5 }); - ``` + ```js + CLEO.runScript("./child.mjs", { a: 1, b: "str", c: 10.5 }); + ``` - child.mjs: + child.mjs: - ```js - showTextBox("child.mjs was launched with: " + a + " " + b + " " + c); - ``` + ```js + showTextBox("child.mjs was launched with: " + a + " " + b + " " + c); + ``` - Now if you run the game you should see the following message: `child.mjs was launched with: 1 str 10.5`. + Now if you run the game you should see the following message: `child.mjs was launched with: 1 str 10.5`. - ###### Launching a new CS script + ###### Launching a new CS script - main.js: + main.js: - ```js - CLEO.runScript("./child.cs", { 1: 500 }); - ``` + ```js + CLEO.runScript("./child.cs", { 1: 500 }); + ``` - child.cs: + child.cs: - ``` - 0109: player $PLAYER_CHAR money += 1@ - 0A93: terminate_this_custom_script - ``` + ``` + 0109: player $PLAYER_CHAR money += 1@ // gives the player $500 + 0A93: terminate_this_custom_script + ``` - The player will get 500 dollars. + To pass floating-point numbers to a CS script use `Memory.FromFloat` function: - To pass floating-point numbers to a CS script use `Memory.FromFloat` function: + main.js: - main.js: + ```js + CLEO.runScript("./child.cs", { + 0: Memory.FromFloat(-921.25), + 1: Memory.FromFloat(662.125), + 2: Memory.FromFloat(-100.0), + }); + ``` - ```js - CLEO.runScript("./child.cs", { - 0: Memory.FromFloat(-921.25), - 1: Memory.FromFloat(662.125), - 2: Memory.FromFloat(-100.0), - }); - ``` + child.cs: - child.cs: + ``` + 00A1: set_char_coordinates $PLAYER_ACTOR x 0@ y 1@ z 2@ // teleports the player at -921.25 662.125 -100.0 + 0A93: terminate_this_custom_script + ``` - ``` - 00A1: set_char_coordinates $PLAYER_ACTOR x 0@ y 1@ z 2@ - 0A93: terminate_this_custom_script - ``` + ##### CLEO.getLastEvent + + - `CLEO.getLastEvent(): object | undefined` - method that returns the last event object. The event object is a JavaScript object with the following fields: + + - `name` - the name of the event + - `data` - any payload [associated with the event](./events.md#list-of-events) + + The method returns `undefined` if there was no event in this frame. + + ```js + log(CLEO.getLastEvent()); // { name: "OnVehicleCreate", data: { address: 0x12345678 } } + ``` diff --git a/docs/en/definitions.md b/docs/en/definitions.md index 676c2e2..8e7fa87 100644 --- a/docs/en/definitions.md +++ b/docs/en/definitions.md @@ -6,15 +6,15 @@ At start CLEO validates that a definition file is present and correct and if not | Game | File | Minimum Required Version | | ----------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------ | -| GTA III, re3 | [gta3.json](https://github.com/sannybuilder/library/blob/master/gta3/gta3.json) | `0.251` | -| GTA VC, reVC | [vc.json](https://github.com/sannybuilder/library/blob/master/vc/vc.json) | `0.257` | -| GTA San Andreas (Classic) 1.0 | [sa.json](https://github.com/sannybuilder/library/blob/master/sa/sa.json) | `0.294` | +| GTA III, re3 | [gta3.json](https://github.com/sannybuilder/library/blob/master/gta3/gta3.json) | `0.252` | +| GTA VC, reVC | [vc.json](https://github.com/sannybuilder/library/blob/master/vc/vc.json) | `0.258` | +| GTA San Andreas (Classic) 1.0 | [sa.json](https://github.com/sannybuilder/library/blob/master/sa/sa.json) | `0.298` | | GTA III: The Definitive Edition | [gta3_unreal.json](https://github.com/sannybuilder/library/blob/master/gta3_unreal/gta3_unreal.json) | `0.222` | | Vice City: The Definitive Edition | [vc_unreal.json](https://github.com/sannybuilder/library/blob/master/vc_unreal/vc_unreal.json) | `0.228` | -| San Andreas: The Definitive Edition | [sa_unreal.json](https://github.com/sannybuilder/library/blob/master/sa_unreal/sa_unreal.json) | `0.250` | +| San Andreas: The Definitive Edition | [sa_unreal.json](https://github.com/sannybuilder/library/blob/master/sa_unreal/sa_unreal.json) | `0.251` | | GTA IV | [gta_iv.json](https://github.com/sannybuilder/library/blob/master/gta_iv/gta_iv.json) | `0.46` | | Unknown (32-bit) | [unknown_x86.json](https://github.com/sannybuilder/library/blob/master/unknown_x86/unknown_x86.json) | `0.222` | | Unknown (64-bit) | [unknown_x64.json](https://github.com/sannybuilder/library/blob/master/unknown_x64/unknown_x64.json) | `0.225` | -| Bully: Scholarship Edition | [bully.json](https://github.com/sannybuilder/library/blob/master/bully/bully.json) | `0.35` | +| Bully: Scholarship Edition | [bully.json](https://github.com/sannybuilder/library/blob/master/bully/bully.json) | `0.39` | CLEO Redux uses compound definitions (a combination of the primary JSON file for the current game and a JSON file for the Unknown host). It lets SDK commands to work in JS scripts regardless of them being defined or not in the primary JSON file. You should notice that during updates CLEO downloads both `.json` and `unknown.json` as well as the accompanying `enums.js` files. It should not affect any existing scripts. diff --git a/docs/en/events.md b/docs/en/events.md new file mode 100644 index 0000000..19a712a --- /dev/null +++ b/docs/en/events.md @@ -0,0 +1,186 @@ +# Events + +CLEO Redux 1.0.6 adds initial support for event-driven scripting. This feature allows you to write scripts that react to events that happen in the game. + +- [Listening to events](#listening-to-events) +- [List of events](#list-of-events) + - [OnVehicleCreate](#onvehiclecreate) + - [OnPedCreate](#onpedcreate) + - [OnObjectCreate](#onobjectcreate) + - [OnVehicleDelete](#onvehicledelete) + - [OnPedDelete](#onpeddelete) + - [OnObjectDelete](#onobjectdelete) +- [Creating your own events](#creating-your-own-events) + +## Listening to events + +A globally available `addEventListener` function creates a new event listener. It takes two arguments: a [predefined event name](#list-of-events) and a function that will be called when the event is triggered (a callback). The callback receives an argument that is an object with a particular structure depending on the event. + +> Event listeners only work in [async context](./async.md). Scripts willing to react to game events must not use a blocking `wait` function. Use `asyncWait` instead. + +```js +addEventListener("OnVehicleCreate", (event) => { + log("A vehicle is created!"); +}); +``` + +`addEventListener` returns a function that can be used to stop listening to the event. This is useful when you want to stop listening to the event after a certain condition is met. + +```js +const cancel = addEventListener("OnVehicleCreate", (event) => { + log("A vehicle is created!"); +}); + +// ... + +cancel(); // the event callback won't be called anymore +``` + +## List of events + +> The following documentation describes the Events.cleo plugin shipped with CLEO Redux 1.0.6+. Other plugins may add their own events. +> Events are game- and version- specific. Some of them might not be available on certain games or versions. + +### OnVehicleCreate + +Triggered after the game creates a new vehicle of any type in the world. An event's `data` object contains the address of the vehicle structure. + +Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)` + +```ts +interface OnVehicleCreateEvent { + name: string; + data: { + address: int; + } +} + +addEventListener("OnVehicleCreate", (event: OnVehicleCreateEvent) => { + const name = event.name; + log(`Event ${name} is triggered!`}); // logs "Event OnVehicleCreate is triggered!" + + const address = event.data.address; + log("A vehicle is created! Its address is " + address); // logs "A vehicle is created! Its address is 0x12345678" +}); +``` + +### OnPedCreate + +Triggered after the game creates a new ped of any type in the world. An event's `data` object contains the address of the ped structure. + +Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)` + +```ts +interface OnPedCreateEvent { + name: string; + data: { + address: int; + }; +} + +addEventListener("OnPedCreate", (event: OnPedCreateEvent) => { + const name = event.name; + log(`Event ${name} is triggered!`); // logs "Event OnPedCreate is triggered!" + + const address = event.data.address; + log("A ped is created! Its address is " + address); // logs "A ped is created! Its address is 0x12345678" +}); +``` + +### OnObjectCreate + +Triggered after the game creates a new object of any type in the world. An event's `data` object contains the address of the object structure. + +Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)` + +```ts +interface OnObjectCreateEvent { + name: string; + data: { + address: int; + }; +} + +addEventListener("OnObjectCreate", (event: OnObjectCreateEvent) => { + const name = event.name; + log(`Event ${name} is triggered!`); // logs "Event OnObjectCreate is triggered!" + + const address = event.data.address; + log("An object is created! Its address is " + address); // logs "An object is created! Its address is 0x12345678" +}); +``` + +### OnVehicleDelete + +Triggered _before_ the game deletes a vehicle from the world. An event's `data` object contains the address of the vehicle structure. + +Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)` + +```ts +interface OnVehicleDeleteEvent { + name: string; + data: { + address: int; + }; +} + +addEventListener("OnVehicleDelete", (event: OnVehicleDeleteEvent) => { + const name = event.name; + log(`Event ${name} is triggered!`); // logs "Event OnVehicleDelete is triggered!" + + const address = event.data.address; + log("A vehicle is about to be deleted! Its address is " + address); // logs "A vehicle is about to be deleted! Its address is 0x12345678" +}); +``` + +### OnPedDelete + +Triggered _before_ the game deletes a ped from the world. An event's `data` object contains the address of the ped structure. + +Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)` + +```ts +interface OnPedDeleteEvent { + name: string; + data: { + address: int; + }; +} + +addEventListener("OnPedDelete", (event: OnPedDeleteEvent) => { + const name = event.name; + log(`Event ${name} is triggered!`); // logs "Event OnPedDelete is triggered!" + + const address = event.data.address; + log("A ped is about to be deleted! Its address is " + address); // logs "A ped is about to be deleted! Its address is 0x12345678" +}); +``` + +### OnObjectDelete + +Triggered _before_ the game deletes an object from the world. An event's `data` object contains the address of the object structure. + +Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)` + +```ts +interface OnObjectDeleteEvent { + name: string; + data: { + address: int; + }; +} + +addEventListener("OnObjectDelete", (event: OnObjectDeleteEvent) => { + const name = event.name; + log(`Event ${name} is triggered!`); // logs "Event OnObjectDelete is triggered!" + + const address = event.data.address; + log("An object is about to be deleted! Its address is " + address); // logs "An object is about to be deleted! Its address is 0x12345678" +}); +``` + +## Creating your own events + +[CLEO Redux SDK](./using-sdk.md) provides a method called `TriggerEvent` that can be used to emit a new event along with some payload. The plugin must decide when the event should be triggered (usually by hooking into a game function). See the [Events.cleo](https://github.com/cleolibrary/CLEO-Redux/tree/master/plugins/Events) plugin source code for an example. + +`TriggerEvent` has two parameters: an event name and a serialized JSON. It will be passed to the event listeners as the `data` property of the event object. diff --git a/docs/en/installation-plugins.md b/docs/en/installation-plugins.md index a7b80b4..3c97bde 100644 --- a/docs/en/installation-plugins.md +++ b/docs/en/installation-plugins.md @@ -4,13 +4,14 @@ Plugins are optional programs adding extra scripting commands with the help of [ ## List of plugins -| Name | Description | Link | -| ------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| [IniFiles](https://library.sannybuilder.com/#/unknown_x86/ini) | Reading from and writing to INI files | [src](https://github.com/cleolibrary/CLEO-Redux/tree/master/plugins/IniFiles) | -| [Dylib](https://library.sannybuilder.com/#/unknown_x86/dylib) | Loading DLL files and importing functions | [src](https://github.com/cleolibrary/CLEO-Redux/tree/master/plugins/Dylib) | -| [Input](https://library.sannybuilder.com/#/unknown_x86/input) | Checking for keyboard and mouse input, emulating key presses | [src](https://github.com/cleolibrary/CLEO-Redux/tree/master/plugins/Input) | -| [ImGuiRedux](https://library.sannybuilder.com/#/unknown_x86/imgui) | Dear ImGui bindings | [GitHub repo](https://github.com/user-grinch/ImGuiRedux) | -| [MemoryOperations](https://library.sannybuilder.com/#/unknown_x86/memops) | Low-level memory operations | [GitHub repo](https://github.com/cleolibrary/CLEO-REDUX-PLUGINS) | -| Frontend | Checks the latest version on GitHub and display information in the main menu | | +| Name | Description | Link | +| ------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| [IniFiles](https://library.sannybuilder.com/#/unknown_x86/ini) | Reading from and writing to INI files | [src](https://github.com/cleolibrary/CLEO-Redux/tree/master/plugins/IniFiles) | +| [Dylib](https://library.sannybuilder.com/#/unknown_x86/dylib) | Loading DLL files and importing functions | [src](https://github.com/cleolibrary/CLEO-Redux/tree/master/plugins/Dylib) | +| [Input](https://library.sannybuilder.com/#/unknown_x86/input) | Checking for keyboard and mouse input, emulating key presses | [src](https://github.com/cleolibrary/CLEO-Redux/tree/master/plugins/Input) | +| [ImGuiRedux](https://library.sannybuilder.com/#/unknown_x86/imgui) | Dear ImGui bindings | [GitHub repo](https://github.com/user-grinch/ImGuiRedux) | +| [MemoryOperations](https://library.sannybuilder.com/#/unknown_x86/memops) | Low-level memory operations | [GitHub repo](https://github.com/cleolibrary/CLEO-REDUX-PLUGINS) | +| Frontend | Checking for updates on GitHub and displaying information in the main menu | | +| Events | Emitting [custom events](./events.md) | [src](https://github.com/cleolibrary/CLEO-Redux/tree/master/plugins/Events) | Plugins are included in the CLEO Redux installer. You can opt out of some of them by unchecking the corresponding checkbox in the installer. diff --git a/installer/cleo_redux.iss b/installer/cleo_redux.iss index 839bea6..03014e0 100644 --- a/installer/cleo_redux.iss +++ b/installer/cleo_redux.iss @@ -1,5 +1,5 @@ #define AppName "CLEO Redux" -#define AppVersion "1.0.5" +#define AppVersion "1.0.6-dev.20221226" #define AppPublisher "Seemann" #define AppURL "https://re.cleo.li" #define SourceDir "..\" @@ -62,6 +62,7 @@ Name: "plugins/imgui/SilentPatch"; Description: "SilentPatch - needed for the mo Name: "plugins/memops"; Description: "MemoryOperations (by ThirteenAG)"; Types: full Name: "plugins/input"; Description: "Input 1.3"; Types: full Name: "plugins/frontend"; Description: "Frontend 1.1"; Types: full +Name: "plugins/events"; Description: "Events 1.0"; Types: full Name: "loaders"; Description: "File Loaders"; Types: full Name: "loaders/text"; Description: "*.txt, *.text (Text files)"; Types: full Name: "loaders/ide"; Description: "*.ide (Item Definition files)"; Types: full @@ -148,6 +149,8 @@ Source: "{#SourceDir}\plugins\IniFiles\build\IniFiles64.cleo"; DestDir: "{app}\C Source: "{#SourceDir}\plugins\Input\build\Input.cleo"; DestDir: "{app}\CLEO\CLEO_PLUGINS"; Flags: ignoreversion; Check: IsX86; Components: plugins/input Source: "{#SourceDir}\plugins\Input\build\Input64.cleo"; DestDir: "{app}\CLEO\CLEO_PLUGINS"; Flags: ignoreversion; Check: IsX64; Components: plugins/input Source: "{#SourceDir}\plugins\Frontend\Frontend.cleo"; DestDir: "{app}\CLEO\CLEO_PLUGINS"; Flags: ignoreversion; Check: IsX86 and (IsGta3 or IsVC or IsSA); Components: plugins/frontend +Source: "{#SourceDir}\plugins\Events\build\Events.cleo"; DestDir: "{app}\CLEO\CLEO_PLUGINS"; Flags: ignoreversion; Check: IsX86 and not IsUnknown; Components: plugins/events +Source: "{#SourceDir}\plugins\Events\build\Events64.cleo"; DestDir: "{app}\CLEO\CLEO_PLUGINS"; Flags: ignoreversion; Check: IsX64 and not IsUnknown; Components: plugins/events Source: "{tmp}\ImGuiRedux.zip"; DestDir: "{app}\CLEO\CLEO_PLUGINS"; Flags: deleteafterinstall external; Check: IsX86; AfterInstall: InstallImGuiRedux32; Components: plugins/imgui; Source: "{tmp}\ImGuiRedux.zip"; DestDir: "{app}\CLEO\CLEO_PLUGINS"; Flags: deleteafterinstall external; Check: IsX64; AfterInstall: Extract('{app}\CLEO\CLEO_PLUGINS\ImGuiRedux.zip', 'ImGuiReduxWin64.cleo', '{app}\CLEO\CLEO_PLUGINS'); Components: plugins/imgui; @@ -476,7 +479,7 @@ begin begin FGameId := IdentifyGame(WizardDirValue); // reset all checkboxes to their initial state first - for I := 1 to 13 do + for I := 1 to 15 do begin WizardForm.ComponentsList.ItemEnabled[I] := True; WizardForm.ComponentsList.Checked[I] := True; @@ -520,8 +523,11 @@ begin // disable IDE Loader for unknown host if IsUnknown then begin + // Events Plugin + WizardForm.ComponentsList.Checked[11] := False; + WizardForm.ComponentsList.ItemEnabled[11] := False; // ide loader - WizardForm.ComponentsList.Checked[13] := False; + WizardForm.ComponentsList.Checked[14] := False; end; // ImGuiRedux is bugged on re3 @@ -537,7 +543,7 @@ begin // MSS lib is an ASI loader if FileExists(ExpandConstant('{app}\Mss32.dll')) then begin - WizardForm.ComponentsList.Checked[14] := False; + WizardForm.ComponentsList.Checked[15] := False; end; end; end;