mirror of
https://github.com/He4eT/cheap-glkote.git
synced 2026-05-05 00:47:28 +00:00
Update README.md
This commit is contained in:
parent
b51dc35e75
commit
15f54b48fa
1 changed files with 8 additions and 6 deletions
14
README.md
14
README.md
|
|
@ -17,17 +17,18 @@ const { glkInterface, sendFn } =
|
||||||
|
|
||||||
### Input
|
### Input
|
||||||
```js
|
```js
|
||||||
sendFn('open door', windowObject)
|
sendFn('open door', inputType, targetWindow)
|
||||||
```
|
```
|
||||||
You can received `windowObject` in `onUpdateWindows` handler.<br>
|
You can receive `inputType` and `id` of `targetWindow` in `onUpdateInputs` handler.<br>
|
||||||
You should respect input type setted by `onUpdateInputs`.
|
You can receive `targetWindow` by its `is` in `onUpdateWindows` handler.<br>
|
||||||
|
As I know, `inputType` can be `line` or `char`.
|
||||||
|
|
||||||
### Output and lifecycle
|
### Output and lifecycle
|
||||||
```js
|
```js
|
||||||
const handlers = {
|
const handlers = {
|
||||||
onInit: () => {
|
onInit: () => {
|
||||||
/**
|
/**
|
||||||
* It's time to prepare the user interface.
|
* It's time to initialize the user interface.
|
||||||
*/
|
*/
|
||||||
},
|
},
|
||||||
onUpdateWindows: windows => {
|
onUpdateWindows: windows => {
|
||||||
|
|
@ -35,10 +36,11 @@ const handlers = {
|
||||||
* Game wants to change the number of windows.
|
* Game wants to change the number of windows.
|
||||||
*/
|
*/
|
||||||
},
|
},
|
||||||
onUpdateInputs: type => {
|
onUpdateInputs: data => {
|
||||||
/**
|
/**
|
||||||
* Game wants to change input type.
|
* Game wants to change input type.
|
||||||
* Supported types: 'char', 'line'.
|
* 'data' is a list with info about
|
||||||
|
* the target window and the input type.
|
||||||
*/
|
*/
|
||||||
},
|
},
|
||||||
onUpdateContent: messages => {
|
onUpdateContent: messages => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue