diff --git a/Icons/SequenceActionReference.svg b/Icons/SequenceActionReference.svg
new file mode 100644
index 0000000..2254ed4
--- /dev/null
+++ b/Icons/SequenceActionReference.svg
@@ -0,0 +1,87 @@
+
+
diff --git a/Icons/SequenceActionReference.svg.import b/Icons/SequenceActionReference.svg.import
new file mode 100644
index 0000000..33b9893
--- /dev/null
+++ b/Icons/SequenceActionReference.svg.import
@@ -0,0 +1,43 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://dt3dphndn4swf"
+path="res://.godot/imported/SequenceActionReference.svg-4359daff0c55d9792387ee93e286001c.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/rokojori_action_library/Icons/SequenceActionReference.svg"
+dest_files=["res://.godot/imported/SequenceActionReference.svg-4359daff0c55d9792387ee93e286001c.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/uastc_level=0
+compress/rdo_quality_loss=0.0
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/channel_remap/red=0
+process/channel_remap/green=1
+process/channel_remap/blue=2
+process/channel_remap/alpha=3
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=false
+editor/convert_colors_with_editor_theme=false
diff --git a/RokojoriPlugin.cs b/RokojoriPlugin.cs
index 6e7125b..594fb22 100644
--- a/RokojoriPlugin.cs
+++ b/RokojoriPlugin.cs
@@ -8,8 +8,16 @@ using System.Data;
namespace Rokojori
{
+ #if ! TOOLS
[Tool]
- public partial class RokojoriPlugin:EditorPlugin
+ public partial class RokojoriPlugin:Node
+ {
+
+ }
+ #else
+ [Tool]
+ public partial class RokojoriPlugin: EditorPlugin
+
{
GizmoDrawerPlugin gizmoDrawerPlugin = new GizmoDrawerPlugin();
@@ -271,4 +279,6 @@ namespace Rokojori
}
}
+
+ #endif
}
\ No newline at end of file
diff --git a/Runtime/Actions/ActionReference.cs b/Runtime/Actions/ActionReference.cs
index 0c84072..574fe99 100644
--- a/Runtime/Actions/ActionReference.cs
+++ b/Runtime/Actions/ActionReference.cs
@@ -10,6 +10,21 @@ namespace Rokojori
[Export]
public Action referencedAction;
+ [ExportToolButton( "Set Reference Name" )]
+ public Callable setReferencedNameButton => Callable.From(
+ ()=>
+ {
+ if ( referencedAction == null )
+ {
+ this.Name = "* (nothing)";
+ }
+ else
+ {
+ this.Name = "* " + referencedAction.Name;
+ }
+ }
+ );
+
protected override void _OnTrigger()
{
Action.Trigger( referencedAction );
diff --git a/Runtime/Actions/Audio/PlayMusic.cs b/Runtime/Actions/Audio/PlayMusic.cs
index b0501d2..5f1090d 100644
--- a/Runtime/Actions/Audio/PlayMusic.cs
+++ b/Runtime/Actions/Audio/PlayMusic.cs
@@ -10,6 +10,21 @@ namespace Rokojori
[Export]
public AudioStreamPlayer music;
+ [ExportToolButton( "Set Reference Name" )]
+ public Callable setReferencedNameButton => Callable.From(
+ ()=>
+ {
+ if ( music == null )
+ {
+ this.Name = "Play (nothing)";
+ }
+ else
+ {
+ this.Name = "Play " + music.Name;
+ }
+ }
+ );
+
[Export]
public bool stopSiblingPlayers = false;
diff --git a/Runtime/Actions/Node3D/PlaySound.cs b/Runtime/Actions/Node3D/PlaySound.cs
index eeb3cfe..4d01817 100644
--- a/Runtime/Actions/Node3D/PlaySound.cs
+++ b/Runtime/Actions/Node3D/PlaySound.cs
@@ -10,6 +10,21 @@ namespace Rokojori
[Export]
public AudioStreamPlayer3D player;
+ [ExportToolButton( "Set Reference Name" )]
+ public Callable setReferencedNameButton => Callable.From(
+ ()=>
+ {
+ if ( player == null )
+ {
+ this.Name = "Play (nothing)";
+ }
+ else
+ {
+ this.Name = "Play " + player.Name;
+ }
+ }
+ );
+
[Export]
public AudioFlag overdrivePreventionFlag;
diff --git a/Runtime/Actions/Sequence/SequenceActionReference.cs b/Runtime/Actions/Sequence/SequenceActionReference.cs
new file mode 100644
index 0000000..26f1b20
--- /dev/null
+++ b/Runtime/Actions/Sequence/SequenceActionReference.cs
@@ -0,0 +1,68 @@
+
+using Godot;
+
+
+namespace Rokojori
+{
+ [Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/SequenceActionReference.svg")]
+ public partial class SequenceActionReference : SequenceAction
+ {
+ [Export]
+ public SequenceAction referencedSequenceAction;
+
+ [ExportToolButton( "Set Reference Name" )]
+ public Callable setReferencedNameButton => Callable.From(
+ ()=>
+ {
+ if ( referencedSequenceAction == null )
+ {
+ this.Name = "* (nothing)";
+ }
+ else
+ {
+ this.Name = "* " + referencedSequenceAction.Name;
+ }
+ }
+ );
+
+ protected override void _OnTrigger()
+ {
+ if ( ! IsInstanceValid( referencedSequenceAction ) )
+ {
+ return;
+ }
+
+ var ownID = DispatchStart();
+ var referenceID = -1;
+
+ System.Action callback = ( se )=>
+ {
+ if ( se.id != referenceID )
+ {
+ return;
+ }
+
+ if ( se.success )
+ {
+ DispatchEnd( ownID );
+ }
+ else
+ {
+ DispatchCancelled( ownID );
+ }
+ }
+ ;
+
+ referencedSequenceAction.onSequenceDone.Once( callback );
+
+ referenceID = referencedSequenceAction.TriggerSequenceAndGetID();
+
+ if ( referenceID == -1 )
+ {
+ referencedSequenceAction.onSequenceDone.RemoveAction( callback );
+ DispatchCancelled( ownID );
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/Runtime/Actions/Sequence/SequenceActionReference.cs.uid b/Runtime/Actions/Sequence/SequenceActionReference.cs.uid
new file mode 100644
index 0000000..fd77387
--- /dev/null
+++ b/Runtime/Actions/Sequence/SequenceActionReference.cs.uid
@@ -0,0 +1 @@
+uid://bvgnrj6aailvl
diff --git a/Runtime/Actions/SequenceAction.cs b/Runtime/Actions/SequenceAction.cs
index 59bb96c..a79530d 100644
--- a/Runtime/Actions/SequenceAction.cs
+++ b/Runtime/Actions/SequenceAction.cs
@@ -47,6 +47,15 @@ namespace Rokojori
}
+ public int TriggerSequenceAndGetID()
+ {
+ var nextID = GetLastSequenceActionID() + 1;
+
+ Trigger();
+
+ return GetLastSequenceActionID() < nextID ? -1 : nextID;
+ }
+
}
diff --git a/Runtime/Animation/Shake/Presets/Poke - Shake.tres b/Runtime/Animation/Shake/Presets/Poke - Shake.tres
new file mode 100644
index 0000000..11e3f92
--- /dev/null
+++ b/Runtime/Animation/Shake/Presets/Poke - Shake.tres
@@ -0,0 +1,35 @@
+[gd_resource type="Resource" script_class="ShakeEffect" load_steps=8 format=3 uid="uid://dedieicyxs0wu"]
+
+[ext_resource type="Script" uid="uid://bec6skfqkb2ci" path="res://addons/rokojori_action_library/Runtime/Animation/Shake/ShakeEffect.cs" id="1_grbkn"]
+[ext_resource type="Script" uid="uid://c5tm02yj1bhhx" path="res://addons/rokojori_action_library/Runtime/Animation/AnimationCurve.cs" id="2_825l5"]
+[ext_resource type="Resource" uid="uid://h6oi6vkj4c2m" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/RealTime.tres" id="3_h78cr"]
+
+[sub_resource type="Curve" id="Curve_63bh3"]
+_data = [Vector2(0, 1), 0.0, -1.3770282, 0, 0, Vector2(1, 0), -0.00696731, 0.0, 0, 0]
+point_count = 2
+
+[sub_resource type="Resource" id="Resource_lnhr4"]
+script = ExtResource("2_825l5")
+curve = SubResource("Curve_63bh3")
+
+[sub_resource type="Curve" id="Curve_4owub"]
+_limits = [-1.0, 1.0, 0.0, 1.0]
+_data = [Vector2(0, 1), 0.0, 0.0, 0, 1, Vector2(1, 1), 0.0, 0.0, 1, 0]
+point_count = 2
+
+[sub_resource type="Resource" id="Resource_sn0rc"]
+script = ExtResource("2_825l5")
+curve = SubResource("Curve_4owub")
+scaleY = 60.0
+
+[resource]
+script = ExtResource("1_grbkn")
+shakeAmountCurve = SubResource("Resource_lnhr4")
+shakeChangeFPSCurve = SubResource("Resource_sn0rc")
+timeline = ExtResource("3_h78cr")
+smoothingStrength = 0.477
+positionShake = Vector3(0.2, 0, 0.2)
+globalPosition = false
+rotationShake = Vector3(1, 1, 20)
+globalRotation = false
+scaleShake = Vector3(0.1, 0.1, 0.1)
diff --git a/Runtime/Cameras/CameraSlotSelectors/SetActiveCamera.cs b/Runtime/Cameras/CameraSlotSelectors/SetActiveCamera.cs
index 698b28c..6e682e5 100644
--- a/Runtime/Cameras/CameraSlotSelectors/SetActiveCamera.cs
+++ b/Runtime/Cameras/CameraSlotSelectors/SetActiveCamera.cs
@@ -15,6 +15,21 @@ namespace Rokojori
[Export]
public VirtualCamera virtualCamera;
+ [ExportToolButton( "Set Reference Name" )]
+ public Callable setReferencedNameButton => Callable.From(
+ ()=>
+ {
+ if ( virtualCamera == null )
+ {
+ this.Name = "Set Active Camera (nothing)";
+ }
+ else
+ {
+ this.Name = "Set Active Camera " + virtualCamera.Name;
+ }
+ }
+ );
+
[ExportGroup( "Create Slot")]
[Export]
public bool createSlotIfNotPresent = true;
diff --git a/Runtime/Cameras/Effects/PlayCameraEffect.cs b/Runtime/Cameras/Effects/PlayCameraEffect.cs
index f03c846..7d68c70 100644
--- a/Runtime/Cameras/Effects/PlayCameraEffect.cs
+++ b/Runtime/Cameras/Effects/PlayCameraEffect.cs
@@ -16,7 +16,7 @@ namespace Rokojori
public CameraEffect cameraEffect;
[Export]
- public bool useActiveCameraSlot = false;
+ public bool useActiveCameraSlot = true;
[ExportGroup("Other Camera Slot")]
[Export]
@@ -35,6 +35,12 @@ namespace Rokojori
protected override void _OnTrigger()
{
var manager = CameraManager.Get();
+
+ if ( manager == null )
+ {
+ return;
+ }
+
var resolvedSlot = useActiveCameraSlot ? manager.activeSlot : cameraSlot;
if ( resolvedSlot == null && camera != null )
diff --git a/Runtime/Cameras/Effects/ScreenShake.cs b/Runtime/Cameras/Effects/ScreenShake.cs
new file mode 100644
index 0000000..0cc2ffc
--- /dev/null
+++ b/Runtime/Cameras/Effects/ScreenShake.cs
@@ -0,0 +1,73 @@
+
+using System.Diagnostics;
+using System.Collections;
+using System.Collections.Generic;
+using System;
+using Godot;
+
+
+namespace Rokojori
+{
+ [Tool]
+ [GlobalClass]
+ public partial class ScreenShake:Action
+ {
+ [Export]
+ public ScreenShakeSettings settings;
+
+ [Export]
+ public bool useActiveCameraSlot = false;
+
+ [ExportGroup("Other Camera Slot")]
+ [Export]
+ public CameraSlot cameraSlot;
+
+ [Export]
+ public VirtualCamera camera;
+
+ [Export]
+ public int cameraSlotIndex = -1;
+
+ [Export]
+ public Selector cameraSlotSelector;
+
+
+ protected override void _OnTrigger()
+ {
+ var manager = CameraManager.Get();
+ var resolvedSlot = useActiveCameraSlot ? manager.activeSlot : cameraSlot;
+
+ if ( resolvedSlot == null && camera != null )
+ {
+ resolvedSlot = manager.GetSlot( camera );
+ }
+
+ if ( resolvedSlot == null )
+ {
+ if ( cameraSlotIndex != -1 )
+ {
+ resolvedSlot = manager.GetSlot( cameraSlotIndex );
+ }
+ else if ( cameraSlotSelector != null )
+ {
+ resolvedSlot = Selectors.GetFromDirectChildren( manager, cameraSlotSelector );
+ }
+ }
+
+ if ( resolvedSlot == null )
+ {
+ this.LogError( "No camera slot found" );
+
+ return;
+ }
+
+ // this.LogInfo( "Camera slot found" );
+ var cameraEffect = new CameraEffect();
+
+ cameraEffect.timeline = TimeLineManager.Ensure( settings.duration.timeLine );
+ resolvedSlot.SetCameraEffect( cameraEffect );
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/Runtime/Cameras/Effects/ScreenShake.cs.uid b/Runtime/Cameras/Effects/ScreenShake.cs.uid
new file mode 100644
index 0000000..0620722
--- /dev/null
+++ b/Runtime/Cameras/Effects/ScreenShake.cs.uid
@@ -0,0 +1 @@
+uid://66geefo04i8e
diff --git a/Runtime/Cameras/Effects/ScreenShakeSettings.cs b/Runtime/Cameras/Effects/ScreenShakeSettings.cs
new file mode 100644
index 0000000..e942c2a
--- /dev/null
+++ b/Runtime/Cameras/Effects/ScreenShakeSettings.cs
@@ -0,0 +1,25 @@
+
+using System.Diagnostics;
+using System.Collections;
+using System.Collections.Generic;
+using System;
+using Godot;
+
+
+namespace Rokojori
+{
+ [Tool]
+ [GlobalClass]
+ public partial class ScreenShakeSettings:Resource
+ {
+ [Export]
+ public Duration duration;
+
+ [Export]
+ public float shakeX = 1;
+
+ [Export]
+ public float shakeY = 1;
+
+ }
+}
\ No newline at end of file
diff --git a/Runtime/Cameras/Effects/ScreenShakeSettings.cs.uid b/Runtime/Cameras/Effects/ScreenShakeSettings.cs.uid
new file mode 100644
index 0000000..5384936
--- /dev/null
+++ b/Runtime/Cameras/Effects/ScreenShakeSettings.cs.uid
@@ -0,0 +1 @@
+uid://bws5dkau0kssg
diff --git a/Runtime/Godot/Nodes.cs b/Runtime/Godot/Nodes.cs
index d58151a..33a7490 100644
--- a/Runtime/Godot/Nodes.cs
+++ b/Runtime/Godot/Nodes.cs
@@ -602,7 +602,9 @@ namespace Rokojori
if ( forceUpdate )
{
+ #if TOOLS
EditorInterface.Singleton.GetResourceFilesystem().Scan();
+ #endif
}
return error;
diff --git a/Runtime/Godot/ResourceExtensions.cs b/Runtime/Godot/ResourceExtensions.cs
index c9b0aed..b32d8db 100644
--- a/Runtime/Godot/ResourceExtensions.cs
+++ b/Runtime/Godot/ResourceExtensions.cs
@@ -10,8 +10,15 @@ namespace Rokojori
{
public static class ResourceExtensions
{
+
+
public static Error SaveAs( this Resource resource, string savePath, bool forceUpdate = false, ResourceSaver.SaverFlags saverFlags = ResourceSaver.SaverFlags.None )
{
+ #if ! TOOLS
+
+ return Error.Unavailable;
+
+ #else
var error = ResourceSaver.Save( resource, savePath, saverFlags );
if ( forceUpdate )
@@ -20,6 +27,10 @@ namespace Rokojori
}
return error;
+
+ #endif
}
+
+
}
}
diff --git a/Runtime/Godot/Unique.cs b/Runtime/Godot/Unique.cs
index 6fb2c29..7a1f7a9 100644
--- a/Runtime/Godot/Unique.cs
+++ b/Runtime/Godot/Unique.cs
@@ -24,7 +24,9 @@ namespace Rokojori
{
if ( Engine.IsEditorHint() )
{
+ #if TOOLS
rootWindow = EditorInterface.Singleton.GetEditedSceneRoot();
+ #endif
}
else
{
@@ -38,7 +40,9 @@ namespace Rokojori
{
if ( Engine.IsEditorHint() )
{
+ #if TOOLS
rootWindow = EditorInterface.Singleton.GetEditedSceneRoot();
+ #endif
_singleton = Nodes.GetAnyChild( rootWindow );
}
}
diff --git a/Runtime/Procedural/Assets/Tree/TreeGenerator.cs b/Runtime/Procedural/Assets/Tree/TreeGenerator.cs
index 5ad733d..b72dda7 100644
--- a/Runtime/Procedural/Assets/Tree/TreeGenerator.cs
+++ b/Runtime/Procedural/Assets/Tree/TreeGenerator.cs
@@ -144,8 +144,10 @@ namespace Rokojori
{
if ( useDebugSingleMeshGeneration )
{
+ #if TOOLS
EditorInterface.Singleton.GetSelection().Clear();
EditorInterface.Singleton.GetSelection().AddNode( deselecter );
+ #endif
await this.RequestNextFrame();
}
@@ -541,7 +543,10 @@ namespace Rokojori
var rr = random.Sample( subdivisionNoiseRange );
p.position += random.InSphere( rr * minT * b.height / (float)subdivisions );
var sp = spline.CreateChild();
+
+ #if TOOLS
sp.editorSplinePointSize = 0.001f;
+ #endif
p.Set( sp );
@@ -620,8 +625,9 @@ namespace Rokojori
var root = spline.CreateChild();
var end = spline.CreateChild();
+ #if TOOLS
root.editorSplinePointSize = 0.001f;
-
+ #endif
end.Position = new Vector3( 0, rootHeight, 0 ) + random.InSphere( noise );
diff --git a/Runtime/Procedural/Parametric/Spline/Spline.cs b/Runtime/Procedural/Parametric/Spline/Spline.cs
index c028520..69be3a7 100644
--- a/Runtime/Procedural/Parametric/Spline/Spline.cs
+++ b/Runtime/Procedural/Parametric/Spline/Spline.cs
@@ -65,7 +65,9 @@ namespace Rokojori
public void SetEditorPointSize( float size )
{
+ #if TOOLS
this.ForEachDirectChild( p => p.editorSplinePointSize = size );
+ #endif
}
SplineCurve splineCurve;
diff --git a/Runtime/Rendering/Assets/Foliage/FoliageRenderer.cs b/Runtime/Rendering/Assets/Foliage/FoliageRenderer.cs
index 6e59e59..13df4e1 100644
--- a/Runtime/Rendering/Assets/Foliage/FoliageRenderer.cs
+++ b/Runtime/Rendering/Assets/Foliage/FoliageRenderer.cs
@@ -218,7 +218,9 @@ namespace Rokojori
if ( Engine.IsEditorHint() )
{
+ #if TOOLS
_assignedCamera = EditorInterface.Singleton.GetEditorViewport3D().GetCamera3D();
+ #endif
}
else
{
diff --git a/Runtime/Rendering/FontFX/FontCreator.cs b/Runtime/Rendering/FontFX/FontCreator.cs
index 54a9e08..97a9175 100644
--- a/Runtime/Rendering/FontFX/FontCreator.cs
+++ b/Runtime/Rendering/FontFX/FontCreator.cs
@@ -99,7 +99,9 @@ namespace Rokojori
await this.RequestNextFrame();
await this.RequestNextFrame();
+ #if TOOLS
EditorInterface.Singleton.GetResourceFilesystem().ScanSources();
+ #endif
}
Node3D CreateGlyph( string character )
diff --git a/Tools/GizmoDrawer.cs b/Tools/GizmoDrawer.cs
index 3b24f95..d5273ca 100644
--- a/Tools/GizmoDrawer.cs
+++ b/Tools/GizmoDrawer.cs
@@ -5,6 +5,15 @@ using System.Collections.Generic;
namespace Rokojori
{
+ #if !TOOLS
+
+ public interface GizmoDrawer
+ {
+
+ }
+
+ #else
+
public interface GizmoDrawer
{
void DrawGizmo( EditorNode3DGizmoPlugin gizmoPlugin, EditorNode3DGizmo gizmo );
@@ -43,4 +52,6 @@ namespace Rokojori
*/
}
+
+ #endif
}
\ No newline at end of file
diff --git a/Tools/GizmoDrawerPlugin.cs b/Tools/GizmoDrawerPlugin.cs
index 681e127..3d5dc02 100644
--- a/Tools/GizmoDrawerPlugin.cs
+++ b/Tools/GizmoDrawerPlugin.cs
@@ -5,6 +5,15 @@ using System.Collections.Generic;
namespace Rokojori
{
+ #if !TOOLS
+ [Tool]
+ public partial class GizmoDrawerPlugin : Node
+ {
+
+ }
+
+ #else
+
[Tool]
public partial class GizmoDrawerPlugin : EditorNode3DGizmoPlugin
{
@@ -85,4 +94,6 @@ namespace Rokojori
gizmoDrawerWithHandles.CommitHandle( gizmo, handle_id, secondary, restore, cancel );
}
}
+
+ #endif
}
\ No newline at end of file
diff --git a/rokojori-action-library-images.svg b/rokojori-action-library-images.svg
new file mode 100644
index 0000000..85193a3
--- /dev/null
+++ b/rokojori-action-library-images.svg
@@ -0,0 +1,343384 @@
+
+
+
+