Skip to content

Commit

Permalink
update to 1.01
Browse files Browse the repository at this point in the history
  • Loading branch information
x87 committed Aug 19, 2022
1 parent 7747667 commit 96c46b0
Show file tree
Hide file tree
Showing 12 changed files with 79 additions and 25 deletions.
33 changes: 29 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
### 1.0.1

- initial support for Bully: Scholarship Edition (v1.2 PC)
- fix a potential crash in gxt hook
- fix a potential issue with scripts not working after reload under some circumstances

**SDK AND PLUGINS**

- add `GTA IV`, `Bully`, and `Manifest` to `HostId` enum
- update Input plugin to v1.3:
- use `GetAsyncKeyState` instead of `GetKeyState`
- new commands [GET_CURSOR_POS](https://library.sannybuilder.com/#/unknown_x86/input/GET_CURSOR_POS) and [SET_CURSOR_POS](https://library.sannybuilder.com/#/unknown_x86/input/SET_CURSOR_POS)
- new SDK method `OnShowTextBox` to register and run callbacks on a `ShowTextBox` function call. Implementing a custom callback shadows the default implementation for the given host (e.g. a message in the black rectangular text box).
- unknown hosts can now have a manifest file to define a custom name and API files for the host
- SDK version is now 5

**INSTALLER**

- you can opt out of installing provided API files and download latest versions from Sanny Builder Library during the first game run

**BREAKING CHANGES**

- bumped minimum required versions of [command definitions](https://re.cleo.li/docs/en/definitions.html)

`Pad` enum was renamed to `PadId` to avoid conflicts with a static `Pad` class.

### 1.0.0 - July 01, 2022

- add initial support for GTA IV (The Complete Edition)
Expand All @@ -12,12 +38,11 @@

**INSTALLER**

- installer now includes all files needed to setup and run CLEO Redux in offline mode


- installer now includes all files needed to setup and run CLEO Redux in offline mode

**BREAKING CHANGES**

- bumped minimum required versions of [command definitions](https://re.cleo.li/docs/en/definitions.html)
- bumped minimum required versions of [command definitions](https://re.cleo.li/docs/en/definitions.html)

### 0.9.4 - May 12, 2022

Expand Down
Binary file modified SDK/cleo_redux.lib
Binary file not shown.
Binary file modified SDK/cleo_redux64.lib
Binary file not shown.
5 changes: 5 additions & 0 deletions SDK/cleo_redux_sdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enum class HostId
SA_UNREAL = 8,
IV = 9,
BULLY = 10,
MANIFEST = 254,
UNKNOWN = 255
};

Expand All @@ -37,6 +38,7 @@ typedef HandlerResult (*CommandHandler)(Context);
typedef void* (*CustomLoader)(const char*);
typedef void (*OnTickCallback)(unsigned int current_time, int time_step);
typedef void (*OnRuntimeInitCallback)();
typedef void (*OnShowTextBoxCallback)(const char*);

extern "C" {
// since v1
Expand Down Expand Up @@ -111,5 +113,8 @@ extern "C" {
// since v4
// Registers a new callback invoked on each runtime init event (new game, saved game load, or SDK's RuntimeInit)
void OnRuntimeInit(OnRuntimeInitCallback callback);
// since v5
// Registers a new callback invoked on a ShowTextBox function call. Providing a callback shadows built-in ShowTextBox implementation.
void OnShowTextBox(OnShowTextBoxCallback callback);
}

16 changes: 16 additions & 0 deletions SDK/cleo_redux_sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub enum HostId {
SA_UNREAL = 8,
IV = 9,
BULLY = 10,
MANIFEST = 254,
UNKNOWN = 255,
}

Expand All @@ -39,6 +40,7 @@ pub type CustomCommand = extern "C" fn(Context) -> HandlerResult;
pub type CustomLoader = extern "C" fn(*const c_char) -> *mut c_void;
pub type OnTickCallback = extern "C" fn(current_time: u32, time_step: i32);
pub type OnRuntimeInitCallback = extern "C" fn();
pub type OnShowTextBoxCallback = extern "C" fn(*const c_char);

#[cfg_attr(target_arch = "x86", link(name = "cleo_redux"))]
#[cfg_attr(target_arch = "x86_64", link(name = "cleo_redux64"))]
Expand Down Expand Up @@ -144,6 +146,10 @@ extern "C" {
///
/// since v4
fn OnRuntimeInit(cb: OnRuntimeInitCallback);
/// Registers a new callback invoked on a ShowTextBox function call. Providing a callback shadows built-in ShowTextBox implementation.
///
/// since v5
fn OnShowTextBox(cb: OnShowTextBoxCallback);
}

macro_rules! sz {
Expand Down Expand Up @@ -365,3 +371,13 @@ pub fn on_runtime_init(cb: OnRuntimeInitCallback) {
OnRuntimeInit(cb);
}
}

/// Registers a new callback invoked on a ShowTextBox function call. Providing a callback shadows built-in ShowTextBox implementation.
///
/// since v5
#[allow(dead_code)]
pub fn on_show_text_box(cb: OnShowTextBoxCallback) {
unsafe {
OnShowTextBox(cb);
}
}
2 changes: 1 addition & 1 deletion docs/en/custom-commands.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Custom Commands

> The following commands are for classic games only. For The Definitive Edition [check this information](the-definitive-edition-faq.md#can-i-use-cleo-opcodes).
> The following commands are for classic GTA games only. For GTA The Trilogy [check this information](the-definitive-edition-faq.md#can-i-use-cleo-opcodes).

CLEO Redux supports all original opcodes available in the given game. On top of those it adds a few new commands listed below. Note that they strictly match the opcodes of CLEO Library.
Expand Down
18 changes: 10 additions & 8 deletions docs/en/definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ On the first run CLEO tries to download a definition file (see the table below)

| Game | File | Minimum Required Version |
| ----------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------ |
| GTA III, re3 | [gta3.json](https://github.com/sannybuilder/library/blob/master/gta3/gta3.json) | `0.226` |
| GTA VC, reVC | [vc.json](https://github.com/sannybuilder/library/blob/master/vc/vc.json) | `0.227` |
| GTA San Andreas (Classic) 1.0 | [sa.json](https://github.com/sannybuilder/library/blob/master/sa/sa.json) | `0.256` |
| GTA IV | [gta_iv.json](https://github.com/sannybuilder/library/blob/master/gta_iv/gta_iv.json) | `0.39` |
| GTA III, re3 | [gta3.json](https://github.com/sannybuilder/library/blob/master/gta3/gta3.json) | `0.231` |
| GTA VC, reVC | [vc.json](https://github.com/sannybuilder/library/blob/master/vc/vc.json) | `0.236` |
| GTA San Andreas (Classic) 1.0 | [sa.json](https://github.com/sannybuilder/library/blob/master/sa/sa.json) | `0.262` |
| GTA IV | [gta_iv.json](https://github.com/sannybuilder/library/blob/master/gta_iv/gta_iv.json) | `0.40` |
| GTA III: The Definitive Edition | [gta3_unreal.json](https://github.com/sannybuilder/library/blob/master/gta3_unreal/gta3_unreal.json) | `0.214` |
| Vice City: The Definitive Edition | [vc_unreal.json](https://github.com/sannybuilder/library/blob/master/vc_unreal/vc_unreal.json) | `0.216` |
| San Andreas: The Definitive Edition | [sa_unreal.json](https://github.com/sannybuilder/library/blob/master/sa_unreal/sa_unreal.json) | `0.229` |
| Unknown (32-bit) | [unknown_x86.json](https://github.com/sannybuilder/library/blob/master/unknown_x86/unknown_x86.json) | `0.212` |
| Unknown (64-bit) | [unknown_x64.json](https://github.com/sannybuilder/library/blob/master/unknown_x64/unknown_x64.json) | `0.216` |
| Vice City: The Definitive Edition | [vc_unreal.json](https://github.com/sannybuilder/library/blob/master/vc_unreal/vc_unreal.json) | `0.220` |
| San Andreas: The Definitive Edition | [sa_unreal.json](https://github.com/sannybuilder/library/blob/master/sa_unreal/sa_unreal.json) | `0.232` |
| San Andreas: The Definitive Edition | [sa_unreal.json](https://github.com/sannybuilder/library/blob/master/sa_unreal/sa_unreal.json) | `0.232` |
| Bully: Scholarship Edition | [bully.json](https://github.com/sannybuilder/library/blob/master/bully/bully.json) | `0.23` |
| Unknown (32-bit) | [unknown_x86.json](https://github.com/sannybuilder/library/blob/master/unknown_x86/unknown_x86.json) | `0.216` |
| Unknown (64-bit) | [unknown_x64.json](https://github.com/sannybuilder/library/blob/master/unknown_x64/unknown_x64.json) | `0.220` |

Starting from v1.0.0 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 `<game>.json` and `unknown.json` as well as the accompanying `enums.js` files. It should not affect any existing scripts.
19 changes: 10 additions & 9 deletions docs/en/installation-plugins.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Plugins

Plugins are optional programs adding extra scripting commands with the help of [CLEO Redux SDK](./using-sdk.md). They have a `.cleo` extension.

Plugins should be copied to the `CLEO\CLEO_PLUGINS` directory.
Plugins are optional programs adding extra scripting commands with the help of [CLEO Redux SDK](./using-sdk.md). A plugin file has a `.cleo` extension and should be copied to the `CLEO\CLEO_PLUGINS` directory.

## 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) - [download](https://github.com/cleolibrary/CLEO-Redux/releases/download/0.9.2/CLEO_Redux-0.9.2+IniFiles+Dylib.zip) |
| [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) - [download](https://github.com/cleolibrary/CLEO-Redux/releases/download/0.9.2/CLEO_Redux-0.9.2+IniFiles+Dylib.zip) |
| [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) |
| 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) |

Plugins are included in the CLEO Redux installer. You can opt out of some of them by unchecking the corresponding checkbox in the installer.
1 change: 1 addition & 0 deletions docs/en/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Other:

- re3 (see [details](./troubleshooting.md#cleo-does-not-work-with-re3-or-revc))
- reVC (see [details](./troubleshooting.md#cleo-does-not-work-with-re3-or-revc))
- Bully: Scholarship Edition
- unknown host (see [details](./embedding.md))

For the complete reference on supported features [refer to this page](https://github.com/cleolibrary/CLEO-Redux/wiki/Feature-Support-Matrix). Also there are known limitations [listed here](unsupported.md).
Expand Down
4 changes: 4 additions & 0 deletions docs/en/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

If CLEO can't create files in `Gameface\Binaries\Win64` it uses another path at `C:\Users\<your_usename>\AppData\Roaming\CLEO Redux`. There should be `cleo_redux.log` and the CLEO folder where all your scripts go.

## Scripts stopped working after CLEO Redux update

In rare cases there might be an error in command definitions in Sanny Builder Library. Delete the [definition file](./definitions.md) from the `.config` folder and restart the game. CLEO will redownload the latest version of the file. If the problem persists, report the issue using links below.

## My problem is not listed there

- Check the [GitHub tickets](https://github.com/cleolibrary/CLEO-Redux/issues)
Expand Down
2 changes: 1 addition & 1 deletion docs/en/using-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SDK provides a way to create new script commands for any game that CLEO Redux su

## SDK Version

The current version is `4`. Changes to SDK advance this number by one.
The current version is `5`. Changes to SDK advance this number by one.


## Platforms Support
Expand Down
4 changes: 2 additions & 2 deletions installer/cleo_redux.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define AppName "CLEO Redux"
#define AppVersion "1.0.1-dev.20220718"
#define AppVersion "1.0.1"
#define AppPublisher "Seemann"
#define AppURL "https://re.cleo.li"
#define SourceDir "..\"
Expand Down Expand Up @@ -60,7 +60,7 @@ Name: "plugins/imgui"; Description: "ImGuiRedux (by Grinch_)"; Types: full
Name: "plugins/imgui/d3d8to9"; Description: "d3d8to9 Wrapper - for games using DirectX 8"; Types: full
Name: "plugins/imgui/SilentPatch"; Description: "SilentPatch - needed for the mouse to work properly in classic GTA"; Types: full
Name: "plugins/memops"; Description: "MemoryOperations (by ThirteenAG)"; Types: full
Name: "plugins/input"; Description: "Input 1.2"; Types: full
Name: "plugins/input"; Description: "Input 1.3"; Types: full
Name: "loaders"; Description: "File Loaders"; Types: full
Name: "loaders/text"; Description: "*.txt files"; Types: full
Name: "loaders/ide"; Description: "*.ide files (for 32-bit GTA3, VC, SA, IV)"; Types: full
Expand Down

0 comments on commit 96c46b0

Please sign in to comment.