Skip to content

Commit bc8a5fc

Browse files
committed
add toc in long articles
1 parent acd0591 commit bc8a5fc

File tree

10 files changed

+274
-209
lines changed

10 files changed

+274
-209
lines changed

docs/en/embedding.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Embedding to custom host
22

3-
CLEO Redux can be embedded and run JS scripts on an unknown (i.e. not [supported officially](./introduction.md#supported-releases)) host. A *host* is an application in which process `cleo_redux.asi` or `cleo_redux64.asi` [gets loaded or injected](#loading-into-custom-process) and where the CLEO runtime [runs](#launching-the-cleo-runtime). This feature is highly experimental and subject to change at any moment.
3+
CLEO Redux can be embedded and run JS scripts on an unknown (i.e. not [supported officially](./introduction.md#supported-releases)) host. A _host_ is an application in which process `cleo_redux.asi` or `cleo_redux64.asi` [gets loaded or injected](#loading-into-custom-process) and where the CLEO runtime [runs](#launching-the-cleo-runtime). This feature is highly experimental and subject to change at any moment.
4+
5+
- [Loading into custom process](#loading-into-custom-process)
6+
- [Launching the CLEO runtime](#launching-the-cleo-runtime)
7+
- [Automatic launch](#automatic-launch)
8+
- [Manually Controlling the Runtime](#manually-controlling-the-runtime)
9+
- [Available Commands](#available-commands)
10+
- [Manifest](#manifest)
11+
- [Example](#example)
412

513
<iframe width="560" height="315" src="https://www.youtube.com/embed/rk2LvDt7UkI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
614

@@ -81,7 +89,7 @@ Manifest is a file with static configuration for the given host. Only unknown ho
8189

8290
- `host` should match the host's executable name. E.g. if the host runs via `application.exe`, the value is `application`. Available in scripts as the [HOST variable](./api.md#host).
8391
- `host_name` defines the host's custom name used in the [log](./log.md)
84-
- `compound` defines whether the host uses [compound definitions](./definitions.md). By default the host uses definitions from the file matching `<host>.json`, e.g. `application.json`. This file should be provided by the person managing integration of CLEO Redux with the given host and placed in the `.config` folder.
92+
- `compound` defines whether the host uses [compound definitions](./definitions.md). By default the host uses definitions from the file matching `<host>.json`, e.g. `application.json`. This file should be provided by the person managing integration of CLEO Redux with the given host and placed in the `.config` folder.
8593

8694
When `compound` is set to `true` the host also uses command definitions for the Unknown host (e.g. `unknown_x86.json`). If this file is missing CLEO downloads it from Sanny Builder Library.
8795

@@ -91,10 +99,10 @@ Host: [Sanny Builder 3](https://sannybuilder.com) (`sanny.exe`)
9199

92100
```json
93101
{
94-
"host": "sanny",
95-
"host_name": "Sanny Builder 3",
96-
"compound": true
102+
"host": "sanny",
103+
"host_name": "Sanny Builder 3",
104+
"compound": true
97105
}
98106
```
99107

100-
`Sanny Builder 3\CLEO\.config` folder contains `sanny.json` and `manifest.json` before the first run. The other files are downloaded or generated automatically.
108+
`Sanny Builder 3\CLEO\.config` folder contains `sanny.json` and `manifest.json` before the first run. The other files are downloaded or generated automatically.

docs/en/first-steps.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# First steps
22

3+
- [Introduction](#introduction)
4+
- [Concurrency](#concurrency)
5+
- [Variables](#variables)
6+
- [Control Flow](#control-flow)
7+
- [Conditions](#conditions)
8+
- [Loops](#loops)
9+
- [Functions](#functions)
10+
11+
## Introduction
12+
313
Since [available commands](./api.md) vary from game to game for the purpose of this tutorial we will be using CLEO's built-in commands such as [`log`](./log.md) command that is available everywhere.
414

515
Once you have CLEO Redux [installed](./installation.md) run the game once to make sure CLEO is loading. You can verify it by having `cleo_redux.log` created in the game root folder. If there are no errors in the log you can start adding new scripts.
@@ -94,7 +104,7 @@ temp = [];
94104
log(typeof temp); // prints "object" in cleo_redux.log*
95105
```
96106

97-
> *`typeof` returns "object" for an array (`[]`). This is a very well known quirk in the language. You can [read more about it here](https://web.mit.edu/jwalden/www/isArray.html) and find other means of differenting between arrays and plain objects.
107+
> \*`typeof` returns "object" for an array (`[]`). This is a very well known quirk in the language. You can [read more about it here](https://web.mit.edu/jwalden/www/isArray.html) and find other means of differenting between arrays and plain objects.
98108
99109
## Control Flow
100110

docs/en/imports.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22

33
You can import other scripts and some custom file formats in your code to make the code modular and share the common logic. This page describes static `import` statements (unconditional importing). Their format matches the [ES6 import syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import). CLEO Redux also supports [dynamic imports](./async.md#dynamic-imports) (importing on-demand).
44

5+
- [Importing scripts](#importing-scripts)
6+
- [Importing JSON files](#importing-json-files)
7+
- [Importing other formats](#importing-other-formats)
8+
- [TXT](#txt)
9+
- [IDE](#ide)
10+
511
## Importing scripts
612

713
- Extensions: `.js`, `.mjs`, `.ts`
814

9-
`./` in a path resolves to the current file's directory. If a script is located at `C:\Game\CLEO\mod1\extra\addon.js` and it contains `import { foo } from './bar.js'`, the runtime will try to load `C:\Game\CLEO\mod1\extra\bar.js`.
10-
11-
`../` resolves to the parent directory. If a script is located at `C:\Game\CLEO\mod1\extra\addon.js` and it contains `import { foo } from '../bar.js'`, the runtime will try to load `C:\Game\CLEO\mod1\bar.js`. You can combine `../` to traverse multiple levels up.
15+
`./` in a path resolves to the current file's directory. If a script is located at `C:\Game\CLEO\mod1\extra\addon.js` and it contains `import { foo } from './bar.js'`, the runtime will try to load `C:\Game\CLEO\mod1\extra\bar.js`.
1216

17+
`../` resolves to the parent directory. If a script is located at `C:\Game\CLEO\mod1\extra\addon.js` and it contains `import { foo } from '../bar.js'`, the runtime will try to load `C:\Game\CLEO\mod1\bar.js`. You can combine `../` to traverse multiple levels up.
1318

1419
To avoid running imported `.js` files as standalone scripts, either put them into a separate folder outside of the main [CLEO directory](./cleo-directory.md) (e.g. `CLEO/includes/`) or use the extension `.mjs`.
1520

@@ -19,7 +24,6 @@ import func from "./other";
1924

2025
// imports named export PedType from types.js or types.mjs located in the CLEO/includes directory
2126
import { PedType } from "./includes/types";
22-
2327
```
2428

2529
## Importing JSON files
@@ -91,13 +95,11 @@ would be transformed into:
9195

9296
```json
9397
{
94-
"peds": [
95-
["0", "null", "generic", "PLAYER1", "STAT_PLAYER", "player", "7f"],
96-
["1", "cop", "cop", "COP", "STAT_COP", "man", "7f"]
97-
],
98-
"objs": [
99-
"170", "grenade", "generic", "1", "100", "0"
100-
]
98+
"peds": [
99+
["0", "null", "generic", "PLAYER1", "STAT_PLAYER", "player", "7f"],
100+
["1", "cop", "cop", "COP", "STAT_COP", "man", "7f"]
101+
],
102+
"objs": ["170", "grenade", "generic", "1", "100", "0"]
101103
}
102104
```
103105

docs/en/installation.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Installation
22

3+
- [CLEO Directory](#cleo-directory)
4+
- [Dependency on ASI Loader](#dependency-on-asi-loader)
5+
- [Note on re3 or reVC](#note-on-re3-or-revc)
6+
- [Uninstallation](#uninstallation)
7+
38
CLEO Redux comes with a hassle-free installer that identifies the selected game and downloads all the dependencies. Just run `cleo_redux_setup.exe` and follow its steps.
49

510
> Both CLEO Redux and its installer recognize the target game purely by the executable name in the selected/working directory.

docs/en/other-features.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
CLEO Redux puts focus on improving dev experience and make scripting process easier.
44

5+
- [Integration with Visual Studio Code](#integration-with-visual-studio-code)
6+
- [SCM Log](#scm-log)
7+
- [Hot Reload](#hot-reload)
8+
- [Main Menu Information](#main-menu-information)
9+
510
## Integration with Visual Studio Code
611

712
<iframe width="560" height="315" src="https://www.youtube.com/embed/jqz8_lGnG4g" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
@@ -56,4 +61,4 @@ Hot reload for CS scripts does not work when CLEO Redux runs alongside CLEO Libr
5661

5762
## Main Menu Information
5863

59-
CLEO Redux displays the information such as the version and the amount of active scripts in the main menu of GTA III / Vice City and San Andreas. To disable this information set [`DisplayMenuInfo`](./config.md#general) to `0`.
64+
`Frontend` plugin displays some extra information such as the CLEO version and the amount of active scripts in the main menu of GTA III, Vice City, and San Andreas. It also checks for available updates. If this information is not needed, delete `Frontend.cleo` file from the CLEO plugins directory.

docs/en/troubleshooting.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Troubleshooting
22

3+
- [CLEO does not work with re3 or reVC](#cleo-does-not-work-with-re3-or-revc)
4+
- [Game crashes with CLEO on San Andreas: The Definitive Edition](#game-crashes-with-cleo-on-san-andreas-the-definitive-edition)
5+
- [Scripts stopped working after CLEO Redux update](#scripts-stopped-working-after-cleo-redux-update)
6+
- [Game is stuck loading](#game-is-stuck-loading)
7+
- [Nothing happens when I run the game, not even a log file is there](#nothing-happens-when-i-run-the-game-not-even-a-log-file-is-there)
8+
- [My problem is not listed there](#my-problem-is-not-listed-there)
9+
310
## CLEO does not work with re3 or reVC
411

512
{{#include ./re3-reVC-notes.md}}

docs/en/using-fxt.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
CLEO Redux supports custom text content without the need to edit game files.
44

5+
- [Static FXT files](#static-fxt-files)
6+
- [FxtStore](#fxtstore)
7+
58
## Static FXT files
69

710
<iframe width="560" height="315" src="https://www.youtube.com/embed/ctsKy7WnY9o" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

0 commit comments

Comments
 (0)