Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for cross-language mixins using MixinScript (aka MultiScript) #92

Merged
merged 30 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
00039cb
Resurrect MultiScript
Xrayez Jun 14, 2021
200b93b
Make `MultiScript` compile in Godot 3.x
Xrayez Jun 14, 2021
7713869
Rename `Multi` to `Owner` in `MultiScript`
Xrayez Jun 14, 2021
e936bea
Move dummy implementations to declaration in `MultiScript`
Xrayez Jun 14, 2021
4e4b257
Add some unit tests for `MultiScript`
Xrayez Jun 14, 2021
55d1733
Expose script methods in `MultiScript`, expose owner in `Owner`
Xrayez Jun 14, 2021
17eee35
Rename `Owner` to `MultiScriptOwner`
Xrayez Jun 14, 2021
2d466f7
Rename `MultiScript` files to use `snake_case`
Xrayez Jun 14, 2021
e2af127
Fix GDScript debug crash when calling non-existing MultiScript methods
Xrayez Jun 14, 2021
26b4a33
Make `MultiScript` serializable (add `ms` extension)
Xrayez Jun 15, 2021
5fc0490
Rename `MultiScript` to `MixinScript`
Xrayez Jun 15, 2021
e0ba0db
Add `MixinScript` editor icon
Xrayez Jun 15, 2021
57874bf
Slightly improve `MixinScript` editor icon
Xrayez Jun 15, 2021
ac51150
Fix crashes and leaks, rename script methods
Xrayez Jun 15, 2021
4a2c986
Add `main_script` property to `MixinScript`
Xrayez Jun 16, 2021
902bf80
Automatically switch to main script while editing `MixinScript`
Xrayez Jun 17, 2021
7ce0357
Document `MixinScript`
Xrayez Jun 17, 2021
cd2e832
Add "Attach Main Script" button in `MixinScriptEditor`
Xrayez Jun 17, 2021
9696b05
Add editor inspector plugin for `MixinScript`
Xrayez Jun 18, 2021
5a3c4ab
Initial implementation for `MixinScript` main script and mixin editors
Xrayez Jun 18, 2021
742a362
Add ability to move scripts in `MixinScript`
Xrayez Jun 19, 2021
87fe605
Unexpose `script_` properties in `MixinScript`
Xrayez Jun 19, 2021
c43fd88
Rename `scripts` to `mixins` throughout `MixinScript` API
Xrayez Jun 19, 2021
7408698
Make main script attach button work as detach as well in `MixinScript`
Xrayez Jun 19, 2021
31bb157
Display language icons in `MixinScriptEditor` per script
Xrayez Jun 19, 2021
a264e74
Instantiate `Mixin` object per main instance
Xrayez Jun 19, 2021
57425d0
Fix unused variables and if checks in `MixinScriptEditor`
Xrayez Jun 19, 2021
31708ff
Replace `ERR_PRINTS` to `ERR_PRINT`
Xrayez Jun 19, 2021
ee0526a
Do not compile `MixinScript` editor callbacks in non-editor builds
Xrayez Jun 19, 2021
613889b
Remove `main_script` property from `MixinScript`
Xrayez Jun 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ if env["goost_image_enabled"]:
if env["goost_math_enabled"]:
SConscript("math/SCsub", exports="env_goost")

if env["goost_script_enabled"]:
SConscript("script/SCsub", exports="env_goost")

env_goost.add_source_files(env.modules_sources, "*.cpp")
env_goost.add_source_files(env.modules_sources, "types/*.cpp")

Expand Down
10 changes: 9 additions & 1 deletion core/register_core_types.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#include "register_core_types.h"
#include "goost/register_types.h"

#include "goost/classes_enabled.gen.h"
#include "goost/register_types.h"

#include "core/engine.h"
#include "scene/main/scene_tree.h"

#include "image/register_image_types.h"
#include "math/register_math_types.h"
#include "script/register_script_types.h"

#ifdef TOOLS_ENABLED
#include "editor/editor_node.h"
Expand Down Expand Up @@ -47,6 +49,9 @@ void register_core_types() {
#ifdef GOOST_MATH_ENABLED
register_math_types();
#endif
#ifdef GOOST_SCRIPT_ENABLED
register_script_types();
#endif
}

void unregister_core_types() {
Expand All @@ -59,6 +64,9 @@ void unregister_core_types() {
#ifdef GOOST_MATH_ENABLED
unregister_math_types();
#endif
#ifdef GOOST_SCRIPT_ENABLED
unregister_script_types();
#endif
}

#if defined(TOOLS_ENABLED) && defined(GOOST_VariantResource)
Expand Down
9 changes: 9 additions & 0 deletions core/script/SCsub
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env python
Import("env")
Import("env_goost")

env_goost.add_source_files(env.modules_sources, "*.cpp")
env_goost.add_source_files(env.modules_sources, "mixin_script/*.cpp")

if env["tools"]:
env_goost.add_source_files(env.modules_sources, "mixin_script/editor/*.cpp")
Loading