Skip to content

Commit

Permalink
Add Admonish (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
CakeVR committed Dec 4, 2023
1 parent 478baf6 commit 74302fc
Show file tree
Hide file tree
Showing 6 changed files with 382 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/mdbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
rustup update
cargo install --version ${MDBOOK_VERSION} mdbook
- name: Install mdBook Preprocessors
run: |
cargo install mdbook-admonish
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
Expand Down
6 changes: 6 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ description = "Learn about Dialogic 2 and how to create beautiful dialogues in y
[output.html]
git-repository-url = "https://github.com/dialogic-godot/documentation/tree/main/"
edit-url-template = "https://github.com/dialogic-godot/documentation/edit/main/{path}"
additional-css = ['.\mdbook-admonish.css']

[preprocessor.admonish]
after = ["links"]
command = "mdbook-admonish"
assets_version = "3.0.1" # do not edit: managed by `mdbook-admonish install`
14 changes: 5 additions & 9 deletions documentation/auto-skip.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,18 @@ taking into account their reading proficiency and the text's complexity.
In Dialogic's Settings tab, under the Text section, you can find the
Auto-Advance settings.
![header_saving_loading](/media/auto_advance_settings.png)
Hover over the tooltip icons to learn more about each settings.
Hover over the tooltip icons to learn more about each setting.

One critical setting is the "Additional Delay", which allows you to choose
between "Per Character" and "Per Word".\
These settings modify the pace at which text is displayed, adding extra delays
either on character or word count.

[comment]: <> (TODO: Add a backlink to the Settings documentation)

> **Note:** \
> Every setting added to `Dialogic.Setting` is automatically saved and loaded by Dialogic for the *player*.

### Per Word vs. Per Character

Some languages, for instance Japanese, don't separate words by spaces.\
Dialogic uses the popular whitespace used by the spacebar to determine when a
Dialogic uses the popular whitespace used by the space bar to determine when a
word ends and another begins.\
If you plan on providing multiple localisations, you can set both settings
via the API.
Expand All @@ -60,7 +56,7 @@ next event.\
Thanks to the multiple enable conditions, if the player disables Auto-Advances,
it will still carry on until the next event.

You can turn any of the enable variables to `true` to enable Auto-Advance. If you have an Auto-Advance button, you can use the following code to enable the feature:
You can turn any of the enable-variables to `true` activating Auto-Advance. If you have an Auto-Advance button, you can use the following code to enable the feature:

```gdscript
Dialogic.Input.auto_advance.enabled_until_user_input = true
Expand All @@ -70,7 +66,7 @@ Dialogic.Input.auto_advance.enabled_until_user_input = true

For Visual Novels, enabling players to set their text speed is a common practice.
To provide the same feature using Dialogic, use `Dialogic.Input.auto_advance.delay_modifier`.
This setting mulitplies the total calculated Auto-Advance delay time. Faster readers may want a lower number.\
This setting multiplies the total calculated Auto-Advance delay time. Faster readers may want a lower number.\

#### Ignored Characters

Expand Down Expand Up @@ -132,4 +128,4 @@ func _ready():
```

Note, if you swap between languages, you'll need to update these settings
accordingly if you don't want languages with whitespaces to be affected by both.
accordingly if you don't want languages with whitespaces to be affected by both.
14 changes: 8 additions & 6 deletions documentation/creating-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Animations are little scripts inheriting the `DialogicAnimation` class, you can
Your animation script should look something like this (bounce_in as example):


### Animation Example Bounce
### Animation Example Bounce

```gdscript
extends DialogicAnimation
Expand All @@ -183,12 +183,14 @@ func animate():
tween.finished.connect(emit_signal.bind('finished_once'))
```

*It's important that you:*
```admonish info
Be aware, you have to:
- extend the `DialogicAnimation` class and implement the animate() method
- at some point emit the `finished_once` signal (it's called like this because animations can be repeated by dialogic)
- extend the `DialogicAnimation` class and implement the `animate()` method
- at some point emit the `finished_once` signal; it's called like this because animations can be repeated by Dialogic
```

*You have the following variables given to work of:*
*You have the following variables given to work with:*

- **node** = the node to animate. This is NOT your portrait node directly, but a Node2D that holds that portrait node
- **time** = the amount of time the animation should take
Expand All @@ -204,7 +206,7 @@ func animate():
[Dialogic node](/documentation/dialogic-nodes) are nodes that in some way execute something visibly, logically or audibly.
They are generally managed by a subsystem and found because they are automatically added to a group. This makes sure it doesn't matter where in the scene tree they are and how many of them exist.

DialogicNodes do not need to be added by the index.gd file!
`DialogicNodes` do not need to be added by the `index.gd` file!

---

Expand Down
23 changes: 15 additions & 8 deletions documentation/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ Now, let's verify you have correctly installed Dialogic:
- Tick the `enabled` button next to Dialogic.
- Restart Godot

## 🚧How to install the latest WIP version🚧
## 🚧 How to install the latest WIP Version 🚧

> *Dialogic is constantly evolving. Oftentimes fixes for bugs or new features might only be available on the main branch. This is especially true during the alpha and beta phase. If you are interested in using the main branch it's easy to do so.*
> *Go to [the main page of the repository](https://github.com/coppolaemilio/dialogic) and click on the green `Code` button then presse the `Download ZIP` button. From there you can install that ZIP's content like a release.*
```admonish warning
*Dialogic is constantly evolving. Oftentimes fixes for bugs or new features might only be available on the main branch. This is especially true during the alpha and beta phase. If you are interested in using the main branch it's easy to do so.*
*Go to [the main page of the repository](https://github.com/coppolaemilio/dialogic) and click on the green `Code` button then presse the `Download ZIP` button. From there you can install that ZIP's content like a release.*
```

## 2. Meeting the editor

Expand Down Expand Up @@ -62,11 +64,16 @@ You can test the timeline by clicking the `Play Timeline` button at the top righ

## 4. Creating a character

To create a new character press the `Add Character` button on the top right.
To create a new character press the `Add Character` button on the top right.

As for timelines, you need to select the place to save to and a name.

As for timelines, you need to select the place to save to and a name.

⚠️*Important: This name (without .dch) is what will be saved whenever you use that character in a timeline and what you will have to write when referencing the character (e.g. `Emilio: This is a text event.`, if the file is named Emilio.dch). So make sure to give it a good name. You can change the name that will actually be displayed in game as the `display_name` property.*
```admonish danger
This name (without `.dch`) is what will be saved whenever you use that character in a timeline and what you will have to write when referencing the character (e.g. `Emilio: This is a text event.`, if the file is named `Emilio.dch`). So make sure to give it a good name.
You can change the name that will actually be displayed in game as the `display_name` property.
```

Once your character is created, you will see the character editor. This editor has 4 main sections.
<img src="/media/character_editor.png" width="600"/>
Expand All @@ -77,9 +84,9 @@ You can learn more about portraits, custom portraits and the character settings

The last important step is to actually have this dialog show up in your game.

For that we need two things to happen:
For that we need two things to happen:

- A) having nodes that can display our timeline and
- A) having nodes that can display our timeline and
- B) start the execution of the timeline.

Luckily for us, Dialogic provides a method that does both of those: `Dialogic.start(@timeline_name_or_path)`
Expand Down
Loading

0 comments on commit 74302fc

Please sign in to comment.