Skip to content

Commit

Permalink
embed youtube videos
Browse files Browse the repository at this point in the history
  • Loading branch information
x87 committed May 11, 2022
1 parent c00e1c3 commit 3367da6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/en/embedding.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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.

[See demo on YouTube](https://www.youtube.com/watch?v=rk2LvDt7UkI).
<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>

## Loading into custom process

Expand Down
4 changes: 2 additions & 2 deletions docs/en/fluent-interface.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Fluent Interface

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

Methods on constructible entities (such as `Player`, `Car`, `Char` -- any entities created via a constructor method) support chaining (also known as Fluent Interface). It allows to write code like this:

```js
Expand All @@ -13,8 +15,6 @@ p.giveWeapon(2, 100)
.setBleeding(true);
```

[See demo on YouTube](https://www.youtube.com/watch?v=LLgJ0fWbklg).

Destructor methods interrupt the chain. E.g. given the code:

`Char.Create(0, 0, 0, 0, 0).setCoordinates(0, 0, 0).delete()`
Expand Down
11 changes: 5 additions & 6 deletions docs/en/other-features.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Other Features

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

## Integration with Visual Studio Code

[See demo on YouTube](https://youtu.be/jqz8_lGnG4g)
<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>

VS Code has excellent JavaScript support out of the box and is highly customizable. CLEO Redux generates typings for all supported commands that you can use when writing JavaScript in VS Code. Add the following line in your `*.js` script to get the full autocomplete support:

Expand Down Expand Up @@ -32,7 +32,6 @@ For `Unknown` host
/// <reference path=".config/unknown.d.ts" />
```


This line instructs VS Code where to look for the commands definitions for the autocomplete feature. The `path` can be relative to the script file or be absolute. [Find out more information](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-path-) on the official TypeScript portal.

## SCM Log
Expand All @@ -45,14 +44,14 @@ In JavaScript code use `CLEO.debug.trace(true)` to trace all commands. Use `CLEO

CLEO monitors active scripts and reloads them in game as they change

[See demo on YouTube](https://www.youtube.com/watch?v=WanLojClqFw)
<iframe width="560" height="315" src="https://www.youtube.com/embed/WanLojClqFw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Adding a new script file in the [CLEO directory](./cleo-directory.md) or deleting one while the game is running starts or stops the script automatically

[See demo on YouTube](https://www.youtube.com/watch?v=LAi2syrsxJg)
<iframe width="560" height="315" src="https://www.youtube.com/embed/LAi2syrsxJg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Hot reload for CS scripts does not work when CLEO Redux runs alongside CLEO Library (e.g. in classic San Andreas).

## Main Menu Information

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`.
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`.
27 changes: 13 additions & 14 deletions docs/en/using-fxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ CLEO Redux supports custom text content without the need to edit game files.

## Static FXT files

[See demo on YouTube](https://youtu.be/ctsKy7WnY9o)
<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>

CLEO Redux can load and serve static text content. Create a new file with the `.fxt` extension and put it in the `CLEO\CLEO_TEXT` [folder](./cleo-directory.md). The file name can be any valid name.
CLEO Redux can load and serve static text content. Create a new file with the `.fxt` extension and put it in the `CLEO\CLEO_TEXT` [folder](./cleo-directory.md). The file name can be any valid name.

Each FXT file contains a list of the key-value entries in the following format:

Expand All @@ -31,10 +31,9 @@ Text.PrintHelp('KEY1') // displays <TEXT1>

You can find the commands available in each game in the Sanny Builder Library, e.g. [for San Andreas: DE](https://library.sannybuilder.com/#/sa_unreal/classes/Text).


## FxtStore

[See demo on YouTube](https://youtu.be/FLyYyrGz1Xg)
<iframe width="560" height="315" src="https://www.youtube.com/embed/FLyYyrGz1Xg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

CLEO Redux provides an interface for manipulating custom text directly in JavaScript code. There is a static variable, named `FxtStore` with the following interface:

Expand All @@ -57,29 +56,29 @@ declare interface FxtStore {
Using `FxtStore` you can create unique keys and values in the script and put it in local FXT storage. Each script owns a private storage and keys from one script will not conflict with other scripts. Also keys defined in the FxtStore will shadow the same keys defined in static FXT files. Consider the example:

custom.fxt:

```
MY_KEY Text from FXT file
```

custom.js:

```js
Text.PrintHelp('MY_KEY') // this displays "Text from FXT file"
FxtStore.insert('MY_KEY', 'Text from script');
Text.PrintHelp('MY_KEY') // this displays "Text from script"
FxtStore.delete('MY_KEY')
Text.PrintHelp('MY_KEY') // this displays "Text from FXT file" again
Text.PrintHelp("MY_KEY"); // this displays "Text from FXT file"
FxtStore.insert("MY_KEY", "Text from script");
Text.PrintHelp("MY_KEY"); // this displays "Text from script"
FxtStore.delete("MY_KEY");
Text.PrintHelp("MY_KEY"); // this displays "Text from FXT file" again
```

A private FXT storage is not supported in San Andreas: The Definitive Edition. Each script there modifies the global FXT storage. This behavior may change in the future.

Custom text can be constructed dynamically, e.g.:

```js
while(true) {
wait(0);
FxtStore.insert('TIME', 'Timestamp: ' + Date.now());
Text.PrintHelp('TIME') // this displays "Timestamp: " and the updated timestamp value
while (true) {
wait(0);
FxtStore.insert("TIME", "Timestamp: " + Date.now());
Text.PrintHelp("TIME"); // this displays "Timestamp: " and the updated timestamp value
}
```

0 comments on commit 3367da6

Please sign in to comment.