Skip to content

Commit

Permalink
Merge branch 'dialogic-godot:main' into layered-portrait
Browse files Browse the repository at this point in the history
  • Loading branch information
CakeVR authored Apr 6, 2024
2 parents 6e78c47 + aea4bf7 commit 4505a21
Show file tree
Hide file tree
Showing 62 changed files with 1,963 additions and 620 deletions.
43 changes: 36 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
<h1 align="center">Dialogic</h1>

<p align="center">
Create dialogs, characters and scenes to display conversations in your Godot games.
Create <b>Dialogs</b>, <b>Visual Novels</b>, <b>RPGs</b>, and <b>manage Characters</b> with Godot to create your Game!
</p>

<p align="center">
<a href="https://discord.gg/DjcDgDaTMe" target="_blank" style="text-decoration:none"><img alt="Discord" src="https://img.shields.io/discord/628713677239091231?logo=discord&labelColor=CFC9C8&color=646FA9"></a>
<a href="https://godotengine.org/download/" target="_blank" style="text-decoration:none"><img alt="Godot v4.2+" src="https://img.shields.io/badge/Godot-v4.2+-%23478cbf?labelColor=CFC9C8&color=49A9B4" /></a>
<a href="https://docs.dialogic.pro/introduction.html" target="_blank" style="text-decoration:none"><img alt="Dialogic 2 Documentation" src="https://img.shields.io/badge/documention-online-green?labelColor=CFC9C8&color=6BCD69"></a>
<a href="https://github.com/dialogic-godot/dialogic/actions/workflows/unit_test.yml" target="_blank style="text-decoration:none"><img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/dialogic-godot/dialogic/unit_test.yml?labelColor=CFC9C8&color=DBDCB8"></a>
<a href="https://github.com/dialogic-godot/dialogic/releases" target="_blank" style="text-decoration:none"><img alt="Latest Dialogic Release" src="https://img.shields.io/github/v/release/dialogic-godot/dialogic?include_prereleases&labelColor=CFC9C8&color=CBA18C"></a>
</p>

## Table of Contents
Expand All @@ -16,11 +24,11 @@
- [Credits](#credits)
- [License](#license)

## Version (Currently in Alpha)
## Version

Dialogic 2.0 is a major rewrite of the plugin including many compatibility-breaking changes. It is currently developed exclusively for Godot 4 and requires at least Godot 4.2.
Dialogic 2 **requires at least Godot 4.2**.

![Godot v4.2](https://img.shields.io/badge/Godot-v4.2-%23478cbf)
It's a major rewrite compared to the previous Dialogic 1.

[If you are looking for the Godot 3.5 version you can find it here.](https://github.com/dialogic-godot/dialogic/tree/dialogic-1)

Expand All @@ -30,14 +38,35 @@ Follow the installation instructions on our [Getting Started](https://docs.dialo
Dialogic comes with an auto-updater so you can install future versions right from within the plugin.

## Documentation
As the plugin is still in alpha state, only limited documentation is available. However you can read all the existing documentation here:
[Dialogic Documentation](https://docs.dialogic.pro/)
You can find the official documentation of Dialogic here: [Dialogic Documentation](https://docs.dialogic.pro/)

There is a Class Reference as well: [Class Reference](https://docs.dialogic.pro/class_index.html)


## Connect with us!
If you need help or want to share your Dialogic projects, take a look at the following options:

- Ask questions, or report bugs on our [Discord](https://discord.gg/DjcDgDaTMe)
- Report bugs and issues on the [GitHub Issues Page](https://github.com/dialogic-godot/dialogic/issues)
- Ask questions on [GitHub Discussions](https://github.com/dialogic-godot/dialogic/discussions)

## Testing
Dialogic uses [Unit Tests](https://en.wikipedia.org/wiki/Unit_testing) to ensure specific parts function as expected. These tests run on every git push and pull request. The framework to do these tests is called [gdUnit4](https://github.com/MikeSchulze/gdUnit4) and our tests reside in the [addons/dialogic/Tests/Unit](https://github.com/dialogic-godot/dialogic/tree/main/addons/dialogic/Tests/Unit) path. We recommend installing the `gdUnit4` add-on from the `AssetLib`, with this add-on, you can run tests locally.
Dialogic uses [Unit Tests](https://en.wikipedia.org/wiki/Unit_testing) to ensure specific parts function as expected. These tests run on every git push and pull request. The framework to do these tests is called [gdUnit4](https://github.com/MikeSchulze/gdUnit4) and our tests reside in the [/Tests/Unit](https://github.com/dialogic-godot/dialogic/tree/main/Tests/Unit) path. We recommend installing the `gdUnit4` add-on from the `AssetLib`, with this add-on, you can run tests locally.

To get started, take a look at the existing files in the path and read the documentation to [create your first test](https://mikeschulze.github.io/gdUnit4/first_steps/firstTest/).

## Interacting with the Source Code
All methods and variables in the Dialogic 2 source **code prefixed with an underscore (`_`)** are considered *private*, for instance: `_remove_character()`.

While you can use them, they may change in their behavior or change their signature, causing breakage in your code while moving between versions.
Most private methods are used inside public ones; if you need help, check the documentation.

**Public methods and variables can be found in our [Class Reference](https://docs.dialogic.pro/class_index.html).**

During the Alpha and Beta version stages, code may change at any Dialogic Release to allow drafting a better design.
Changelogs will accommodate for these changes and inform you on how to update your code.


## Credits
Made by [Emilio Coppola](https://github.com/coppolaemilio) and [Jowan-Spooner](https://github.com/Jowan-Spooner).

Expand Down
51 changes: 51 additions & 0 deletions Tests/Unit/subsystem_history_test.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
extends GdUnitTestSuite

var history := Dialogic.History

const EXAMPLE_SEEN_HISTORY: Dictionary = {
"res://Dialogic/Timelines/start.dtl1": 1,
"res://Dialogic/Timelines/start.dtl2": 2,
"res://Dialogic/Timelines/start.dtl3": 3,
"res://Dialogic/Timelines/start.dtl4": 4,
"res://Dialogic/Timelines/start.dtl5": 5,
"res://Dialogic/Timelines/start.dtl7": 7
}

func test_save_load_visited() -> void:
assert(history.visited_event_history_content == {}, "Seen events should have be empty.")
history.load_visited_history()
assert(history.visited_event_history_content == {}, "Seen events should have be empty after empty load.")

history.visited_event_history_content = EXAMPLE_SEEN_HISTORY
assert(history.visited_event_history_content == EXAMPLE_SEEN_HISTORY, "Seen events should have be identical to test data.")

history.save_visited_history()
var global_data_seen_events: Dictionary = history.get_saved_visited_history()

assert(global_data_seen_events == EXAMPLE_SEEN_HISTORY, "Global data does not have example data.")

history.load_visited_history()
assert(history.visited_event_history_content == EXAMPLE_SEEN_HISTORY, "Seen events should have be identical to test data after load.")


func test_deletion_save_visited() -> void:
history.visited_event_history_content = EXAMPLE_SEEN_HISTORY
assert(history.visited_event_history_content == EXAMPLE_SEEN_HISTORY, "Seen events should have be identical to test data.")

history.save_visited_history()
var global_data_seen_events: Dictionary = history.get_saved_visited_history()
assert(global_data_seen_events == EXAMPLE_SEEN_HISTORY, "Global data does not have example data.")

history.reset_visited_history(false)
var global_data_seen_events_after_reset: Dictionary = history.get_saved_visited_history()
assert(history.visited_event_history_content == EXAMPLE_SEEN_HISTORY, "Seen events are gone after global data only reset.")
assert(global_data_seen_events_after_reset == {}, "Global data should be empty after reset.")

history.load_visited_history()
assert(history.visited_event_history_content == {}, "Seen events should have be empty after empty load.")

history.visited_event_history_content = EXAMPLE_SEEN_HISTORY
history.reset_visited_history(true)
var global_data_seen_events_after_full_reset: Dictionary = history.get_saved_visited_history()
assert(global_data_seen_events_after_full_reset == {}, "Seen events in global data should have be empty after full data reset.")
assert(history.visited_event_history_content == {}, "Seen events in history should have be empty after full data reset.")
Loading

0 comments on commit 4505a21

Please sign in to comment.